/* MeDaily — professional, clean, simple. Hard edges everywhere (no rounded buttons or cards). Amber + charcoal from the logo. */
:root {
  --amber: #FEB403;  --amber-dark: #E09D00;  --amber-soft: #FFF3D1;
  --ink: #202122;    --ink-2: #3A3B3D;
  --muted: #6B6E73;
  --line: #E2E2DE;   --line-2: #CFCFCA;
  --bg: #F5F5F2;     --card: #FFFFFF;
  --ok: #1E7F45;     --ok-soft: #E3F3E8;
  --bad: #C2271D;    --bad-soft: #FBE6E4;
  --info: #2F5FB8;   --info-soft: #E5ECF9;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
code { font: 13px ui-monospace, Menlo, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); padding: 1px 6px; word-break: break-all; }
.icon { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.ok-text { color: var(--ok); font-weight: 600; }
.bad-text { color: var(--bad); font-weight: 600; }
.label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hint { font-size: 13px; color: var(--muted); }
.hint a { color: var(--ink); font-weight: 600; }
.mt { margin-top: 14px; }
.mt-s { margin-top: 8px; }
[hidden] { display: none !important; }

/* ---------- Top bar + tabs ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 64px; }
.brand img { height: 30px; width: auto; }
.tabs { display: flex; height: 100%; gap: 4px; }
.tab { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 100%; text-decoration: none; font-weight: 600; color: var(--muted);
       border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--amber); }
.tab .badge { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; line-height: 18px; text-align: center; background: var(--bad); color: #fff; font-weight: 700; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.whoami { font-size: 13px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--line-2); padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); }
.logout-btn:hover { border-color: var(--ink); }

@media (max-width: 760px) {
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .topbar-in { height: 56px; gap: 12px; padding: 0 14px; }
  .brand img { height: 26px; }
  .whoami { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
          padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
  .tab { flex-direction: column; justify-content: center; gap: 3px; padding: 0; font-size: 11px; border-bottom: 0; border-top: 3px solid transparent; }
  .tab.is-active { border-top-color: var(--amber); border-bottom: 0; }
}

/* ---------- Page ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; display: grid; gap: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-main { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .grid-2, .grid-main { grid-template-columns: 1fr; } .page { padding: 16px 14px 32px; gap: 14px; } }

.card { background: var(--card); border: 1px solid var(--line); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head .label { color: var(--muted); }
.card.accent { border-top: 4px solid var(--amber); }
.card.attention { border-left: 4px solid var(--bad); }
.section-title { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 12px; }
.section-title .label { font-size: 11px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; font: inherit; font-weight: 700;
       font-size: 14px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #000; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-amber { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn-amber:hover { background: var(--amber-dark); border-color: var(--amber-dark); }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { background: var(--bg); border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #9E1D15; }
.btn-small { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-xl { min-height: 48px; font-size: 15px; padding: 0 22px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0 4px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; text-decoration: underline; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field-label { font-weight: 600; font-size: 13px; }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 11px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); }
.input:focus, select:focus, textarea:focus { outline: 2px solid var(--amber); outline-offset: -1px; border-color: var(--ink); }
select { font: inherit; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line-2); background: #fff; }
.input[type=time] { width: auto; }
.pw-wrap { display: flex; gap: 6px; align-items: center; }
.field-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.field-row:first-child { border-top: 0; padding-top: 0; }
.field-row b { display: block; font-size: 14px; }
.field-row small { display: block; font-size: 13px; color: var(--muted); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .input { width: auto; flex: 1; min-width: 160px; }

/* Square switch */
.switch { position: relative; display: inline-block; vertical-align: middle; flex: none; width: 46px; height: 26px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line-2); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--amber); }
.switch input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Day picker: square chips */
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days label { position: relative; }
.days input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.days span { display: grid; place-items: center; width: 48px; height: 38px; border: 1px solid var(--line-2); font-weight: 700; font-size: 13px; background: #fff; }
.days input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.days input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 1px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches label { position: relative; }
.swatches input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatches span { display: block; width: 34px; height: 34px; border: 2px solid #fff; outline: 1px solid var(--line-2); }
.swatches input:checked + span { outline: 3px solid var(--ink); }
.radio-list { display: grid; gap: 6px; }
.radio-list label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); cursor: pointer; }
.radio-list label:has(input:checked) { border-color: var(--ink); background: var(--amber-soft); }
.radio-list input { margin-top: 3px; accent-color: var(--ink); }
.radio-list small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- Pills, banners, toasts ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; font-size: 12px; font-weight: 700; letter-spacing: .02em; border: 1px solid; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; background: currentColor; }
.pill-ok { color: var(--ok); background: var(--ok-soft); border-color: #B5DFC3; }
.pill-bad { color: var(--bad); background: var(--bad-soft); border-color: #F1BDB8; }
.pill-info { color: var(--info); background: var(--info-soft); border-color: #BFCFF0; }
.pill-muted { color: var(--muted); background: var(--bg); border-color: var(--line-2); }
.pill-amber { color: var(--ink); background: var(--amber-soft); border-color: #F5D77D; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--amber-soft);
          border: 1px solid #F5D77D; border-left: 4px solid var(--amber); font-weight: 600; font-size: 14px; }
.banner.bad { background: var(--bad-soft); border-color: #F1BDB8; border-left-color: var(--bad); }
.toasts { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(520px, calc(100% - 28px)); }
.toast { padding: 12px 16px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; border-left: 5px solid var(--amber); box-shadow: 0 8px 24px rgba(0,0,0,.18); transition: opacity .4s, transform .4s; }
.toast-error { border-left-color: var(--bad); }
.toast-info { border-left-color: #9AA0A6; }
.toast.is-gone { opacity: 0; transform: translateY(-8px); }

/* ---------- Main tab ---------- */
.power { display: flex; align-items: center; gap: 18px; width: 100%; padding: 18px; font: inherit; text-align: left; cursor: pointer;
         background: var(--ink); color: #fff; border: 0; }
.power .knob { display: grid; place-items: center; width: 64px; height: 64px; background: var(--amber); color: var(--ink); flex: none; }
.power b { display: block; font-size: 18px; }
.power small { display: block; color: #C9CACC; font-size: 13px; margin-top: 2px; }
.power .state { margin-left: auto; font-size: 22px; font-weight: 800; letter-spacing: .08em; color: var(--amber); }
.power.is-off { background: var(--card); color: var(--ink); border: 1px solid var(--line-2); }
.power.is-off .knob { background: var(--bg); color: var(--muted); border: 1px solid var(--line-2); }
.power.is-off small { color: var(--muted); }
.power.is-off .state { color: var(--muted); }
.status { display: flex; gap: 14px; align-items: flex-start; }
.status-mark { width: 12px; align-self: stretch; flex: none; background: var(--line-2); }
.status-active .status-mark { background: var(--ok); }
.status-setup .status-mark, .status-held .status-mark { background: var(--amber); }
.status-paused .status-mark { background: var(--muted); }
.todo-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.todo-list a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.todo-list a:hover { border-color: var(--ink); }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.issues li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--bad-soft); border-left: 3px solid var(--bad); font-size: 14px; }
.issues li .icon { color: var(--bad); margin-top: 1px; }
.last-print { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; }
.page-thumb { display: block; border: 1px solid var(--line-2); background: #fff; box-shadow: 0 1px 0 var(--line); }
.page-thumb img { width: 100%; height: auto; }
.page-thumb-empty { display: grid; place-items: center; aspect-ratio: 8.5 / 11; color: var(--muted); background: var(--bg); }
@media (max-width: 500px) { .last-print { grid-template-columns: 110px 1fr; } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Lists + tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item b { display: block; }
.list-item .muted { font-size: 13px; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td small { display: block; color: var(--muted); font-size: 12px; }
.table tr:last-child td { border-bottom: 0; }
.table.log td { font: 12.5px ui-monospace, Menlo, Consolas, monospace; padding: 5px 8px; }
.lvl-error { color: var(--bad); font-weight: 700; }
.lvl-warn { color: #A86A00; font-weight: 700; }
.thumb-mini { width: 46px; border: 1px solid var(--line-2); background: #fff; }

/* ---------- Printer + connector cards ---------- */
.device { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); }
.device + .device { margin-top: 10px; }
.device.is-default { border-color: var(--ink); border-left: 4px solid var(--amber); }
.device-icon { display: grid; place-items: center; width: 44px; height: 44px; background: var(--bg); border: 1px solid var(--line); flex: none; }
.device h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.connectors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 760px) { .connectors { grid-template-columns: 1fr; } }
.connector { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); padding: 18px; background: #fff; }
.connector-head { display: flex; gap: 12px; align-items: center; }
.connector-logo { display: grid; place-items: center; width: 40px; height: 40px; font-weight: 800; font-size: 18px; color: #fff; flex: none; }
.logo-google { background: #4285F4; } .logo-outlook { background: #0F6CBD; } .logo-apple { background: #1D1D1F; } .logo-ics { background: #6B6E73; }
.logo-skylight { background: #8A9BA8; } .logo-demo { background: var(--amber); color: var(--ink); }
.connector.is-soon { background: var(--bg); color: var(--muted); border-style: dashed; }
.account { border-top: 1px solid var(--line); padding-top: 12px; }
.cal-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 2px; }
.cal-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.cal-swatch { width: 12px; height: 12px; flex: none; background: var(--muted); }
.cal-list form { margin-left: auto; }

/* ---------- Template library ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tpl { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.tpl input { position: absolute; opacity: 0; }
.tpl-img { background: var(--bg); border-bottom: 1px solid var(--line); aspect-ratio: 8.5 / 11; overflow: hidden; }
.tpl-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tpl-body { padding: 10px 12px; }
.tpl-body b { display: block; font-size: 14px; }
.tpl-body small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.tpl:has(input:checked) { border: 2px solid var(--ink); box-shadow: inset 0 -4px 0 var(--amber); }
.tpl:has(input:checked)::after { content: "Selected"; position: absolute; top: 8px; left: 8px; background: var(--ink); color: var(--amber); font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 3px 7px; text-transform: uppercase; }
.tpl:has(input:focus-visible) { outline: 2px solid var(--amber); }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--card); }
.auth-art { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; gap: 32px; }
.auth-art::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--amber); }
.auth-art-logo { height: 44px; width: auto; align-self: flex-start; }
.auth-art-body { flex: 1; display: grid; grid-template-columns: 1fr 260px; gap: 40px; align-items: center; position: relative; z-index: 1; }
.auth-art h2 { font-size: 46px; font-weight: 800; line-height: 1.05; letter-spacing: -.025em; }
.auth-art h2 em { font-style: normal; color: var(--amber); }
.auth-art p { color: #C9CACC; font-size: 16px; margin-top: 18px; max-width: 420px; }
.auth-art ul { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; color: #E6E6E6; font-size: 15px; }
.auth-art li { display: flex; gap: 12px; align-items: center; }
.auth-art li::before { content: ""; width: 10px; height: 10px; background: var(--amber); flex: none; }
.paper-stack { position: relative; width: 260px; aspect-ratio: 8.5 / 11; }
.sheet { position: absolute; width: 100%; height: auto; background: #fff; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.sheet-back { transform: translate(26px, -22px) rotate(4deg); opacity: .55; }
.sheet-front { transform: rotate(-2deg); }
.paper-tag { position: absolute; left: -18px; bottom: 26px; background: var(--amber); color: var(--ink); font-weight: 800; font-size: 12px; letter-spacing: .06em;
             text-transform: uppercase; padding: 7px 11px; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.auth-art .powered { display: flex; align-items: center; gap: 10px; color: #9A9B9E; font-size: 13px; position: relative; z-index: 1; }
.auth-art .powered img { height: 22px; background: #fff; padding: 3px 6px; }
.auth { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: min(420px, 100%); }
.auth-card .card { padding: 30px; border-top: 4px solid var(--amber); }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 20px; }
.auth-logo-m { display: none; height: 44px; width: auto; margin: 0 auto 24px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--ink); font-weight: 700; }
@media (max-width: 1100px) { .auth-art-body { grid-template-columns: 1fr; } .paper-stack { display: none; } }
@media (max-width: 860px) {
  .auth-body { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth { align-items: start; padding-top: 48px; }
  .auth-logo-m { display: block; }
}

/* ---------- Error page ---------- */
.error-body { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 24px; }
.error-card { width: min(460px, 100%); background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--amber); padding: 32px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.error-logo { height: 40px; width: auto; margin-bottom: 8px; }
.error-card p { color: var(--muted); }

/* ---------- Main tab hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 26px 28px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--amber); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; background: url("medaily-mark.png") center / contain no-repeat; opacity: .07; }
.hero-date { display: grid; place-items: center; width: 84px; height: 84px; background: var(--amber); color: var(--ink); flex: none; line-height: 1; }
.hero-date small { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-date b { font-size: 38px; font-weight: 800; letter-spacing: -.03em; }
.hero h1 { font-size: 28px; }
.hero p { color: #C9CACC; margin-top: 4px; }
.hero-stats { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stat { min-width: 132px; padding: 10px 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); }
.hero-stat span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #9A9B9E; }
.hero-stat b { display: block; font-size: 16px; margin-top: 3px; white-space: nowrap; }
.hero-stat b.ok { color: #7FD69E; } .hero-stat b.warn { color: var(--amber); }
@media (max-width: 760px) { .hero { padding: 20px; } .hero-stats { margin-left: 0; width: 100%; } .hero-stat { flex: 1; min-width: 0; } .hero-date { width: 64px; height: 64px; } .hero-date b { font-size: 28px; } }
.page-head h1 { position: relative; padding-top: 12px; }
.page-head h1::before { content: ""; position: absolute; top: 0; left: 0; width: 36px; height: 4px; background: var(--amber); }

/* ---------- Footer, modal ---------- */
.footer { max-width: 1080px; margin: 0 auto; padding: 8px 20px 28px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12.5px; }
.footer .powered { display: inline-flex; align-items: center; gap: 6px; }
.footer .powered img { height: 14px; }
.modal { border: 0; padding: 0; width: min(440px, calc(100% - 28px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); border-top: 4px solid var(--amber); }
.modal::backdrop { background: rgba(20, 21, 22, .55); }
.modal form { padding: 22px; display: grid; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---------- Admin ---------- */
.admin-top { background: var(--ink); color: #fff; }
.admin-top .topbar-in { height: 58px; }
.admin-top h1 { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); padding-left: 16px; border-left: 1px solid #45474A; }
.admin-top .brand img { height: 26px; }
.admin-top .logout-btn { color: #fff; border-color: #55575A; }
.admin-top .logout-btn:hover { border-color: #fff; }
.admin-nav { background: var(--card); border-bottom: 1px solid var(--line); }
.admin-nav .topbar-in { height: 48px; gap: 2px; overflow-x: auto; }
.admin-nav a { display: flex; align-items: center; gap: 7px; height: 100%; padding: 0 14px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted);
               border-bottom: 3px solid transparent; white-space: nowrap; }
.admin-nav a.is-active { color: var(--ink); border-bottom-color: var(--amber); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); padding: 14px 16px; border-top: 3px solid var(--ink); }
.stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.amber { border-top-color: var(--amber); }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 170px; padding-top: 10px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bar i { display: block; background: var(--ink); min-height: 1px; }
.bar i.fail { background: var(--bad); }
.bar span { font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; white-space: nowrap; overflow: hidden; }
.bar em { font-style: normal; font-size: 11px; font-weight: 700; text-align: center; }
.filter-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.filter-row a { padding: 4px 10px; border: 1px solid var(--line-2); text-decoration: none; }
.filter-row a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.user-tools summary { cursor: pointer; font-weight: 700; font-size: 13px; list-style: none; padding: 4px 10px; border: 1px solid var(--line-2); display: inline-block; }
.user-tools[open] summary { background: var(--ink); color: #fff; }
.user-tools > div { display: grid; gap: 6px; margin-top: 8px; min-width: 180px; }
.temp-pw { display: inline-block; margin-top: 6px; padding: 4px 8px; background: var(--amber-soft); border: 1px solid #F5D77D; font: 13px ui-monospace, Menlo, monospace; font-weight: 700; }
.admin-tpl { display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.admin-tpl:first-child { border-top: 0; padding-top: 0; }
.admin-tpl.is-archived { opacity: .6; }
@media (max-width: 700px) { .admin-tpl { grid-template-columns: 80px 1fr; } .admin-tpl > .btn-row { grid-column: 1 / -1; } }
pre.json { font: 12px ui-monospace, Menlo, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); padding: 12px; overflow: auto; max-height: 320px; margin: 0; }
