@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:opsz,wght@6..12,400;6..12,600;6..12,700;6..12,800&display=swap');

:root {
  --bg: #F6F0E4;
  --surface: #FFFCF5;
  --surface-2: #FBF5E9;
  --surface-3: #F3EBDB;
  --border: #E7DCC6;
  --border-strong: #D9CBAF;
  --text: #3F362A;
  --text-soft: #7C7160;
  --text-faint: #A3977F;
  --accent: #B65C33;
  --accent-hover: #A34F29;
  --accent-soft: #F5E4D7;
  --accent-softer: #FAF0E8;
  --green: #5C7B4F;
  --green-soft: #E8EEDD;
  --amber: #A5761F;
  --amber-soft: #F7ECD2;
  --red: #A6402C;
  --red-soft: #F6E1DB;
  --blue: #4E6E8E;
  --blue-soft: #E3EAF1;
  --shadow: 0 1px 2px rgba(93,78,55,.06), 0 6px 20px rgba(93,78,55,.07);
  --radius: 18px;
  --ease: cubic-bezier(.4,0,.2,1);
  --dur: .2s;
  --dur-slow: .35s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: #EDE5D4; }
body { font-family: 'Nunito Sans', sans-serif; color: var(--text); font-size: 14px; line-height: 1.45; }
h1, h2, h3, .serif { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; letter-spacing: -.01em; }
a { text-decoration: none; color: inherit; }

/* ============ SHELL ============ */
.shell { width: 1440px; margin: 0 auto; display: flex; background: var(--bg); min-height: 100vh; box-shadow: 0 0 40px rgba(93,78,55,.12); }

/* ============ SIDEBAR ============ */
.sidebar { width: 248px; flex-shrink: 0; background: #332B21; color: #EFE7D6; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.logo { padding: 24px 22px 20px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(239,231,214,.12); }
.logo-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-family: Georgia, serif; font-size: 19px; font-weight: 700; color: #FFF6EA; flex-shrink: 0; }
.logo-text { font-family: Georgia, serif; font-size: 16px; line-height: 1.15; }
.logo-text small { display: block; font-family: 'Nunito Sans', sans-serif; font-size: 10.5px; font-weight: 600; color: #B9AC93; letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.nav-section { padding: 18px 14px 6px; }
.nav-label { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #8E8168; padding: 0 10px; margin-bottom: 8px; }
.nav-label:not(:first-child) { margin-top: 18px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 999px; color: #CFC4AC; text-decoration: none; font-size: 13.5px; font-weight: 600; margin-bottom: 2px; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), opacity var(--dur) var(--ease); cursor: pointer; }
.nav a:hover { background: rgba(255,252,245,.07); color: #F3ECDC; }
.nav a.active { background: var(--accent); color: #FFF7ED; box-shadow: 0 3px 10px rgba(182,92,51,.4); }
.nav a svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav .count { margin-left: auto; background: rgba(255,252,245,.15); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 1px 8px; }
.nav a.active .count { background: rgba(255,255,255,.25); }
.sidebar-footer { margin-top: auto; padding: 16px 18px 20px; border-top: 1px solid rgba(239,231,214,.12); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #7C6A4E; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #FFF6EA; flex-shrink: 0; }
.sidebar-footer .who { font-size: 12.5px; font-weight: 700; color: #EFE7D6; line-height: 1.25; }
.sidebar-footer .who small { display: block; font-weight: 600; color: #9C8F75; font-size: 11px; }
.sidebar-footer .logout-btn { margin-left: auto; cursor: pointer; color: #9C8F75; transition: color var(--dur) var(--ease); background: none; border: none; display: flex; align-items: center; padding: 6px; border-radius: 50%; }
.sidebar-footer .logout-btn:hover { color: #EFE7D6; }

/* ============ MAIN ============ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 32px; display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 40; }
.crumbs { font-size: 12.5px; color: var(--text-faint); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.crumbs a { color: var(--text-soft); text-decoration: none; cursor: pointer; }
.crumbs a:hover { color: var(--accent); }
.crumbs .cur { color: var(--text); font-weight: 700; }
.search { margin-left: auto; display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 7px 16px; width: 290px; color: var(--text-faint); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color var(--dur) var(--ease); }
.search:hover { border-color: var(--border-strong); }
.search input { border: none; background: transparent; outline: none; font-family: 'Nunito Sans', sans-serif; font-size: 13px; font-weight: 600; color: var(--text); width: 100%; }
.search input::placeholder { color: var(--text-faint); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--text-soft); cursor: pointer; position: relative; transition: border-color var(--dur) var(--ease); }
.icon-btn:hover { border-color: var(--border-strong); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }

.content { padding: 26px 32px 120px; }

/* ============ PAGE HEAD ============ */
.page-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-size: 27px; color: var(--text); }
.page-head .sub { color: var(--text-soft); font-size: 13.5px; margin-top: 5px; font-weight: 600; max-width: 640px; }
.head-right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* ============ CHIPS ============ */
.chip { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 5px 13px; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.chip .b { width: 7px; height: 7px; border-radius: 50%; }
.chip.queue { background: var(--accent-soft); color: var(--accent); }
.chip.sla { background: var(--amber-soft); color: var(--amber); }
.chip.status { background: var(--blue-soft); color: var(--blue); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }

/* ============ BANNER ============ */
.banner { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; display: flex; gap: 13px; align-items: flex-start; margin-bottom: 22px; }
.banner svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.banner b { font-weight: 800; }
.banner p { font-size: 13px; color: var(--text-soft); font-weight: 600; }

/* ============ CARDS ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ============ SCORE STRIP ============ */
.score-strip { display: grid; grid-template-columns: 300px 1fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.score-hero { padding: 18px 22px; display: flex; align-items: center; gap: 18px; }
.ring { width: 76px; height: 76px; flex-shrink: 0; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: Georgia, serif; font-size: 20px; font-weight: 700; color: var(--amber); }
.score-hero .lbl { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.score-hero .name { font-family: Georgia, serif; font-size: 16px; margin: 3px 0 5px; }
.score-hero .band { font-size: 12px; font-weight: 700; color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 2px 10px; display: inline-block; }
.mini-stat { padding: 16px 20px; }
.mini-stat .lbl { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 7px; }
.mini-stat .val { font-family: Georgia, serif; font-size: 21px; font-weight: 700; }
.mini-stat .hint { font-size: 12px; font-weight: 600; color: var(--text-soft); margin-top: 3px; }
.mini-stat .val.amber { color: var(--amber); }
.mini-stat .val.red { color: var(--red); }
.mini-stat .val.green { color: var(--green); }

/* ============ SECTION TITLES ============ */
.sec-title { display: flex; align-items: baseline; gap: 12px; margin: 28px 0 14px; }
.sec-title h2 { font-size: 19px; }
.sec-title .note { font-size: 12.5px; color: var(--text-faint); font-weight: 600; }

/* ============ COMPARE GRID ============ */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rec-card { overflow: hidden; }
.rec-head { padding: 16px 22px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--border); }
.src-badge { width: 40px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-family: Georgia, serif; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.src-badge.chewy { background: var(--blue-soft); color: var(--blue); }
.src-badge.vendor { background: var(--accent-soft); color: var(--accent); }
.rec-head .t { font-family: Georgia, serif; font-size: 15.5px; }
.rec-head .id { font-size: 12px; color: var(--text-soft); font-weight: 700; margin-top: 1px; }
.rec-head .tag { margin-left: auto; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 4px 11px; }
.tag.master { background: var(--blue-soft); color: var(--blue); }
.tag.inbound { background: var(--accent-soft); color: var(--accent); }
.rec-body { padding: 8px 22px 16px; }
.frow { display: flex; padding: 10px 0; border-bottom: 1px dashed var(--border); gap: 12px; align-items: baseline; }
.frow:last-child { border-bottom: none; }
.frow .k { width: 118px; flex-shrink: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.frow .v { font-size: 13.5px; font-weight: 700; }
.frow .v small { display: block; font-weight: 600; color: var(--text-faint); font-size: 11.5px; margin-top: 1px; }
.pill-flag { font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: middle; }
.pill-flag.warn { background: var(--amber-soft); color: var(--amber); }
.pill-flag.ok { background: var(--green-soft); color: var(--green); }
.pill-flag.miss { background: var(--surface-3); color: var(--text-faint); }

/* ============ BREAKDOWN TABLE ============ */
.breakdown { margin-top: 16px; }
.breakdown table { width: 100%; border-collapse: collapse; }
.breakdown th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); padding: 13px 22px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.breakdown th:first-child { border-radius: var(--radius) 0 0 0; }
.breakdown th:last-child { border-radius: 0 var(--radius) 0 0; }
.breakdown td { padding: 13px 22px; border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 700; vertical-align: middle; }
.breakdown tr:last-child td { border-bottom: none; }
.bar { width: 150px; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 11px; }
.bar i { display: block; height: 100%; border-radius: 999px; }
.bar-sm { width: 80px; height: 6px; }
.g { background: var(--green); }
.a { background: var(--amber); }
.r { background: var(--red); }
.tg { color: var(--green); }
.ta { color: var(--amber); }
.tr { color: var(--red); }
.mono { font-variant-numeric: tabular-nums; }
.wcell { color: var(--text-soft); font-weight: 600; font-size: 12.5px; }

/* ============ SURVIVORSHIP ============ */
.surv-card { overflow: hidden; }
.surv-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.surv-head h3 { font-size: 16px; }
.surv-head p { font-size: 12.5px; color: var(--text-soft); font-weight: 600; margin-top: 2px; }
.surv-head .apply-all { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 700; color: var(--text-soft); }
.btn-ghost-sm { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 5px 14px; font-size: 12px; font-weight: 800; color: var(--text-soft); cursor: pointer; font-family: 'Nunito Sans', sans-serif; transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.btn-ghost-sm:hover { border-color: var(--accent); color: var(--accent); }
.surv-table { width: 100%; border-collapse: collapse; }
.surv-table th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); padding: 12px 20px; border-bottom: 1px solid var(--border); }
.surv-table td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; vertical-align: middle; }
.surv-table tr:last-child td { border-bottom: none; }
.surv-table .fname { font-family: Georgia, serif; font-size: 14px; }
.srcval { color: var(--text-soft); font-weight: 600; font-size: 12.5px; max-width: 200px; }
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; border-radius: 999px; padding: 5px 13px; font-size: 11.5px; font-weight: 800; color: var(--text-soft); cursor: pointer; font-family: 'Nunito Sans', sans-serif; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.seg button.on-chewy { background: var(--blue); color: #FFFBF2; box-shadow: 0 2px 6px rgba(78,110,142,.35); }
.seg button.on-vendor { background: var(--accent); color: #FFFBF2; box-shadow: 0 2px 6px rgba(182,92,51,.35); }
.merged-val { font-weight: 800; font-size: 13px; }
.merged-val .src-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.src-dot.c { background: var(--blue); }
.src-dot.v { background: var(--accent); }

/* ============ PREVIEW GRID ============ */
.preview-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.legend { padding: 18px 22px; }
.legend h4 { font-family: Georgia, serif; font-size: 14.5px; margin-bottom: 12px; }
.legend .row { display: flex; gap: 10px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--text-soft); margin-bottom: 9px; }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }

/* ============ DECISION BAR ============ */
.decision-bar { position: sticky; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(93,78,55,.09); padding: 16px 32px; display: flex; align-items: center; gap: 12px; }
.decision-bar.scrolled { box-shadow: 0 -8px 32px rgba(93,78,55,.15); }
.decision-bar .note-in { flex: 1; border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 10px 18px; font-size: 13px; font-family: 'Nunito Sans', sans-serif; font-weight: 600; color: var(--text); outline: none; }
.decision-bar .note-in::placeholder { color: var(--text-faint); }

/* ============ BUTTONS ============ */
.btn { border: none; border-radius: 999px; padding: 11px 24px; font-size: 13.5px; font-weight: 800; cursor: pointer; font-family: 'Nunito Sans', sans-serif; display: inline-flex; align-items: center; gap: 8px; transition: background var(--dur) var(--ease), transform .1s var(--ease), box-shadow var(--dur) var(--ease); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #FFF7ED; box-shadow: 0 4px 14px rgba(182,92,51,.35); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--surface); color: var(--red); border: 1.5px solid #E0BCB2; }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { background: transparent; color: var(--text-soft); border: 1.5px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--text-soft); }
.btn-sm { padding: 7px 16px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ============ AUDIT ============ */
.audit { padding: 6px 22px 10px; }
.audit-item { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px dashed var(--border); }
.audit-item:last-child { border-bottom: none; }
.audit-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-soft); }
.audit-item .txt { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.audit-item .txt b { color: var(--text); font-weight: 800; }
.audit-item .ts { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--text-faint); white-space: nowrap; }

/* ============ DATA TABLES ============ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); padding: 13px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); cursor: default; }
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--text-soft); }
.data-table td { padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.clickable { cursor: pointer; transition: background var(--dur) var(--ease); }
.data-table tr.clickable:hover { background: var(--surface-2); }
.data-table tr.muted { opacity: .55; }
.data-table th:first-child { border-radius: var(--radius) 0 0 0; }
.data-table th:last-child { border-radius: 0 var(--radius) 0 0; }

/* ============ FILTER BAR ============ */
/* position+z-index so open filter panels paint above the cards below them —
   .anim-slide leaves a filling transform on .card, which creates a stacking
   context that would otherwise cover the panel. */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; position: relative; z-index: 50; }
.filter-dropdown { position: relative; }
.filter-trigger { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--text-soft); cursor: pointer; font-family: 'Nunito Sans', sans-serif; transition: border-color var(--dur) var(--ease); white-space: nowrap; }
.filter-trigger:hover { border-color: var(--border-strong); }
.filter-trigger.active { border-color: var(--accent); color: var(--accent); background: var(--accent-softer); }
.filter-trigger svg { width: 14px; height: 14px; }
.filter-panel { position: absolute; top: calc(100% + 6px); left: 0; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); z-index: 100; padding: 6px; display: none; animation: fadeIn var(--dur) var(--ease); }
.filter-panel.open { display: block; }
.filter-option { padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-soft); cursor: pointer; transition: background var(--dur) var(--ease); }
.filter-option:hover { background: var(--surface-2); }
.filter-option.selected { background: var(--accent-soft); color: var(--accent); font-weight: 800; }

/* ============ SEARCH INPUT ============ */
.search-input { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); width: 220px; }
.search-input input { border: none; background: transparent; outline: none; font-family: 'Nunito Sans', sans-serif; font-size: 12.5px; font-weight: 600; color: var(--text); width: 100%; }
.search-input input::placeholder { color: var(--text-faint); }

/* ============ STAT CARDS ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 20px; }
.stat-card .label { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.stat-card .value { font-family: Georgia, serif; font-size: 28px; font-weight: 700; }
.stat-card .delta { font-size: 12px; font-weight: 700; margin-top: 4px; }
.stat-card .delta.up { color: var(--green); }
.stat-card .delta.down { color: var(--red); }

/* ============ TAB BAR ============ */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn { padding: 10px 20px; font-size: 13.5px; font-weight: 700; color: var(--text-soft); cursor: pointer; border: none; background: transparent; font-family: 'Nunito Sans', sans-serif; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 800; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============ TOAST ============ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 20px; border-radius: 14px; font-size: 13px; font-weight: 700; color: var(--surface); box-shadow: 0 4px 20px rgba(0,0,0,.15); animation: slideIn var(--dur-slow) var(--ease); display: flex; align-items: center; gap: 10px; max-width: 400px; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--blue); }
.toast.warning { background: var(--amber); }
.toast.fade-out { animation: fadeOut var(--dur) var(--ease) forwards; }

/* ============ MODAL ============ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(63,54,42,.4); z-index: 10000; display: flex; align-items: center; justify-content: center; animation: fadeIn var(--dur) var(--ease); }
.modal-panel { background: var(--surface); border-radius: var(--radius); box-shadow: 0 8px 40px rgba(93,78,55,.2); padding: 28px; max-width: 480px; width: 90%; animation: scaleIn var(--dur-slow) var(--ease); }
.modal-panel h3 { font-size: 18px; margin-bottom: 12px; }
.modal-panel p { font-size: 13.5px; color: var(--text-soft); font-weight: 600; line-height: 1.6; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ============ LOGIN ============ */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { text-align: center; width: 640px; }
.login-box h1 { font-size: 32px; margin-bottom: 6px; }
.login-box .sub { color: var(--text-soft); font-size: 14px; font-weight: 600; margin-bottom: 32px; }
.user-cards { display: flex; gap: 16px; justify-content: center; margin-bottom: 28px; }
.user-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 24px 20px; width: 180px; cursor: pointer; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform .1s var(--ease); text-align: center; }
.user-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.user-card.selected { border-color: var(--accent); box-shadow: 0 4px 20px rgba(182,92,51,.2); }
.user-card .avatar-lg { width: 56px; height: 56px; border-radius: 50%; background: #7C6A4E; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #FFF6EA; margin: 0 auto 12px; }
.user-card .name { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.user-card .role { font-size: 11.5px; font-weight: 600; color: var(--text-soft); }
.login-form { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.login-form .login-fields { display: flex; gap: 12px; width: 400px; }
.login-form input { flex: 1; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 10px 18px; font-size: 13px; font-family: 'Nunito Sans', sans-serif; font-weight: 600; color: var(--text); outline: none; }

/* ============ EMPTY STATE ============ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty-state svg { margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-soft); }
.empty-state p { font-size: 13px; font-weight: 600; }

/* ============ UPLOAD ZONE ============ */
.upload-zone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 48px 32px; text-align: center; cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.upload-zone:hover { border-color: var(--accent); background: var(--accent-softer); }
.upload-zone.error { border-color: var(--red); background: var(--red-soft); }
.upload-zone .icon { color: var(--text-faint); margin-bottom: 12px; }
.upload-zone h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-soft); }
.upload-zone p { font-size: 12.5px; color: var(--text-faint); font-weight: 600; }
.upload-progress { margin-top: 16px; }
.progress-bar { width: 100%; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.progress-bar .fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 2s linear; }
.upload-result { margin-top: 16px; }

/* ============ DETAIL EXPAND ============ */
.detail-row { display: none; }
.detail-row.open { display: table-row; }
.detail-row td { background: var(--surface-2); padding: 16px 22px; }
.detail-content { font-size: 13px; font-weight: 600; color: var(--text-soft); line-height: 1.7; }

/* ============ CONNECTION CARD ============ */
.conn-card { padding: 22px; margin-bottom: 16px; }
.conn-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.conn-header h3 { font-size: 16px; }
.conn-status { margin-left: auto; }
.conn-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.conn-field .label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.conn-field .value { font-size: 13px; font-weight: 700; }
.conn-actions { display: flex; gap: 10px; }

/* ============ ZONE BAR ============ */
.zone-bar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; margin: 8px 0; font-size: 10px; font-weight: 800; color: white; }
.zone-bar .zone { display: flex; align-items: center; justify-content: center; padding: 0 6px; white-space: nowrap; }

/* ============ CHART ============ */
.chart-container { padding: 20px; }
.bar-chart { display: flex; align-items: flex-end; gap: 16px; height: 160px; padding: 0 10px; }
.bar-group { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.bar-group .bars { display: flex; gap: 4px; align-items: flex-end; height: 130px; }
.bar-group .bar-v { width: 24px; border-radius: 4px 4px 0 0; transition: height var(--dur-slow) var(--ease); }
.bar-group .week-label { font-size: 10.5px; font-weight: 700; color: var(--text-faint); }
.chart-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11px; font-weight: 700; color: var(--text-soft); }
.chart-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ============ DONUT ============ */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut { width: 120px; height: 120px; position: relative; }
.donut svg { transform: rotate(-90deg); }
.donut .center-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .center-label .pct { font-family: Georgia, serif; font-size: 22px; font-weight: 700; }
.donut .center-label .sub { font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend .item { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-soft); }

/* ============ COLLAPSIBLE ============ */
.collapsible-header { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 12px 0; font-weight: 800; font-size: 13px; color: var(--text-soft); }
.collapsible-header svg { transition: transform var(--dur) var(--ease); }
.collapsible-header.open svg { transform: rotate(180deg); }
.collapsible-body { display: none; }
.collapsible-body.open { display: block; }

/* ============ SKELETON ============ */
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-card { height: 80px; border-radius: var(--radius); margin-bottom: 14px; }
.skeleton-table { height: 200px; border-radius: var(--radius); }

/* ============ SPINNER ============ */
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; vertical-align: middle; }

/* ============ ANIMATIONS ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes progressFill { from { width: 0; } to { width: 100%; } }

.anim-fade { animation: fadeIn var(--dur-slow) var(--ease); }
.anim-slide { animation: slideUp var(--dur-slow) var(--ease); }
.stagger-1 { animation-delay: .05s; animation-fill-mode: both; }
.stagger-2 { animation-delay: .1s; animation-fill-mode: both; }
.stagger-3 { animation-delay: .15s; animation-fill-mode: both; }
.stagger-4 { animation-delay: .2s; animation-fill-mode: both; }

/* ============ MERGED VIEW ============ */
.merged-field-row { display: flex; padding: 14px 22px; border-bottom: 1px solid var(--border); gap: 16px; align-items: center; }
.merged-field-row:last-child { border-bottom: none; }
.merged-field-row .field-label { width: 130px; flex-shrink: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.merged-field-row .field-value { font-size: 15px; font-weight: 700; flex: 1; }
.merged-field-row .field-source { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; }

/* ============ UTILITIES ============ */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.ml-auto { margin-left: auto; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-faint { color: var(--text-faint); }
.fw-800 { font-weight: 800; }
.nowrap { white-space: nowrap; }
