/* ==========================================================================
   GymTrack Portal — gym membership management (front-end demo)
   Palette: graphite + volt lime, coral and amber status colours
   Type: Big Shoulders Display (numbers, headings) + Manrope (interface)
   ========================================================================== */

:root {
  --bg: #0D0F12;
  --panel: #15181D;
  --panel-2: #1B1F26;
  --panel-3: #242a33;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #EEF0F3;
  --dim: #A3ABB6;
  --faint: #8A939E;
  --volt: #CCFF3D;
  --volt-2: #B8EE1F;
  --volt-soft: rgba(204, 255, 61, .12);
  --on-volt: #0D0F12;
  --coral: #FF7A5C;
  --coral-soft: rgba(255, 122, 92, .14);
  --amber: #FFBA4D;
  --amber-soft: rgba(255, 186, 77, .14);
  --sky: #6CCBFF;
  --violet: #B59CFF;
  --mint: #4FE0B0;
  --f-display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --f-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 16px;
  --r-sm: 10px;
  --side: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.5 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--volt); color: var(--on-volt); }
.sprite { position: absolute; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--volt); color: var(--on-volt); padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }
.dim { color: var(--dim); }
.noscript { padding: 20px; border: 1px solid var(--line-2); border-radius: var(--r); margin-bottom: 20px; }

/* ------------------------------ App shell ------------------------------ */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, #111419 0%, #0F1115 100%);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-mark, .tb-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--volt); flex: none; }
.brand-mark svg, .tb-mark svg { width: 30px; height: 30px; fill: var(--on-volt); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font: 800 24px/1 var(--f-display); letter-spacing: .02em; text-transform: uppercase; }
.brand-text small { color: var(--faint); font-size: 12px; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 0 12px 8px; font-weight: 700; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px; color: var(--dim); font-weight: 600;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-link:hover { background: var(--panel-2); color: var(--text); }
.nav-link.is-active { background: var(--panel-3); color: var(--text); }
.nav-link.is-active::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--volt); }
.nav-link.is-active .ic { color: var(--volt); }
.nav-count { margin-left: auto; font: 700 12px/1 var(--f-ui); background: var(--panel-3); color: var(--dim); padding: 4px 8px; border-radius: 99px; }
.nav-link.is-active .nav-count { background: var(--bg); }
.nav-count.is-warn { background: var(--amber-soft); color: var(--amber); }

.floor { margin-top: auto; padding: 16px; border-radius: var(--r); background: radial-gradient(120% 100% at 0% 0%, rgba(204,255,61,.14), transparent 60%), var(--panel); border: 1px solid var(--line); }
.floor-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--volt); box-shadow: 0 0 0 0 rgba(204,255,61,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(204,255,61,0); } 100% { box-shadow: 0 0 0 0 rgba(204,255,61,0); } }
.floor-num { font: 800 44px/1 var(--f-display); margin: 10px 0 10px; }
.floor-num small { font: 600 13px var(--f-ui); color: var(--faint); margin-left: 6px; }
.meter { height: 6px; border-radius: 9px; background: var(--panel-3); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--volt-2), var(--volt)); border-radius: inherit; transition: width .6s var(--ease); }
.floor-note { font-size: 12px; color: var(--faint); margin-top: 10px; line-height: 1.4; }

.side-foot { display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.btn-reset { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--dim); padding: 9px 12px; border: 1px dashed var(--line-2); border-radius: 10px; transition: color .2s, border-color .2s; }
.btn-reset:hover { color: var(--coral); border-color: var(--coral); }
.btn-reset .ic { width: 15px; height: 15px; }
.credit { font-size: 12px; color: var(--faint); }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 32px; min-height: 72px;
  background: rgba(13, 15, 18, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tb-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-mark { display: none; width: 34px; height: 34px; border-radius: 10px; }
.tb-mark svg { width: 26px; height: 26px; }
.tb-title h1 { font: 800 28px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.demo-badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 99px; color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(255,186,77,.3); white-space: nowrap; }
.tb-search { position: relative; flex: 1; max-width: 420px; margin-left: auto; display: flex; align-items: center; }
.tb-search > .ic { position: absolute; left: 14px; color: var(--faint); pointer-events: none; }
.tb-search input { width: 100%; height: 42px; padding: 0 40px 0 42px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); outline: none; }
.tb-search input:focus { border-color: var(--volt); }
.tb-search kbd { position: absolute; right: 10px; font: 700 11px var(--f-ui); color: var(--faint); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 7px; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); z-index: 30; }
.search-results li button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-align: left; }
.search-results li button:hover, .search-results li button:focus-visible { background: var(--panel-3); outline: none; }
.search-results .empty { padding: 12px; color: var(--dim); font-size: 14px; }
.tb-actions { display: flex; gap: 10px; }

main { padding: 28px 32px 48px; outline: none; flex: 1; }
.view[hidden] { display: none !important; }
.view.is-active { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.mobile-foot { display: none; }

/* ------------------------------ Buttons ------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 14px; white-space: nowrap; transition: transform .15s var(--ease), background .2s, border-color .2s, color .2s; }
.btn:active { transform: translateY(1px); }
.btn-volt { background: var(--volt); color: var(--on-volt); }
.btn-volt:hover { background: #d8ff66; }
.btn-line { border: 1px solid var(--line-2); color: var(--text); }
.btn-line:hover { border-color: var(--volt); color: var(--volt); }
.btn-danger { background: var(--coral); color: #1a0c08; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-xl { height: 56px; font-size: 16px; width: 100%; border-radius: 14px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--dim); }
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.link-sm { font-size: 13px; font-weight: 700; color: var(--volt); white-space: nowrap; }
.link-sm:hover { text-decoration: underline; }
.link-btn { color: var(--volt); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pill-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); font-weight: 700; font-size: 14px; border: 1px solid rgba(255,186,77,.25); }
.pill-link:hover { background: rgba(255,186,77,.22); }

/* ------------------------------ Headings & layout ------------------------------ */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--volt); margin-bottom: 6px; }
.display { font: 800 clamp(34px, 3.6vw, 48px)/1 var(--f-display); text-transform: uppercase; letter-spacing: .01em; margin-bottom: 8px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.g-rev { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-desk { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h.pad { padding: 20px 20px 0; }
.card-h h3 { font-size: 16px; font-weight: 800; }
.sub { font-size: 13px; color: var(--faint); margin-top: 2px; }
.fine { font-size: 12px; color: var(--faint); margin-top: 16px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.kpis-3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 14px; }
.kpi.is-hero { background: var(--volt); color: var(--on-volt); border-color: transparent; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 13px; font-weight: 700; color: var(--dim); }
.kpi.is-hero .kpi-label, .kpi.is-hero .kpi-foot { color: rgba(13,15,18,.72); }
.kpi-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--panel-3); color: var(--volt); }
.kpi.is-hero .kpi-icon { background: rgba(13,15,18,.1); color: var(--on-volt); }
.kpi-val { font: 800 44px/1 var(--f-display); margin: 14px 0 6px; letter-spacing: .01em; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--faint); font-weight: 600; }
.delta { font-weight: 800; padding: 2px 7px; border-radius: 99px; background: var(--volt-soft); color: var(--volt); }
.delta.down { background: var(--coral-soft); color: var(--coral); }
.kpi.is-hero .delta { background: rgba(13,15,18,.12); color: var(--on-volt); }
.spark { width: 84px; height: 30px; }

/* Charts */
.chart { position: relative; min-height: 240px; }
.chart-sm { min-height: 150px; }
.chart-lg { min-height: 300px; }
.chart svg { display: block; overflow: visible; }
.chart .gl { stroke: var(--line); }
.chart .ax { fill: var(--faint); font: 600 11px var(--f-ui); }
.chart .b { fill: var(--panel-3); transition: fill .2s; }
.chart .bar.is-hl .b { fill: var(--volt); }
.chart .bar:hover .b, .chart .bar:focus .b { fill: var(--volt-2); }
.chart .bar.is-hl:hover .b { fill: #e0ff7a; }
.chart .bar { outline: none; }
.chart .bar:focus-visible .hit { stroke: var(--volt); stroke-width: 1.5; }
.chart .val { fill: var(--text); font: 800 13px var(--f-display); letter-spacing: .03em; }
.tip { position: fixed; z-index: 80; pointer-events: none; background: #f4f6f8; color: #0D0F12; font-size: 12.5px; font-weight: 700; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }

.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.donut { width: 190px; height: 190px; }
.donut circle { fill: none; stroke-width: 22; }
.donut .track { stroke: var(--panel-3); }
.donut-c1 { font: 800 40px var(--f-display); fill: var(--text); }
.donut-c2 { font: 700 11px var(--f-ui); fill: var(--faint); letter-spacing: .1em; text-transform: uppercase; }
.legend { width: 100%; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span { color: var(--dim); }
.legend b { margin-left: auto; font-weight: 800; }

/* List rows */
.rows { display: flex; flex-direction: column; }
.rows > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.rows-tight > li { padding: 8px 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .meta { font-size: 12.5px; color: var(--faint); }
.rows .when { font-size: 13px; font-weight: 700; color: var(--dim); white-space: nowrap; }
.rows .empty { color: var(--dim); font-size: 14px; padding: 18px 0; justify-content: center; }
.rows-log { max-height: 420px; overflow: auto; margin-top: 8px; }
.row-actions { display: flex; gap: 6px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font: 800 15px var(--f-display); letter-spacing: .04em; flex: none; color: var(--on-volt); }
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 26px; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active { background: var(--volt-soft); color: var(--volt); }
.badge.due { background: var(--amber-soft); color: var(--amber); }
.badge.expired { background: var(--coral-soft); color: var(--coral); }
.plan-tag { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13.5px; }
.plan-tag i { width: 8px; height: 8px; border-radius: 2px; }

/* Members toolbar + table */
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px; margin-bottom: 14px; }
.field-search { position: relative; flex: 1 1 240px; display: flex; align-items: center; }
.field-search .ic { position: absolute; left: 12px; color: var(--faint); }
.field-search input, select, .f input, .f textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); outline: none;
}
.field-search input { padding-left: 38px; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
select option { background: var(--panel-2); color: var(--text); }
.field-search input:focus, select:focus, .f input:focus, .f textarea:focus { border-color: var(--volt); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; color: var(--dim); display: inline-flex; align-items: center; gap: 6px; }
.chip b { font-size: 11.5px; padding: 2px 6px; border-radius: 99px; background: var(--panel-3); color: var(--dim); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip[aria-pressed="true"] b { background: var(--bg); color: var(--text); }
.selects { display: flex; gap: 8px; }
.selects select { width: auto; min-width: 150px; }

.table-card { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 800; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255,255,255,.025); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .who { display: flex; align-items: center; gap: 12px; text-align: left; }
.table .who b { display: block; font-weight: 700; }
.table .who small { color: var(--faint); font-size: 12.5px; font-weight: 700; letter-spacing: .03em; }
.table .days { display: block; font-size: 12px; color: var(--faint); }
.table .empty-row td { text-align: center; padding: 40px 16px; color: var(--dim); }
.table tr.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { background: var(--volt-soft); } 100% { background: transparent; } }

/* Check-in desk */
.desk { display: grid; gap: 20px; }
.desk-form { display: grid; gap: 14px; }
.desk-label { font: 800 13px var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.desk-input { display: flex; align-items: center; gap: 4px; height: 80px; padding: 0 22px; border-radius: 16px; background: var(--bg); border: 2px solid var(--line-2); }
.desk-input:focus-within { border-color: var(--volt); }
.desk-input span { font: 800 44px var(--f-display); color: var(--faint); }
.desk-input input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font: 800 44px var(--f-display); letter-spacing: .08em; }
.hint { font-size: 13px; color: var(--dim); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 58px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); font: 700 26px var(--f-display); display: grid; place-items: center; transition: background .15s, transform .1s; }
.keypad button:hover { background: var(--panel-3); }
.keypad button:active { transform: scale(.97); }
.keypad .k-soft { font: 700 14px var(--f-ui); color: var(--dim); }
.desk-result:empty { display: none; }
.result { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 18px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel-2); animation: viewIn .3s var(--ease); }
.result.ok { border-color: rgba(204,255,61,.45); background: linear-gradient(135deg, rgba(204,255,61,.12), transparent 70%), var(--panel-2); }
.result.warn { border-color: rgba(255,186,77,.45); background: linear-gradient(135deg, rgba(255,186,77,.12), transparent 70%), var(--panel-2); }
.result.bad { border-color: rgba(255,122,92,.5); background: linear-gradient(135deg, rgba(255,122,92,.14), transparent 70%), var(--panel-2); }
.result h3 { font: 800 26px/1.05 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.result .r-state { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.result.ok .r-state { color: var(--volt); }
.result.warn .r-state { color: var(--amber); }
.result.bad .r-state { color: var(--coral); }
.result .r-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--dim); margin-top: 8px; }
.result .r-meta b { color: var(--text); }
.result .r-act { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }

/* Tabs + renewal cards */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { height: 38px; padding: 0 14px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--dim); display: inline-flex; align-items: center; gap: 8px; }
.tabs button b { font-size: 12px; padding: 2px 7px; border-radius: 99px; background: var(--panel-3); }
.tabs button[aria-selected="true"] { background: var(--panel-3); color: var(--text); }
.tabs button[aria-selected="true"] b { background: var(--volt); color: var(--on-volt); }
.renew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.rcard { display: flex; flex-direction: column; gap: 14px; }
.rcard-top { display: flex; align-items: center; gap: 12px; }
.rcard-top .grow { flex: 1; min-width: 0; }
.rcard-top b { display: block; font-weight: 800; }
.rcard-top small { color: var(--faint); font-weight: 700; font-size: 12.5px; }
.countdown { text-align: right; }
.countdown strong { display: block; font: 800 34px/1 var(--f-display); }
.countdown span { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.countdown.due strong { color: var(--amber); }
.countdown.expired strong { color: var(--coral); }
.rcard-info { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--dim); padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rcard-info b { color: var(--text); display: block; font-size: 14px; }
.rcard-act { display: flex; gap: 8px; }
.rcard-act .btn { flex: 1; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--dim); border: 1px dashed var(--line-2); border-radius: var(--r); }

/* Plans */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.pcard::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--c, var(--volt)); }
.pcard h3 { font: 800 26px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.pcard .price { font: 800 46px/1 var(--f-display); }
.pcard .price small { font: 600 13px var(--f-ui); color: var(--faint); margin-left: 4px; }
.pcard .per { font-size: 13px; color: var(--dim); }
.perks { display: grid; gap: 7px; font-size: 13.5px; color: var(--dim); }
.perks li { display: flex; gap: 8px; align-items: flex-start; }
.perks .ic { width: 16px; height: 16px; color: var(--c, var(--volt)); margin-top: 2px; }
.pstats { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--faint); border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.pstats b { color: var(--text); font-size: 15px; display: block; }
.pbar { height: 6px; border-radius: 9px; background: var(--panel-3); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--c, var(--volt)); border-radius: inherit; }
.pact { display: flex; gap: 8px; }
.pact .btn { flex: 1; }
.pnew { display: grid; place-items: center; gap: 8px; min-height: 280px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--dim); font-weight: 700; transition: border-color .2s, color .2s; }
.pnew:hover { border-color: var(--volt); color: var(--volt); }
.pnew .ic { width: 30px; height: 30px; }

/* Payments */
.modes { display: grid; gap: 18px; }
.mode-bar { display: flex; height: 16px; border-radius: 9px; overflow: hidden; gap: 3px; }
.mode-bar i { display: block; height: 100%; }
.mode-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mode-list li:first-child { border-top: 0; }
.mode-list i { width: 10px; height: 10px; border-radius: 3px; }
.mode-list b { margin-left: auto; }
.mode-list span.pc { color: var(--faint); font-size: 12.5px; width: 44px; text-align: right; }
.mode-pill { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--panel-3); }

/* Dialogs */
.dlg { border: 1px solid var(--line-2); border-radius: 20px; padding: 0; background: var(--panel); color: var(--text); width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow); }
.dlg-sm { width: min(480px, calc(100vw - 24px)); }
.dlg-xs { width: min(400px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(5, 6, 8, .72); backdrop-filter: blur(3px); }
.dlg[open] { animation: dlgIn .25s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.dlg-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dlg-h h2, .dlg-b h2 { font: 800 26px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.dlg-b { padding: 20px; display: grid; gap: 14px; }
.dlg-b > h2 + p { margin-top: -4px; }
.dlg-f { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
.form-grid { grid-template-columns: 1fr 1fr; }
.f { display: grid; gap: 6px; align-content: start; }
.f-wide { grid-column: 1 / -1; }
.f label, .lbl { font-size: 13px; font-weight: 700; color: var(--dim); }
.f label i, .lbl i { color: var(--volt); font-style: normal; }
.f textarea { height: auto; padding: 10px 12px; resize: vertical; }
.f input[type="date"] { color-scheme: dark; }
.f input[aria-invalid="true"] { border-color: var(--coral); }
.err { font-size: 12.5px; color: var(--coral); min-height: 0; }
.err:empty { display: none; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.plan-opt { position: relative; }
.plan-opt input { position: absolute; opacity: 0; inset: 0; }
.plan-opt span { display: block; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; transition: border-color .15s, background .15s; }
.plan-opt span b { display: block; font-size: 14px; }
.plan-opt span small { color: var(--faint); font-size: 12.5px; }
.plan-opt input:checked + span { border-color: var(--volt); background: var(--volt-soft); }
.plan-opt input:focus-visible + span { outline: 2px solid var(--volt); outline-offset: 2px; }
.summary { font-size: 13.5px; color: var(--dim); background: var(--panel-2); border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); }
.summary b { color: var(--text); }
.rn-who { display: flex; align-items: center; gap: 12px; }
.rn-who b { display: block; }
.rn-who small { color: var(--faint); font-weight: 700; }

.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(440px, 100vw); border-radius: 22px 0 0 22px; }
.drawer[open] { animation: drawerIn .3s var(--ease); }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-in { display: flex; flex-direction: column; gap: 18px; padding: 22px; min-height: 100%; }
.dw-top { display: flex; justify-content: space-between; align-items: flex-start; }
.dw-id { display: flex; gap: 14px; align-items: center; }
.dw-id h2 { font: 800 30px/1 var(--f-display); text-transform: uppercase; }
.dw-id p { color: var(--faint); font-weight: 700; font-size: 13px; margin-top: 4px; }
.dw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dw-stats div { background: var(--panel-2); border-radius: 12px; padding: 12px; border: 1px solid var(--line); }
.dw-stats b { display: block; font: 800 28px/1 var(--f-display); }
.dw-stats span { font-size: 11.5px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.dw-list { display: grid; gap: 0; font-size: 14px; }
.dw-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dw-list dt { color: var(--faint); }
.dw-list dd { margin: 0; font-weight: 700; text-align: right; }
.dw-sec { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.dw-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.dw-act .btn-danger-line { grid-column: 1 / -1; color: var(--coral); border: 1px solid rgba(255,122,92,.4); }
.dw-act .btn-danger-line:hover { background: var(--coral-soft); }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: #F4F6F8; color: #0D0F12; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); animation: dlgIn .25s var(--ease); max-width: 360px; }
.toast .ic { color: #3f6b00; }
.toast.bad .ic { color: #b3361b; }

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 1180px) {
  .kpis, .kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-rev { grid-template-columns: 1fr; }
  .donut-wrap { flex-direction: row; justify-content: center; flex-wrap: wrap; }
  .legend { width: auto; min-width: 220px; }
  .hide-sm { display: none; }
}
@media (max-width: 980px) {
  .g-two, .g-desk { grid-template-columns: minmax(0, 1fr); }
  :root { --side: 220px; }
  .topbar { padding: 12px 20px; }
  main { padding: 22px 20px 40px; }
}

/* Sidebar collapses into a bottom tab bar */
@media (max-width: 820px) {
  .app { display: block; }
  .sidebar { position: static; height: auto; padding: 0; border: 0; background: none; display: block; }
  .brand, .floor, .side-foot, .nav-label { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(17, 20, 25, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line-2);
  }
  .nav-link { flex: 1; flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 10.5px; border-radius: 10px; min-width: 0; text-align: center; }
  .nav-link .ic { width: 20px; height: 20px; }
  .nav-link.is-active { background: transparent; color: var(--volt); }
  .nav-link.is-active::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .nav-count { position: absolute; top: 2px; left: 54%; margin: 0; padding: 2px 5px; font-size: 10px; }
  .tb-mark { display: grid; }
  .tb-title h1 { font-size: 24px; }
  .topbar { flex-wrap: wrap; gap: 10px 12px; }
  .tb-search { order: 3; flex-basis: 100%; max-width: none; }
  .tb-actions { margin-left: auto; }
  main { padding-bottom: 110px; }
  .mobile-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
  .toasts { bottom: 86px; left: 16px; right: 16px; }
  .toast { max-width: none; }
}

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  main { padding: 18px 16px 110px; }
  .tb-actions .btn span { display: none; }
  .tb-actions .btn { width: 42px; padding: 0; }
  .demo-badge { font-size: 10px; padding: 4px 8px; }
  .tb-search kbd { display: none; }
  .hello { flex-direction: column; align-items: flex-start; }
  .kpis, .kpis-3 { gap: 12px; }
  .kpi { padding: 14px; }
  .kpi-val { font-size: 34px; }
  .spark { display: none; }
  .card { padding: 16px; }
  .card-h.pad { padding: 16px 16px 0; }
  .selects { width: 100%; }
  .selects select { flex: 1; min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .dw-act { grid-template-columns: 1fr; }
  .desk-input { height: 68px; }
  .desk-input span, .desk-input input { font-size: 36px; }

  /* Stack table rows as cards */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .table td { padding: 0; border: 0; }
  .table td[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
  .table td.cell-who { grid-column: 1 / -1; }
  .table td.cell-act { grid-column: 1 / -1; }
  .table .num { text-align: left; }
  .table .empty-row { display: block; }
}
@media (max-width: 400px) {
  .kpis, .kpis-3 { grid-template-columns: 1fr 1fr; }
  .kpi-val { font-size: 30px; }
  .kpi-label { font-size: 12px; }
  .kpi-icon { display: none; }
  .tb-title h1 { font-size: 21px; }
  .keypad button { height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Pager + search extras */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--dim); }
.pager:empty { display: none; }
.pager .btn[disabled] { opacity: .4; cursor: not-allowed; }
.search-results .grow { flex: 1; min-width: 0; line-height: 1.3; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { height: 30px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; font-weight: 800; color: var(--dim); }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--volt); }
.card.col { display: flex; flex-direction: column; }
.chart.fill { flex: 1; }
.chart .ghost { fill: rgba(255, 255, 255, .07); }
.chart .today .b { fill: var(--sky); }
.chart .today .bar.is-hl .b { fill: var(--volt); }
.view { scroll-margin-top: 90px; }
.desk > *, .desk-form > * { min-width: 0; }
.desk-input input { width: 100%; }
.dw-top { gap: 10px; }
.dw-id { min-width: 0; }
.dw-id h2 { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  #dashRenewals .when { display: none; }
  .dw-id h2 { font-size: 25px; }
  .drawer { max-width: 100vw; width: 100vw; border-radius: 0; }
}
@media (max-width: 400px) {
  .tb-mark { display: none; }
  .topbar { gap: 8px; }
  .tb-title { gap: 8px; }
}
