:root {
  --navy:      #375673;
  --navy-dark: #2a4057;
  --navy-lite: #4a6d8c;
  --green:     #779d36;
  --green-lt:  #8fb842;
  --bg:        #f4f6f8;
  --white:     #ffffff;
  --border:    #dde2e8;
  --text:      #1a2733;
  --muted:     #6b7f8e;
  --danger:    #dc2626;
  --sidebar-w: 220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ── AUTH ──────────────────────────────────────────────── */
#authScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}
.auth-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 48px 56px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.auth-logo-mark {
  width: 72px; height: 72px;
  background: rgba(119,157,54,.25);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; color: var(--green);
}
.auth-h1  { font-size: 24px; font-weight: 800; color: #fff; }
.auth-sub { font-size: 13px; color: rgba(255,255,255,.5); }
.auth-btn {
  background: var(--green); color: #fff; border: none;
  padding: 13px 32px; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: background .15s;
}
.auth-btn:hover { background: var(--green-lt); }
.ms-icon { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 18px; height: 18px; }
.ms-icon span { background: rgba(255,255,255,.9); border-radius: 1px; }
.ms-icon span:nth-child(2), .ms-icon span:nth-child(3) { opacity: .6; }
.ms-icon span:nth-child(4) { opacity: .3; }

/* ── APP SHELL ───────────────────────────────────────── */
#appShell { display: flex; width: 100%; height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.sb-logo {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
}
.sb-logomark {
  width: 30px; height: 30px;
  background: rgba(119,157,54,.3);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900; color: var(--green); flex-shrink: 0;
}
.sb-logo-txt { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.85); line-height: 1.3; }
.sb-section  { padding: 14px 0 6px; }
.sb-sec-lbl  { font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.35); padding: 0 16px 7px; }
.sb-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px; font-size: 12.5px;
  color: rgba(255,255,255,.7); cursor: pointer;
  transition: all .15s; border-left: 3px solid transparent; white-space: nowrap;
}
.sb-item:hover             { background: rgba(255,255,255,.07); color: #fff; }
.sb-item.active            { background: rgba(119,157,54,.18); color: #fff; border-left-color: var(--green); }
.sb-item svg               { flex-shrink: 0; opacity: .75; }
.sb-btn {
  margin: 0 12px 12px;
  background: var(--green); color: #fff; border: none;
  border-radius: 6px; padding: 9px 12px;
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: background .15s; width: calc(100% - 24px);
}
.sb-btn:hover { background: var(--green-lt); }
.sb-btn.disabled { opacity: .4; pointer-events: none; }
.sb-user {
  padding: 14px 16px;
  font-size: 11px; color: rgba(255,255,255,.35);
  border-top: 1px solid rgba(255,255,255,.08); line-height: 1.5;
}
.sb-role-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  letter-spacing: .5px; padding: 2px 8px; border-radius: 3px;
  text-transform: uppercase; margin-top: 4px;
}

/* ── MY ACTIONS ────────────────────────────────────────── */
.sb-my-actions-section {
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sb-my-actions-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; color: rgba(255,255,255,.85);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .15s; text-align: left;
  font-family: inherit;
}
.sb-my-actions-btn:hover { background: rgba(255,255,255,.13); }
.sb-my-actions-btn svg { opacity: .8; flex-shrink: 0; }
.sb-my-actions-btn .ma-label { flex: 1; }
.my-actions-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #dc2626; color: #fff;
  border-radius: 9px; font-size: 10px; font-weight: 700;
  animation: badgePop .2s ease;
}
.my-actions-badge.hidden { display: none; }
@keyframes badgePop { from { transform: scale(.6); } to { transform: scale(1); } }

.my-actions-overlay {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,.35);
  display: flex; align-items: stretch;
}
.my-actions-overlay.hidden { display: none; }
.my-actions-panel {
  width: 420px; max-width: 100vw;
  margin-left: var(--sidebar-w);
  background: #fff; display: flex; flex-direction: column;
  box-shadow: 4px 0 32px rgba(0,0,0,.18);
  animation: panelSlide .18s ease;
}
@keyframes panelSlide { from { transform: translateX(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
.my-actions-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.my-actions-panel-title {
  font-size: 16px; font-weight: 700; color: var(--text);
}
.my-actions-panel-sub {
  font-size: 11.5px; color: var(--muted); margin-top: 2px;
}
.my-actions-close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; line-height: 1;
  padding: 2px 6px; border-radius: 4px;
}
.my-actions-close-btn:hover { background: var(--bg); color: var(--text); }
.my-actions-panel-body {
  flex: 1; overflow-y: auto; padding: 12px 16px;
}
.my-actions-group-lbl {
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 0 6px; margin-top: 4px;
}
.my-actions-item {
  display: block; width: 100%;
  padding: 11px 14px; margin-bottom: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; text-align: left;
  transition: border-color .12s, box-shadow .12s;
  font-family: inherit;
}
.my-actions-item:hover { border-color: var(--navy-lite); box-shadow: 0 2px 8px rgba(55,86,115,.1); }
.my-actions-item-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.my-actions-item-num {
  font-size: 12px; font-weight: 800; font-family: 'Courier New', monospace;
  color: var(--navy);
}
.my-actions-item-project { font-size: 11.5px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-actions-item-type {
  font-size: 9px; font-weight: 700; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 3px; text-transform: uppercase;
  background: #e8f0f8; color: var(--navy);
}
.my-actions-item-comments {
  font-size: 11px; color: var(--muted);
  white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.my-actions-empty {
  text-align: center; padding: 48px 20px;
  color: var(--muted); font-size: 13px;
}
.my-actions-empty svg { display: block; margin: 0 auto 12px; opacity: .35; }

/* ── MAIN ──────────────────────────────────────────────── */
.main         { flex: 1; overflow-y: scroll; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #b0bcc8 #eef0f3; }
.topbar       { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; }
.topbar-title { font-size: 17px; font-weight: 800; color: var(--navy); }
.topbar-sub   { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.content      { padding: 24px; }
.main::-webkit-scrollbar         { width: 8px; display: block; }
.main::-webkit-scrollbar-track   { background: #eef0f3; }
.main::-webkit-scrollbar-thumb   { background: #b0bcc8; border-radius: 4px; }
.main::-webkit-scrollbar-thumb:hover { background: #8a9aaa; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn { padding: 8px 16px; border-radius: 6px; font-size: 12.5px; font-weight: 700; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.btn-primary   { background: var(--green); color: #fff; }   .btn-primary:hover   { background: var(--green-lt); }
.btn-secondary { background: #fff; color: var(--navy); border: 1px solid var(--border); } .btn-secondary:hover { background: var(--bg); }
.btn-danger    { background: #fee2e2; color: var(--danger); border: 1px solid #fca5a5; } .btn-danger:hover    { background: #fecaca; }
.btn-sm        { padding: 5px 12px; font-size: 11.5px; }
.btn:disabled  { opacity: .5; cursor: default; }

/* ── BADGES ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-draft     { background: #fef3c7; color: #d97706; }
.badge-submitted { background: #dbeafe; color: #2563eb; }
.badge-approved  { background: #dcfce7; color: #16a34a; }
.badge-executed  { background: #dcfce7; color: #16a34a; }
.badge-rejected  { background: #fee2e2; color: #dc2626; }

/* ── CONN BADGE ──────────────────────────────────────── */
.conn-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.conn-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.conn-ok  { background: #dcfce7; color: #16a34a; }
.conn-err { background: #fee2e2; color: #dc2626; }

/* ── KPI GRID ──────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: #fff; border-radius: 8px; padding: 16px 20px; border: 1px solid var(--border); }
.kpi-lbl  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.kpi-val  { font-size: 26px; font-weight: 900; color: var(--navy); line-height: 1; }
.kpi-card.hi .kpi-val { color: var(--green); }

/* ── TABLE ───────────────────────────────────────────── */
.table-card    { background: #fff; border-radius: 8px; border: 1px solid var(--border); }
.table-toolbar { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-inp { flex: 1; min-width: 200px; max-width: 300px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; outline: none; }
.search-inp:focus { border-color: var(--navy-lite); }
.fil-sel { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; background: #fff; outline: none; cursor: pointer; }
.table-scroll  { overflow-x: scroll; width: 100%; scrollbar-width: thin; scrollbar-color: #b0bcc8 #eef0f3; }
.sticky-scrollbar-wrapper { position: sticky; bottom: 0; z-index: 10; overflow-x: scroll; width: 100%; scrollbar-width: thin; scrollbar-color: #b0bcc8 #eef0f3; background: #eef0f3; border-top: 1px solid var(--border); }
.sticky-scrollbar-wrapper::-webkit-scrollbar         { height: 8px; display: block; }
.sticky-scrollbar-wrapper::-webkit-scrollbar-track   { background: #eef0f3; }
.sticky-scrollbar-wrapper::-webkit-scrollbar-thumb   { background: #b0bcc8; border-radius: 4px; }
.sticky-scrollbar-wrapper::-webkit-scrollbar-thumb:hover { background: #8a9aaa; }
.sticky-scrollbar-inner { height: 1px; }

/* ── PAGINATION ──────────────────────────────────────── */
.pagination-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px; min-height: 48px;
}
.pagination-bar:empty { display: none; }
.pagination-info { font-size: 12px; color: var(--muted); }
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.pg-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text);
  font-size: 12.5px; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.pg-btn:hover:not(:disabled):not(.pg-active) { border-color: var(--navy-lite); background: var(--bg); }
.pg-btn.pg-active { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }
.pg-btn:disabled  { opacity: .35; cursor: default; }
.pg-ellipsis      { font-size: 12px; color: var(--muted); padding: 0 4px; line-height: 32px; }
.table-scroll::-webkit-scrollbar         { height: 8px; display: block; }
.table-scroll::-webkit-scrollbar-track   { background: #eef0f3; }
.table-scroll::-webkit-scrollbar-thumb   { background: #b0bcc8; border-radius: 4px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #8a9aaa; }
table { width: 100%; min-width: 1100px; border-collapse: collapse; font-size: 12.5px; }
thead { background: var(--bg); }
th { padding: 9px 14px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
th.col-project { white-space: normal; min-width: 160px; }
td.col-project { min-width: 160px; white-space: normal; word-break: break-word; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; transition: background .1s; }
tbody tr:hover { background: #f8fafc; }
.po-num { font-weight: 800; color: var(--navy); font-family: 'Courier New', monospace; font-size: 12px; }

/* ── DETAIL PANEL ────────────────────────────────────── */
.overlay      { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.open { opacity: 1; pointer-events: all; }
.detail-panel { position: fixed; top: 0; right: -720px; width: 700px; height: 100vh; background: #fff; z-index: 101; display: flex; flex-direction: column; transition: right .25s cubic-bezier(.4,0,.2,1); box-shadow: -6px 0 28px rgba(0,0,0,.13); }
.detail-panel.open { right: 0; }
.dp-header { background: var(--navy); color: #fff; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.dp-pnum   { font-family: 'Courier New', monospace; font-size: 20px; font-weight: 800; }
.dp-proj   { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 3px; }
.dp-close  { background: rgba(255,255,255,.15); border: none; color: #fff; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; font-size: 17px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.dp-close:hover { background: rgba(255,255,255,.25); }
.dp-body   { flex: 1; overflow-y: auto; padding: 22px; }
.dp-footer { padding: 13px 22px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-shrink: 0; }
.ds        { margin-bottom: 20px; }
.ds-title  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 7px; margin-bottom: 12px; }
#dropZone:hover, #dropZone.dz-over { border-color: var(--navy-lite); background: #f0f5fa; }
#dropZone.dz-over { border-color: var(--green); background: #f2f8e8; }
.dg        { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.df .dl    { font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.df .dv    { font-size: 13px; font-weight: 600; }
.li-tbl    { width: 100%; border-collapse: collapse; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.li-tbl th { background: var(--bg); font-size: 9.5px; padding: 7px 10px; }
.li-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.li-tbl tr:last-child td { border-bottom: none; }
.totals-row { display: flex; justify-content: flex-end; gap: 20px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ti .tl { font-size: 10.5px; color: var(--muted); }
.ti .tv { font-size: 13px; font-weight: 700; }
.ti.grand .tv { font-size: 16px; color: var(--green); }

/* ── MODAL ───────────────────────────────────────────── */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.52); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px; overflow-y: auto; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-bg.open { opacity: 1; pointer-events: all; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 960px; box-shadow: 0 20px 60px rgba(0,0,0,.22); transform: translateY(-16px); transition: transform .25s; flex-shrink: 0; }
.modal-bg.open .modal { transform: translateY(0); }
.mh   { background: var(--navy); color: #fff; padding: 18px 24px; border-radius: 10px 10px 0 0; display: flex; align-items: flex-start; justify-content: space-between; }
.mh h2 { font-size: 16px; font-weight: 800; }
.mh p  { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 3px; }
.mb    { padding: 24px; }
.mf    { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; border-radius: 0 0 10px 10px; }

/* ── FORM ────────────────────────────────────────────── */
.fs       { margin-bottom: 22px; }
.fs-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--navy); border-bottom: 2px solid var(--green); padding-bottom: 7px; margin-bottom: 14px; }
.fg  { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.fg3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }
.fg4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 13px; }
.fg-full { grid-column: 1 / -1; }
.fgrp  { display: flex; flex-direction: column; gap: 4px; }
label  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fc    { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; color: var(--text); outline: none; background: #fff; transition: border-color .15s; width: 100%; }
.fc:focus    { border-color: var(--navy-lite); box-shadow: 0 0 0 3px rgba(55,86,115,.08); }
.fc:disabled { background: var(--bg); color: var(--muted); }
.fc-static    { background: var(--bg); color: var(--navy); font-weight: 700; cursor: default; }
textarea.fc  { resize: vertical; min-height: 68px; }

/* ── LINE ITEMS ──────────────────────────────────────── */
.li-wrap  { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.li-hdr   { background: var(--bg); padding: 7px 10px; display: grid; grid-template-columns: 18px 1.5fr 2.2fr 80px 110px 55px 95px 90px 22px 32px; gap: 6px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); }
.li-row   { padding: 7px 10px; display: grid; grid-template-columns: 18px 1.5fr 2.2fr 80px 110px 55px 95px 90px 22px 32px; gap: 6px; align-items: center; border-bottom: 1px solid var(--border); }
.li-drag-handle { cursor: grab; color: #bcc8d4; font-size: 15px; display: flex; align-items: center; justify-content: center; user-select: none; padding: 2px 0; }
.li-drag-handle:hover { color: var(--navy); }
.li-row.dragging  { opacity: .4; }
.li-row.drag-over { border-top: 2px solid var(--green); }
.li-row:last-child { border-bottom: none; }
.li-row .fc { padding: 5px 7px; font-size: 12px; }
.rm-btn { background: none; border: none; color: var(--danger); cursor: pointer; padding: 3px; border-radius: 4px; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.rm-btn:hover { background: #fee2e2; }
.li-move-btns { display: flex; flex-direction: column; gap: 1px; }
.li-move-btn { background: none; border: none; color: #bcc8d4; cursor: pointer; padding: 1px; font-size: 10px; line-height: 1; border-radius: 3px; display: flex; align-items: center; justify-content: center; }
.li-move-btn:hover { color: var(--navy); background: var(--bg); }
.add-li-btn { padding: 8px 12px; background: var(--bg); border: none; border-top: 1px solid var(--border); width: 100%; text-align: left; font-size: 12px; color: var(--navy); cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 6px; transition: background .1s; }
.add-li-btn:hover { background: #eef2f5; }
.totals-sum { display: flex; justify-content: flex-end; gap: 18px; margin-top: 10px; padding: 12px 14px; background: var(--bg); border-radius: 6px; align-items: flex-end; flex-wrap: wrap; }
.tc .tl { font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.tc .tv { font-size: 14px; font-weight: 800; }
.tc.gtc .tv { color: var(--green); font-size: 18px; }
.tc input.fc { width: 90px; text-align: right; padding: 4px 7px; font-size: 12.5px; }

/* ── FLOW BAR ────────────────────────────────────────── */
.flow-bar  { display: flex; align-items: center; margin-bottom: 18px; overflow-x: auto; }
.flow-step { display: flex; align-items: center; }
.flow-node { padding: 6px 12px; font-size: 11px; font-weight: 700; white-space: nowrap; background: #fff; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.flow-node.done   { background: #dcfce7; border-color: #86efac; color: #16a34a; }
.flow-node.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.flow-arrow { color: var(--border); padding: 0 4px; font-size: 14px; flex-shrink: 0; }

/* ── MISC ────────────────────────────────────────────── */
.hidden  { display: none !important; }
.loading { display: flex; align-items: center; justify-content: center; padding: 48px; color: var(--muted); font-size: 13px; gap: 10px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--navy); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty    { text-align: center; padding: 48px; color: var(--muted); }
.empty h3 { font-size: 14px; color: var(--text); margin-bottom: 5px; }
.empty p  { font-size: 12.5px; }
.locked-badge { display: inline-flex; align-items: center; gap: 5px; background: #fee2e2; color: var(--danger); padding: 3px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 700; }
.toast { position: fixed; bottom: 24px; right: 24px; padding: 11px 18px; border-radius: 8px; font-size: 12.5px; font-weight: 700; z-index: 999; transform: translateY(70px); opacity: 0; transition: all .3s; background: var(--navy); color: #fff; max-width: 360px; }
.toast.show    { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--danger); }

/* ── HOW-TO GUIDE ────────────────────────────────────────── */
.guide-step { border-bottom: 1px solid rgba(255,255,255,.07); }
.guide-step summary {
  padding: 8px 16px;
  font-size: 11.5px; font-weight: 700;
  color: rgba(255,255,255,.8);
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 7px;
  transition: background .15s; user-select: none;
}
.guide-step summary::-webkit-details-marker { display: none; }
.guide-step summary::before {
  content: '›'; font-size: 15px; color: var(--green);
  transition: transform .2s; flex-shrink: 0;
}
.guide-step[open] > summary::before { transform: rotate(90deg); }
.guide-step summary:hover { background: rgba(255,255,255,.06); }
.guide-step ul { padding: 2px 14px 10px 14px; list-style: none; }
.guide-step ul li {
  font-size: 10.5px; color: rgba(255,255,255,.58);
  padding: 4px 0 4px 10px;
  border-left: 2px solid rgba(119,157,54,.35);
  margin-bottom: 5px; line-height: 1.4;
}
.guide-step ul li strong {
  display: block; font-size: 10px;
  color: rgba(255,255,255,.88); margin-bottom: 1px;
}
.guide-step ul li code {
  font-size: 9px; font-family: 'Courier New', monospace;
  background: rgba(255,255,255,.1); color: var(--green);
  padding: 1px 5px; border-radius: 3px; display: inline-block; margin-top: 2px;
}
.guide-tip {
  margin: 0 14px 10px; padding: 8px 10px;
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.22);
  border-radius: 6px; font-size: 10px;
  color: rgba(255,255,255,.65); line-height: 1.5;
}
.guide-tip strong { color: #fbbf24; }

/* ── TAB BAR ─────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 2px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  padding: 11px 18px;
  font-size: 12.5px; font-weight: 700;
  color: var(--muted);
  background: none; border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--green); }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1280px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  {
  .fg3 { grid-template-columns: 1fr 1fr; }
  .fg4 { grid-template-columns: 1fr 1fr; }
  .li-hdr, .li-row { grid-template-columns: 18px 1.2fr 1.6fr 70px 90px 50px 80px 75px 20px 30px; }
}
@media (max-width: 640px)  {
  .sidebar { display: none; }
  .fg, .fg3, .fg4 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
