/* ============================================================
   PLATFORM CHROME — neutral SaaS dashboard
   Used by login / admin / brand-edit. Brand-agnostic on purpose.
   ============================================================ */
:root{
  --bg:        #f4f5f7;
  --surface:   #ffffff;
  --surface-2: #fafbfc;
  --ink:       #15181d;
  --muted:     #5b626d;
  --soft:      #6b7280;  /* WCAG AA (~4.6:1 on white) */
  --line:      #e6e8ec;
  --line-2:    #d7dae0;
  --accent:    #4f46e5;
  --accent-d:  #3f37c9;
  --accent-sft:#eef0fe;
  --ok:        #1f9d6b;
  --ok-sft:    #e6f6ef;
  --warn:      #c0521f;
  --warn-sft:  #fbeee6;
  --danger:    #c0392b;
  --danger-sft:#fbeaea;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20,24,29,.05), 0 1px 3px rgba(20,24,29,.05);
  --shadow-md: 0 8px 28px rgba(20,24,29,.10), 0 2px 6px rgba(20,24,29,.06);
  --shadow-lg: 0 30px 70px rgba(20,24,29,.20);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{ margin:0; font-family:var(--font); color:var(--ink); background:var(--bg); -webkit-font-smoothing:antialiased; }
a{ color:var(--accent); text-decoration:none; }
/* visible keyboard focus for all interactive chrome */
a:focus-visible, button:focus-visible, .btn:focus-visible, .navlink:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px; border-radius:6px;
}
h1,h2,h3,h4{ margin:0; font-weight:800; letter-spacing:-.01em; line-height:1.1; }

/* ---- buttons ---- */
.btn{ font-family:var(--font); font-weight:700; font-size:14px; border-radius:10px; padding:10px 16px;
  border:1px solid var(--line-2); background:var(--surface); color:var(--ink); cursor:pointer; display:inline-flex;
  align-items:center; gap:8px; transition:.13s; white-space:nowrap; }
.btn:hover{ border-color:var(--soft); background:var(--surface-2); }
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--accent); border-color:var(--accent); color:#fff; }
.btn-primary:hover{ background:var(--accent-d); border-color:var(--accent-d); }
.btn-ghost{ border-color:transparent; background:transparent; color:var(--muted); }
.btn-ghost:hover{ background:var(--surface-2); color:var(--ink); }
.btn-danger{ color:var(--danger); border-color:var(--line-2); }
.btn-danger:hover{ background:var(--danger-sft); border-color:var(--danger); }
.btn-sm{ padding:7px 11px; font-size:12.5px; border-radius:8px; }
.btn[disabled]{ opacity:.5; pointer-events:none; }

/* ---- inputs ---- */
.label{ display:block; font-size:12px; font-weight:700; letter-spacing:.02em; color:var(--muted); margin-bottom:7px; text-transform:none; }
.input, .select, textarea.input{
  width:100%; border:1px solid var(--line-2); border-radius:10px; padding:11px 13px;
  font-family:var(--font); font-size:14.5px; color:var(--ink); background:var(--surface); transition:.13s;
}
.input:focus, .select:focus, textarea.input:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-sft); }
.input::placeholder{ color:var(--soft); }
.hint{ font-size:12px; color:var(--soft); margin-top:6px; line-height:1.5; }
.field + .field{ margin-top:14px; }

/* ---- cards ---- */
.card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm); }
.card-pad{ padding:22px 24px; }

/* ---- pills / badges ---- */
.pill{ display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:700; padding:4px 10px; border-radius:999px; background:var(--surface-2); color:var(--muted); border:1px solid var(--line); }
.pill.accent{ background:var(--accent-sft); color:var(--accent-d); border-color:transparent; }
.pill.ok{ background:var(--ok-sft); color:var(--ok); border-color:transparent; }
.pill.warn{ background:var(--warn-sft); color:var(--warn); border-color:transparent; }

/* ---- app shell ---- */
.app{ display:grid; grid-template-columns:248px 1fr; min-height:100vh; }
.side{ background:var(--surface); border-right:1px solid var(--line); padding:22px 16px; display:flex; flex-direction:column; gap:6px; position:sticky; top:0; height:100vh; }
.brandmark{ display:flex; align-items:center; gap:11px; padding:6px 10px 20px; }
.brandmark .logo{ width:34px; height:34px; border-radius:9px; background:var(--ink); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:16px; }
.brandmark .t{ font-weight:800; font-size:15px; letter-spacing:-.01em; white-space:nowrap; }
.brandmark .s{ font-size:11px; color:var(--soft); font-weight:600; white-space:nowrap; }
.navlink{ display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:10px; color:var(--muted); font-weight:600; font-size:14px; cursor:pointer; }
.navlink:hover{ background:var(--surface-2); color:var(--ink); }
.navlink.active{ background:var(--accent-sft); color:var(--accent-d); }
.navlink .ico{ width:18px; height:18px; flex:none; opacity:.85; }
.side .spacer{ flex:1; }
.side .who{ border-top:1px solid var(--line); padding:14px 10px 4px; font-size:12px; color:var(--soft); }
.side .who b{ display:block; color:var(--ink); font-size:13px; font-weight:700; }

.main{ min-width:0; }
.topbar{ height:64px; border-bottom:1px solid var(--line); background:var(--surface); display:flex; align-items:center; gap:16px; padding:0 30px; position:sticky; top:0; z-index:20; }
.topbar h1{ font-size:18px; }
.topbar .crumbs{ font-size:13px; color:var(--soft); font-weight:600; }
.topbar .crumbs a{ color:var(--muted); }
.topbar .right{ margin-left:auto; display:flex; align-items:center; gap:10px; }
.content{ padding:30px; max-width:1180px; }

/* ---- section heads ---- */
.sectionhead{ display:flex; align-items:flex-end; gap:14px; margin:0 0 18px; }
.sectionhead h2{ font-size:20px; }
.sectionhead .sub{ font-size:13.5px; color:var(--muted); }
.sectionhead .right{ margin-left:auto; display:flex; gap:10px; }

/* ---- grid of brand cards ---- */
.grid{ display:grid; gap:18px; }
.grid.cols3{ grid-template-columns:repeat(3,1fr); }
.grid.cols2{ grid-template-columns:repeat(2,1fr); }
@media(max-width:1000px){ .grid.cols3{ grid-template-columns:repeat(2,1fr); } .app{ grid-template-columns:1fr; } .side{ position:static; height:auto; flex-direction:row; flex-wrap:wrap; align-items:center; } .side .spacer{ display:none; } .side .who{ display:none; } }
@media(max-width:680px){ .grid.cols3,.grid.cols2{ grid-template-columns:1fr; } }

/* ---- table ---- */
.tbl{ width:100%; border-collapse:collapse; }
.tbl th{ text-align:left; font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--soft); font-weight:700; padding:0 14px 12px; }
.tbl td{ padding:14px; border-top:1px solid var(--line); font-size:14px; vertical-align:middle; }
.tbl tr:hover td{ background:var(--surface-2); }

/* ---- modal ---- */
.modal-bg{ position:fixed; inset:0; background:rgba(20,24,29,.42); backdrop-filter:blur(3px); display:flex; align-items:center; justify-content:center; padding:24px; z-index:100; opacity:0; pointer-events:none; transition:.16s; }
.modal-bg.show{ opacity:1; pointer-events:auto; }
.modal{ background:var(--surface); border-radius:18px; box-shadow:var(--shadow-lg); width:100%; max-width:520px; max-height:90vh; overflow:auto; transform:translateY(10px) scale(.99); transition:.16s; }
.modal-bg.show .modal{ transform:none; }
.modal .mhead{ padding:22px 26px 0; }
.modal .mhead h3{ font-size:19px; }
.modal .mhead p{ font-size:13.5px; color:var(--muted); margin:6px 0 0; }
.modal .mbody{ padding:20px 26px; }
.modal .mfoot{ padding:16px 26px 22px; display:flex; gap:10px; justify-content:flex-end; border-top:1px solid var(--line); margin-top:4px; }

/* ---- toast ---- */
.toast{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(16px); background:var(--ink); color:#fff; padding:13px 20px; border-radius:11px; font-size:14px; font-weight:600; opacity:0; pointer-events:none; transition:.22s; z-index:200; box-shadow:var(--shadow-lg); }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* ---- misc ---- */
.empty{ text-align:center; padding:60px 20px; color:var(--soft); }
.empty .big{ font-size:17px; font-weight:700; color:var(--muted); margin-bottom:6px; }
.row{ display:flex; align-items:center; gap:10px; }
.swatch-dot{ width:28px; height:28px; border-radius:8px; border:1px solid var(--line-2); flex:none; }
.mono{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
