/* =========================================================================
   NAMAN Mission POC — Base, layout, landing & login
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 .6em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--river-500); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 12px; }

/* ---------------- Demo ribbon ---------------- */
.demo-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #F2D58F;
  white-space: nowrap;
}
.demo-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

/* =========================================================================
   App shell
   ========================================================================= */
#app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
#app-shell.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--navy-900); color: #C9D4E5;
  display: flex; flex-direction: column; z-index: 40;
  border-right: 1px solid #0A1830;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; height: var(--header-h);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sb-logo { width: 34px; height: 34px; flex: 0 0 34px; }
.sb-title { line-height: 1.1; min-width: 0; }
.sb-title b { display: block; color: #fff; font-size: 15px; letter-spacing: .04em; }
.sb-title span { display: block; font-size: 10.5px; color: #8FA3C0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nav { flex: 1; overflow-y: auto; padding: 8px 8px 16px; scrollbar-width: thin; scrollbar-color: #24406b transparent; }
.sb-group { margin-top: 4px; }
.sb-group-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: none; border: 0; cursor: pointer;
  padding: 9px 10px; border-radius: 8px;
  color: #8FA3C0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.sb-group-btn:hover { color: #fff; background: rgba(255,255,255,.04); }
.sb-group-btn .chev { margin-left: auto; transition: transform .2s; }
.sb-group.closed .chev { transform: rotate(-90deg); }
.sb-group.closed .sb-items { display: none; }
.sb-items { list-style: none; margin: 0; padding: 0 0 4px; }
.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px 7px 12px; margin: 1px 0; border-radius: 8px;
  color: #C9D4E5; font-size: 13.5px; text-decoration: none !important;
  position: relative;
}
.sb-link svg { flex: 0 0 18px; opacity: .85; }
.sb-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-link.active { background: linear-gradient(90deg, rgba(19,149,159,.28), rgba(19,149,159,.08)); color: #fff; }
.sb-link.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--teal-500); }
.sb-link .sb-count { margin-left: auto; background: var(--crit); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.sb-link.locked { opacity: .45; }
.sb-foot { padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11px; color: #7E92B0; }
.sb-foot .demo-pill { background: rgba(250,178,25,.12); border-color: rgba(250,178,25,.35); color: #F6C75A; }

#app-shell.collapsed .sb-title, #app-shell.collapsed .sb-group-btn span,
#app-shell.collapsed .sb-group-btn .chev, #app-shell.collapsed .sb-link span,
#app-shell.collapsed .sb-foot, #app-shell.collapsed .sb-count { display: none; }
#app-shell.collapsed .sb-link { justify-content: center; padding: 9px 0; }
#app-shell.collapsed .sb-group-btn { justify-content: center; }
#app-shell.collapsed .sb-group.closed .sb-items { display: block; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 var(--gutter);
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); }
.crumbs b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { opacity: .5; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.gsearch { position: relative; width: 260px; flex: 0 1 260px; min-width: 160px; }
.topbar .crumbs { flex: 1 1 auto; min-width: 150px; }
.gsearch input {
  display: block; width: 100%; height: 36px; margin: 0; padding: 0 34px 0 34px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
  text-overflow: ellipsis;
}
.gsearch input:focus { background: #fff; border-color: var(--river-500); outline: none; box-shadow: 0 0 0 3px rgba(42,120,214,.15); }
.gsearch > span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; color: var(--muted); pointer-events: none; }
.gsearch > span svg { display: block; }
.sync-chip, .user-btn .u-meta b, .user-btn .u-meta span { white-space: nowrap; }
.user-btn .u-meta { max-width: 170px; overflow: hidden; }
.user-btn .u-meta b, .user-btn .u-meta span { display: block; overflow: hidden; text-overflow: ellipsis; }
.lp-hero .lp-tagline { font-size: 18px; color: #C9D4E5; margin-bottom: 6px; }
.gsearch kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); line-height: 18px; pointer-events: none; font: 11px/18px var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: #fff; }
.gsearch-results {
  position: absolute; top: 42px; left: 0; right: -120px; max-height: 420px; overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px;
}
.gs-group { padding: 6px 8px 2px; font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.gs-item { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 7px; cursor: pointer; color: var(--text); }
.gs-item:hover, .gs-item.active { background: var(--river-50); text-decoration: none; }
.gs-item small { color: var(--muted); display: block; font-size: 11.5px; }

.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 9px;
  display: inline-grid; place-items: center;
  background: none; border: 1px solid transparent; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--crit); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.sync-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); padding: 0 10px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }
.sync-chip:hover { border-color: var(--border-strong); }
.sync-chip .live { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(12,163,12,.15); }

.user-btn { display: flex; align-items: center; gap: 9px; padding: 3px 8px 3px 3px; border-radius: 10px; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.user-btn:hover { border-color: var(--border-strong); }
.avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--teal-600); flex: 0 0 30px; }
.user-btn .u-meta { line-height: 1.1; text-align: left; }
.user-btn .u-meta b { display: block; font-size: 12.5px; }
.user-btn .u-meta span { font-size: 11px; color: var(--muted); }

.dropdown {
  position: absolute; z-index: 60; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 240px; padding: 6px;
}
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--text); font-size: 13.5px; }
.dd-item:hover { background: var(--surface-3); text-decoration: none; }
.dd-item.danger { color: var(--crit-ink); }
.dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-head { padding: 8px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }

.content { padding: var(--gutter); min-width: 0; flex: 1; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--text-2); font-size: 13px; margin-top: 3px; max-width: 820px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.app-foot { padding: 14px var(--gutter); font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--border); display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }

/* =========================================================================
   Landing page
   ========================================================================= */
#landing { background: #fff; }
.lp-nav { position: sticky; top: 0; z-index: 20; background: rgba(10,27,54,.96); backdrop-filter: blur(6px); color: #fff; }
.lp-nav .inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 12px 24px; }
.lp-brand { display: flex; align-items: center; gap: 10px; }
.lp-brand b { font-size: 16px; letter-spacing: .06em; }
.lp-brand span { display: block; font-size: 11px; color: #9FB2CE; }
.lp-links { margin-left: auto; display: flex; gap: 22px; font-size: 13.5px; }
.lp-links a { color: #C9D4E5; }
.lp-links a:hover { color: #fff; text-decoration: none; }
.lp-hero { position: relative; overflow: hidden; background: var(--navy-900); color: #fff; }
.lp-hero .inner { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 72px 24px 96px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.lp-hero .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #7FD3D9; font-weight: 700; }
.lp-hero h1 { font-size: 46px; line-height: 1.08; margin: 12px 0 8px; letter-spacing: -.02em; }
.lp-hero h1 em { font-style: normal; color: #7FD3D9; }
.lp-hero .tag { font-size: 18px; color: #C9D4E5; margin-bottom: 6px; }
.lp-hero .desc { font-size: 15px; color: #A9B9D2; max-width: 560px; margin: 14px 0 26px; }
.lp-hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-river { position: absolute; inset: 0; z-index: 1; }
.lp-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.lp-stat { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 16px; }
.lp-stat b { display: block; font-size: 26px; }
.lp-stat span { font-size: 12.5px; color: #A9B9D2; }
.lp-stat-note { grid-column: 1 / -1; font-size: 11px; color: #8FA3C0; }
.lp-section { max-width: 1200px; margin: 0 auto; padding: 64px 24px; }
.lp-section h2 { font-size: 28px; margin-bottom: 8px; }
.lp-section .lead { color: var(--text-2); max-width: 760px; font-size: 15px; margin-bottom: 28px; }
.lp-alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lp-grid { display: grid; gap: 16px; }
.lp-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.lp-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.lp-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.lp-card h3 { font-size: 16px; margin: 10px 0 6px; }
.lp-card p { color: var(--text-2); font-size: 13.5px; margin: 0; }
.lp-card .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); }
.lp-card.link { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.lp-card.link:hover { border-color: var(--teal-500); box-shadow: var(--shadow-md); }
.lp-pillar { border-left: 3px solid var(--teal-500); }
.lp-obj { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.lp-obj b { display: block; }
.lp-obj .n { width: 30px; height: 30px; border-radius: 50%; background: var(--navy-800); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 30px; }
.lp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.lp-foot { background: var(--navy-950); color: #9FB2CE; font-size: 13px; }
.lp-foot .inner { max-width: 1200px; margin: 0 auto; padding: 40px 24px 24px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.lp-foot h4 { color: #fff; font-size: 13px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .08em; }
.lp-foot a { color: #C9D4E5; display: block; padding: 3px 0; }
.lp-foot .bottom { max-width: 1200px; margin: 0 auto; padding: 14px 24px 28px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* =========================================================================
   Login
   ========================================================================= */
#login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.login-art { position: relative; background: var(--navy-900); color: #fff; padding: 48px; display: flex; flex-direction: column; overflow: hidden; }
.login-art .lp-river { opacity: .9; }
.login-art > * { position: relative; z-index: 2; }
.login-art h2 { font-size: 30px; margin-top: auto; line-height: 1.15; }
.login-art p { color: #A9B9D2; max-width: 440px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px; overflow-y: auto; }
.login-box { width: 100%; max-width: 440px; }
.login-box h1 { font-size: 24px; }
.login-box .sub { color: var(--text-2); margin: 4px 0 20px; font-size: 13.5px; }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; right: 3px; top: 3px; width: 32px; height: 32px; }
.demo-profiles { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.demo-profiles h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-card { text-align: left; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 8px 10px; cursor: pointer; display: flex; gap: 9px; align-items: center; }
.profile-card:hover { border-color: var(--teal-500); background: var(--teal-50); }
.profile-card b { display: block; font-size: 12.5px; }
.profile-card span { font-size: 11px; color: var(--muted); }
.login-msg { margin-top: 12px; }

/* =========================================================================
   Print
   ========================================================================= */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .app-foot, .page-head .actions, .no-print, .toast-wrap, .filterbar, .rp-side { display: none !important; }
  #app-shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 500; background: var(--navy-800); color: #fff; padding: 8px 14px; border-radius: 8px; border: 0; font-weight: 600; cursor: pointer; }
.skip-link:focus { top: 10px; }
.print-head { padding: 0 0 10px; margin-bottom: 10px; border-bottom: 2px solid #0F2547; font-size: 11px; color: #333; }
.print-head span { color: #8A5A00; }
@media print { .print-head { display: block !important; padding: 0 0 8px; } }
