/* ==========================================================================
   FOUND it · ERP — application chrome
   Two-row top navigation, no sidebar. Loaded last, after the template CSS.
   One light surface throughout: chrome and content share the same family.
   ========================================================================== */

:root {
  --fi-crimson: #a81b23;
  --fi-navy: #0b1f3a;

  --fi-ink: #0f172a;
  --fi-muted: #667085;
  --fi-line: #e6e9ef;
  --fi-line-soft: #eef1f6;
  --fi-surface: #ffffff;
  --fi-page: #f6f7f9;
  --fi-hover: #f2f4f8;

  --fi-top-h: 60px;
  --fi-nav-h: 50px;
  --fi-ui: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fi-display: "Montserrat", var(--fi-ui);
  --fi-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

body {
  font-family: var(--fi-ui);
  background: var(--fi-page);
}

/* --------------------------------------------------------------- shell */

.fi-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fi-page);
}

.fi-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--fi-surface);
  border-bottom: 1px solid var(--fi-line);
}

.fi-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Template rules assumed a sidebar offset; the top nav owns the full width. */
.dashboard-main,
.dashboard-main.active {
  margin-left: 0 !important;
  width: 100% !important;
}

.dashboard-main-body {
  padding: 24px !important;
  background: var(--fi-page);
  flex: 1;
}

@media (max-width: 767px) {
  .dashboard-main-body {
    padding: 16px !important;
  }
}

/* --------------------------------------------------------- row 1: brand */

.fi-header-top {
  height: var(--fi-top-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}

.fi-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  flex-shrink: 0;
}

/* Product lockup: own mark + product name, with the parent wordmark as a byline */
.fi-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.fi-lockup-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: block;
  flex-shrink: 0;
}

.fi-lockup-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 5px;
}

.fi-lockup-text > b {
  font-family: var(--fi-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--fi-navy);
}

/* The parent wordmark carries the attribution on its own — below ~12px the
   crimson "FOUND" and navy "it" bleed into each other and it reads as a smudge. */
.fi-lockup-by {
  display: inline-flex;
  align-items: center;
}

.fi-lockup-by img {
  height: 12px;
  width: auto;
  display: block;
  opacity: 0.9;
}

/* Sign-in: same lockup, sized for a first impression. */
.fi-auth-brand .fi-lockup {
  gap: 14px;
}

.fi-auth-brand .fi-lockup-mark {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.fi-auth-brand .fi-lockup-text > b {
  font-size: 25px;
}

.fi-auth-brand .fi-lockup-by {
  font-size: 12px;
  gap: 5px;
}

.fi-auth-brand .fi-lockup-by img {
  height: 11px;
}

/* Where am I: the brand says which product, this says which page. Sits against
   the lockup so the left edge reads as one block instead of a stranded logo. */
.fi-header-where {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  line-height: 1;
  padding-left: 18px;
  margin-left: 4px;
  border-left: 1px solid var(--fi-line);
  min-width: 0;
}

.fi-header-where > span {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fi-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fi-header-where > b {
  font-size: 14px;
  font-weight: 600;
  color: var(--fi-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fi-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 16px;
}

/* icon buttons: ghost, hairline on hover */
.fi-header-actions .fi-iconbtn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--fi-muted) !important;
  position: relative;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.fi-header-actions .fi-iconbtn:hover {
  background: var(--fi-hover) !important;
  border-color: var(--fi-line) !important;
  color: var(--fi-ink) !important;
}

/* A promoted action that is also a route needs to show it's the current page. */
.fi-header-actions .fi-iconbtn.is-active {
  background: #eceff4 !important;
  border-color: transparent !important;
  color: var(--fi-navy) !important;
}

.fi-header-divider {
  width: 1px;
  height: 22px;
  background: var(--fi-line);
  margin: 0 6px;
  flex-shrink: 0;
}

/* One optical size for every action icon. The glyphs come from one family
   (tabler) so the stroke weights match; this pins the box so they also
   share a baseline regardless of each glyph's own viewBox padding. */
.fi-header-actions .fi-iconbtn .icon,
.fi-header-actions .fi-iconbtn svg {
  font-size: 20px;
  width: 20px;
  height: 20px;
  display: block;
  stroke-width: 1.7;
}

.fi-header-actions .fi-iconbtn .badge {
  background: var(--fi-crimson) !important;
  color: #fff !important;
  font-family: var(--fi-mono);
  font-weight: 600;
  font-size: 9px !important;
  padding: 2px 5px;
  border: 2px solid var(--fi-surface);
}

/* profile: who you are posting as, spelled out */
.fi-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  margin-left: 4px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fi-profile:hover {
  background: var(--fi-hover);
  border-color: var(--fi-line);
}

.fi-profile img,
.fi-profile .is-initials,
.fi-profile .fi-avatar-skeleton {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  flex: 0 0 32px;
  background: #e9edf3;
}

.fi-profile .is-initials,
.fi-pop-identity .is-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #5a6a82;
}

.fi-profile .is-initials {
  font-size: 12px;
}

.fi-pop-identity .is-initials {
  font-size: 14px;
}

.fi-profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  max-width: 160px;
}

.fi-profile-meta b {
  font-size: 13px;
  font-weight: 600;
  color: var(--fi-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.fi-profile-meta span {
  font-size: 11px;
  color: var(--fi-muted);
  white-space: nowrap;
}

/* ------------------------------------------------- header popovers */

/* Same shell as the department panels, so chrome surfaces read as one system. */
.fi-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 400;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1),
    0 2px 6px rgba(15, 23, 42, 0.05);
  animation: fi-pop 0.13s ease-out;
  overflow: hidden;
}

.fi-pop--profile {
  width: 258px;
  padding: 6px;
}

.fi-pop--notif {
  width: 384px;
}

/* --- profile --- */

.fi-pop-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px 12px;
}

.fi-pop-identity img,
.fi-pop-identity .is-initials {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: cover;
  flex: 0 0 40px;
  background: #e9edf3;
}

.fi-pop-identity > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.25;
  min-width: 0;
}

.fi-pop-identity b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fi-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fi-pop-identity > span > span {
  font-size: 11.5px;
  color: var(--fi-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fi-pop-sep {
  height: 1px;
  background: var(--fi-line-soft);
  margin: 0 4px 6px;
}

.fi-pop-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #344054;
  font-family: var(--fi-ui);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}

.fi-pop-item svg {
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--fi-muted);
}

.fi-pop-item:hover {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-pop-item.is-danger:hover,
.fi-pop-item.is-danger:hover svg {
  background: #fdf2f2;
  color: var(--fi-crimson);
}

/* --- notifications --- */

.fi-pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--fi-line-soft);
}

.fi-pop-head > b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-pop-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--fi-crimson);
  color: #fff;
  font-family: var(--fi-mono);
  font-size: 11px;
  font-weight: 600;
}

.fi-pop-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fi-muted);
  font-family: var(--fi-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.13s ease;
}

.fi-pop-action svg {
  font-size: 14px;
}

.fi-pop-action:hover {
  color: var(--fi-navy);
}

.fi-pop-prefs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--fi-line-soft);
}

.fi-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--fi-line);
  border-radius: 7px;
  background: transparent;
  color: var(--fi-muted);
  font-family: var(--fi-ui);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}

.fi-chip svg {
  font-size: 14px;
}

.fi-chip:hover {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-chip.is-on {
  background: #eef2f7;
  border-color: transparent;
  color: var(--fi-navy);
}

.fi-pop-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}

.fi-notif {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.13s ease;
}

.fi-notif:hover {
  background: var(--fi-hover);
}

.fi-notif.is-unread {
  background: #f7f9fc;
}

.fi-notif-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: #eef1f6;
  color: var(--fi-muted);
}

.fi-notif.is-unread .fi-notif-icon {
  background: #e9eef6;
  color: var(--fi-navy);
}

.fi-notif-icon svg {
  font-size: 17px;
}

.fi-notif-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.fi-notif-body b {
  font-size: 13px;
  font-weight: 600;
  color: var(--fi-ink);
  line-height: 1.3;
}

.fi-notif-body > span {
  font-size: 12px;
  color: var(--fi-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fi-notif-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 1px;
}

.fi-notif-meta > span {
  font-size: 11px;
  color: var(--fi-muted);
  white-space: nowrap;
}

.fi-notif-meta > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fi-crimson);
}

.fi-pop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 34px 16px;
  color: var(--fi-muted);
  font-size: 12.5px;
}

.fi-pop-empty svg {
  font-size: 26px;
  opacity: 0.45;
}

.fi-pop-foot {
  display: flex;
  justify-content: center;
  padding: 10px 14px;
  border-top: 1px solid var(--fi-line-soft);
}

.fi-pop-foot .fi-pop-action {
  margin-left: 0;
}

@media (max-width: 479px) {
  .fi-pop--notif {
    width: calc(100vw - 28px);
  }
}

/* ------------------------------------------------------ row 2: sections */

.fi-nav {
  height: var(--fi-nav-h);
  border-top: 1px solid var(--fi-line-soft);
  padding: 0 16px;
  position: relative;
}

/* When the departments run past the edge, fade the cut so it reads as
   "keep scrolling" instead of a clipped word. */
.fi-nav::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 48px;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0),
    var(--fi-surface) 70%
  );
}

.fi-nav-scroll {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.fi-nav-scroll::-webkit-scrollbar {
  display: none;
}

.fi-nav-slot {
  flex-shrink: 0;
}

.fi-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--fi-muted);
  font-family: var(--fi-ui);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.fi-nav-item:hover {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-nav-item.is-open {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-nav-item.is-active {
  background: #eceff4;
  color: var(--fi-ink);
  font-weight: 600;
}

.fi-nav-caret {
  font-size: 14px;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.fi-nav-item.is-open .fi-nav-caret {
  transform: rotate(180deg);
}

/* Panels are fixed so the scrollable nav row can never clip them. */
.fi-nav-panel {
  position: fixed;
  z-index: 400;
  min-width: 248px;
  max-width: 320px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 6px;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1),
    0 2px 6px rgba(15, 23, 42, 0.05);
  animation: fi-pop 0.13s ease-out;
}

@keyframes fi-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.fi-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 9px;
  color: #344054;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.13s ease, color 0.13s ease;
}

.fi-nav-link:hover {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-nav-link.is-active {
  background: #eceff4;
  color: var(--fi-navy);
  font-weight: 600;
}

.fi-nav-link-icon {
  font-size: 18px;
  flex: 0 0 18px;
  color: var(--fi-muted);
}

.fi-nav-link.is-active .fi-nav-link-icon {
  color: var(--fi-crimson);
}

@media (max-width: 767px) {
  .fi-header-top {
    padding: 0 14px;
    gap: 10px;
  }
  .fi-nav {
    padding: 0 8px;
  }
  .fi-brand-sep,
  .fi-brand-org,
  .fi-header-where,
  .fi-profile-meta {
    display: none;
  }
  .fi-header-actions {
    padding-left: 0;
  }
}

/* -------------------------------------------------------------- welcome */

.fi-welcome {
  width: 100%;
}

.fi-welcome-head h1 {
  font-size: 30px !important;
  font-weight: 700;
  color: var(--fi-ink);
  letter-spacing: -0.02em;
  margin: 8px 0 6px;
}

.fi-welcome-head p {
  font-size: 15px;
  color: var(--fi-muted);
  margin: 0 0 34px;
}

.fi-welcome-label {
  font-family: var(--fi-mono);
  font-size: 10.5px !important;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fi-muted);
  margin: 0 0 12px;
}

.fi-welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 12px;
}

.fi-welcome-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease,
    box-shadow 0.16s ease;
}

.fi-welcome-card:hover {
  border-color: #d5dae3;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.fi-welcome-card-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f1f4f9;
  color: var(--fi-navy);
  font-size: 20px;
}

.fi-welcome-card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--fi-ink);
  flex: 1;
}

.fi-welcome-card-go {
  font-size: 16px;
  color: #b6bece;
  transition: color 0.16s ease;
}

.fi-welcome-card:hover .fi-welcome-card-go {
  color: var(--fi-crimson);
}

/* News / buyruqlar feed on the home page. Placeholder skeleton for now —
   HR will post real entries here later. */
.fi-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.fi-feed-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 14px;
}

.fi-feed-thumb {
  flex: 0 0 132px;
  height: 96px;
  border-radius: 10px;
  background: #eef1f6;
}

.fi-feed-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 3px;
}

.fi-skel {
  height: 11px;
  border-radius: 6px;
  background: #eef1f6;
}

.fi-skel-title {
  height: 15px;
  width: 62%;
}

.fi-skel-meta {
  height: 9px;
  width: 30%;
  margin-bottom: 4px;
}

.fi-skel-line {
  width: 100%;
}

.fi-skel-line.is-short {
  width: 45%;
}

/* Gentle shimmer so it reads as "content coming", not broken. */
.fi-feed-card.is-skeleton .fi-feed-thumb,
.fi-feed-card.is-skeleton .fi-skel {
  background: linear-gradient(90deg, #eef1f6 25%, #f5f7fa 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: fi-shimmer 1.5s ease infinite;
}

@keyframes fi-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fi-feed-card.is-skeleton .fi-feed-thumb,
  .fi-feed-card.is-skeleton .fi-skel {
    animation: none;
  }
}

.fi-feed-soon {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px dashed var(--fi-line);
  border-radius: 11px;
  font-size: 12.5px;
  color: var(--fi-muted);
  background: #fbfcfe;
}

.fi-feed-soon svg {
  font-size: 17px;
  color: #94a3b8;
  flex-shrink: 0;
}

@media (max-width: 620px) {
  .fi-feed-thumb {
    flex-basis: 96px;
    height: 72px;
  }
}

/* Real feed cards (populated home page). */
.fi-feed-thumb-img {
  flex: 0 0 132px;
  width: 132px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  background: #eef1f6;
  cursor: zoom-in;
}

.fi-feed-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 600;
  color: var(--fi-ink);
  line-height: 1.3;
}

.fi-feed-date {
  font-size: 11.5px;
  color: var(--fi-muted);
  font-variant-numeric: tabular-nums;
}

.fi-feed-body {
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  white-space: pre-line;
}

.fi-feed-body.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fi-feed-more {
  align-self: flex-start;
  border: 0;
  background: none;
  padding: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fi-navy);
  cursor: pointer;
}

.fi-feed-more:hover {
  color: var(--fi-crimson);
}

@media (max-width: 620px) {
  .fi-feed-thumb-img {
    flex-basis: 96px;
    width: 96px;
    height: 72px;
  }
}

/* HR announcements manager — thumbnails, upload picker. */
.fi-ann-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1f6;
  color: #94a3b8;
}

.fi-ann-thumb.is-empty svg {
  font-size: 19px;
}

.fi-ann-date {
  font-size: 12px;
  color: var(--fi-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fi-ann-upload {
  display: flex;
}

.fi-ann-drop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px dashed var(--fi-line);
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--fi-muted);
  font-size: 13px;
  cursor: pointer;
}

.fi-ann-drop:hover {
  border-color: #cdd6e4;
  color: var(--fi-ink);
}

.fi-ann-drop svg {
  font-size: 18px;
}

.fi-ann-preview {
  position: relative;
  display: inline-block;
}

.fi-ann-preview img {
  max-width: 260px;
  max-height: 200px;
  border-radius: 10px;
  border: 1px solid var(--fi-line);
  display: block;
}

.fi-ann-preview-x {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: var(--fi-crimson);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Умумий статистика — live-updating dashboard: KPI tiles + live indicator.
   ========================================================================== */
.fi-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #2c7a51;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fi-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2c7a51;
  animation: fi-live-pulse 1.8s infinite;
}

@keyframes fi-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(44, 122, 81, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(44, 122, 81, 0); }
  100% { box-shadow: 0 0 0 0 rgba(44, 122, 81, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .fi-live i { animation: none; }
}

.fi-kpigrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.fi-kpi {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 13px;
}

.fi-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: #eef1f6;
  color: var(--fi-navy);
}

.fi-kpi-icon svg { font-size: 21px; }
.fi-kpi-icon.is-money { background: #edf6f0; color: #2c7a51; }
.fi-kpi-icon.is-danger { background: #fdf2f2; color: var(--fi-crimson); }
.fi-kpi-icon.is-expense { background: #fef2ec; color: #c2410c; }
.fi-kpi-icon.is-volume { background: #eef3fb; color: #2a78d6; }

.fi-kpi-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.fi-kpi-label {
  font-size: 11.5px;
  color: var(--fi-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fi-kpi-value {
  font-family: var(--fi-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 600;
  color: var(--fi-ink);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fi-kpi-value small { font-size: 11px; font-weight: 500; color: var(--fi-muted); }

.fi-kpi-sub {
  font-size: 11px;
  color: var(--fi-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Headline stat cards with a sparkline + Батафсил link. */
.fi-statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.fi-statcard {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 0;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 14px;
}

.fi-statcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.fi-statcard-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--fi-muted);
}

.fi-statcard-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef1f6;
  color: var(--fi-navy);
}
.fi-statcard-icon svg { font-size: 18px; }

.fi-statcard-value {
  font-family: var(--fi-mono);
  font-variant-numeric: tabular-nums;
  font-size: 23px;
  font-weight: 700;
  color: var(--fi-ink);
  line-height: 1.1;
  display: block;
}
.fi-statcard-value small { font-size: 12px; font-weight: 500; color: var(--fi-muted); }

.fi-statcard-foot { padding: 10px 0 12px; min-height: 20px; }

.fi-statcard-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fi-muted);
  text-decoration: none;
}
.fi-statcard-more:hover { color: var(--fi-navy); }

.fi-statcard-spark {
  margin: 0 -16px;
  height: 40px;
}

/* Rich metric card: value + percentage + progress bar. */
.fi-metric {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 14px;
}

.fi-metric-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.fi-metric-title { font-size: 14px; font-weight: 600; color: var(--fi-ink); }
.fi-metric-sub { font-size: 11.5px; color: var(--fi-muted); margin-top: 2px; }

.fi-metric-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: #eef1f6; color: var(--fi-navy); flex-shrink: 0;
}
.fi-metric-icon svg { font-size: 18px; }

.fi-metric-mid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fi-metric-caplabel { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; color: var(--fi-muted); margin-bottom: 3px; }
.fi-metric-value {
  font-family: var(--fi-mono); font-variant-numeric: tabular-nums;
  font-size: 26px; font-weight: 700; color: var(--fi-ink); line-height: 1;
}
.fi-metric-value small { font-size: 13px; font-weight: 500; color: var(--fi-muted); }

.fi-metric-pctbox { text-align: right; }
.fi-metric-pct { font-family: var(--fi-mono); font-size: 20px; font-weight: 700; line-height: 1; display: block; }
.fi-metric-pctlabel { font-size: 10.5px; color: var(--fi-muted); }

.fi-metric-bar {
  height: 9px;
  border-radius: 6px;
  background: #eef1f6;
  overflow: hidden;
}
.fi-metric-bar i { display: block; height: 100%; border-radius: 6px; }

/* tone accents (shared by statcard icon, metric icon/pct/bar) */
.fi-statcard-icon.is-money, .fi-metric-icon.is-money { background: #edf6f0; color: #2c7a51; }
.fi-statcard-icon.is-danger, .fi-metric-icon.is-danger { background: #fdf2f2; color: var(--fi-crimson); }
.fi-statcard-icon.is-volume, .fi-metric-icon.is-volume { background: #eef3fb; color: #2a78d6; }
.fi-statcard-icon.is-teal, .fi-metric-icon.is-teal { background: #e8f4f6; color: #0e7490; }
.fi-statcard-icon.is-warn, .fi-metric-icon.is-warn { background: #fff5e8; color: #b5711b; }
.fi-metric-pct.is-warn { color: #b5711b; }
.fi-metric-pct.is-danger { color: var(--fi-crimson); }
.fi-metric-bar i.is-warn { background: linear-gradient(90deg, #f0b45a, #d98a1e); }
.fi-metric-bar i.is-danger { background: linear-gradient(90deg, #ec9a9a, #d24a4a); }

/* chart head extras */
.fi-chart-sub { font-size: 11.5px; color: var(--fi-muted); }
.fi-chart-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: #eef1f6; color: var(--fi-navy); margin-left: auto;
}
.fi-chart-icon svg { font-size: 17px; }
.fi-chart-icon.is-money { background: #edf6f0; color: #2c7a51; }
.fi-chart-icon.is-danger { background: #fdf2f2; color: var(--fi-crimson); }
.fi-chart-icon.is-volume { background: #eef3fb; color: #2a78d6; }
.fi-chart-icon.is-teal { background: #e8f4f6; color: #0e7490; }
.fi-chart-head .fi-chart-total { margin-left: auto; }
.fi-chart-head .fi-chart-icon + .fi-chart-total,
.fi-chart-head .fi-chart-total + .fi-chart-icon { margin-left: 8px; }

/* --------------------------------------------------------------- footer */

.d-footer {
  background: transparent !important;
  border-top: 1px solid var(--fi-line);
  font-size: 13px;
  color: var(--fi-muted);
  margin-left: 0 !important;
  padding: 16px 24px !important;
}

.d-footer a {
  color: var(--fi-ink);
  font-weight: 600;
  text-decoration: none;
}

.d-footer a:hover {
  color: var(--fi-crimson);
  text-decoration: underline;
}

/* --------------------------------------------------------------- tables */

/* The topbar carries the page name, so the in-page breadcrumb that repeated
   it verbatim is gone. One answer to "where am I", not two. */
.fi-breadcrumb {
  display: none !important;
}

table td,
table th {
  font-variant-numeric: tabular-nums;
}

table td.text-end,
table th.text-end {
  white-space: nowrap;
}

/* Statement tables: the amount column keeps a fixed width so a long line-item
   description can never push the money off the card. */
.fi-report-table {
  table-layout: fixed;
  width: 100%;
}

.fi-report-table td.text-end,
.fi-report-table th.text-end {
  width: 190px;
}

/* Sub-totals under a line item: wrap as labelled pairs instead of one long
   string that pushes the amount column off the card. */
.fi-subtotals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
}

.fi-subtotals span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
  color: var(--fi-muted);
  white-space: nowrap;
}

.fi-subtotals b {
  font-weight: 600;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Фойда-зиён — the monthly P&L. A formula strip states the fact
   (даромад − харажат = фойда); the two panels below trace every figure to
   the source report it came from.
   ========================================================================== */

.fi-pl-formula {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 16px;
}

.fi-pl-term {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 18px;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 13px;
}

.fi-pl-term > small {
  font-size: 11px;
  color: var(--fi-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fi-pl-term b {
  font-family: var(--fi-mono);
  font-variant-numeric: tabular-nums;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--fi-ink);
}

.fi-pl-term b small {
  font-size: 12px;
  font-weight: 500;
  color: var(--fi-muted);
  margin-left: 4px;
}

.fi-pl-hint {
  font-size: 11px;
  color: var(--fi-muted);
}

.fi-pl-term.is-income b {
  color: #2c7a51;
}

.fi-pl-term.is-expense b {
  color: #c2410c;
}

.fi-pl-term.is-profit {
  background: #f8fafc;
  border-color: #cdd6e4;
  box-shadow: inset 0 0 0 1px #cdd6e4;
}

.fi-pl-term.is-profit.is-positive b {
  color: #2c7a51;
}

.fi-pl-term.is-profit.is-negative b {
  color: var(--fi-crimson);
}

.fi-pl-op {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fi-mono);
  font-size: 24px;
  font-weight: 400;
  color: #94a3b8;
}

/* Two statement columns side by side, stacking on narrow screens. */
.fi-pl-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Explainer above a statement table — says how the section is computed. */
.fi-pl-note {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  margin: 0;
  background: var(--fi-line-soft);
  border-bottom: 1px solid var(--fi-line-soft);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--fi-muted);
}

.fi-pl-note svg {
  flex: 0 0 15px;
  font-size: 15px;
  margin-top: 1px;
  color: #94a3b8;
}

.fi-pl-warn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #fff8ec;
  border: 1px solid #f3d492;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #8a5a00;
}

.fi-pl-warn svg {
  flex: 0 0 18px;
  font-size: 18px;
  margin-top: 1px;
  color: #d68a0c;
}

.fi-pl-warn b {
  color: #6b4600;
}

.fi-pl-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.fi-pl-table td {
  padding: 10px 16px;
  border-top: 1px solid var(--fi-line-soft);
  vertical-align: top;
  font-size: 13px;
}

.fi-pl-table tr:first-child td {
  border-top: 0;
}

.fi-pl-table td:last-child {
  width: 180px;
  text-align: right;
  font-family: var(--fi-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fi-pl-table .fi-pl-idx {
  color: #94a3b8;
  font-weight: 600;
  margin-right: 7px;
}

.fi-pl-table a {
  color: var(--fi-navy);
  font-weight: 500;
}

.fi-pl-table a:hover {
  color: var(--fi-crimson);
}

.fi-pl-table .fi-pl-sub {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--fi-muted);
}

.fi-pl-in {
  color: #2c7a51;
}

.fi-pl-out {
  color: #c2410c;
}

.fi-pl-table tr.fi-pl-total td {
  border-top: 1.5px solid var(--fi-line);
  padding-top: 12px;
  padding-bottom: 12px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--fi-ink);
  background: #fbfcfe;
}

.fi-pl-table tr.fi-pl-total td small {
  font-weight: 500;
}

.fi-pl-money-small {
  font-size: 11px;
  color: var(--fi-muted);
  margin-left: 3px;
}

/* Тан нарх cards — one per concrete grade, each with its material breakdown. */
.fi-costcards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 16px 16px;
}

.fi-costcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fi-line-soft);
}

.fi-costcard-head .fi-costcard-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-costcard-head .fi-costcard-branch {
  font-size: 11.5px;
  color: var(--fi-muted);
}

.fi-costcard-head .fi-costcard-amt {
  font-family: var(--fi-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 600;
  color: #c2410c;
  text-align: right;
  white-space: nowrap;
}

.fi-costcard-head .fi-costcard-qty {
  display: block;
  font-family: var(--fi-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fi-muted);
}

@media (max-width: 1024px) {
  .fi-pl-cols {
    grid-template-columns: 1fr;
  }
  .fi-costcards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .fi-pl-formula {
    grid-template-columns: 1fr;
  }

  .fi-pl-op {
    padding: 2px 0;
    transform: rotate(90deg);
  }
}

/* ==========================================================================
   Data pages — panel, toolbar, table, buttons, modals.
   Shared by every list screen so the department pages stay one system.
   ========================================================================== */

.fi-panel {
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 14px;
  overflow: hidden;
}

/* --------------------------------------------------------------- toolbar */

.fi-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--fi-line-soft);
}

.fi-toolbar-spacer {
  margin-left: auto;
}

.fi-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.fi-search svg {
  position: absolute;
  left: 11px;
  font-size: 16px;
  color: var(--fi-muted);
  pointer-events: none;
}

.fi-search input {
  height: 36px;
  width: 260px;
  padding: 0 12px 0 33px;
  border: 1px solid var(--fi-line);
  border-radius: 9px;
  background: var(--fi-surface);
  font-family: var(--fi-ui);
  font-size: 13.5px;
  color: var(--fi-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fi-search input::placeholder {
  color: var(--fi-muted);
}

.fi-search input:focus {
  outline: none;
  border-color: var(--fi-navy);
  box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.08);
}

/* A fixed-height select with appearance:none does not centre its own text in
   Chrome — it follows line-height, which the template sets to 1.7. Match the
   line box to the content box (height minus borders) so the value sits centred. */
.fi-select {
  height: 36px;
  line-height: 34px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--fi-line);
  border-radius: 9px;
  background: var(--fi-surface)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E")
    no-repeat right 9px center;
  font-family: var(--fi-ui);
  font-size: 13.5px;
  color: var(--fi-ink);
  appearance: none;
  cursor: pointer;
}

.fi-select:focus {
  outline: none;
  border-color: var(--fi-navy);
  box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.08);
}

.fi-toolbar-label {
  font-size: 12.5px;
  color: var(--fi-muted);
}

/* Two dates that belong together read as one control, not two fields. */
.fi-daterange {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--fi-line);
  border-radius: 9px;
  background: var(--fi-surface);
}

.fi-daterange input {
  border: 0;
  padding: 0;
  background: transparent;
  font-family: var(--fi-ui);
  font-size: 12.5px;
  color: var(--fi-ink);
  min-width: 108px;
}

.fi-daterange input:focus {
  outline: none;
}

.fi-daterange:focus-within {
  border-color: var(--fi-navy);
  box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.08);
}

.fi-daterange > span {
  color: var(--fi-muted);
  font-size: 12px;
}

/* --------------------------------------------------------------- buttons */

.fi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-family: var(--fi-ui);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    opacity 0.15s ease;
}

.fi-btn svg {
  font-size: 17px;
}

.fi-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fi-btn--primary {
  background: var(--fi-navy);
  color: #fff;
}

.fi-btn--primary:hover:not(:disabled) {
  background: #14304f;
}

.fi-btn--ghost {
  background: var(--fi-surface);
  border-color: var(--fi-line);
  color: #344054;
}

.fi-btn--ghost:hover:not(:disabled) {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-btn--danger {
  background: var(--fi-crimson);
  color: #fff;
}

.fi-btn--danger:hover:not(:disabled) {
  background: #8e161d;
}

/* ----------------------------------------------------------------- table */

.fi-table-wrap {
  overflow-x: auto;
}

.fi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.fi-table thead th {
  padding: 10px 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--fi-line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fi-muted);
  text-align: left;
  white-space: nowrap;
}

/* Sortable header: the whole cell is the control. */
.fi-table thead th.is-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.13s ease;
}

.fi-table thead th.is-sortable:hover {
  color: var(--fi-ink);
}

.fi-table thead th.is-sortable > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fi-table thead th svg {
  font-size: 13px;
  opacity: 0.35;
}

.fi-table thead th.is-sorted {
  color: var(--fi-navy);
}

.fi-table thead th.is-sorted svg {
  opacity: 1;
}

.fi-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--fi-line-soft);
  color: #344054;
  vertical-align: middle;
}

.fi-table tbody tr:last-child td {
  border-bottom: 0;
}

.fi-table tbody tr {
  transition: background 0.12s ease;
}

.fi-table tbody tr:hover {
  background: #fafbfc;
}

/* Row number and any figure: tabular so columns line up vertically. */
.fi-table .fi-td-num {
  font-family: var(--fi-mono);
  font-size: 12px;
  color: var(--fi-muted);
  width: 1px;
  white-space: nowrap;
}

.fi-table .fi-td-strong {
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-table .fi-td-muted {
  color: var(--fi-muted);
}

/* Long free text must not stretch a column past the rest of the table. */
.fi-table .fi-td-clamp {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fi-muted);
}

.fi-table .fi-td-actions {
  width: 1px;
  white-space: nowrap;
  text-align: right;
}

/* Each action carries its own colour so it is identifiable at a glance,
   without the candy-circle look: soft tint, coloured glyph, deepens on hover. */
.fi-rowacts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fi-rowact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}

.fi-rowact svg {
  font-size: 17px;
}

.fi-rowact.is-view {
  background: #eef3fa;
  color: #35618f;
}

.fi-rowact.is-view:hover {
  background: #dfe9f5;
  color: #24486b;
}

.fi-rowact.is-edit {
  background: #edf6f0;
  color: #2c7a51;
}

.fi-rowact.is-edit:hover {
  background: #dcede3;
  color: #1f5c3c;
}

/* Overflow for rows that carry more actions than fit as icons. Neutral, so
   it never competes with the coloured primary actions beside it. */
.fi-rowact.is-more {
  background: transparent;
  color: var(--fi-muted);
}

.fi-rowact.is-more:hover,
.fi-rowact.is-more.is-open {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-rowmenu {
  position: fixed;
  z-index: 500;
  min-width: 208px;
  padding: 5px;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12),
    0 2px 6px rgba(15, 23, 42, 0.05);
  animation: fi-pop 0.13s ease-out;
  text-align: left;
}

.fi-rowmenu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  font-family: var(--fi-ui);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}

.fi-rowmenu button svg {
  font-size: 17px;
  flex: 0 0 17px;
  color: var(--fi-muted);
}

.fi-rowmenu button:hover {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-rowmenu button:hover svg {
  color: var(--fi-ink);
}

.fi-rowmenu-sep {
  height: 1px;
  background: var(--fi-line-soft);
  margin: 4px 6px;
}

/* Tones are grouped by what the action does, so eight icons in a row still
   read as three intents rather than eight unrelated colours:
   blue = look at it, green = change it, amber = change who owns it,
   crimson = destroy it. */
.fi-rowact.is-call {
  background: #eaf4f4;
  color: #2b6a66;
}

.fi-rowact.is-call:hover {
  background: #d9ecea;
  color: #1f504d;
}

.fi-rowact.is-assign {
  background: #eef0fa;
  color: #45509a;
}

.fi-rowact.is-assign:hover {
  background: #e0e4f4;
  color: #343d7d;
}

.fi-rowact.is-excel {
  background: #edf6f0;
  color: #2c7a51;
}

.fi-rowact.is-excel:hover {
  background: #dcede3;
  color: #1f5c3c;
}

.fi-rowact.is-wait {
  background: #fff5e8;
  color: #96601c;
}

.fi-rowact.is-wait:hover {
  background: #fdead1;
  color: #7a4d13;
}

.fi-rowact.is-danger {
  background: #fdf2f2;
  color: var(--fi-crimson);
}

.fi-rowact.is-danger:hover {
  background: #fae0e0;
  color: #8e161d;
}

/* Restore a soft-deleted row — a positive "bring it back" action, teal so it
   reads apart from the green edit and the crimson delete beside it. */
.fi-rowact.is-restore {
  background: #eaf4f4;
  color: #2b6a66;
}

.fi-rowact.is-restore:hover {
  background: #d9ecea;
  color: #1f504d;
}

/* Master-detail selection: the clicked row stays highlighted while its detail
   pane is loaded alongside. A left navy rail marks it without shouting. */
.fi-table tbody tr.is-selected,
.fi-table tbody tr.is-selected:hover {
  background: rgba(11, 31, 58, 0.05);
  box-shadow: inset 3px 0 0 var(--fi-navy);
}

/* ------------------------------------------------- states and pagination */

.fi-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 56px 20px;
  color: var(--fi-muted);
  font-size: 13px;
}

.fi-state svg {
  font-size: 30px;
  opacity: 0.4;
}

.fi-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--fi-line);
  border-top-color: var(--fi-navy);
  border-radius: 50%;
  animation: fi-spin 0.65s linear infinite;
}

@keyframes fi-spin {
  to {
    transform: rotate(360deg);
  }
}

.fi-tablefoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--fi-line-soft);
}

.fi-tablefoot-count {
  font-size: 12.5px;
  color: var(--fi-muted);
}

.fi-tablefoot-count b {
  font-family: var(--fi-mono);
  font-weight: 600;
  color: #344054;
}

/* Page size sits with the pagination — both answer "how much am I seeing". */
.fi-tablefoot-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.fi-perpage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fi-muted);
  white-space: nowrap;
}

.fi-select--sm {
  height: 30px;
  line-height: 28px;
  padding: 0 26px 0 9px;
  font-size: 12.5px;
  background-position: right 7px center;
}

.fi-pager {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Flex-centred, not text-centred: an inline SVG would otherwise sit on the
   text baseline while the page numbers centre, leaving the arrows low. */
.fi-pager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--fi-muted);
  font-family: var(--fi-ui);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}

.fi-pager button svg {
  font-size: 16px;
  width: 16px;
  height: 16px;
  display: block;
}

.fi-pager button:hover:not(:disabled):not(.is-current):not(.is-active) {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

/* Most converted lists mark the current page `is-active` (matching fi-segmented);
   the original sales detail uses `is-current`. Style both so the highlight
   renders everywhere without touching every page. */
.fi-pager button.is-current,
.fi-pager button.is-active {
  background: var(--fi-navy);
  color: #fff;
  font-weight: 600;
}

.fi-pager button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fi-pager span {
  padding: 0 3px;
  color: var(--fi-muted);
  font-size: 12.5px;
}

/* ---------------------------------------------------------------- modals */

.fi-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  animation: fi-fade 0.14s ease-out;
}

@keyframes fi-fade {
  from {
    opacity: 0;
  }
}

.fi-modal {
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--fi-surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  animation: fi-rise 0.16s ease-out;
}

@keyframes fi-rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}

.fi-modal--sm {
  max-width: 420px;
}

.fi-modal--md {
  max-width: 620px;
}

.fi-modal--lg {
  max-width: 880px;
}

.fi-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--fi-line-soft);
}

.fi-modal-head h2 {
  flex: 1;
  margin: 0;
  font-size: 15px !important;
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-modal-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fi-muted);
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}

.fi-modal-x svg {
  font-size: 18px;
}

.fi-modal-x:hover {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-modal-body {
  padding: 20px;
  overflow-y: auto;
}

.fi-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--fi-line-soft);
}

/* ------------------------------------------------------------ map picker */

.fi-modal--map {
  max-width: 820px;
  height: min(660px, calc(100vh - 40px));
}

.fi-maptools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 11px 20px;
  border-bottom: 1px solid var(--fi-line-soft);
  position: relative;
}

.fi-maptools .fi-search {
  flex: 1;
  min-width: 200px;
}

.fi-maptools .fi-search input {
  width: 100%;
}

.fi-mapresults {
  position: absolute;
  top: calc(100% - 4px);
  left: 20px;
  right: 20px;
  z-index: 600;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 11px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  max-height: 240px;
  overflow-y: auto;
}

.fi-mapresults button {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  font-family: var(--fi-ui);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  line-height: 1.4;
}

.fi-mapresults button:hover {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-mapresults svg {
  font-size: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
  color: var(--fi-muted);
}

.fi-mapbody {
  flex: 1;
  position: relative;
  min-height: 0;
}

.fi-mapbody .leaflet-container {
  background: #eef1f6;
}

.fi-maphint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}

.fi-maphint svg {
  font-size: 15px;
}

/* Leaflet's own marker images 404 under webpack; the pin is drawn here. */
.fi-mappin {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--fi-crimson);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.4);
}

.fi-mapcoords {
  font-family: var(--fi-mono);
  font-size: 12px;
  color: var(--fi-muted);
  font-variant-numeric: tabular-nums;
}

.fi-modal--map .fi-modal-foot {
  gap: 8px;
}

/* A repeatable project row: name, location, and its remove control. */
.fi-projectrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fi-line-soft);
}

.fi-projectrow:last-of-type {
  border-bottom: 0;
}

.fi-projectrow-x {
  margin-bottom: 3px;
}

@media (max-width: 767px) {
  .fi-projectrow {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .fi-projectrow .fi-field:first-child {
    grid-column: 1 / -1;
  }
}

/* The location field on a form row: read-only text plus a map trigger. */
.fi-locfield {
  display: flex;
  gap: 6px;
  align-items: center;
}

.fi-locfield input {
  flex: 1;
  min-width: 0;
}

/* --- confirm: deliberately small, so it reads as a question not a page --- */

.fi-modal--confirm {
  max-width: 380px;
  padding: 24px;
  text-align: center;
  align-items: center;
}

.fi-confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: #fdf2f2;
  color: var(--fi-crimson);
  margin-bottom: 14px;
}

.fi-confirm-icon svg {
  font-size: 22px;
}

.fi-modal--confirm h2 {
  margin: 0;
  font-size: 15.5px !important;
  font-weight: 600;
  color: var(--fi-ink);
  line-height: 1.4;
}

.fi-confirm-name {
  margin: 8px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fi-navy);
  word-break: break-word;
}

.fi-confirm-note {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--fi-muted);
  line-height: 1.5;
}

.fi-confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  width: 100%;
}

.fi-confirm-actions .fi-btn {
  flex: 1;
}

/* ----------------------------------------------------------------- forms */

.fi-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fi-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.fi-field--full {
  grid-column: 1 / -1;
}

/* Single column, read top to bottom. Used where a record hangs off a parent:
   choose the parent first, then fill in what belongs to it. */
.fi-form-grid--stack {
  grid-template-columns: minmax(0, 1fr);
}

.fi-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: #344054;
}

/* The unit hint on a field's own label. Scoped to the direct child so a
   nested control (a switch row, which is itself a <label><span>) does not
   inherit the accent colour. */
.fi-field > label span {
  color: var(--fi-crimson);
}

.fi-field input,
.fi-field textarea,
.fi-field select {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--fi-line);
  border-radius: 9px;
  background: var(--fi-surface);
  font-family: var(--fi-ui);
  font-size: 13.5px;
  color: var(--fi-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fi-field textarea {
  resize: vertical;
  line-height: 1.5;
}

/* Match the toolbar selects: own chevron, so a dropdown never reads as a
   text input the user is expected to type into. */
.fi-field select {
  height: 38px;
  line-height: 36px;
  padding: 0 30px 0 11px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  appearance: none;
  cursor: pointer;
}

.fi-field input:focus,
.fi-field textarea:focus,
.fi-field select:focus {
  outline: none;
  border-color: var(--fi-navy);
  box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.08);
}

/* --- read-only detail view --- */

.fi-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 14px;
}

.fi-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 0;
  border-bottom: 1px solid var(--fi-line-soft);
  min-width: 0;
}

.fi-detail-row--full {
  grid-column: 1 / -1;
}

/* Wider detail grid (fixed-asset detail packs 11 fields — 3 columns on desktop
   keeps the panel short enough to fit the viewport). */
.fi-detail--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .fi-detail--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Fixed-asset detail layout: info on the left, QR/signature rail on the right;
   the two secondary cards sit side by side under the main card. */
.fa-detailgrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.fa-detailmain {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.fa-detailpair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.fa-detailaside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 1023px) {
  .fa-detailgrid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 639px) {
  .fa-detailpair {
    grid-template-columns: minmax(0, 1fr);
  }
}

.fa-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.fa-qr {
  width: 100%;
  max-width: 160px;
  border-radius: 8px;
  border: 1px solid var(--fi-line-soft);
}

.fa-sign {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--fi-line-soft);
  background: #fff;
}

.fa-empty {
  margin: 0;
  font-size: 13px;
  color: var(--fi-muted);
}

.fi-detail-row dt {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fi-muted);
}

.fi-detail-row dd {
  margin: 0;
  font-size: 13.5px;
  color: var(--fi-ink);
  word-break: break-word;
}

@media (max-width: 639px) {
  .fi-form-grid,
  .fi-detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .fi-search input {
    width: 100%;
  }
  .fi-search {
    flex: 1;
  }
}

/* ------------------------------------------------------------ stat cards */

.fi-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.fi-stat {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 13px;
}

.fi-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 11px;
  background: #eef1f6;
  color: var(--fi-navy);
}

.fi-stat-icon svg {
  font-size: 20px;
}

.fi-stat-icon.is-money {
  background: #edf6f0;
  color: #2c7a51;
}

.fi-stat-icon.is-danger {
  background: #fdf2f2;
  color: var(--fi-crimson);
}

.fi-stat-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.fi-stat-body span {
  font-size: 11.5px;
  color: var(--fi-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Figures are tabular so cards line up across the row. */
.fi-stat-body b {
  font-family: var(--fi-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--fi-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.fi-stat-body b small {
  font-size: 11px;
  font-weight: 500;
  color: var(--fi-muted);
  margin-left: 3px;
}

/* ---------------------------------------------------------------- badges */

.fi-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.fi-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.fi-badge--neutral {
  background: #eef1f6;
  color: #475569;
}

.fi-badge--info {
  background: #eef3fa;
  color: #35618f;
}

.fi-badge--progress {
  background: #fff5e8;
  color: #96601c;
}

.fi-badge--success {
  background: #edf6f0;
  color: #2c7a51;
}

.fi-badge--danger {
  background: #fdf2f2;
  color: var(--fi-crimson);
}

/* --------------------------------------------------------------- money */

.fi-money {
  font-family: var(--fi-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  /* Numeric columns right-align their header; the value must follow. */
  text-align: right;
}

.fi-money b {
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-money small {
  font-size: 11px;
  color: var(--fi-muted);
  margin-left: 3px;
}

/* Two-line table cell: headline value over a quieter qualifier. */
.fi-cell-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fi-cell-stack > span:last-child {
  font-size: 11.5px;
  color: var(--fi-muted);
}

/* -------------------------------------------------------------- progress */

.fi-progress {
  height: 6px;
  border-radius: 999px;
  background: #eef1f6;
  overflow: hidden;
}

.fi-progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--fi-navy);
  transition: width 0.3s ease;
}

.fi-progress.is-danger > i {
  background: var(--fi-crimson);
}

/* ------------------------------------------------- record page scaffolding */

.fi-recordhead {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.fi-recordhead h1 {
  margin: 0;
  font-size: 19px !important;
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-recordhead-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.fi-recordhead-meta > span {
  font-size: 12px;
  color: var(--fi-muted);
}

/* 5/12 for the record, 7/12 for its children — the record's labels are long
   enough that a narrower column wrapped every second one onto two lines. */
.fi-recordgrid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 1023px) {
  .fi-recordgrid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.fi-panel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--fi-line-soft);
}

.fi-panel-head h2 {
  margin: 0;
  font-size: 13.5px !important;
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-panel-head svg {
  font-size: 17px;
  color: var(--fi-muted);
}

.fi-panel-body {
  padding: 16px;
}

/* Label/value rows inside a record panel. */
.fi-rows {
  display: flex;
  flex-direction: column;
}

.fi-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--fi-line-soft);
  font-size: 12.5px;
}

.fi-row:last-child {
  border-bottom: 0;
}

.fi-row > dt {
  flex: 0 0 44%;
  color: var(--fi-muted);
  font-size: 12.5px;
}

.fi-row > dd {
  margin: 0;
  flex: 1;
  min-width: 0;
  color: var(--fi-ink);
  word-break: break-word;
}

.fi-row--total {
  border-top: 1px solid var(--fi-line);
  margin-top: 4px;
  padding-top: 12px;
}

.fi-row--total > dt,
.fi-row--total > dd {
  font-weight: 600;
  color: var(--fi-ink);
}

/* Breadcrumb above a record page. The in-page Breadcrumb component is hidden
   app-wide, so record screens carry their own trail. */
.fi-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--fi-muted);
  flex-wrap: wrap;
}

.fi-crumbs a {
  color: var(--fi-muted);
  text-decoration: none;
  transition: color 0.13s ease;
}

.fi-crumbs a:hover {
  color: var(--fi-navy);
}

.fi-crumbs svg {
  font-size: 13px;
  opacity: 0.5;
}

.fi-crumbs > span:last-child {
  color: var(--fi-ink);
  font-weight: 500;
}

.fi-recordcol {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Compact search that sits inside a panel header. */
.fi-search--sm input {
  height: 32px;
  width: 200px;
  font-size: 12.5px;
}

.fi-note {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid var(--fi-line);
  border-radius: 10px;
  background: #fafbfc;
}

.fi-note > span {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fi-muted);
  margin-bottom: 4px;
}

.fi-note > p {
  margin: 0;
  font-size: 12.5px;
  color: #344054;
  line-height: 1.5;
}

.fi-note a {
  color: var(--fi-crimson);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fi-note a:hover {
  text-decoration-thickness: 2px;
}

.fi-truck {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.fi-truck > svg {
  font-size: 17px;
  color: var(--fi-muted);
  flex-shrink: 0;
}

/* Batch timeline as one short strip. Four stacked label/value rows made every
   batch ~60px tall; laid out inline the row is short enough to fit ten. */
.fi-times {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
}

.fi-times > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.fi-times dt {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fi-muted);
  white-space: nowrap;
}

.fi-times dd {
  margin: 0;
  font-family: var(--fi-mono);
  font-size: 11.5px;
  color: #344054;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fi-times dd.is-empty {
  color: #b6bdc9;
}

/* Denser table for record sub-lists, where many short rows beat few tall ones. */
.fi-table--compact tbody td {
  padding: 8px 10px;
}

.fi-table--compact thead th {
  padding: 8px 10px;
}

.fi-table--compact .fi-cell-stack > span:last-child {
  font-size: 11px;
}

.fi-table--compact .fi-truck > svg {
  font-size: 15px;
}

/* Progress lives inside the record card, separated by a rule rather than
   its own panel — it describes the record, it is not a second subject. */
.fi-progress-block {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--fi-line);
}

.fi-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 12px;
  color: var(--fi-muted);
}

.fi-progress-head b {
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-progress.is-done > i {
  background: #2c7a51;
}

.fi-progress-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  font-family: var(--fi-mono);
  font-size: 11.5px;
  color: var(--fi-muted);
}

/* ----------------------------------------------------------- form pieces */

.fi-formcard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0 24px;
  padding: 20px;
}

.fi-fieldset {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 18px;
  min-width: 0;
}

.fi-fieldset > h3 {
  margin: 0;
  font-size: 11px !important;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fi-muted);
}

.fi-switchrow {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.fi-switchrow input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fi-switchrow > i {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 34px;
  border-radius: 999px;
  background: #d7dce5;
  transition: background 0.15s ease;
}

.fi-switchrow > i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}

.fi-switchrow input:checked + i {
  background: var(--fi-navy);
}

.fi-switchrow input:checked + i::after {
  transform: translateX(14px);
}

.fi-switchrow input:focus-visible + i {
  outline: 2px solid var(--fi-crimson);
  outline-offset: 2px;
}

.fi-switchrow > span {
  font-size: 13px;
  color: #344054;
}

/* Checkbox variant. A switch reads as "applies now"; these two answer a
   question the form only commits on Сақлаш, so they are checkboxes. */
.fi-checkrow {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.fi-checkrow input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fi-checkrow > i {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 5px;
  border: 1.5px solid #cbd2dd;
  background: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fi-checkrow > i::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 5px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

.fi-checkrow input:checked + i {
  background: var(--fi-navy);
  border-color: var(--fi-navy);
}

.fi-checkrow input:checked + i::after {
  transform: rotate(45deg) scale(1);
}

.fi-checkrow input:focus-visible + i {
  outline: 2px solid var(--fi-crimson);
  outline-offset: 2px;
}

.fi-checkrow > span {
  font-size: 13px;
  color: #344054;
}

/* A computed figure the user cannot type into. */
.fi-field input[readonly] {
  background: #f7f8fa;
  color: var(--fi-ink);
  font-family: var(--fi-mono);
  font-weight: 600;
  cursor: default;
}

.fi-field-hint {
  font-size: 11.5px;
  color: var(--fi-muted);
}

.fi-formfoot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--fi-line-soft);
}

/* ------------------------------------------------------------ analytics */

.fi-chartgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

/* Each chart carries ONE measure. A client count and a concrete volume do not
   share an axis — two scales on one axis makes the smaller series unreadable,
   and a second y-axis invites false correlation. */
.fi-chart-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 16px 0;
}

.fi-chart-head h2 {
  margin: 0;
  font-size: 13.5px !important;
  font-weight: 600;
  color: var(--fi-ink);
}

/* Section heading inside a panel (a sub-table title). The wowdash template
   sizes bare h2/h3 responsively, so an inline font-size loses — this needs the
   same !important the chart head uses. */
.fi-subhead {
  margin: 0;
  font-size: 14px !important;
  font-weight: 600;
  color: var(--fi-ink);
}

/* Printable car report — a document, not a data table. Centered, bordered,
   and stripped to ink on white when printed. */
.fi-payslip {
  max-width: 760px;
  margin: 0 auto;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 14px;
  overflow: hidden;
}

.fi-payslip-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--fi-line-soft);
}

.fi-payslip-head h2 {
  margin: 0 0 6px;
  font-size: 18px !important;
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-payslip-head h3 {
  margin: 0 0 4px;
  font-size: 14px !important;
  font-weight: 600;
}

.fi-payslip-head p {
  margin: 0 0 2px;
  font-size: 12.5px;
  color: var(--fi-muted);
}

.fi-payslip-body {
  padding: 28px 24px;
}

.fi-payslip-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.fi-payslip-cols h4 {
  margin: 0 0 10px;
  font-size: 13px !important;
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-payslip-net {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--fi-line-soft);
  font-size: 14px;
}

.fi-payslip-net b {
  font-family: var(--fi-mono);
  font-size: 17px;
}

.fi-payslip-note {
  margin: 44px 0 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fi-muted);
}

.fi-payslip-sign {
  display: flex;
  justify-content: space-between;
  margin-top: 52px;
  font-size: 12.5px;
  color: var(--fi-ink);
}

.fi-payslip-sign span {
  border-top: 1px solid var(--fi-line);
  padding: 6px 14px 0;
}

@media print {
  .no-print,
  .fi-crumbs {
    display: none !important;
  }
  .fi-payslip {
    border: none;
    max-width: none;
  }
}

/* Full-width info strip — a few label/value pairs laid out in one horizontal
   row inside a panel, instead of a tall single-column detail list. */
.fi-inforow {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  padding: 16px 20px;
}

.fi-inforow-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.fi-inforow-item span {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--fi-muted);
}

.fi-inforow-item b {
  font-size: 14px;
  font-weight: 600;
  color: var(--fi-ink);
}

/* Transactions page: a wide table with a fixed balance/summary aside. Stacks
   the aside above the table once there is no room for the side-by-side split. */
.fi-txlayout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.fi-txaside {
  flex: 0 0 320px;
  width: 320px;
}

@media (max-width: 1100px) {
  .fi-txlayout {
    flex-direction: column-reverse;
  }
  .fi-txaside {
    flex-basis: auto;
    width: 100%;
  }
}

.fi-chart-head span {
  font-size: 11.5px;
  color: var(--fi-muted);
}

.fi-chart-total {
  margin-left: auto;
  font-family: var(--fi-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--fi-ink);
  font-variant-numeric: tabular-nums;
}

.fi-chart-total small {
  font-size: 11px;
  font-weight: 500;
  color: var(--fi-muted);
  margin-left: 3px;
}

/* ApexCharts sizes its y-axis gutter on mount and its <svg> is overflow:hidden,
   so a wide tick such as "200 млн" gets left-clipped to its tail ("0 млн").
   Let the svg paint outside its box, and pad the body so it lands inside the
   panel rather than being re-clipped by .fi-panel's own overflow:hidden. */
.fi-chart-body {
  padding: 4px 8px 6px 20px;
}

.fi-chart-body .apexcharts-canvas svg {
  overflow: visible;
}

/* Segmented control — two mutually exclusive views of the same list. */
.fi-segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: #eef1f6;
  border-radius: 10px;
}

.fi-segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fi-muted);
  font-family: var(--fi-ui);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}

.fi-segmented button:hover:not(.is-active) {
  color: var(--fi-ink);
}

.fi-segmented button.is-active {
  background: var(--fi-surface);
  color: var(--fi-ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.fi-segmented b {
  font-family: var(--fi-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Expandable row: a parent row that reveals its own detail table. */
.fi-table tr.is-expandable td:first-child {
  cursor: pointer;
}

.fi-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fi-muted);
  cursor: pointer;
  transition: background 0.13s ease, transform 0.13s ease;
}

.fi-expand:hover {
  background: var(--fi-hover);
  color: var(--fi-ink);
}

.fi-expand.is-open {
  transform: rotate(90deg);
  color: var(--fi-navy);
}

.fi-subtable {
  background: #fafbfc;
}

.fi-subtable > td {
  padding: 0 !important;
}

.fi-subtable table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.fi-subtable thead th {
  padding: 7px 12px;
  background: #f2f4f8;
  border-bottom: 1px solid var(--fi-line-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fi-muted);
  text-align: left;
  white-space: nowrap;
}

.fi-subtable tbody td {
  padding: 7px 12px;
  border-bottom: 1px solid #eef1f6;
  color: #344054;
}

.fi-subtable tbody tr:last-child td {
  border-bottom: 0;
}

/* Conversion meter: one ratio against its whole, on a same-ramp track. */
.fi-meter {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 15px 16px;
  background: var(--fi-surface);
  border: 1px solid var(--fi-line);
  border-radius: 13px;
}

.fi-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--fi-muted);
}

.fi-meter-head b {
  font-family: var(--fi-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--fi-ink);
  font-variant-numeric: tabular-nums;
}

.fi-meter-track {
  height: 8px;
  border-radius: 999px;
  background: #eef1f6;
  overflow: hidden;
}

.fi-meter-track > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #2a78d6;
  transition: width 0.3s ease;
}

.fi-meter-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--fi-muted);
}

/* Two panels side by side. minmax(0,1fr) rather than 1fr, or a chart's SVG
   forces its track wider than half and breaks the split. */
.fi-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}

@media (max-width: 1200px) {
  .fi-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A row that navigates. The chevron is the affordance — without it a clickable
   row is invisible until hovered. */
.fi-table tbody tr.is-clickable {
  cursor: pointer;
}

.fi-table tbody tr.is-clickable:focus-visible {
  outline: 2px solid var(--fi-crimson);
  outline-offset: -2px;
}

.fi-rowgo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #98a2b3;
  transition: color 0.13s ease, background 0.13s ease;
}

.fi-rowgo svg {
  font-size: 17px;
}

.fi-table tbody tr.is-clickable:hover .fi-rowgo {
  color: var(--fi-navy);
  background: #eef1f6;
}

/* ------------------------------------------------------------- kassa */

/* Register context bar: which branch / which register, and its state. */
.fi-regbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
}

.fi-regbar-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.fi-regbar-field > span {
  font-size: 11.5px;
  color: var(--fi-muted);
  white-space: nowrap;
}

.fi-regbar-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-right: 12px;
  margin-right: 2px;
  border-right: 1px solid var(--fi-line);
}

.fi-regbar-state > time {
  font-family: var(--fi-mono);
  font-size: 11.5px;
  color: var(--fi-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .fi-regbar-state {
    border-right: 0;
    padding-right: 0;
  }
}

/* Action picker: a grid of choices inside a modal, one per operation. */
.fi-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.fi-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  text-align: left;
  border: 1px solid var(--fi-line);
  border-radius: 12px;
  background: var(--fi-surface);
  cursor: pointer;
  transition: border-color 0.13s ease, background 0.13s ease;
}

.fi-choice:hover {
  border-color: #c9d2e0;
  background: var(--fi-hover);
}

.fi-choice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: #eef1f6;
  color: var(--fi-navy);
}

.fi-choice-icon svg {
  font-size: 19px;
}

.fi-choice-icon.is-income {
  background: #edf6f0;
  color: #2c7a51;
}

.fi-choice-icon.is-expense {
  background: #fdf2f2;
  color: var(--fi-crimson);
}

.fi-choice-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fi-choice-body b {
  font-size: 13px;
  font-weight: 600;
  color: var(--fi-ink);
}

.fi-choice-body span {
  font-size: 11.5px;
  color: var(--fi-muted);
  line-height: 1.45;
}

/* Amounts carry their sign in colour as well as glyph. */
.fi-amount {
  font-family: var(--fi-mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fi-amount.is-income {
  color: #2c7a51;
}

.fi-amount.is-expense {
  color: var(--fi-crimson);
}

.fi-amount small {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--fi-muted);
  margin-left: 3px;
}

/* --------------------------------------------------------------- a11y */

.fi-nav-item:focus-visible,
.fi-nav-link:focus-visible,
.fi-header-actions button:focus-visible,
.fi-profile:focus-visible,
.fi-brand:focus-visible,
.fi-btn:focus-visible,
.fi-rowact:focus-visible,
.fi-pager button:focus-visible,
.fi-pop-item:focus-visible,
.fi-modal-x:focus-visible {
  outline: 2px solid var(--fi-crimson);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ toasts */
/* The single transient notification. Bottom-right so it never covers the
   toolbar or a modal's action row, which is where the user is looking. */
.fi-toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: min(400px, calc(100vw - 40px));
}

.fi-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--fi-line);
  border-left: 3px solid var(--fi-muted);
  background: var(--fi-surface);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  animation: fi-toast-in 0.18s ease-out;
}

.fi-toast > svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--fi-muted);
}

.fi-toast > p {
  flex: 1;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fi-ink);
  overflow-wrap: anywhere;
}

.fi-toast > button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fi-muted);
  cursor: pointer;
}

.fi-toast > button:hover {
  color: var(--fi-ink);
}

.fi-toast > button:focus-visible {
  outline: 2px solid var(--fi-crimson);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Accent matches the fi-badge family so a toast and a status pill agree. */
.fi-toast--success {
  border-left-color: #2c7a51;
}
.fi-toast--success > svg {
  color: #2c7a51;
}

.fi-toast--error {
  border-left-color: var(--fi-crimson);
}
.fi-toast--error > svg {
  color: var(--fi-crimson);
}

.fi-toast--info {
  border-left-color: #35618f;
}
.fi-toast--info > svg {
  color: #35618f;
}

@keyframes fi-toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Small button variant — inline actions on cards and panel heads. */
.fi-btn--sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 8px;
}

.fi-btn--sm svg {
  font-size: 15px;
}

/* Attachment cards — lab QR files, both standalone and under an update. */
.fi-filegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.fi-filecard {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--fi-line);
  border-radius: 11px;
  background: var(--fi-surface);
}

.fi-filecard-head {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.fi-filecard-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fi-ink);
  word-break: break-word;
}

.fi-filecard-date {
  font-size: 11.5px;
  color: var(--fi-muted);
}

.fi-filecard .fi-btn {
  margin-top: 2px;
}

/* Lab update history — a light left-ruled feed. */
.fi-timeline-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--fi-line);
  border-left: 3px solid var(--fi-navy);
  border-radius: 11px;
  background: var(--fi-surface);
}

.fi-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.fi-timeline-meta {
  font-size: 11.5px;
  color: var(--fi-muted);
}

/* Employee identity cell — avatar + name/phone, used in HR rosters. */
.fi-emp {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fi-emp-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  object-fit: cover;
  background: #e9edf3;
}

.fi-emp-avatar.is-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #5a6a82;
  letter-spacing: 0.02em;
}

.fi-emp-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.fi-emp-meta b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fi-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fi-emp-meta span {
  font-size: 11.5px;
  color: var(--fi-muted);
  white-space: nowrap;
}

/* ------------------------------------------------- HR profile page */
/* Two-column: identity card aside + tabbed editor. Stacks on narrow. */
.fi-hrlayout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.fi-hrside {
  flex: 0 0 330px;
  width: 330px;
}

.fi-hrmain {
  flex: 1;
  min-width: 0;
}

@media (max-width: 1000px) {
  .fi-hrlayout {
    flex-direction: column;
  }
  .fi-hrside {
    flex-basis: auto;
    width: 100%;
  }
}

/* Two equal columns for a form split into main + optional panels; stacks on
   narrow screens so it stays one screen on desktop without scrolling. */
.fi-formsplit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 1000px) {
  .fi-formsplit {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Self-service profile: a wider identity card than the fixed 330px HR side —
   a 4/8 grid that stacks on narrow screens. */
.fi-proflayout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 1000px) {
  .fi-proflayout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Identity card: cover band, overlapping avatar, name, info list. */
.fi-profilecard {
  overflow: hidden;
}

.fi-cover {
  height: 108px;
  background: linear-gradient(120deg, #14304f 0%, #24557f 55%, #3f7ca8 100%);
}

.fi-profilecard-body {
  padding: 0 18px 18px;
  margin-top: -54px;
  text-align: center;
}

.fi-profilecard-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--fi-surface);
  background: #e9edf3;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.fi-profilecard-avatar.is-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  color: #5a6a82;
}

.fi-profilecard-body h2 {
  margin: 12px 0 2px;
  font-size: 17px !important;
  font-weight: 700;
  color: var(--fi-ink);
}

.fi-profilecard-body > span {
  display: block;
  font-family: var(--fi-mono);
  font-size: 13px;
  color: var(--fi-muted);
}

.fi-profilecard-list {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--fi-line-soft);
  text-align: left;
}

.fi-profilecard-list h3 {
  margin: 0 0 12px;
  font-size: 13px !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--fi-muted);
}

.fi-idrow {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--fi-line-soft);
}

.fi-idrow:last-child {
  border-bottom: 0;
}

.fi-idrow dt {
  flex: 0 0 104px;
  color: var(--fi-muted);
  font-weight: 500;
}

.fi-idrow dd {
  margin: 0;
  color: var(--fi-ink);
  font-weight: 600;
  min-width: 0;
  word-break: break-word;
}

/* Round photo picker with a camera affordance (edit-profile tab). */
.fi-photoedit {
  position: relative;
  width: 116px;
  height: 116px;
}

.fi-photoedit img,
.fi-photoedit .is-initials {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--fi-line);
  background: #e9edf3;
}

.fi-photoedit .is-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 600;
  color: #5a6a82;
}

.fi-photoedit-btn {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--fi-navy);
  color: #fff;
  border: 2px solid var(--fi-surface);
  cursor: pointer;
}

.fi-photoedit-btn:hover {
  background: #14304f;
}

.fi-photoedit-btn svg {
  font-size: 17px;
}

/* Wrapping list of role checkboxes. */
.fi-checkgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}
