/* ============================================================================
 * 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;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(123,63,228,0.35));
  animation: irid-sweep 6s linear infinite;
}
@keyframes irid-sweep { to { background-position: 220% center; } }

/* ---- 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 transparent;
  background:
    linear-gradient(var(--ink), var(--ink)) padding-box,
    var(--irid) border-box;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow 0.2s ease, transform 0.08s ease;
}
.btn:hover { box-shadow: 0 3px 22px rgba(90,90,255,0.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,0.55); }
.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; }
}


/* ---- login: the genie mark as a premium tile + brighter wordmark -------- */
.login-mark {
  width: 66px; height: 66px; border-radius: 18px;
  display: block; margin: 0 auto 8px;
  box-shadow: 0 0 44px rgba(123,63,228,0.5), inset 0 0 0 1px rgba(255,255,255,0.08);
}
.login-title { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 2.1rem; letter-spacing: 0.04em; margin: 2px 0 2px; }
.login-tag { color: var(--text-dim); letter-spacing: 0.02em; 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,0.35); }
