/* MYKYKLO admin theme — tokens taken from mykyklo.com */
:root {
  --ink: #171816;
  --graphite: #252724;
  --graphite-2: #2f322e;
  --paper: #e9e6df;
  --paper-2: #dcd9d1;
  --surface: #f0eee8;
  --white: #fbfaf7;
  --accent: #ff5a1f;
  --accent-dark: #d9430d;
  --accent-soft: #fff1ea;
  --muted: #5f625b;
  --muted-2: #8a8d84;
  --line: rgba(23, 24, 22, .16);
  --line-strong: rgba(23, 24, 22, .3);
  --ok-bg: #e2ebdd; --ok: #2f5a2a;
  --warn-bg: #fbe3d6; --warn: #a3360c;
  --off-bg: #e2e0da; --off: #5f625b;
  --bad-bg: #f6dcd9; --bad: #9b2a20;
  --info-bg: #e3e6ee; --info: #2e3d63;
  --sans: "Inter", Arial, sans-serif;
  --mono: "DM Mono", monospace;
  --radius: 2px;
  --nav-w: 232px;
  --drawer-w: 460px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.mono { font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; background: var(--graphite); color: #d8d6cf; display: flex; flex-direction: column; overflow-y: auto; }
.nav-logo { padding: 20px 20px 4px; color: #fff; font-weight: 700; font-size: 20px; letter-spacing: -.05em; }
.nav-org { padding: 0 20px 18px; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }
.nav-org .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.nav-group { padding: 14px 20px 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #7d8077; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 20px; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: #b8bbb3; border-left: 2px solid transparent; }
.nav a i { font-size: 17px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.03); }
.nav a.active { color: #fff; border-left-color: var(--accent); background: rgba(255,255,255,.05); }
.nav a.active i { color: var(--accent); }
.support-banner { display: flex; align-items: center; gap: 12px; background: var(--accent-soft); border: 1px solid var(--accent); color: var(--warn); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 18px; font-size: 13px; }
.support-banner i { font-size: 20px; color: var(--accent-dark); }
.support-banner div { flex: 1; }
.platform-badge { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; background: var(--accent); color: #fff; padding: 2px 6px; border-radius: var(--radius); vertical-align: middle; margin-left: 4px; }
.app.platform .nav { background: #1d1f1c; }
.nav-foot a { padding: 6px 0; font-size: 10.5px; }
.nav-foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #b8bbb3; }
.nav-foot b { color: #fff; font-weight: 500; display: block; }

.main { min-width: 0; padding: 26px 34px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.crumb { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.crumb a:hover { color: var(--ink); }
h1 { margin: 4px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.045em; line-height: 1.1; }
h2 { margin: 0 0 10px; font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.head-actions { display: flex; gap: 8px; }

/* ---------- Sub nav ---------- */
.subnav { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 20px 0 18px; overflow-x: auto; }
.subnav button { background: none; border: 0; padding: 9px 0; font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav button:hover { color: var(--ink); }
.subnav button.active { color: var(--ink); border-bottom-color: var(--accent); }
.subnav .count { margin-left: 6px; color: var(--muted-2); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--ink); background: var(--ink); color: #fff; padding: 8px 13px; border-radius: var(--radius); font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
.btn:hover { background: #000; }
.btn i { font-size: 15px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 5px 9px; font-size: 10px; }
.icon-btn { background: none; border: 0; color: var(--muted); width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); font-size: 17px; position: relative; }
.icon-btn:hover { color: var(--ink); background: var(--paper-2); }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-bg); }
.icon-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-family: var(--mono); font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; padding: 3px 7px; white-space: nowrap; border-radius: var(--radius); margin-bottom: 4px; z-index: 5; }

/* ---------- Cards / KPIs ---------- */
.grid { display: grid; gap: 14px; }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; margin-top: 6px; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kv-list { display: grid; grid-template-columns: 160px 1fr; font-size: 13px; }
.kv-list div { padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv-list div:nth-child(odd) { color: var(--muted); }

/* ---------- Tables ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.search { flex: 1; max-width: 320px; display: flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 10px; }
.search input { border: 0; background: none; padding: 8px 0; outline: none; width: 100%; font: inherit; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: #f6f4ef; }
tbody tr.selected td { background: var(--accent-soft); }
td.actions { text-align: right; white-space: nowrap; width: 1%; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- Pills ---------- */
.pill { display: inline-block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; padding: 2px 7px; border-radius: var(--radius); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.off { background: var(--off-bg); color: var(--off); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.accent { background: var(--accent); color: #fff; }

/* ---------- Drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(23,24,22,.28); opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 40; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: var(--drawer-w); max-width: 100vw; background: var(--white); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .2s ease; z-index: 50; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.drawer-top { display: flex; justify-content: space-between; align-items: center; }
.drawer-kind { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.drawer-title { font-size: 21px; font-weight: 700; letter-spacing: -.035em; margin-top: 6px; }
.drawer-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.drawer-section { margin-bottom: 18px; }
.drawer-section h3 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 6px; }
.drawer .kv-list { grid-template-columns: 140px 1fr; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 8px 10px; outline: none; }
.field textarea { min-height: 120px; resize: vertical; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 2px var(--accent-soft); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.field .err { font-size: 11.5px; color: var(--bad); margin-top: 4px; }
.field.check label { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 13px; color: var(--ink); }
.field.check input { width: auto; }
.secret { font-family: var(--mono); letter-spacing: .1em; }

/* ---------- Modal (confirm only) ---------- */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 70; background: rgba(23,24,22,.35); }
.modal.open { display: flex; }
.modal-box { background: var(--white); width: 400px; max-width: 92vw; border-radius: var(--radius); border: 1px solid var(--line); padding: 20px 22px; }
.modal-box h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -.02em; }
.modal-box p { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: var(--radius); font-size: 13px; opacity: 0; transition: all .2s; z-index: 80; display: flex; gap: 8px; align-items: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast i { color: var(--accent); }

/* ---------- Versions ---------- */
.version-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.version-row .v { font-family: var(--mono); font-size: 12px; width: 34px; }
.version-row .meta { flex: 1; font-size: 12.5px; }
.version-row .meta div:last-child { color: var(--muted); font-size: 11.5px; }
pre.content { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-family: var(--sans); font-size: 12.5px; margin: 0; max-height: 260px; overflow: auto; }

/* ---------- Recording player ---------- */
.player { display: flex; align-items: center; gap: 12px; background: var(--graphite); color: #e9e6df; border-radius: var(--radius); padding: 12px 14px; }
.player-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.player-btn:hover { background: var(--accent-dark); }
.player-main { flex: 1; min-width: 0; }
.player-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #b8bbb3; margin-bottom: 6px; }
.player-bar { height: 5px; background: rgba(255,255,255,.14); border-radius: 3px; cursor: pointer; }
.player-bar:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.player-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.player-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: #8a8d84; margin-top: 6px; }
.player .icon-btn { color: #b8bbb3; }
.player .icon-btn:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ---------- Wizard ---------- */
.steps { display: flex; gap: 0; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step { flex: 1; padding: 12px 14px; border-right: 1px solid var(--line); font-size: 12.5px; }
.step:last-child { border-right: 0; }
.step .n { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.step.active { background: var(--white); box-shadow: inset 0 -2px 0 var(--accent); }
.step.done .n { color: var(--ok); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.check-list i { font-size: 18px; }
.check-list .ok i { color: var(--ok); }
.check-list .pending i { color: var(--muted-2); }
.check-list .bad i { color: var(--bad); }

@media (max-width: 1100px) { .grid.k4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid.c3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .app { grid-template-columns: 1fr; } .nav { position: static; height: auto; } .main { padding: 18px 16px; } .grid.c2 { grid-template-columns: 1fr; } }

/* ---------- Public pages: landing, sign-in, register ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.public-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 32px; background: var(--graphite); color: #d8d6cf; }
.public-top .nav-logo { padding: 0; }
.public-top nav { display: flex; gap: 8px; flex-wrap: wrap; }
.public-top .btn.ghost { color: #d8d6cf; border-color: rgba(255,255,255,.25); }
.public-main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 32px 60px; }
.hero h1 { font-size: 40px; letter-spacing: -.04em; line-height: 1.1; margin: 10px 0 12px; max-width: 760px; }
.hero p { font-size: 16px; color: var(--muted); max-width: 680px; margin: 0; }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); }
.section-title { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 38px 0 12px; }
.flow { counter-reset: flow; }
.flow .card { position: relative; padding-top: 34px; }
.flow .card::before { counter-increment: flow; content: counter(flow, decimal-leading-zero); position: absolute; top: 12px; left: 18px; font-family: var(--mono); font-size: 11px; color: var(--accent-dark); }
.flow h3, .portal h3 { margin: 0 0 6px; font-size: 15px; }
.flow p, .portal p { margin: 0; color: var(--muted); font-size: 13px; }
.portal { display: flex; flex-direction: column; gap: 12px; }
.portal ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.portal .btn { align-self: flex-start; margin-top: auto; }
.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; font-size: 13px; color: var(--ink); margin-top: 28px; }
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 26px 22px; }
.auth-card h1 { font-size: 24px; letter-spacing: -.03em; margin: 6px 0 4px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.auth-card .btn { width: 100%; justify-content: center; padding: 10px 13px; }
.auth-card .alt { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-card .alt a { color: var(--accent-dark); text-decoration: underline; }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 8px 10px; font-size: 13px; border-radius: var(--radius); margin-bottom: 14px; }
.form-error:empty { display: none; }
@media (max-width: 760px) { .public-top { padding: 14px 16px; } .public-main { padding: 28px 16px 48px; } .hero h1 { font-size: 30px; } }
