/* ============================================================================
   NEXTGEN DESIGN SYSTEM — the ONE skin, lifted from the GC portal.
   Every surface in the new app is assembled from these tokens + components.
   Change it here, it changes everywhere. Consistency by construction.
   Pair with scripts/ui-kit.js (the JS helpers that emit these classes).
   ============================================================================ */

:root {
  /* Brand — the GC portal palette (canonical) */
  --nx-navy:   #1A2E4A;
  --nx-navy2:  #243F63;
  --nx-gold:   #C9A84C;
  --nx-gold2:  #B8942E;
  /* Ink / text */
  --nx-ink:    #1A2E4A;   /* primary text */
  --nx-ink2:   #4A5568;   /* secondary */
  --nx-ink3:   #8896A6;   /* muted / labels */
  --nx-ink4:   #B0C0D4;   /* faint / chevrons */
  /* Surfaces */
  --nx-bg:     #F4F6F9;   /* page */
  --nx-card:   #FFFFFF;
  --nx-bd:     #E2E8F0;   /* card border */
  --nx-bd2:    #D4DCE8;   /* input / stronger border */
  --nx-hair:   #F1F4F8;   /* internal dividers */
  /* Status */
  --nx-grn:    #16A34A; --nx-grn-bg:#DCFCE7;
  --nx-amb:    #D97706; --nx-amb-bg:#FEF3C7;
  --nx-red:    #DC2626; --nx-red-bg:#FEE2E2;
  --nx-blue:   #2563EB;
  /* Type */
  --nx-fc: 'Barlow Condensed', system-ui, sans-serif;  /* headings / labels */
  --nx-fb: 'Barlow', system-ui, sans-serif;            /* body */
  /* Shape */
  --nx-r:   14px;   /* card radius */
  --nx-r-sm:11px;   /* control radius */
  --nx-shadow: 0 1px 3px rgba(26,46,74,.06);
  --nx-shadow-l: 0 10px 34px rgba(26,46,74,.16);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
.nx { font-family: var(--nx-fb); color: var(--nx-ink); -webkit-tap-highlight-color: transparent; }
.nx *, .nx *::before, .nx *::after { box-sizing: border-box; }
.nx-page { background: var(--nx-bg); min-height: 100%; padding-bottom: env(safe-area-inset-bottom); }

/* ── Hero (navy gradient + gold rule) — the portal header ─────────────── */
.nx-hero {
  background: linear-gradient(160deg, var(--nx-navy) 0%, var(--nx-navy2) 100%);
  padding: 30px 22px 26px; text-align: center; position: relative;
  padding-top: calc(30px + env(safe-area-inset-top));
}
.nx-hero::after { content:''; position:absolute; left:0; right:0; bottom:0; height:5px;
  background: linear-gradient(90deg, var(--nx-gold), #D4B567); }
.nx-hero-kicker { font-family: var(--nx-fc); font-size:13px; font-weight:800; letter-spacing:3px;
  color: var(--nx-gold); text-transform: uppercase; }
.nx-hero-title { font-family: var(--nx-fc); font-size:34px; font-weight:800; color:#fff; line-height:1.05; margin-top:6px; }
.nx-hero-sub { font-size:15px; color: rgba(255,255,255,.82); margin-top:8px; font-weight:500; }

/* ── Back button (COPIED from the GC portal .crane-back) ──────────────── */
.nx-back { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; user-select: none; }
.nx-back-chev { width: 44px; height: 44px; border-radius: 12px; background: var(--nx-card); border: 1.5px solid var(--nx-bd);
  color: var(--nx-navy); display: flex; align-items: center; justify-content: center; box-shadow: var(--nx-shadow);
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .12s ease; }
.nx-back:hover .nx-back-chev { border-color: var(--nx-navy); background: var(--nx-navy); color: var(--nx-gold); transform: translateX(-2px); }
.nx-back-text { font-family: var(--nx-fc); font-size: 18px; font-weight: 700; color: var(--nx-ink); letter-spacing: -.005em; line-height: 1; }
@media (min-width: 900px) { .nx-back-text { font-size: 20px; } }

/* ── Hero card (navy gradient detail block — matches the GC portal .crane-hero) ── */
.nx-herocard { background: linear-gradient(140deg, var(--nx-navy) 0%, var(--nx-navy2) 100%);
  border-radius: 14px; padding: 28px 26px; margin-bottom: 16px; color: #fff; position: relative;
  overflow: hidden; box-shadow: 0 20px 50px rgba(10,20,40,.16); }
.nx-herocard::after { content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 400px 200px at 85% 0%, rgba(201,168,76,.15), transparent 70%); pointer-events: none; }
.nx-herocard > * { position: relative; z-index: 1; }
.nx-herocard-kicker { font-family: var(--nx-fc); font-size: 11.5px; font-weight: 800; color: var(--nx-gold);
  letter-spacing: 2.4px; text-transform: uppercase; margin-bottom: 10px; }
.nx-herocard-name { font-family: var(--nx-fc); font-size: 32px; font-weight: 800; color: #fff;
  letter-spacing: -.015em; line-height: 1.05; }
.nx-herocard-sub { font-family: var(--nx-fb); font-size: 15px; color: #C9D4E6; margin-top: 6px; }
.nx-herocard-status { display: inline-block; margin-top: 14px; background: rgba(255,255,255,.14); color: #fff;
  font-family: var(--nx-fc); font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; }
@media (min-width: 900px) { .nx-herocard-name { font-size: 40px; } }

/* ── Card ─────────────────────────────────────────────────────────────── */
.nx-card { background: var(--nx-card); border:1.5px solid var(--nx-bd); border-radius: var(--nx-r);
  box-shadow: var(--nx-shadow); overflow: hidden; }
.nx-card-pad { padding: 16px 18px; }

/* ── Section eyebrow ──────────────────────────────────────────────────── */
.nx-eyebrow { font-family: var(--nx-fc); font-size:11px; font-weight:800; letter-spacing:1.6px;
  color: var(--nx-ink3); text-transform: uppercase; margin: 4px 2px 10px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.nx-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:44px; padding:0 20px; border:none; border-radius: var(--nx-r-sm);
  background: var(--nx-navy); color:#fff; font-family: var(--nx-fc); font-size:13.5px; font-weight:800;
  letter-spacing:1px; text-transform: uppercase; cursor:pointer; text-decoration:none;
  -webkit-tap-highlight-color: transparent; }
.nx-btn:active { transform: translateY(1px); }
.nx-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.nx-btn-outline { background: var(--nx-card); border:1.5px solid var(--nx-bd2); color: var(--nx-navy); }
.nx-btn-gold { background: linear-gradient(135deg, var(--nx-gold), #D4B567); color: var(--nx-navy); }
.nx-btn-block { width:100%; }

/* ── Sub-tab pills (Plan · Maint · Binder) ────────────────────────────── */
.nx-pills { display:flex; gap:8px; margin:2px 0 14px; }
.nx-pill { flex:1; min-height:42px; border-radius: var(--nx-r-sm); border:1.5px solid var(--nx-bd2);
  background: var(--nx-card); color: var(--nx-ink2); font-family: var(--nx-fc); font-size:13px;
  font-weight:800; letter-spacing:1px; text-transform: uppercase; cursor:pointer; white-space:nowrap;
  -webkit-tap-highlight-color: transparent; }
.nx-pill.on { background: var(--nx-navy); border-color: var(--nx-navy); color:#fff; }

/* ── List row (tappable) ──────────────────────────────────────────────── */
.nx-row { display:flex; align-items:center; gap:14px; padding:14px 16px; background: var(--nx-card);
  border:1.5px solid var(--nx-bd); border-radius:12px; box-shadow: var(--nx-shadow); margin-bottom:10px;
  cursor:pointer; transition: transform .12s ease, border-color .12s ease; }
.nx-row:hover { border-color: var(--nx-gold); transform: translateY(-1px); }
.nx-row-ic { width:44px; height:44px; border-radius:11px; flex-shrink:0; display:flex; align-items:center;
  justify-content:center; background: linear-gradient(135deg, var(--nx-navy), var(--nx-navy2)); }
.nx-row-ic svg { width:22px; height:22px; stroke: var(--nx-gold); }
.nx-row-main { flex:1; min-width:0; }
.nx-row-title { font-family: var(--nx-fc); font-size:16px; font-weight:800; color: var(--nx-ink); line-height:1.2; }
.nx-row-sub { font-family: var(--nx-fb); font-size:12.5px; color: var(--nx-ink3); margin-top:3px; font-weight:500; }
.nx-row-chev { flex-shrink:0; stroke: var(--nx-ink4); }

/* ── Inputs (16px min — no iOS zoom) ──────────────────────────────────── */
.nx-field { margin-bottom:14px; }
.nx-label { font-family: var(--nx-fc); font-size:11px; font-weight:800; letter-spacing:1px;
  text-transform: uppercase; color: var(--nx-ink3); margin:0 2px 6px; display:block; }
.nx-input, .nx-textarea, .nx-select { width:100%; min-height:48px; padding:0 14px; font-family: var(--nx-fb);
  font-size:16px; color: var(--nx-ink); background: var(--nx-card); border:1.5px solid var(--nx-bd2);
  border-radius:12px; -webkit-appearance:none; outline:none; }
.nx-textarea { padding:12px 14px; min-height:96px; resize:vertical; line-height:1.5; }
.nx-input:focus, .nx-textarea:focus, .nx-select:focus { border-color: var(--nx-gold); }

/* ── Badge / status pill ──────────────────────────────────────────────── */
.nx-badge { display:inline-block; font-family: var(--nx-fc); font-size:10.5px; font-weight:800;
  letter-spacing:.8px; text-transform: uppercase; border-radius:999px; padding:3px 10px; white-space:nowrap; }
.nx-badge-grn { background: var(--nx-grn-bg); color:#166534; }
.nx-badge-amb { background: var(--nx-amb-bg); color:#92600A; }
.nx-badge-red { background: var(--nx-red-bg); color:#B91C1C; }
.nx-badge-navy{ background: rgba(26,46,74,.08); color: var(--nx-navy); }

/* ── Empty state ──────────────────────────────────────────────────────── */
.nx-empty { padding:22px; text-align:center; color: var(--nx-ink3); font-family: var(--nx-fb);
  font-size:13px; border:1.5px dashed var(--nx-bd2); border-radius:12px; }

/* ── Content padding for surfaces ─────────────────────────────────────── */
.nx-body { padding: 16px; }

/* ── NEXTGEN frame overrides — match the GC portal (nextgen tenants ONLY, via html.nx) ── */
html.nx .co-hero { background: linear-gradient(160deg, #1A2E4A 0%, #243F63 100%) !important; }

/* ── Lightbox (tap image to enlarge) ──────────────────────────────────── */
.nx-lightbox { position:fixed; inset:0; z-index:9999; background: rgba(10,15,25,.93);
  display:flex; align-items:center; justify-content:center; padding:20px; cursor: zoom-out; }
.nx-lightbox img { max-width:100%; max-height:100%; border-radius:12px; box-shadow:0 14px 60px rgba(0,0,0,.55); }
