:root {
  --ink: #152725;
  --muted: #647671;
  --muted-2: #8b9a96;
  --line: #dce7e3;
  --line-strong: #c8d8d3;
  --bg: #f3f7f5;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --teal: #0b7d73;
  --teal-dark: #075e58;
  --teal-deep: #103b38;
  --teal-soft: #e5f3ef;
  --amber: #a76717;
  --amber-soft: #fff2dc;
  --red: #ad454d;
  --red-soft: #fdebed;
  --shadow: 0 14px 38px rgba(20, 62, 56, .07);
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"], summary { -webkit-tap-highlight-color: transparent; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 30; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px; color: #dfeeea; background: linear-gradient(180deg, #123c39 0%, #0c302e 100%); overflow-y: auto; }
.brand-block { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { flex: 0 0 auto; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: #19a092; color: #fff; font-size: 17px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.brand-name { max-width: 170px; color: #fff; font-size: 11px; line-height: 1.25; font-weight: 700; }
.brand-product { margin-top: 3px; color: #93b8b2; font-size: 10px; }
.side-nav { padding: 17px 0; }
.nav-group-label { padding: 7px 11px; color: #7fa9a3; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.future-label { margin-top: 12px; }
.nav-item { width: 100%; min-height: 43px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 5px; margin: 2px 0; padding: 8px 10px; border: 0; border-radius: 10px; color: #b8d0cc; background: transparent; text-align: left; cursor: pointer; transition: background .16s ease, color .16s ease, transform .16s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.075); }
.nav-item.active { color: #fff; background: rgba(37, 179, 162, .18); box-shadow: inset 3px 0 #36c0b1; }
.nav-icon { width: 23px; text-align: center; color: #83bbb4; font-size: 17px; }
.nav-item.active .nav-icon { color: #63d3c7; }
.lock { padding: 2px 6px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #7ea39e; font-size: 9px; }
.sidebar-profile { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.profile-button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 8px; border: 0; border-radius: 11px; color: #dcece8; background: transparent; text-align: left; cursor: pointer; }
.profile-button:hover { background: rgba(255,255,255,.07); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #0e514b; background: #d3eee8; font-size: 13px; font-weight: 800; }
.profile-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.profile-copy strong { overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: #8fb4af; font-size: 10px; }
.signout-link { width: 100%; padding: 7px 8px; border: 0; color: #87aaa6; background: transparent; font-size: 10px; text-align: left; cursor: pointer; }

.workspace { min-width: 0; }
.topbar { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px clamp(22px, 4vw, 54px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(16px); }
.page-heading h1 { margin: 2px 0 0; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.15; letter-spacing: -.025em; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.eyebrow, .card-kicker, .step-label { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.role-switch { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 11px; }
.role-switch select { min-height: 34px; border: 0; background: transparent; color: var(--ink); font-weight: 650; }
.mode { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid #cfe4df; border-radius: 999px; color: #456762; background: #eef7f5; font-size: 11px; font-weight: 650; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #23a877; box-shadow: 0 0 0 4px rgba(35,168,119,.1); }
.mobile-menu { display: none; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; }

.content { max-width: 1540px; margin: 0 auto; padding: 28px clamp(22px, 4vw, 54px) 68px; }
.panel { display: none; }
.panel.active { display: block; animation: panel-in .22s ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.overview-hero, .product-roadmap { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 27px 30px; border: 1px solid #cde5df; border-radius: 20px; background: linear-gradient(115deg, #e4f3ef 0%, #f9fbfa 68%); }
.overview-hero h2, .product-roadmap h2, .section-bar h2 { margin: 5px 0 7px; font-size: clamp(23px, 2.1vw, 30px); line-height: 1.2; letter-spacing: -.025em; }
.overview-hero p, .product-roadmap p, .section-bar p { max-width: 740px; margin: 0; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 16px 0; }
.metric, .card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.metric { padding: 18px 20px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-value { margin-top: 5px; font-size: 30px; line-height: 1; font-weight: 760; letter-spacing: -.04em; }
.metric-note { margin-top: 9px; color: var(--muted-2); font-size: 10px; }
.metric-note.positive { color: var(--teal); }
.metric-note.warning { color: var(--amber); }
.metric-note.danger { color: var(--red); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 16px; }
.card { padding: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card h3, .card-head h3 { margin: 3px 0 0; font-size: 17px; line-height: 1.3; }
.quiet-badge { padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: 10px; white-space: nowrap; }
.chart-card { min-height: 298px; }
.column-chart { height: 210px; display: flex; align-items: end; gap: clamp(10px, 2.6vw, 24px); padding: 26px 8px 2px; border-bottom: 1px solid var(--line); }
.chart-column { min-width: 34px; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: end; gap: 8px; height: 100%; }
.chart-column .bar-value { color: var(--muted); font-size: 10px; font-weight: 750; }
.chart-column .chart-bar { width: min(46px, 72%); min-height: 5px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #25a89a, #0b7d73); box-shadow: 0 8px 16px rgba(11,125,115,.14); }
.chart-column .bar-label { color: var(--muted); font-size: 10px; }
.status-card { min-height: 298px; }
.status-visual { display: grid; grid-template-columns: 132px 1fr; align-items: center; gap: 22px; min-height: 212px; }
.donut { --ready: 60%; width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--teal) 0 var(--ready), #d7a04f var(--ready) calc(var(--ready) + 24%), #d15c65 0); position: relative; }
.donut::after { content: ""; position: absolute; inset: 17px; border-radius: 50%; background: var(--surface); }
.donut div { z-index: 1; display: grid; text-align: center; }
.donut strong { font-size: 23px; line-height: 1.1; }
.donut span { color: var(--muted); font-size: 10px; }
.legend { display: grid; gap: 11px; }
.legend-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.legend-row i { width: 8px; height: 8px; border-radius: 3px; }
.legend-row b { color: var(--ink); font-size: 12px; }
.attention-card, .carriers-card { min-height: 250px; }
.count { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; color: var(--amber); background: var(--amber-soft); font-size: 11px; font-weight: 800; }
.missing-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf2f0; }
.missing-row b { font-size: 12px; }
.sub { color: var(--muted); font-size: 12px; }
.text-button { margin-top: 12px; padding: 0; border: 0; color: var(--teal); background: transparent; font-size: 12px; font-weight: 750; cursor: pointer; }
.carrier-row { display: grid; grid-template-columns: minmax(0, 1fr) 45%; align-items: center; gap: 12px; padding: 9px 0; }
.carrier-copy { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.mini-track, .track { overflow: hidden; border-radius: 999px; background: #edf2f0; }
.mini-track { height: 6px; }
.mini-track span, .fill { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.product-roadmap { margin-top: 16px; background: #173f3c; border-color: #173f3c; color: #fff; }
.product-roadmap .eyebrow { color: #73d2c6; }
.product-roadmap p { color: #b8d0cc; }
.roadmap-modules { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.roadmap-modules button { padding: 9px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; color: #d7ebe7; background: rgba(255,255,255,.06); cursor: pointer; }

.section-bar { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.registry-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .58fr); gap: 16px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-wrap { min-width: 0; display: flex; flex: 1; align-items: center; gap: 8px; padding-left: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.search-wrap span { color: var(--muted-2); font-size: 18px; }
.search-wrap .input { border: 0; padding-left: 0; }
.input, select, textarea { min-height: 43px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; color: var(--ink); background: #fff; outline: none; }
.input { width: 100%; }
.input:focus, select:focus, textarea:focus { border-color: #68b9af; box-shadow: 0 0 0 3px rgba(55,171,158,.12); }
.table-wrap { max-width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 10px 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
td { padding: 13px 11px; border-bottom: 1px solid #edf2f0; font-size: 12px; }
tbody tr:hover { background: #fafcfb; }
.doc { font-weight: 750; }
.pill { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; }
.pill.ok { color: var(--teal); background: var(--teal-soft); }
.pill.wait { color: var(--amber); background: var(--amber-soft); }
.pill.miss { color: var(--red); background: var(--red-soft); }
.row-action { padding: 6px; border: 0; color: var(--teal); background: transparent; font-size: 11px; font-weight: 750; cursor: pointer; }
.notice, .message, .file-info { margin-top: 13px; padding: 11px 13px; border-radius: 10px; font-size: 11px; }
.notice { color: #526762; background: var(--surface-soft); }
.message, .file-info { color: var(--teal-dark); background: var(--teal-soft); }
.message.error { color: var(--red); background: var(--red-soft); }
.form-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: 16px; }
.step-label { margin-bottom: 4px; }
.upload-card h3, .form-card h3 { margin: 0 0 16px; font-size: 18px; }
.drop { width: 100%; min-height: 310px; display: grid; place-content: center; gap: 6px; padding: 30px; border: 1.5px dashed #7cbcb3; border-radius: 14px; color: var(--muted); background: #f7fbfa; text-align: center; cursor: pointer; transition: .16s ease; }
.drop:hover, .drop.drag { border-color: var(--teal); background: #edf8f5; transform: translateY(-1px); }
.drop strong { color: var(--teal-dark); font-size: 17px; }
.drop small { margin-top: 7px; color: var(--muted-2); }
.upload-icon { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 9px; border-radius: 14px; color: var(--teal); background: var(--teal-soft); font-size: 24px; }
.field { display: grid; gap: 6px; margin-bottom: 13px; }
.field > span, .field > label { color: var(--muted); font-size: 11px; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
button.primary, button.secondary, button.ghost { min-height: 43px; padding: 10px 15px; border: 0; border-radius: 10px; font-weight: 750; cursor: pointer; transition: background .16s ease, transform .16s ease, box-shadow .16s ease; }
button.primary { color: #fff; background: var(--teal); box-shadow: 0 8px 18px rgba(11,125,115,.18); }
button.primary:hover { background: var(--teal-dark); transform: translateY(-1px); }
button.secondary { color: var(--teal-dark); background: var(--teal-soft); }
button.ghost { color: var(--muted); background: var(--surface-soft); }
button.wide { width: 100%; }
button:focus-visible, .drop:focus-visible { outline: 3px solid rgba(52,183,168,.28); outline-offset: 2px; }
button:disabled { opacity: .6; cursor: wait; }
pre { max-height: 150px; overflow: auto; padding: 12px; border-radius: 10px; background: #f5f8f7; white-space: pre-wrap; font: 11px/1.45 Consolas, monospace; }
.report { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bar { margin: 18px 0; }
.barhead { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.track { height: 8px; margin-top: 7px; }
.empty { padding: 26px; color: var(--muted); text-align: center; }

.locked-page { min-height: 520px; display: grid; place-content: center; justify-items: center; padding: 40px; border: 1px solid var(--line); border-radius: 22px; background: radial-gradient(circle at 50% 10%, #e5f4f0, #fff 55%); text-align: center; }
.locked-symbol { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid #a9d3cc; border-radius: 18px; color: var(--teal); background: #fff; font-size: 28px; box-shadow: var(--shadow); }
.locked-page h2 { margin: 7px 0 9px; font-size: 30px; }
.locked-page p { max-width: 560px; margin: 0; color: var(--muted); }
.locked-actions { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.locked-actions span { color: var(--muted-2); font-size: 11px; }

.auth-dialog { width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 27px; border: 0; border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(12,48,46,.26); }
.auth-dialog::backdrop { background: rgba(8, 31, 29, .56); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 15px; right: 15px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: var(--surface-soft); font-size: 22px; cursor: pointer; }
.auth-intro .brand-mark { margin-bottom: 16px; }
.auth-intro h2 { margin: 5px 0 7px; font-size: 27px; }
.auth-intro p { margin: 0; color: var(--muted); }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-panel .field:first-of-type { margin-top: 22px; }
.role-field select { min-height: 54px; font-size: 15px; font-weight: 700; }
.demo-entry { min-height: 52px; margin-top: 5px; font-size: 15px; }
.working-access { display: grid; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.working-access > span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.auth-text-button, .auth-back { border: 0; color: var(--teal); background: transparent; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.auth-text-button { padding: 5px; }
.auth-back { margin: 18px 0 3px; padding: 0; text-align: left; }
.auth-required .auth-dialog { box-shadow: 0 35px 110px rgba(5,35,32,.32); }
.auth-required .dialog-close { display: none; }
.auth-note, .auth-status { color: var(--muted); font-size: 11px; text-align: center; }
.auth-status { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 380px; padding: 13px 16px; border-radius: 12px; color: #fff; background: #153f3b; box-shadow: 0 16px 45px rgba(14,49,43,.28); }
.mobile-nav { display: none; }
.sidebar-scrim { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1120px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .registry-layout { grid-template-columns: 1fr; }
  .side-card { display: none; }
}

@media (max-width: 900px) {
  :root { --sidebar: 270px; }
  .app-layout { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0,0,0,.2); }
  body.menu-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 29; display: block; border: 0; background: rgba(8,30,28,.38); }
  .sidebar-scrim[hidden] { display: none; }
  .mobile-menu { display: block; flex: 0 0 auto; }
  .topbar { min-height: 88px; padding: 15px 18px; }
  .topbar .page-heading p { display: none; }
  .role-switch { display: none; }
  .content { padding: 20px 18px 94px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-layout, .report { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 25; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); padding: 5px; border: 1px solid rgba(255,255,255,.7); border-radius: 17px; background: rgba(255,255,255,.92); box-shadow: 0 12px 38px rgba(17,56,51,.18); backdrop-filter: blur(18px); }
  .mobile-nav button { min-height: 51px; display: grid; place-items: center; gap: 1px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; }
  .mobile-nav button span { font-size: 19px; line-height: 1; }
  .mobile-nav button.active { color: var(--teal); background: var(--teal-soft); }
}

@media (max-width: 650px) {
  body { font-size: 14px; }
  .topbar { align-items: flex-start; }
  .mode { padding: 8px 9px; font-size: 10px; }
  .page-heading h1 { font-size: 22px; }
  .overview-hero, .product-roadmap, .section-bar { align-items: flex-start; flex-direction: column; }
  .overview-hero, .product-roadmap { padding: 22px; }
  .overview-hero .primary, .section-bar .primary, .section-bar .secondary { width: 100%; }
  .metrics { gap: 9px; }
  .metric { min-height: 126px; padding: 15px; }
  .metric-label { min-height: 36px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .status-visual { grid-template-columns: 116px 1fr; gap: 16px; }
  .donut { width: 116px; height: 116px; }
  .roadmap-modules { justify-content: flex-start; }
  .toolbar { flex-direction: column; }
  .toolbar select { width: 100%; }
  .registry-card { margin: 0 -18px; border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
  .drop { min-height: 235px; padding: 22px 16px; }
  .locked-page { min-height: 470px; padding: 28px 20px; }
  .locked-actions { align-items: stretch; flex-direction: column; }
  .auth-dialog { padding: 23px 19px; }
  .toast { right: 14px; bottom: 82px; left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
