/* JAMS Activation – interface styles. Typeface: Lato (self-hosted, SIL OFL – see fonts/OFL.txt). Icons: Lucide (ISC). Flags: flag-icons (MIT). */

@font-face { font-family: "Lato"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/lato-latin-300-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/lato-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/lato-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/lato-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 900; font-display: swap; src: url("fonts/lato-latin-900-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/lato-latin-ext-300-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/lato-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/lato-latin-ext-400-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/lato-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 900; font-display: swap; src: url("fonts/lato-latin-ext-900-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ==========================================================================
   Theme: classic portal – dark sidebar, white panels, compact tables.
   Works from 320px phones to wide desktops; no external resources.
   ========================================================================== */
:root {
    --font: "Lato", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;
    --bg: #f6f6f6;
    --panel: #ffffff;
    --panel-head: #ffffff;
    --ink: #000000;
    --ink-2: #333333;
    --muted: #6b6b6b;
    --line: #e8e8e8;
    --line-2: #cbcbcb;
    --side: #000000;
    --side-ink: #c4c4c4;
    --side-hover: #1f1f1f;
    --side-active: #ffffff;
    --brand: #000000;
    --brand-dark: #333333;
    --brand-soft: #f3f3f3;
    --ok: #17803d;   --ok-bg: #e3f4e8;
    --warn: #8a5800; --warn-bg: #fff2d1;
    --bad: #b42318;  --bad-bg: #fde7e5;
    --info: #36519b; --info-bg: #e9eefb;
    --radius: 8px;
    --side-w: 232px;
    --top-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: #eef1f4; padding: .1em .35em; border-radius: 3px; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.upper { text-transform: uppercase; }
.dim { opacity: .55; }
[hidden] { display: none !important; }

/* ---------- Icons, flags, chips ---------- */
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.flag { width: 20px; height: 15px; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); object-fit: cover; }
.flag-name { white-space: nowrap; }
.marker, .feature {
    display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: .74rem; font-weight: 700;
    line-height: 1.5; white-space: nowrap; border: 1px solid transparent; vertical-align: middle;
}
.marker-blue   { background: #e5efff; color: #1d4ed8; border-color: #c3d7fb; }
.marker-green  { background: #e2f5e8; color: #15703a; border-color: #bfe5cb; }
.marker-amber  { background: #fff1d0; color: #8a5600; border-color: #f2d699; }
.marker-red    { background: #fde4e2; color: #b42318; border-color: #f6c2bd; }
.marker-purple { background: #f1e8fd; color: #6b2fb3; border-color: #dcc8f7; }
.marker-grey   { background: #eceff2; color: #4b5563; border-color: #d4d9df; }
.feature { font-family: var(--mono); font-weight: 600; background: #eef2f6; color: #334155; border-color: #d6dde5; letter-spacing: .02em; }
.role-pill { font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; background: #e6ebf1; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.role-admin { background: #e8f0fd; color: #2459b5; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
    position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: var(--side-w);
    background: var(--side); color: var(--side-ink);
    display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.brand { display: flex; align-items: center; gap: .6rem; height: var(--top-h); padding: 0 1rem; color: #fff; font-weight: 900; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,.08); flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 5px; background: var(--brand); color: #fff; font-weight: 900; }
.brand-mark.big { width: 52px; height: 52px; border-radius: 8px; font-size: 1.6rem; }
.sidenav { padding: .5rem 0 1rem; flex: 1; }
.nav-heading { margin: 1rem 1rem .35rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #7d8a9c; }
.sidenav a {
    display: flex; align-items: center; gap: .7rem; padding: .6rem 1rem; margin: 1px .5rem; border-radius: var(--radius);
    color: var(--side-ink); font-weight: 700; font-size: .92rem; min-height: 40px;
}
.sidenav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.sidenav a.active { background: var(--side-active); color: #fff; }
.sidenav .icon { width: 18px; height: 18px; opacity: .9; }
.sidebar-foot { padding: .8rem 1rem; font-size: .75rem; color: #6f7c8e; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-backdrop { display: none; }

.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--top-h);
    display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem;
    background: #fff; border-bottom: 1px solid var(--line);
}
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 40px; height: 40px; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.menu-toggle .icon { width: 20px; height: 20px; }
.topsearch { position: relative; flex: 1; max-width: 460px; margin: 0; }
.topsearch .icon { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topsearch input { margin: 0 !important; padding-left: 2.1rem !important; background: var(--panel-head) !important; }
.usermenu { margin-left: auto; display: flex; align-items: center; gap: .9rem; font-size: .9rem; }
.usermenu form { margin: 0; }
.who { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-2); }
.top-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-2); font-weight: 700; padding: .4rem .2rem; }
.top-link:hover { color: var(--brand); text-decoration: none; }
.content { flex: 1; width: 100%; max-width: 1320px; padding: 1.25rem 1.5rem 3rem; }
.content-plain { max-width: 760px; margin: 0 auto; padding-top: 3rem; }

#loading-bar { position: fixed; z-index: 100; top: 0; left: 0; height: 3px; width: 0; background: var(--brand); opacity: 0; transition: width .3s ease, opacity .3s ease; pointer-events: none; }
#loading-bar.on { opacity: 1; width: 70%; transition: width 8s cubic-bezier(.1,.6,.2,1); }
#loading-bar.done { opacity: 0; width: 100%; transition: width .15s ease, opacity .4s ease .15s; }
body.loading .content { opacity: .6; transition: opacity .2s; }

/* ---------- Page header ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.page-head p { margin: 0; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .2rem !important; }

/* ---------- Panels ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1rem; }
.card.flush { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    margin: -1rem -1.15rem 1rem; padding: .65rem 1.15rem; background: var(--panel-head); border-bottom: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
}
.card.flush > .card-head { margin: 0; }
.card-head h2 { margin: 0; font-size: .95rem; display: flex; align-items: center; gap: .45rem; }
.card-head .icon { color: var(--muted); }
.card > h2:first-child:not(.pad) { margin: -1rem -1.15rem 1rem; padding: .65rem 1.15rem; background: var(--panel-head); border-bottom: 1px solid var(--line); font-size: .95rem; }
.card.flush > h2.pad { margin: 0; padding: .65rem 1.15rem; background: var(--panel-head); border-bottom: 1px solid var(--line); font-size: .95rem; }
.card .pad { padding-left: 1.15rem; padding-right: 1.15rem; }
.card.flush > p.pad { padding-top: .75rem; }
.empty { padding: 1.25rem 1.15rem; color: var(--muted); margin: 0; }
.center-card { text-align: center; max-width: 520px; margin: 2rem auto; }
.error-code { font-size: 3rem; font-weight: 900; color: var(--line-2); margin: 0; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.two-col.wide-left { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }

/* ---------- Dashboard ---------- */
.actions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.action-tile {
    display: flex; gap: .8rem; align-items: flex-start; padding: 1rem; border-radius: var(--radius);
    background: var(--panel); border: 1px solid var(--line); color: var(--ink);
}
.action-tile:hover { text-decoration: none; border-color: var(--brand); background: #fbfcff; }
.action-tile > .icon { width: 34px; height: 34px; padding: 7px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); }
.action-tile.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.action-tile.primary > .icon { background: rgba(255,255,255,.18); color: #fff; }
.action-tile.primary .tile-text { color: #dbe6fb; }
.tile-title { display: block; font-weight: 900; font-size: 1rem; }
.tile-text { display: block; color: var(--muted); font-size: .86rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; }
.stat.s-ok { border-left-color: var(--ok); } .stat.s-warn { border-left-color: #d99a06; } .stat.s-info { border-left-color: #7c3aed; }
.stat-num { font-size: 1.6rem; font-weight: 900; line-height: 1.15; }
.stat-label { color: var(--muted); font-size: .82rem; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .55rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--panel-head); white-space: nowrap; }
.card:not(.flush) .table th, .card:not(.flush) .table td { padding-left: .25rem; padding-right: .5rem; }
.card:not(.flush) .table th { background: none; }
.table tbody tr:nth-child(even) { background: #fafbfc; }
.table tbody tr:hover { background: #f2f6fd; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding-top: .35rem; padding-bottom: .35rem; }
.table .right { text-align: right; }
.table td .marker, .table td .feature { margin: 1px 0; }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }

/* ---------- Badges, callouts, flashes ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.callout { padding: .7rem .9rem; border-radius: var(--radius); margin: .75rem 0; border: 1px solid; }
.callout-info { background: var(--info-bg); border-color: #c8d3f1; }
.callout-warn { background: var(--warn-bg); border-color: #efd28f; }
.callout-bad { background: var(--bad-bg); border-color: #f3c0ba; }
.flash { display: flex; gap: .55rem; align-items: flex-start; padding: .65rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; font-weight: 700; border: 1px solid; }
.flash .icon { margin-top: .15em; }
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: #bfe3c9; }
.flash-error { background: var(--bad-bg); color: var(--bad); border-color: #f3c0ba; }
.flash-info { background: var(--info-bg); color: var(--info); border-color: #c8d3f1; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=url], input[type=search], input[type=tel], select, textarea {
    display: block; width: 100%; margin-top: .3rem; padding: .5rem .65rem; min-height: 38px;
    font: inherit; font-weight: 400; color: var(--ink);
    background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius);
    -webkit-appearance: none; appearance: none;
}
select {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .55rem center; background-size: 16px;
}
textarea { resize: vertical; min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b9cff7; outline-offset: 0; border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); }
.hint { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.req { color: var(--bad); }
label.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: .2rem; flex: none; }
label.narrow { max-width: 220px; }
.narrow-form { max-width: 480px; }
fieldset { border: 0; padding: 0; margin: 0 0 .5rem; min-width: 0; }
legend { font-weight: 700; font-size: .95rem; margin-bottom: .6rem; padding: 0; display: flex; align-items: center; gap: .4rem; }
.form-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 170px; margin: 0; flex: 0 1 auto; }
.filters input[type=search] { min-width: 230px; }
.filters .spacer { flex: 1; }
.radio-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.radio-card { position: relative; display: block; margin: 0; border: 1px solid var(--line-2); border-radius: var(--radius); padding: .75rem .9rem .75rem 2.6rem; cursor: pointer; font-weight: 400; background: #fff; }
.radio-card input { position: absolute; left: .8rem; top: .9rem; }
.radio-card.is-checked, .radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.rc-title { display: block; font-weight: 700; }
.rc-text { display: block; font-size: .8rem; color: var(--ink-2); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .4rem .9rem; margin-bottom: .75rem; }
.check-grid label { margin: 0; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.check-grid label:hover { border-color: var(--line-2); }
.check-grid .hint { margin: 0; }
.marker-picker { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 .5rem; }
.marker-picker label { margin: 0; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; font-weight: 400; }
.save-state { font-size: .8rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .45rem .85rem; min-height: 36px; border-radius: var(--radius); border: 1px solid var(--line-2);
    background: #fff; color: var(--ink); font: inherit; font-weight: 700; font-size: .88rem;
    cursor: pointer; text-decoration: none; white-space: nowrap; touch-action: manipulation;
}
.btn:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; color: #fff; }
.btn-ghost { background: transparent; }
.btn-ghost.danger { color: var(--bad); }
.btn-ghost.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn-small { padding: .25rem .55rem; min-height: 30px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn .icon { width: 16px; height: 16px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.inline { display: inline; }
.copied { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; }

/* ---------- Licence page ---------- */
.keycard .keyline { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.bigkey { font-size: 1.45rem; font-weight: 700; letter-spacing: .05em; -webkit-user-select: all; user-select: all; overflow-wrap: anywhere; }
.message-box { margin-top: .9rem; }
details > summary { cursor: pointer; font-weight: 700; color: var(--brand); margin-bottom: .5rem; list-style-position: inside; }
.danger-zone { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.danger-zone > summary { color: var(--bad); }
.message-box textarea { font-family: var(--font); margin-bottom: .5rem; }
.codebox { font-family: var(--mono); font-size: .8rem; word-break: break-all; margin: .5rem 0; background: #f8f9fb; }
.details { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: .4rem .9rem; margin: 0 0 1rem; }
.details dt { color: var(--muted); font-size: .85rem; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: .25rem 1.15rem .75rem; }
.timeline li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }

/* ---------- Wizard & lists ---------- */
.steps { display: flex; gap: .4rem; margin-bottom: .4rem !important; flex-wrap: wrap; }
.step { font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 3px; background: #e1e6ec; color: var(--muted); }
.step.on { background: var(--brand); color: #fff; }
.step.done { background: var(--ok-bg); color: var(--ok); }
.pick-list { list-style: none; margin: 0; padding: 0; }
.pick-list li a { display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .45rem; color: var(--ink); }
.pick-list li a:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.pick-main { flex: 1; min-width: 0; }
.pick-main strong { display: block; }
.pick-go { color: var(--brand); font-weight: 700; white-space: nowrap; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: .4rem 0 .4rem 1.7rem; position: relative; }
.checklist li::before { position: absolute; left: 0; top: .4rem; font-weight: 900; }
.checklist li.ok::before { content: "✓"; color: var(--ok); }
.checklist li.bad::before { content: "✕"; color: var(--bad); }
.howto { padding-left: 1.2rem; }
.howto li { margin-bottom: .5rem; }
.pagination { display: flex; gap: 1rem; justify-content: center; align-items: center; color: var(--muted); margin: .5rem 0 1rem; }
.login-wrap { max-width: 400px; margin: 0 auto; }
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand h1 { margin: .6rem 0 .1rem; }
.inline-edit { margin: 0; }
.inline-edit .grid-3 { align-items: end; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
    body.menu-open .sidebar { transform: none; box-shadow: 4px 0 24px rgba(0,0,0,.25); }
    body.menu-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15, 23, 42, .45); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .two-col, .two-col.wide-left, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .who-name, .role-pill, .hide-sm { display: none; }
    .content { padding: 1rem .85rem 2.5rem; }
}
@media (max-width: 640px) {
    body { font-size: 15px; }
    /* 16px inputs stop iOS Safari zooming in on focus */
    input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
    input[type=url], input[type=search], input[type=tel], select, textarea { font-size: 16px; }
    .actions-grid, .radio-cards { grid-template-columns: minmax(0, 1fr); }
    .filters input, .filters select, .filters input[type=search] { min-width: 0; flex: 1 1 100%; }
    .filters .btn { flex: 1 1 auto; }
    .topbar { gap: .5rem; padding: 0 .6rem; }
    .details { grid-template-columns: minmax(0, 1fr); gap: 0 0; }
    .details dt { margin-top: .5rem; }
    .bigkey { font-size: 1.15rem; }
    .page-head { align-items: stretch; }
    .head-actions .btn { flex: 1 1 auto; }
    .table th, .table td { padding: .5rem .6rem; }
    .btn { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
    .sidebar, .topbar, .head-actions, .filters, .row-actions, .danger-zone, .btn { display: none !important; }
    .main { margin: 0; }
    .card { border: 0; }
}

/* ==========================================================================
   Monochrome layer (Uber-style): black & white, bold type, filled inputs,
   pill navigation. Status colours are kept only where they carry meaning.
   ========================================================================== */
body { letter-spacing: .005em; }
h1 { font-size: 1.85rem; font-weight: 900; letter-spacing: -.02em; }
h2 { font-weight: 900; }
a { color: #000; text-decoration: underline; text-decoration-color: rgba(0,0,0,.25); text-underline-offset: 2px; }
a:hover { text-decoration-color: #000; }
.sidenav a, .brand, .btn, .action-tile, .pick-list a, .top-link, .table a.mono, .step { text-decoration: none; }
.table td a { text-decoration: none; font-weight: 700; }
.table td a:hover { text-decoration: underline; }

/* Sidebar: black, with a white pill for the current page */
.brand { font-size: 1.15rem; letter-spacing: -.01em; border-bottom-color: #1f1f1f; }
.brand-mark { background: #fff; color: #000; border-radius: 6px; }
.brand-mark.big { background: #000; color: #fff; }
.nav-heading { color: #8a8a8a; }
.sidenav a { border-radius: 999px; margin: 2px .6rem; padding: .6rem 1rem; }
.sidenav a.active { background: #fff; color: #000; }
.sidenav a.active .icon { opacity: 1; }
.sidebar-foot { color: #777; border-top-color: #1f1f1f; }

/* Top bar */
.topbar { border-bottom: 1px solid var(--line); }
.topsearch input { background: #f3f3f3 !important; border-color: transparent !important; border-radius: 999px !important; min-height: 42px; }
.topsearch input:focus { background: #fff !important; border-color: #000 !important; outline: none; }
.role-pill { background: #f3f3f3; color: #000; border-radius: 999px; }
.role-admin { background: #000; color: #fff; }
.menu-toggle { border-radius: 999px; }
#loading-bar { background: #000; }

/* Panels */
.card { border-color: var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card-head, .card > h2:first-child:not(.pad), .card.flush > h2.pad { background: #fff; border-bottom-color: var(--line); border-radius: 12px 12px 0 0; padding-top: .85rem; padding-bottom: .85rem; }
.card-head .icon { color: #000; }
.table th { background: #fff; color: #6b6b6b; letter-spacing: .04em; border-bottom: 2px solid #000; }
.table tbody tr:nth-child(even) { background: #fff; }
.table tbody tr:hover { background: #f6f6f6; }

/* Inputs: soft grey fill, black outline on focus */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=url], input[type=search], input[type=tel], select, textarea {
    background-color: #f3f3f3; border: 2px solid transparent; border-radius: 8px; min-height: 44px; padding: .55rem .75rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #000; background-color: #fff; }
input[type=checkbox], input[type=radio] { accent-color: #000; }
.radio-card { border: 2px solid #e8e8e8; border-radius: 10px; }
.radio-card.is-checked, .radio-card:has(input:checked) { border-color: #000; background: #fff; box-shadow: none; }
.check-grid label { border-radius: 8px; }

/* Buttons: black primary, white secondary, pill-ish */
.btn { border-radius: 8px; border: 2px solid #e2e2e2; min-height: 40px; padding: .45rem 1rem; color: #000; }
.btn:hover { border-color: #000; color: #000; background: #f6f6f6; }
.btn-primary { background: #000; border-color: #000; color: #fff; }
.btn-primary:hover { background: #333; border-color: #333; color: #fff; }
.btn-small { min-height: 32px; padding: .2rem .65rem; border-width: 1px; }
.btn-danger { border-color: var(--bad); }

/* Dashboard */
.action-tile { border-radius: 12px; border: 1px solid var(--line); }
.action-tile:hover { border-color: #000; background: #fff; }
.action-tile > .icon { background: #f3f3f3; color: #000; border-radius: 999px; }
.action-tile.primary { background: #000; border-color: #000; }
.action-tile.primary > .icon { background: #fff; color: #000; }
.action-tile.primary .tile-text { color: #bdbdbd; }
.stat, .stat.s-ok, .stat.s-warn, .stat.s-info { border: 1px solid var(--line); border-radius: 12px; }
.stat-num { font-size: 2rem; }

/* Chips and status */
.badge { border-radius: 999px; padding: 2px 10px; }
.marker, .feature { border-radius: 999px; padding: 1px 9px; }
.feature { background: #000; color: #fff; border-color: #000; }
.step { border-radius: 999px; background: #eeeeee; }
.step.on { background: #000; }
.flash { border-radius: 10px; }
.flash-info, .callout-info { background: #f3f3f3; color: #000; border-color: #e2e2e2; }
.callout { border-radius: 10px; }
.pick-list li a { border-radius: 10px; }
.pick-list li a:hover { background: #f6f6f6; border-color: #000; }
.pick-go { color: #000; }
details > summary { color: #000; }
code { background: #f3f3f3; }
.card > .danger-zone:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.danger-zone > summary { margin-bottom: 0; }
.danger-zone[open] > summary { margin-bottom: .75rem; }
/* On phones, show the side column (details, actions) before the long lists. */
@media (max-width: 900px) { .two-col.side-first > :last-child { order: -1; } }

/* ==========================================================================
   Help & guides
   ========================================================================== */
.btn-help { border-style: dashed; }
.guide-hero {
    display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; margin-bottom: 1.5rem;
    background: #000; color: #fff; border-radius: 12px; text-decoration: none;
}
.guide-hero:hover { background: #222; text-decoration: none; }
.guide-hero > .icon { width: 40px; height: 40px; padding: 9px; background: #fff; color: #000; border-radius: 999px; }
.guide-hero-title { display: block; font-weight: 900; font-size: 1.1rem; }
.guide-hero-text { display: block; color: #bdbdbd; }
.guide-hero-go { margin-left: auto; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }
.guide-section { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.guide-card {
    display: flex; gap: .85rem; align-items: flex-start; padding: 1rem; background: #fff; color: #000;
    border: 1px solid var(--line); border-radius: 12px; text-decoration: none;
}
.guide-card:hover { border-color: #000; text-decoration: none; }
.guide-card > .icon { width: 36px; height: 36px; padding: 8px; background: #f3f3f3; border-radius: 999px; }
.guide-card-title { display: block; font-weight: 900; }
.guide-card-text { display: block; color: var(--muted); font-size: .88rem; margin: .15rem 0 .35rem; }
.guide-meta { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .8rem; align-items: center; }
.guide-meta.big { font-size: .9rem; margin-top: .35rem !important; }
.guide-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.guide-intro p:last-child { margin-bottom: 0; }
.guide-intro { font-size: 1.02rem; }
.guide-need { background: #f6f6f6; border-radius: 8px; padding: .6rem .8rem; }
.guide-steps { list-style: none; padding: 0; margin: 0; counter-reset: none; }
.guide-step { padding: 1.2rem 1.3rem; }
.guide-step-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.guide-step-head h2 { margin: 0; font-size: 1.2rem; }
.step-num {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 999px; background: #000; color: #fff; font-weight: 900; font-size: 1.05rem;
}
.guide-text { font-size: 1.02rem; line-height: 1.6; max-width: 70ch; }
.guide-tip, .guide-warn { display: flex; gap: .55rem; align-items: flex-start; padding: .65rem .85rem; border-radius: 10px; max-width: 80ch; }
.guide-tip { background: #f3f3f3; }
.guide-warn { background: #fff2d1; color: #5c3b00; }
.guide-tip .icon, .guide-warn .icon { margin-top: .15em; }
.guide-shot { display: block; margin-top: .9rem; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-width: 960px; box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.guide-shot img { display: block; width: 100%; height: auto; }
.guide-shot:hover { border-color: #000; }
.guide-done { display: flex; gap: .8rem; align-items: flex-start; background: #e3f4e8; border-color: #bfe3c9; font-size: 1.02rem; }
.guide-done > .icon { width: 28px; height: 28px; padding: 5px; background: var(--ok); color: #fff; border-radius: 999px; flex: none; }
@media (max-width: 640px) {
    .guide-hero { flex-wrap: wrap; }
    .guide-hero-go { margin-left: 0; }
    .guide-step { padding: 1rem; }
}
