/* NRDhub dev shell — "flat look" (light, Inter) after NRD Home / Processing.
   Palette: navy band #1B2A4A, ground #F2F4F8, white cards r4 with soft shadow,
   accent #0C66E4, ink #172B4D, muted #6B7A96. Inter is used if installed;
   no web font is fetched (no network calls beyond the Firebase SDK). */
:root {
  --navy: #1B2A4A; --navy-mid: #233562; --cream: #f2ede6; --taupe: #d6cebf; --gold: #C8A951;
  --ground: #F2F4F8; --surface: #FFFFFF; --ink: #172B4D; --muted: #6B7A96; --line: #E3E7EE;
  --accent: #0C66E4; --accent-hover: #0055CC;
  --card-shadow: 0 4px 10px rgba(0,0,0,.06);
  --topnav-h: 56px; --sidebar-w: 228px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button { font: inherit; }

/* ── Sign in: the shared #nrd-flat-login block, minus the email/password fields ── */
#nrdLogin { min-height: calc(100vh - var(--dev-banner-h)); display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: #F2F4F8; }
#nrdLogin .nrd-login-card { background: #FFFFFF; border: 0; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,.06); padding: 36px; max-width: 420px; width: 100%; text-align: center; font-family: var(--font); }
#nrdLogin .nrd-login-logo { height: 46px; width: auto; filter: brightness(0) opacity(.82); margin: 0 auto 18px; display: block; }
#nrdLogin .nrd-login-brand { font-size: 17px; font-weight: 700; color: #6B7A96; margin: 0 0 2px; display: flex; align-items: center; justify-content: center; gap: 8px; }
#nrdLogin .nrd-login-sub { font-size: 14px; font-weight: 600; color: #0C66E4; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 18px; }
#nrdLoginErr { color: #172B4D; font-weight: 600; font-size: 12px; margin: 0 0 12px; }
#nrdLoginErr:empty { margin: 0; }
#nrdLoginErr:not(:empty) { background: #FFF4E5; border-left: 3px solid #C25100; padding: 8px 10px; text-align: left; border-radius: 2px; }
#nrdLoginBtn { width: 100%; background: #0C66E4; color: #FFFFFF; border: 0; border-radius: 4px; padding: 11px 18px; font-size: 12px; font-weight: 500; letter-spacing: .8px; text-transform: uppercase; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
#nrdLoginBtn:hover:not(:disabled) { background: #0055CC; }
#nrdLoginBtn:disabled { opacity: .65; cursor: default; }
#nrdLoginBtn .ms-mark { display: inline-grid; grid-template-columns: 7px 7px; gap: 1px; }
#nrdLoginBtn .ms-mark i { width: 7px; height: 7px; display: block; }
#nrdLogin .nrd-login-foot { font-size: 11.5px; color: #6B7A96; margin-top: 14px; }

/* ── Top nav ── */
.top-nav { position: sticky; top: var(--dev-banner-h); z-index: 200; height: var(--topnav-h); background: var(--navy); display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--cream); min-width: 0; }
.brand-logo { height: 26px; width: auto; flex-shrink: 0; }
.brand-name { font-size: 12.5px; font-weight: 600; letter-spacing: .13em; color: var(--taupe); text-transform: uppercase; }
.nav-spacer { flex: 1; }
.nav-burger { display: none; background: none; border: 0; color: var(--cream); padding: 6px; cursor: pointer; border-radius: 4px; }
.nav-burger:hover { background: rgba(255,255,255,.08); }

.acct { position: relative; }
.acct-btn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid rgba(255,255,255,.14); color: #fff; padding: 5px 10px 5px 5px; border-radius: 30px; cursor: pointer; max-width: 100%; }
.acct-btn:hover { background: rgba(255,255,255,.07); }
.acct-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.acct-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.acct-caret { opacity: .7; flex-shrink: 0; }
.role-badge { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 30px; background: rgba(12,102,228,.25); color: #CFE1FD; border: 1px solid rgba(207,225,253,.35); white-space: nowrap; flex-shrink: 0; }
.role-badge.none { background: rgba(255,255,255,.06); color: #D6CEBF; border-color: rgba(214,206,191,.35); text-transform: none; letter-spacing: 0; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: #fff; border-radius: 4px; box-shadow: 0 8px 24px rgba(23,43,77,.18); padding: 6px 0; z-index: 300; }
.acct-menu-head { padding: 10px 14px 12px; border-bottom: 1px solid var(--line); }
.acct-menu-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.acct-menu-email, .acct-menu-role { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.acct-menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 14px; color: var(--ink); cursor: pointer; }
.acct-menu-item:hover { background: var(--ground); color: var(--accent); }

/* ── Layout + sidebar ── */
.layout { display: flex; min-height: calc(100vh - var(--dev-banner-h) - var(--topnav-h)); }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: calc(var(--dev-banner-h) + var(--topnav-h)); height: calc(100vh - var(--dev-banner-h) - var(--topnav-h)); overflow-y: auto; }
.sidebar-nav { padding: 8px 0; flex: 1; }
.s-item { display: flex; align-items: center; gap: 9px; padding: 11px 14px 11px 18px; color: var(--muted); font-size: 13.5px; font-weight: 500; text-decoration: none; border-left: 2px solid transparent; transition: border-color .16s, color .16s; }
.s-item svg { flex-shrink: 0; opacity: .7; }
.s-item:hover:not(.active) { border-left-color: var(--line); color: var(--ink); }
.s-item.active { border-left-color: var(--accent); color: var(--ink); font-weight: 600; }
.s-item.active svg { opacity: 1; color: var(--accent); }
.platform-label { font-size: 9.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 14px 18px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.sidebar-foot { padding: 10px 18px 14px; }
.diag-link { font-size: 11px; color: var(--muted); text-decoration: none; }
.diag-link:hover { color: var(--accent); text-decoration: underline; }
.sidebar-scrim { display: none; }

/* ── Main ── */
.main-content { flex: 1; min-width: 0; padding: 18px 22px 40px; }
.notice { background: #FFF8E6; border-left: 3px solid #B7791F; color: var(--ink); padding: 12px 14px; border-radius: 2px; margin-bottom: 16px; font-size: 13px; }
.page-title { font-size: 14px; font-weight: 600; letter-spacing: .42px; color: var(--accent); margin: 18px 0 20px; }

.welcome-card, .wtile, .metric-card, .empty-card { background: var(--surface); border: 0; border-radius: 4px; box-shadow: var(--card-shadow); }
.welcome-card { padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.welcome-text h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; overflow-wrap: anywhere; }
.welcome-text p { margin: 0; font-size: 13px; color: var(--muted); }
.welcome-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; flex-shrink: 0; }

.section-title { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { padding: 18px 18px 16px; }
.metric-icon { width: 32px; height: 32px; border-radius: 6px; background: #E9F2FF; color: var(--accent); display: grid; place-items: center; margin-bottom: 12px; }
.metric-label { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.metric-value { font-size: 30px; font-weight: 700; line-height: 1; color: #B3BCCB; }
.metric-sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

.tile-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.wtile { grid-column: span 4; padding: 18px; min-height: 150px; display: flex; flex-direction: column; }
.wtile.lg { grid-column: span 6; }
.wtile.full { grid-column: span 12; }
.wtile h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink); }

.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 13px; gap: 6px; padding: 14px 8px; }
.empty svg { color: #B3BCCB; }
.empty b { color: var(--ink); font-weight: 600; }
.empty-card { padding: 40px 20px; }

/* ── Phone / narrow ── */
@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wtile, .wtile.lg { grid-column: span 12; }
}
@media (max-width: 760px) {
  .nav-burger { display: inline-flex; }
  .brand-name { display: none; }
  .acct-name { max-width: 110px; }
  .sidebar { position: fixed; left: 0; top: calc(var(--dev-banner-h) + var(--topnav-h)); bottom: 0; height: auto; z-index: 150; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 8px 24px rgba(23,43,77,.18); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(23,43,77,.35); z-index: 140; }
  .main-content { padding: 14px 16px 32px; }
  .welcome-card { padding: 18px; }
}
@media (max-width: 460px) {
  .acct-name { display: none; }
  .metrics-grid { grid-template-columns: minmax(0, 1fr); }
  .welcome-avatar { display: none; }
  #nrdLogin .nrd-login-card { padding: 28px 20px; }
}
