/* ============================================================================
 * ARZU — styles. All colour values flow from the BRAND constant via CSS
 * custom properties set in app.js (applyBrand). Nothing brand-specific here.
 * ==========================================================================*/

:root {
  --ink: #0B0B10;                /* overwritten from BRAND at boot */
  --irid-a: #7B3FE4;
  --irid-b: #1F4FE0;
  --irid-c: #35E0FF;
  --live: #2BFF88;
  --warn: #FFB020;
  --danger: #FF5470;

  --font-scale: 1;
  --text: rgba(255, 255, 255, 0.92);
  --text-dim: rgba(255, 255, 255, 0.55);
  --text-faint: rgba(255, 255, 255, 0.35);

  /* pearlescent: the same hues, pale, mixed with white — the calm 95% */
  --pearl: linear-gradient(135deg,
    rgba(255,255,255,0.055) 0%,
    rgba(160,140,255,0.075) 38%,
    rgba(120,170,255,0.065) 70%,
    rgba(255,255,255,0.05) 100%);
  --pearl-strong: linear-gradient(135deg,
    rgba(255,255,255,0.10) 0%,
    rgba(170,150,255,0.14) 45%,
    rgba(130,180,255,0.12) 100%);
  --card-border: 1px solid rgba(255,255,255,0.09);
  --card-radius: 16px;

  /* iridescent: the loud 5% */
  --irid: linear-gradient(120deg, var(--irid-a) 0%, var(--irid-b) 55%, var(--irid-c) 100%);
  --irid-soft: linear-gradient(120deg,
    color-mix(in srgb, var(--irid-a) 32%, transparent),
    color-mix(in srgb, var(--irid-b) 32%, transparent),
    color-mix(in srgb, var(--irid-c) 28%, transparent));
}

* { box-sizing: border-box; }
html { font-size: calc(16px * var(--font-scale)); }
body {
  margin: 0;
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(123,63,228,0.14), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(31,79,224,0.12), transparent 55%),
    var(--ink);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display { font-family: 'Sora', 'Inter', system-ui, sans-serif; letter-spacing: -0.01em; }

/* ---- iridescent text: the signature, used sparingly -------------------- */
.irid-text {
  background: linear-gradient(110deg, var(--irid-a) 0%, var(--irid-c) 30%, #ffffff 50%, var(--irid-b) 70%, var(--irid-a) 100%);
  background-size: 220% auto;
  filter: drop-shadow(0 0 18px rgba(123,63,228,0.35));
  animation: irid-sweep 6s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- layout: sidebar + content on desktop, drawer on mobile ------------ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: 0 0 248px;
  padding: 22px 16px;
  border-right: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.content {
  flex: 1;
  padding: 28px clamp(18px, 4vw, 48px);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
.topbar { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-dim); text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  font-size: 0.95rem;
  background: none; width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.045); }
.nav-item.active {
  color: #fff;
  background: var(--irid-soft);
  border: 1px solid rgba(255,255,255,0.12);
}
.nav-section { margin-top: 14px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); padding: 0 12px; }

.brand-row { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.brand-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.15rem; }

/* ---- cards -------------------------------------------------------------- */
.card {
  background: var(--pearl);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: 20px;
  backdrop-filter: blur(6px);
}
.card + .card { margin-top: 14px; }
.card.clickable { cursor: pointer; transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.2s ease; }
.card.clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(180,160,255,0.35);
  box-shadow: 0 8px 40px rgba(80,60,220,0.18);
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card h3 { margin: 0 0 6px; font-size: 1.06rem; }
.card .sub { color: var(--text-dim); font-size: 0.88rem; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 1.7rem; }
.page-head .crumbs { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 4px; }
.page-head .crumbs a { color: var(--text-dim); text-decoration: none; }
.page-head .crumbs a:hover { color: var(--text); }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, box-shadow 0.2s ease;
}
.btn:hover { background: rgba(255,255,255,0.09); }
.btn.primary {
  background: var(--irid);
  border: none; color: #fff; font-weight: 600;
}
.btn.primary:hover { box-shadow: 0 4px 28px rgba(90,90,255,0.45); }
.btn.small { padding: 5px 10px; font-size: 0.8rem; border-radius: 8px; }
.btn.danger { border-color: rgba(255,84,112,0.4); color: var(--danger); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- pointer pills — the three-pointer language of the whole product ---- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 3px 11px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.current { color: #cfc4ff; border-color: rgba(150,120,255,0.45); }
.pill.lkg     { color: #a8ecff; border-color: rgba(80,200,255,0.4); }
.pill.live    { color: var(--live); border-color: color-mix(in srgb, var(--live) 45%, transparent); }
.pill.none    { color: var(--text-faint); border-style: dashed; }

.drift-flag {
  display: inline-flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  color: var(--warn);
  border-radius: 10px; padding: 6px 12px; font-size: 0.82rem; font-weight: 600;
}
.ok-flag {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--live); font-size: 0.82rem; font-weight: 600;
}

/* ---- forms --------------------------------------------------------------- */
input, select, textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.13);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.92rem;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(150,120,255,0.6);
  box-shadow: 0 0 0 3px rgba(123,63,228,0.18);
}
label { display: block; font-size: 0.8rem; color: var(--text-dim); margin: 10px 0 5px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 160px; }
select option { background: #16161f; color: #fff; }

/* ---- tables --------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; color: var(--text-faint); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; }
tr:hover td { background: rgba(255,255,255,0.02); }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.8rem; }

/* ---- login --------------------------------------------------------------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card { width: 100%; max-width: 420px; padding: 34px; }
.login-card .brand-mark { width: 52px; height: 52px; margin-bottom: 14px; }
.login-title { font-size: 1.9rem; margin: 0 0 2px; }
.login-tag { color: var(--text-dim); margin: 0 0 22px; font-size: 0.95rem; }

/* ---- misc ---------------------------------------------------------------- */
.empty { color: var(--text-faint); font-size: 0.9rem; padding: 18px 4px; }
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #191926; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px; padding: 12px 16px; font-size: 0.9rem; max-width: 380px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.toast.err { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.toast.good { border-color: color-mix(in srgb, var(--live) 45%, transparent); }
.muted { color: var(--text-dim); }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.font-controls { display: flex; gap: 4px; }
.badge-count {
  background: var(--irid-soft); border-radius: 999px; padding: 1px 9px;
  font-size: 0.72rem; border: 1px solid rgba(255,255,255,0.12);
}
details { border-top: 1px solid rgba(255,255,255,0.06); padding: 8px 0; }
summary { cursor: pointer; color: var(--text-dim); font-size: 0.86rem; }
.token-reveal {
  background: rgba(43,255,136,0.07);
  border: 1px solid color-mix(in srgb, var(--live) 40%, transparent);
  border-radius: 10px; padding: 12px; margin-top: 10px;
  font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; word-break: break-all;
}
.conductor-panel {
  background: var(--pearl-strong);
  border: 1px solid rgba(170,150,255,0.25);
}
.hint { font-size: 0.78rem; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }

/* ---- ONE breakpoint: real desktop above, real mobile below -------------- */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 200;
    background: #101018;
    box-shadow: 20px 0 60px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: sticky; top: 0; background: rgba(11,11,16,0.9); backdrop-filter: blur(10px); z-index: 100;
  }
  .content { padding: 18px 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 150; }
}

@keyframes irid-sweep { to { background-position: 220% center; } }
/* ---- every button iridescent, not just primary ---- */
.btn { border:1px solid transparent;
  background: linear-gradient(var(--ink),var(--ink)) padding-box, var(--irid) border-box;
  transition: box-shadow .2s ease, transform .08s ease; }
.btn:hover { box-shadow: 0 3px 22px rgba(90,90,255,.30); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--irid); border:1px solid transparent; color:#fff; font-weight:600; }
.btn.primary:hover { box-shadow: 0 4px 30px rgba(90,90,255,.55); }
/* ---- login: the genie as a premium glowing tile ---- */
.login-mark { width:66px; height:66px; border-radius:18px; display:block; margin:0 auto 8px;
  box-shadow: 0 0 44px rgba(123,63,228,.5), inset 0 0 0 1px rgba(255,255,255,.08); }
.login-title { font-family:'Sora',sans-serif; font-weight:800; font-size:2.1rem; letter-spacing:.04em; margin:2px 0; }
.login-tag { color:var(--text-dim); margin-bottom:18px; }
.login-card { text-align:center; }
.login-card label, .login-card input { text-align:left; }
.brand-mark { box-shadow: 0 0 20px rgba(123,63,228,.35); }

/* ============================================================================
 * BUILD 3 — self-explaining surfaces: purpose lines, teaching empty states,
 * the in-product manual, the ? help button, and the guided first run.
 * ==========================================================================*/
.purpose {
  color: var(--text-dim); font-size: 0.92rem; margin: -14px 0 20px;
  line-height: 1.5; max-width: 860px;
}
.help-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; cursor: pointer; color: var(--text);
  border: 1px solid transparent;
  background: linear-gradient(var(--ink),var(--ink)) padding-box, var(--irid) border-box;
  flex: 0 0 auto;
}
.help-btn:hover { box-shadow: 0 3px 22px rgba(90,90,255,.35); }

.empty-teach {
  background: var(--pearl);
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: var(--card-radius);
  padding: 26px; text-align: center;
}
.empty-teach h3 { margin: 0 0 8px; }
.empty-teach p { color: var(--text-dim); font-size: 0.92rem; max-width: 560px; margin: 0 auto 14px; line-height: 1.55; }

/* ---- the manual (Help) ---- */
.man-wrap { display: flex; gap: 22px; align-items: flex-start; }
.man-toc {
  flex: 0 0 240px; position: sticky; top: 16px;
  background: var(--pearl); border: var(--card-border); border-radius: var(--card-radius);
  padding: 14px; max-height: calc(100vh - 60px); overflow: auto;
}
.man-toc a {
  display: block; padding: 7px 10px; border-radius: 8px;
  color: var(--text-dim); text-decoration: none; font-size: 0.88rem;
}
.man-toc a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.man-toc a.active { color: #fff; background: var(--irid-soft); }
.man-body { flex: 1; min-width: 0; }
.man-section { scroll-margin-top: 16px; }
.man-section h3 { font-size: 1.15rem; margin: 26px 0 10px; }
.man-section:first-child h3 { margin-top: 0; }
.man-table { margin: 10px 0; }
.man-code {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 12px; font-family: ui-monospace, Menlo, monospace;
  font-size: 0.82rem; overflow-x: auto; white-space: pre-wrap;
}
.man-search { margin-bottom: 16px; }
.man-hit { background: color-mix(in srgb, var(--irid-a) 30%, transparent); border-radius: 3px; }
blockquote {
  border-left: 3px solid var(--irid-a); margin: 10px 0; padding: 4px 14px;
  color: var(--text-dim); background: rgba(123,63,228,0.06); border-radius: 0 8px 8px 0;
}
@media (max-width: 900px) {
  .man-wrap { flex-direction: column; }
  .man-toc { position: static; flex: none; width: 100%; max-height: none; }
}

/* ---- help overlay (the ? on every screen) ---- */
.help-overlay {
  position: fixed; inset: 0; z-index: 400; background: rgba(5,5,10,0.72);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(6px);
}
.help-panel {
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.14);
  background-image: var(--pearl);
  border-radius: 18px; max-width: 760px; width: 100%;
  max-height: 84vh; overflow: auto; padding: 26px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.6);
}
.help-panel h3 { margin-top: 0; }

/* ---- guided first run ---- */
.tour-card {
  background: var(--pearl-strong);
  border: 1px solid rgba(170,150,255,0.3);
  border-radius: var(--card-radius); padding: 20px; margin-bottom: 16px;
}
.tour-step { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; }
.tour-step .tick {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.2); color: var(--text-faint);
}
.tour-step.done .tick { background: color-mix(in srgb, var(--live) 18%, transparent); border-color: color-mix(in srgb, var(--live) 50%, transparent); color: var(--live); }
.tour-step .body b { display: block; }
.tour-step .body span { color: var(--text-dim); font-size: 0.86rem; line-height: 1.5; }
.tour-step.done .body b { color: var(--text-dim); text-decoration: line-through; }

/* ---- stat tiles (console overview & health) ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat {
  background: var(--pearl); border: var(--card-border); border-radius: 14px; padding: 14px 16px;
}
.stat .num { font-family: 'Sora', sans-serif; font-size: 1.55rem; font-weight: 700; }
.stat .lbl { color: var(--text-dim); font-size: 0.78rem; margin-top: 2px; line-height: 1.4; }
.stat.flag .num { color: var(--warn); }
.stat.bad .num { color: var(--danger); }
.stat.good .num { color: var(--live); }

.flag-row td { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.suspended-row td { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.status-pill { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; }
.code-reveal {
  background: rgba(43,255,136,0.07);
  border: 1px solid color-mix(in srgb, var(--live) 40%, transparent);
  border-radius: 10px; padding: 12px; margin-top: 10px;
  font-family: ui-monospace, Menlo, monospace; font-size: 0.9rem; word-break: break-all;
}

/* ============================================================================
 * OPERATIONS-ONLY DRESSING — same brand, unmistakably its own surface.
 * ==========================================================================*/
.ops-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 8px; padding: 3px 10px;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 0.7rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: #fff;
  border: 1px solid transparent;
  background: linear-gradient(rgba(11,11,16,0.85),rgba(11,11,16,0.85)) padding-box, var(--irid) border-box;
}
.ops-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--irid-c); box-shadow: 0 0 10px var(--irid-c); }
.sidebar .ops-chip { margin: 0 0 6px 8px; }
body {
  background:
    radial-gradient(1100px 700px at 110% -15%, rgba(53,224,255,0.10), transparent 55%),
    radial-gradient(1200px 800px at 85% -10%, rgba(123,63,228,0.14), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(31,79,224,0.12), transparent 55%),
    var(--ink);
}
.boundary-note {
  font-size: 0.75rem; color: var(--text-faint); line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,0.07); padding: 10px 12px 0; margin-top: 8px;
}
