:root {
    color-scheme: dark;
    --bg: #1E1E1E; --chrome: #1B1B1B; --panel: #2B2B2B; --panel-2: #232323;
    --line: rgba(255, 255, 255, .1); --dim: rgba(255, 255, 255, .7); --grey: #9E9E9E;
    --green: #00FF66; --red: #FF5252; --orange: #FFAB40; --blue: #448AFF; --sky: #40C4FF;
    --ease: .15s ease;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: #fff; font: 14px/1.5 Inter, Roboto, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
/* Fields show focus with a green border instead of the outline. */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: var(--green); }
::selection { background: rgba(0, 255, 102, .3); }
td, .card strong, .row b, .legend b { font-variant-numeric: tabular-nums; }
small { display: block; color: var(--grey); font-size: 12px; }
h1 { margin: 4px 0 20px; color: var(--green); font-size: 20px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
h2 small { display: inline; margin-left: 6px; font-weight: 400; }
.material-symbols-outlined { font-size: 20px; vertical-align: middle; }
.green { color: var(--green); } .red { color: var(--red); } .orange { color: var(--orange); }
.blue { color: var(--blue); } .grey { color: var(--grey); }
.center { text-align: center; margin: 8px 0 0; }
.right { text-align: right; white-space: nowrap; }
.link { color: var(--grey); font-size: 12px; transition: color var(--ease); }
.link:hover { color: var(--green); }

/* Shell: sidebar, top bar, content */
.shell { display: flex; min-height: 100vh; background: linear-gradient(90deg, var(--chrome) 231px, var(--line) 231px 232px, transparent 232px); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; width: 232px; flex: none; background: var(--chrome); border-right: 1px solid var(--line); padding: 20px 14px; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 4px 28px; }
.brand img { flex: none; width: 84px; height: auto; aspect-ratio: 140 / 93; object-fit: contain; }
.brand b { display: block; font-size: 24px; font-weight: 900; line-height: 1; }
.brand em { font-style: normal; color: #9AE04A; }
.brand small { color: #fff; font-size: 12px; letter-spacing: 4px; }
.sidebar nav a { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 4px; border-radius: 8px; color: var(--dim); font-size: 14px; font-weight: 500; transition: background var(--ease), color var(--ease); }
.sidebar nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(0, 255, 102, .16), rgba(0, 255, 102, .04)); color: #fff; font-weight: 600; }
.sidebar nav a.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green); }
.sidebar nav a.active .material-symbols-outlined { color: var(--green); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 24px; background: rgba(27, 27, 27, .85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .today { margin-right: auto; color: var(--grey); font-size: 13px; }
.topbar .nav-toggle { display: none; padding: 6px; }
.nav-toggle .material-symbols-outlined { font-size: 26px; }
.scrim { display: none; }
.content { width: 100%; max-width: 1480px; margin: 0 auto; padding: 24px; }

.user { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 24px; font-size: 13px; transition: background var(--ease); }
.user:hover { background: rgba(255, 255, 255, .06); }
.user small { font-size: 11px; }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #444; font-size: 11px; font-weight: 700; }
/* Pinned to the circle: a % height inside the grid lets a tall photo spill out. */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.icon-btn { display: inline-grid; place-items: center; padding: 4px; background: none; border: 0; border-radius: 6px; color: var(--grey); cursor: pointer; transition: color var(--ease); }
.icon-btn:hover { color: #fff; }

/* Cards and panels */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card { position: relative; overflow: hidden; transition: border-color var(--ease), transform var(--ease); }
.card::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--green), transparent 70%); opacity: .7; }
.card:hover { border-color: rgba(0, 255, 102, .35); transform: translateY(-2px); }
.card span { color: var(--grey); font-size: 13px; font-weight: 500; }
.card strong { display: block; margin: 6px 0 4px; font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.card small { color: var(--green); font-size: 12px; }
.card small.bad { color: var(--red); }
.panel.alt { background: var(--panel-2); }
.content > .panel + .panel { margin-top: 20px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.panel-head select { padding: 6px 10px; background: #1E1E1E; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; cursor: pointer; }
.grid { display: grid; gap: 20px; margin-bottom: 20px; align-items: start; }
.g-2-3 { grid-template-columns: 2fr 3fr; } .g-3-2 { grid-template-columns: 3fr 2fr; } .g-3 { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; color: var(--dim); font-size: 13px; }
.row b { color: #fff; } .row b.green { color: var(--green); }
.row .time { width: 150px; flex: none; }
.row .tag { width: 56px; text-align: right; color: var(--grey); font-size: 12px; }

/* Tables: each row is a rounded card */
table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
th { padding: 0 14px; text-align: left; color: var(--grey); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
td { padding: 12px 14px; background: var(--panel); border-block: 1px solid rgba(255, 255, 255, .12); color: var(--dim); font-size: 13px; transition: background var(--ease); }
td:first-child { border-left: 1px solid rgba(255, 255, 255, .12); border-radius: 12px 0 0 12px; color: #fff; }
td:last-child { border-right: 1px solid rgba(255, 255, 255, .12); border-radius: 0 12px 12px 0; }
tr:hover td { background: #333; }
table.plain { border-spacing: 0; }
table.plain th, table.plain td { padding: 5px 0; background: none; border: 0; border-radius: 0; text-transform: none; }
table.plain th { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 12px; font-weight: 500; }

/* Toolbar, chips, buttons, badges */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.chip { padding: 6px 16px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 20px; color: var(--dim); font-size: 13px; transition: background var(--ease), color var(--ease), border-color var(--ease); }
.chip:hover { background: #333; color: #fff; }
.chip.active { background: #383838; border-color: var(--green); color: var(--green); font-weight: 700; }
.toggle { display: flex; padding: 3px; background: #1E1E1E; border-radius: 6px; }
.toggle a { padding: 4px 10px; border-radius: 4px; color: var(--grey); font-size: 13px; }
.toggle a.active { background: var(--panel); color: #fff; }
.btn { padding: 8px 16px; background: #1E1E1E; border: 1px solid rgba(255, 255, 255, .24); border-radius: 6px; color: var(--dim); font-size: 13px; font-weight: 500; cursor: pointer; transition: background var(--ease), color var(--ease), border-color var(--ease); }
.btn:hover { background: #333; }
.btn.primary { background: #1E3A29; border-color: var(--green); color: var(--green); font-weight: 700; }
.btn.primary:hover { background: #00E65C; color: #000; }
.btn.small { padding: 3px 8px; font-size: 11px; }
.inline { display: inline-flex; align-items: center; gap: 6px; }
.plan-form input[type=number] { width: 110px; padding: 5px 8px; background: #1E1E1E; border: 1px solid rgba(255, 255, 255, .24); border-radius: 6px; outline: 0; }
.plan-form input[type=color] { width: 34px; height: 28px; padding: 0; background: none; border: 0; cursor: pointer; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid color-mix(in srgb, currentColor 50%, transparent); border-radius: 12px; background: color-mix(in srgb, currentColor 10%, transparent); font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge::before, .dot { content: ''; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; transition: border-color var(--ease); }
.tile small { margin: 4px 0 10px; }

/* Row menus (staff status and role) */
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; padding: 4px; color: var(--grey); cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { color: #fff; }
.menu-list { position: absolute; right: 0; z-index: 5; min-width: 150px; padding: 4px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; background: none; border: 0; color: var(--dim); font-size: 13px; text-align: left; cursor: pointer; }
.menu-list button:hover { background: #383838; }
.menu-list .current { color: #fff; font-weight: 700; }
.menu-list .red { color: var(--red); }
.menu-list hr { margin: 4px 0; border: 0; border-top: 1px solid var(--line); }

/* Dialogs and forms */
dialog { width: min(420px, 92vw); padding: 24px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 64px rgba(0, 0, 0, .6); color: #fff; }
dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
dialog[open] { animation: pop .18s ease-out; }
.tile:hover { border-color: rgba(0, 255, 102, .35); }
.btn:active, .chip:active { transform: scale(.97); }

/* Log out confirmation */
dialog.logout { width: min(380px, 92vw); padding: 32px 28px 24px; border-top: 3px solid var(--red); text-align: center; }
dialog.logout[open] { animation: pop .18s ease-out; }
dialog.logout::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.logout-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border: 2px solid var(--red); border-radius: 50%; background: rgba(255, 82, 82, .12); color: var(--red); }
.logout-icon .material-symbols-outlined { font-size: 32px; }
dialog.logout h2 { margin: 16px 0 8px; color: #fff; font-size: 20px; font-weight: 900; letter-spacing: 2px; }
dialog.logout p { margin: 0 0 18px; color: var(--grey); font-size: 13px; line-height: 1.5; }
.logout-who { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; text-align: left; font-size: 12px; }
.logout-who b { display: block; color: #fff; }
.logout-who small { color: var(--grey); }
.logout-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.logout-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; font-weight: 700; letter-spacing: 1px; }
.logout-actions .btn .material-symbols-outlined { font-size: 18px; }
.btn.danger { background: rgba(255, 82, 82, .14); border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #000; }
dialog h2 { margin-bottom: 18px; color: var(--green); letter-spacing: 1.2px; }
label { display: block; margin-bottom: 14px; color: var(--grey); font-size: 13px; }
label input, label select { display: block; width: 100%; margin-top: 6px; padding: 12px; background: var(--panel); border: 1px solid rgba(255, 255, 255, .24); border-radius: 8px; color: #fff; outline: 0; }
label input:focus, label select:focus { border-color: var(--green); }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.error { margin: 0 0 12px; color: var(--red); font-size: 13px; }
.notice { margin: 0 0 12px; color: var(--green); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); border-left: 3px solid var(--green); animation: toast 3s forwards; }
@keyframes toast { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* Charts */
.bars { display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; height: 170px; }
.bars div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; color: var(--grey); font-size: 11px; white-space: nowrap; }
.bars i { width: 28px; max-width: 100%; min-height: 2px; border-radius: 6px; background: var(--green); }
.segments { display: flex; height: 14px; margin: 12px 0 22px; border-radius: 4px; overflow: hidden; background: #1E1E1E; }
.legend { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--grey); font-size: 12px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend b { margin-left: auto; color: #fff; }
/* Pie chart: slices split by thin lines in the panel colour, % inside each,
   with the plans and their counts beside it at the top right. */
.pie-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 20px; }
.pie { display: block; flex: 1 1 150px; min-width: 150px; max-width: 200px; margin: 0 auto; overflow: visible; }
.pie path { stroke: var(--panel); stroke-width: 1.5; stroke-linejoin: round; transition: opacity var(--ease), transform var(--ease); transform-origin: 100px 100px; }
.pie:hover path { opacity: .55; }
.pie path:hover { opacity: 1; transform: scale(1.04); }
.pie text { fill: #111; font-size: 13px; font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pie-empty { flex: 1; margin: 24px 0; color: var(--grey); text-align: center; font-size: 13px; }
.pie-legend { flex: 1 0 100px; margin: 0; padding: 0; list-style: none; }
.pie-legend li { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--grey); font-size: 13px; }
.pie-legend li + li { border-top: 1px solid var(--line); }
.pie-legend i { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.pie-legend b { margin-left: auto; color: #fff; font-variant-numeric: tabular-nums; }
.meter { flex: 1; height: 6px; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--sky); }
.meter i.peak { background: var(--green); }
.spark { position: relative; height: 90px; margin: 12px 8px 0; }
.spark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.spark polyline { fill: none; stroke: var(--green); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark i { position: absolute; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: #1E88E5; }
.spark-labels { display: flex; justify-content: space-between; margin-top: 8px; color: var(--grey); font-size: 11px; text-align: center; }

/* Audit log rows */
.log { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin-bottom: 12px; background: var(--panel); border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; color: var(--dim); font-size: 13px; transition: background var(--ease), border-color var(--ease); }
.log:hover { background: #333; border-color: rgba(0, 255, 102, .5); }
.log time { width: 130px; flex: none; }
.log span { flex: 1; }
.log b { color: #fff; }
.log .dot { color: #00E5FF; }

/* Login */
.login { display: flex; min-height: 100vh; }
.login-brand { position: relative; flex: 1; display: grid; place-items: center; padding: 48px 24px; background: radial-gradient(circle at 50% 45%, #2A2A2A, #1C1C1C); text-align: center; }
.logo { display: grid; place-items: center; width: 260px; height: 260px; border-radius: 50%; animation: enter 1.1s ease-out both, glow 3.2s ease-in-out infinite alternate; }
.logo img { display: block; width: 190px; height: auto; animation: float 3.2s ease-in-out infinite alternate; }
.wordmark { margin-top: 10px; animation: rise .6s ease-out .5s both; }
.wordmark b { font-size: 28px; font-weight: 900; letter-spacing: 1px; }
.wordmark em { font-style: normal; color: var(--green); }
.wordmark small { color: #fff; font-size: 16px; font-weight: 500; letter-spacing: 3px; }
.owner-tag { position: absolute; left: 32px; bottom: 28px; color: rgba(255, 255, 255, .3); font-size: 14px; letter-spacing: 2px; }
.login-form { flex: 2; display: grid; place-items: center; padding: 48px 24px; background: var(--panel); }
.login-form form { width: 100%; max-width: 380px; }
.field { position: relative; margin-bottom: 16px; }
.field input { width: 100%; padding: 16px; background: #424242; border: 1.4px solid transparent; border-radius: 8px; color: #fff; font-size: 14px; outline: 0; }
.field input::placeholder { color: rgba(255, 255, 255, .54); }
.field input:focus { border-color: var(--green); }
.field button { position: absolute; right: 10px; top: 50%; translate: 0 -50%; background: none; border: 0; color: rgba(255, 255, 255, .54); cursor: pointer; }
.login-btn { width: 100%; margin-top: 8px; padding: 16px; background: #28C76F; border: 0; border-radius: 8px; color: #000; font-size: 14px; font-weight: 700; letter-spacing: 1px; cursor: pointer; transition: .15s; }
.login-btn:hover { background: #34E27E; box-shadow: 0 4px 16px rgba(40, 199, 111, .4); }
.login-btn:active { transform: scale(.97); }
@keyframes enter { from { opacity: 0; transform: scale(.82); } }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
@keyframes float { from { transform: translateY(-4px); } to { transform: translateY(4px); } }
@keyframes glow { from { box-shadow: 0 0 55px 4px rgba(0, 255, 102, .25); } to { box-shadow: 0 0 55px 4px rgba(0, 255, 102, .45); } }

/* Phones and small tablets */
@media (max-width: 900px) {
    .login { flex-direction: column; }
    /* Stacked above the form on phones: still larger than before, less tall. */
    .logo { width: 220px; height: 220px; }
    .logo img { width: 170px; }
    /* The sidebar becomes a drawer, opened from the menu button in the top bar. */
    .sidebar { position: fixed; left: 0; z-index: 40; box-shadow: 8px 0 32px rgba(0, 0, 0, .5); transform: translateX(-100%); transition: transform .22s ease; }
    .nav-open .sidebar { transform: none; }
    .scrim { position: fixed; inset: 0; z-index: 30; display: block; background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
    .nav-open .scrim { opacity: 1; pointer-events: auto; }
    .shell { background: none; }
    .topbar .nav-toggle { display: inline-grid; place-items: center; margin-left: -6px; }
    .topbar { padding: 0 16px; }
    .content { padding: 16px; }
    .grid { grid-template-columns: 1fr; }
    .table-wrap { overflow-x: auto; }
    .table-wrap table { min-width: 640px; }
    .user div { display: none; }
}
@media (max-width: 700px) {
    /* Table rows become cards; the layout script labels each cell with its column. */
    .table-wrap { overflow: visible; }
    .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
    .table-wrap table { min-width: 0; border-spacing: 0; }
    .table-wrap tr:has(th) { display: none; }
    .table-wrap tr { margin-bottom: 10px; padding: 4px 14px; background: var(--panel); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; }
    .table-wrap td, .table-wrap td:first-child, .table-wrap td:last-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 0; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: right; white-space: normal; }
    .table-wrap tr:hover td { background: none; }
    .table-wrap td:last-child { border-bottom: 0; }
    .table-wrap td.blank { display: none; }
    .table-wrap td:has(+ .blank:last-child) { border-bottom: 0; }
    .table-wrap td::before { content: attr(data-label); margin-right: auto; color: var(--grey); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-align: left; text-transform: uppercase; }
    .table-wrap td[data-label=""] { justify-content: flex-end; }
    .table-wrap td[data-label=""]::before { display: none; }
    .table-wrap td:first-child { flex-direction: column; align-items: flex-start; font-size: 15px; font-weight: 600; text-align: left; }
    .table-wrap td:first-child::before { display: none; }
    .table-wrap td[colspan]:first-child { font-size: 13px; font-weight: 400; color: var(--grey); }
    .plan-form input[type=number] { width: 90px; }
    .log { flex-wrap: wrap; gap: 4px 10px; }
    .log time { width: 100%; color: var(--grey); font-size: 12px; }
}
@media (max-width: 600px) {
    .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card { padding: 14px; }
    .card strong { font-size: 22px; }
    .toolbar .toggle, .toolbar .btn.primary { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* ===================================================================
   Staff portal
   =================================================================== */

.g-2 { grid-template-columns: repeat(2, 1fr); }
.sky { color: var(--sky); }
.btn.wide { width: 100%; padding: 14px; font-size: 14px; letter-spacing: 1px; }
.btn.primary.warn { background: #4A3A1E; border-color: var(--orange); color: var(--orange); }
.btn.primary.warn:hover { background: var(--orange); color: #000; }
.icon-btn.red { color: var(--red); }
.icon-btn.red:hover { color: #FF8A80; }
code { padding: 2px 6px; background: #1E1E1E; border-radius: 4px; color: var(--sky); font-size: 11px; }

/* Staff login header */
.login-head { margin-bottom: 28px; text-align: center; }
.login-head .badge-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border: 2px solid #22C55E; border-radius: 50%; background: rgba(34, 197, 94, .15); color: #22C55E; }
.login-head .badge-icon .material-symbols-outlined { font-size: 34px; }
.login-head h1 { margin: 14px 0 8px; color: #fff; font-size: 30px; font-weight: 900; letter-spacing: 3px; }
.login-head i { display: block; width: 70px; height: 4px; margin: 0 auto 10px; border-radius: 2px; background: #22C55E; }
.login-head small { color: rgba(255, 255, 255, .54); font-size: 13px; letter-spacing: 1px; }

/* Dashboard: check-ins against check-outs */
.spark polyline.alt { stroke: var(--grey); }
.chart-key { display: flex; align-items: center; gap: 24px; margin-top: 10px; color: var(--grey); font-size: 12px; }
.chart-key span { display: flex; align-items: center; gap: 8px; }
.chart-key i { width: 22px; height: 6px; border-radius: 5px; background: var(--green); }
.chart-key i.alt { background: var(--grey); }
.chart-key small { margin-left: auto; }

/* Time in / time out picker */
.seg { display: flex; gap: 12px; margin-bottom: 16px; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; background: #424242; border: 1px solid var(--line); border-radius: 8px; color: var(--dim); font-size: 13px; font-weight: 700; cursor: pointer; }
.seg span:hover { background: #4D4D4D; }
.seg input:checked + span { background: #28C76F; border-color: #28C76F; color: #000; }
.seg input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }

/* Notifications */
.note { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.note.read { opacity: .6; }
.note b { font-size: 14px; }
.note p { margin: 4px 0 6px; color: var(--dim); font-size: 13px; }
.note > div { flex: 1; min-width: 0; }
.note-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 8px; background: color-mix(in srgb, currentColor 22%, #1E1E1E); }
.note .unread { width: 8px; height: 8px; flex: none; margin-top: 4px; border-radius: 50%; background: var(--green); }

/* Scanner */
.scanner { position: relative; height: 340px; display: grid; place-items: center; overflow: hidden; background: var(--chrome); border: 1px solid var(--line); border-radius: 8px; }
.scanner #reader { position: absolute; inset: 0; }
.scanner #reader video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 16px; text-align: center; pointer-events: none; }
.scanner .frame::after { content: ''; position: absolute; top: 50%; left: 50%; width: 200px; height: 200px; translate: -50% -50%; background:
    linear-gradient(var(--green), var(--green)) 0 0 / 28px 4px no-repeat,
    linear-gradient(var(--green), var(--green)) 0 0 / 4px 28px no-repeat,
    linear-gradient(var(--green), var(--green)) 100% 0 / 28px 4px no-repeat,
    linear-gradient(var(--green), var(--green)) 100% 0 / 4px 28px no-repeat,
    linear-gradient(var(--green), var(--green)) 0 100% / 28px 4px no-repeat,
    linear-gradient(var(--green), var(--green)) 0 100% / 4px 28px no-repeat,
    linear-gradient(var(--green), var(--green)) 100% 100% / 28px 4px no-repeat,
    linear-gradient(var(--green), var(--green)) 100% 100% / 4px 28px no-repeat; }
.scanner .frame b { font-size: 13px; font-weight: 600; letter-spacing: 1px; }
.scanner .frame small { color: var(--dim); font-size: 12px; }
.scanner .scanned { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 16px; text-align: center; background: rgba(0, 0, 0, .8); }
.scanner .scanned .material-symbols-outlined { font-size: 64px; color: var(--green); }
.scanner .scanned b { font-size: 15px; }
.scanner .scanned small { color: rgba(255, 255, 255, .6); overflow-wrap: anywhere; }
dialog.member-qr { text-align: center; }
dialog.member-qr .qr-image { display: inline-grid; place-items: center; min-width: 220px; min-height: 220px; margin: 0 auto 12px; padding: 12px; background: #fff; border-radius: 8px; }
dialog.member-qr code { display: block; font-size: 18px; letter-spacing: 2px; }
dialog.member-qr p { margin: 8px 0 0; font-size: 12px; }
.code-input { flex: 1; min-width: 160px; padding: 10px 12px; background: #424242; border: 1.4px solid transparent; border-radius: 6px; color: #fff; font-size: 13px; outline: 0; }
.code-input:focus { border-color: var(--green); }
.member-head { align-items: center; gap: 14px; margin-bottom: 16px; }
.member-head .avatar { width: 52px; height: 52px; }
.member-head .avatar.found { background: #294A31; color: var(--green); }
.scan-result { margin-top: 16px; padding: 14px; border: 1px solid currentColor; border-radius: 8px; background: color-mix(in srgb, currentColor 12%, transparent); font-size: 16px; font-weight: 900; letter-spacing: 2px; text-align: center; }
.scan-result.in { color: var(--green); }
.scan-result.out { color: var(--orange); }
.member-head .avatar .material-symbols-outlined { font-size: 28px; }
.member-head b { font-size: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.info-grid > div { padding: 10px 12px; background: #1E1E1E; border: 1px solid var(--line); border-radius: 8px; }
.info-grid small { font-size: 11px; letter-spacing: .5px; }
.info-grid b { display: block; margin-top: 8px; font-size: 15px; overflow-wrap: anywhere; }
.panel .actions { margin-top: 16px; }
.content > .note + .note { margin-top: 0; }
td select { padding: 6px 10px; background: #1E1E1E; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; cursor: pointer; }

@media (max-width: 900px) {
    .g-2 { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
}
.login-switch { margin: 18px 0 0; color: var(--grey); font-size: 12px; text-align: center; }
.login-switch a { color: var(--green); font-weight: 600; }
.login-switch a:hover { text-decoration: underline; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; z-index: 50;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .5); animation: pop .14s ease-out;
}
.user-dropdown a, .user-dropdown button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
    color: var(--dim); background: none; border: 0; border-radius: 8px;
    font: inherit; text-align: left; cursor: pointer; text-decoration: none;
    transition: background var(--ease), color var(--ease);
}
.user-dropdown a:hover, .user-dropdown button:hover { background: rgba(0, 255, 102, .1); color: #fff; }
.user-dropdown button:hover { background: rgba(255, 82, 82, .12); color: var(--red); }

.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 20px; align-items: start; }
.account-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px;
    display: flex; flex-direction: column; gap: 14px;
}
.account-card h2 { margin: 0 0 4px; }
.account-card label { display: flex; flex-direction: column; gap: 6px; margin: 0; color: var(--grey); font-size: 13px; }
.account-card input {
    margin: 0; background: var(--panel-2); border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px;
    padding: 12px; color: #fff; font: inherit; outline: 0; transition: border-color var(--ease);
}
.account-card input:focus { border-color: var(--green); }
.field-error { color: var(--red); font-size: 13px; margin: -6px 0 0; }
.field-hint { margin: -4px 0 0; color: var(--grey); font-size: 12px; line-height: 1.5; }

/* Password boxes in the portals, with an eye button to show what was typed. */
.pw-toggle { position: relative; display: block; margin-top: 6px; }
.account-card .pw-toggle { margin-top: 0; }
.pw-toggle input { width: 100%; margin-top: 0; padding-right: 44px; }
.pw-toggle button {
    position: absolute; right: 8px; top: 50%; translate: 0 -50%; display: flex; padding: 4px;
    background: none; border: 0; color: var(--grey); cursor: pointer;
}
.pw-toggle button:hover { color: #fff; }
.btn-primary {
    background: #1E3A29; color: var(--green); border: 1px solid var(--green); border-radius: 8px;
    padding: 10px 18px; font-weight: 700; cursor: pointer; align-self: flex-start;
    transition: background var(--ease), color var(--ease);
}
.btn-primary:hover { background: #00E65C; color: #000; }
/* Make sidebar links flex so the badge can sit at the right edge.
   Remove this rule if your links are already display:flex. */
.sidebar nav a {
    display: flex;
    align-items: center;
}

/* Red number badge */
.notif-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

/* Small red dot on the mobile menu button */
.nav-toggle {
    position: relative;
}

.notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e53935;
    border: 2px solid #fff;
}
/* Standalone scanner page: a slim bar instead of the staff shell. */
.scanner-bar .brand { margin: 0; }
.scanner-bar .brand img { width: auto; height: 52px; }
.scanner-bar .brand b { font-size: 18px; }
.scanner-bar .brand small { font-size: 10px; letter-spacing: 3px; }
.scanner-bar .btn { display: inline-flex; align-items: center; gap: 6px; }
.scanner-bar .btn .material-symbols-outlined { font-size: 18px; }
/* The sign-in, for visitors: a round profile icon, big enough to tap. */
.scanner-bar .profile-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #444; color: #fff; border: 2px solid transparent; transition: border-color var(--ease), color var(--ease); }
.scanner-bar .profile-btn .material-symbols-outlined { font-size: 24px; }
.scanner-bar .profile-btn:hover, .scanner-bar .profile-btn:focus-visible { border-color: var(--green); color: var(--green); }
.scanner-page .scanner { height: min(60vh, 520px); }
@media (max-width: 640px) {
    .scanner-bar { gap: 10px; padding: 0 16px; }
    .scanner-bar .today, .scanner-bar .user { display: none; }
    .scanner-bar .brand { margin-right: auto; }
    .scanner-bar .brand img { height: 44px; }
    .scanner-page .scanner { height: 340px; }
}

/* Numbered pagination (partials/pager): "Showing 11–20 of 57   ‹ 1 2 3 … 6 ›". */
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.pager__info { font-size: 14px; color: #8b93a1; }
.pager__nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pager__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 10px; background: #1a1d24; border: 1px solid #2f343d; color: #fff; font-size: 15px; font-weight: 700; text-decoration: none; transition: background var(--ease), border-color var(--ease), color var(--ease); }
a.pager__btn:hover { border-color: #22c55e; color: #22c55e; }
.pager__btn.active { background: #22c55e; border-color: #22c55e; color: #05260f; }
.pager__btn.disabled { opacity: .35; cursor: not-allowed; }
.pager__gap { color: #8b93a1; padding: 0 2px; }
@media (max-width: 600px) { .pager { justify-content: center; } }

/* Charts with x and y axes (partials/axis-chart). The y-axis carries rounded
   ticks with faint gridlines across the plot; the x labels sit under it. */
.axis-chart { display: grid; grid-template-columns: 16px auto 1fr; grid-template-rows: 170px auto auto; column-gap: 8px; margin-top: 22px; }
.axis-y-title { grid-row: 1; grid-column: 1; display: flex; align-items: center; justify-content: center; }
.axis-y-title span { transform: rotate(-90deg); white-space: nowrap; color: var(--grey); font-size: 11px; letter-spacing: .3px; }
.axis-y { grid-row: 1; grid-column: 2; position: relative; min-width: 26px; }
.axis-y span { position: absolute; right: 0; transform: translateY(50%); color: var(--grey); font-size: 10px; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.axis-y span:first-child { transform: none; }
.axis-plot { grid-row: 1; grid-column: 3; position: relative; border-left: 1px solid var(--line); border-bottom: 1px solid rgba(255, 255, 255, .25); }
.axis-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(255, 255, 255, .07); }
.axis-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.axis-bars > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.axis-bars small { color: var(--grey); font-size: 10px; white-space: nowrap; }
.axis-bars i { width: 28px; max-width: 70%; min-height: 2px; border-radius: 5px 5px 0 0; background: var(--green); opacity: .8; transition: opacity var(--ease); }
.axis-bars > div:hover i, .axis-bars > div.top i { opacity: 1; }
.axis-bars > div.top i { box-shadow: 0 0 16px rgba(34, 197, 94, .35); }
.axis-bars > div.top small { color: var(--green); font-weight: 700; }
.axis-bars > div.is-zero small { visibility: hidden; }
.axis-bars > div.is-zero i { background: rgba(255, 255, 255, .15); }
.axis-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.axis-plot polyline { fill: none; stroke: var(--green); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.axis-dot { position: absolute; width: 8px; height: 8px; margin: 0 0 -4px -4px; border-radius: 50%; background: #1E88E5; box-shadow: 0 0 0 2px var(--panel); }
.axis-dot small { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); color: var(--grey); font-size: 10px; white-space: nowrap; }
.axis-x { grid-row: 2; grid-column: 3; display: flex; padding-top: 6px; }
.axis-x span { flex: 1; min-width: 0; color: var(--grey); font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.axis-x span.top { color: #fff; font-weight: 600; }
.axis-x-title { grid-row: 3; grid-column: 3; padding-top: 4px; color: var(--grey); font-size: 11px; text-align: center; letter-spacing: .3px; }

/* A section heading led by a small green icon. */
.icon-title, .panel-head h2.icon-title { display: flex; align-items: center; gap: 8px; }
.icon-title > .material-symbols-outlined { flex: none; color: var(--green); font-size: 20px; }
.icon-title small { margin-left: 2px; }


/* Check out button beside "In Gym" on the staff Attendance list: as small
   as the badge, orange like the Checked out column. */
.btn.checkout-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 7px; border-color: color-mix(in srgb, var(--orange) 60%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--orange) 12%, transparent); color: var(--orange); font-size: 11px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.btn.checkout-btn .material-symbols-outlined { font-size: 15px; }
.btn.checkout-btn:hover { background: var(--orange); border-color: var(--orange); color: #000; }
