/* ══════════════════════════════════════════════════════════════════
   Poker Tracker — App Stylesheet
   Dark theme matching poker-range-ref.net design system
   ══════════════════════════════════════════════════════════════════ */

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button  { font: inherit; cursor: pointer; border: none; background: none; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ── CSS Variables ───────────────────────────────────────────────── */
:root {
  --bg: #0a0c0f;
  --bg2: #0d1520;
  --bg3: #1a2535;
  --surface: #111418;
  --surface2: #181c22;
  --border: #252b35;
  --border2: #2e3845;
  --text: #c8d0dc;
  --text-dim: #5a6578;
  --text-bright: #e8edf5;
  --muted: #8899aa;
  --accent: #00d4ff;
  --accent2: #ff6b35;
  --gold: #f5a623;
  --green: #00e676;
  --red: #ff4444;
  --blue: #4a90d9;
  --purple: #6c5ce7;
  --nav-h: 62px;
}

/* ── Base ────────────────────────────────────────────────────────── */
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ── App Shell ───────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}
#view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

/* ── Bottom Navigation ───────────────────────────────────────────── */
#bottom-nav {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  flex-shrink: 0;
  z-index: 100;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-dim);
  height: 100%;
  transition: color 0.15s;
}
.nav-btn svg  { width: 24px; height: 24px; }
.nav-btn span { font-size: 10px; font-weight: 500; }
.nav-btn.active { color: var(--purple); }

.nav-btn--add {
  flex: none;
  width: 52px;
  height: 42px;
  background: var(--purple);
  border-radius: 14px;
  margin: 0 12px;
  color: white;
  box-shadow: 0 4px 14px rgba(108,92,231,0.45);
}
.nav-btn--add svg { width: 22px; height: 22px; }

/* ── View Header ─────────────────────────────────────────────────── */
.view-header {
  display: flex;
  align-items: center;
  padding: 14px 16px 12px;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  border-bottom: 1px solid var(--border);
}
.view-header h2 {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-bright);
}
.back-btn, .hdr-icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  border-radius: 8px;
  flex-shrink: 0;
}
.back-btn svg, .hdr-icon-btn svg { width: 20px; height: 20px; }
.hdr-icon-btn:active { background: var(--surface2); }

/* ── Type Filter Tabs (Dashboard) ────────────────────────────────── */
.type-tabs {
  display: flex;
  background: var(--surface2);
  border-radius: 12px;
  padding: 3px;
  margin: 14px 16px 0;
}
.type-tab {
  flex: 1;
  padding: 8px 4px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-align: center;
  transition: all 0.2s;
  white-space: nowrap;
}
.type-tab.active {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,92,231,0.4);
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: 14px;
  margin: 12px 16px 0;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ── Total Profit Card ───────────────────────────────────────────── */
.profit-card {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  gap: 8px;
}
.profit-card-body  { flex: 1; }
.profit-card-label { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.profit-value {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.p-pos  { color: var(--green); }
.p-neg  { color: var(--red); }
.p-zero { color: var(--text-bright); }

/* ── Chart Card ──────────────────────────────────────────────────── */
.chart-card { padding: 14px 14px 10px; }
.chart-header {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}
.chart-lbl  { flex: 1; font-size: 13px; color: var(--text-dim); }
.chart-zero { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.chart-wrap { height: 140px; position: relative; }
.chart-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.chart-footer span { font-size: 11px; color: var(--text-dim); }

/* ── KPI Grid ────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 12px 16px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.kpi-card {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.kpi-card:nth-child(even)      { border-right: none; }
.kpi-card:nth-last-child(-n+2) { border-bottom: none; }
.kpi-lbl {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.kpi-val {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}
.kpi-val.p-pos { color: var(--green); }
.kpi-val.p-neg { color: var(--red); }

/* ── Period Section ──────────────────────────────────────────────── */
.period-section { margin: 12px 16px 20px; }
.period-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.period-header.open { border-radius: 14px 14px 0 0; }
.period-header:active { background: var(--surface2); }
.period-header-title { font-size: 15px; color: var(--text); }
.period-header-title strong { color: var(--text-bright); }
.period-chevron { color: var(--text-dim); font-size: 18px; transition: transform 0.2s; }
.period-chevron.open { transform: rotate(90deg); }

.period-tab-row {
  display: flex;
  border: 1px solid var(--border);
  border-top: none;
  background: var(--surface2);
  overflow: hidden;
}
.period-tab-btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-align: center;
  border-right: 1px solid var(--border);
  transition: all 0.15s;
}
.period-tab-btn:last-child { border-right: none; }
.period-tab-btn.active { color: var(--purple); background: rgba(108,92,231,0.1); }

.period-table-wrap { border: 1px solid var(--border); border-top: none; border-radius: 0 0 14px 14px; overflow: hidden; }
.period-row {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  background: var(--surface);
}
.period-row:last-child { border-bottom: none; }
.period-row .pr-period { flex: 1; color: var(--text-dim); }
.period-row .pr-sess   { width: 44px; text-align: center; color: var(--muted); font-size: 12px; }
.period-row .pr-hours  { width: 50px; text-align: center; color: var(--muted); font-size: 12px; }
.period-row .pr-profit { width: 72px; text-align: right; font-weight: 600; }

/* ── Search Bar ──────────────────────────────────────────────────── */
.search-bar {
  padding: 10px 16px;
  position: sticky;
  top: 57px;
  background: var(--bg);
  z-index: 9;
  border-bottom: 1px solid var(--border);
}
.search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px 9px 36px;
  color: var(--text-bright);
  font-size: 15px;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus        { outline: none; border-color: var(--border2); }
.search-wrap { position: relative; }
.search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  width: 16px; height: 16px;
}

/* ── Session Cards ───────────────────────────────────────────────── */
.sessions-list { padding-bottom: 24px; }
.session-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.session-card:active { background: var(--surface); }
.session-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.session-icon.cash       { background: rgba(245,166,35,0.15); color: var(--gold); }
.session-icon.tournament { background: rgba(108,92,231,0.15); color: var(--purple); }
.session-icon svg { width: 20px; height: 20px; }

.session-info { flex: 1; min-width: 0; }
.session-title {
  font-size: 15px; font-weight: 600; color: var(--text-bright);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-venue { font-size: 13px; color: var(--text-dim); margin-top: 1px; }
.session-meta  { font-size: 12px; color: var(--text-dim); margin-top: 3px; display: flex; align-items: center; gap: 4px; }

.session-right { text-align: right; flex-shrink: 0; }
.session-profit { font-size: 16px; font-weight: 700; }
.session-sub    { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.session-lock { color: var(--border2); flex-shrink: 0; }
.session-lock svg { width: 16px; height: 16px; }

.active-banner {
  margin: 12px 16px 0;
  padding: 12px 14px;
  background: rgba(108,92,231,0.1);
  border: 1px solid rgba(108,92,231,0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.pulse-dot {
  width: 8px; height: 8px;
  background: var(--purple); border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.5; transform:scale(1.4); }
}
.active-banner-text { flex: 1; font-size: 14px; color: var(--text); }
.active-banner-text strong { color: var(--purple); }

/* ── Form (New Session) ──────────────────────────────────────────── */
.session-type-tabs {
  display: flex;
  background: var(--surface2);
  border-radius: 12px;
  padding: 3px;
  margin: 14px 16px;
}
.stype-tab {
  flex: 1; padding: 10px;
  border-radius: 9px;
  font-size: 15px; font-weight: 600;
  color: var(--text-dim); text-align: center;
  transition: all 0.2s;
}
.stype-tab.active { background: var(--purple); color: #fff; }

.form-section-lbl {
  font-size: 13px; color: var(--text-dim);
  padding: 0 16px;
  margin-top: 18px; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.form-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 4px 16px;
  overflow: hidden;
}
.form-row {
  display: flex; align-items: center;
  padding: 12px 14px; gap: 12px;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}
.form-row:last-child { border-bottom: none; }
.form-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.form-icon svg { width: 16px; height: 16px; }
/* Icon colour themes */
.fi-gold   { background: rgba(245,166,35,0.18); color: var(--gold); }
.fi-orange { background: rgba(255,107,53,0.18); color: var(--accent2); }
.fi-blue   { background: rgba(74,144,217,0.18); color: var(--blue); }
.fi-muted  { background: rgba(136,153,170,0.12); color: var(--muted); }
.fi-teal   { background: rgba(0,212,255,0.15);  color: var(--accent); }
.fi-green  { background: rgba(0,230,118,0.15);  color: var(--green); }
.fi-purple { background: rgba(108,92,231,0.15); color: var(--purple); }

.form-row-lbl { flex: 1; font-size: 15px; color: var(--text); }
.form-row input,
.form-row select {
  background: transparent; border: none;
  color: var(--text-bright); font-size: 15px;
  text-align: right; min-width: 0;
}
.form-row input:focus,
.form-row select:focus { outline: none; }
.form-row input::placeholder { color: var(--text-dim); }
.form-row select { -webkit-appearance: none; appearance: none; }
.form-row select option { background: var(--surface2); }
.form-chevron { color: var(--text-dim); font-size: 16px; flex-shrink: 0; margin-left: 2px; }

/* Split buy-in (prize + rake + sidepot) */
.buyin-split {
  display: flex; align-items: center; gap: 6px; flex: 1; justify-content: flex-end;
}
.buyin-split input {
  width: 60px; text-align: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 7px; padding: 5px 6px;
  color: var(--text-bright); font-size: 14px;
}
.buyin-split input:focus { outline: none; border-color: var(--purple); }
.buyin-sep { font-size: 12px; color: var(--text-dim); }
.buyin-total { font-size: 12px; color: var(--text-dim); margin-left: 6px; white-space: nowrap; }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; }
.toggle-switch { position: relative; width: 51px; height: 31px; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border2); border-radius: 34px;
  cursor: pointer; transition: 0.25s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  left: 3px; top: 3px; width: 25px; height: 25px;
  background: #fff; border-radius: 50%;
  transition: 0.25s; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.toggle-switch input:checked + .toggle-slider { background: var(--purple); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-row {
  display: flex; gap: 10px;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  position: sticky; bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.btn {
  height: 52px; border-radius: 14px;
  font-size: 16px; font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); opacity: 0.85; }
.btn-primary  { flex: 1; background: var(--purple); color: #fff; }
.btn-secondary { width: 110px; background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-danger   { flex: 1; background: rgba(255,68,68,0.1); color: var(--red); border: 1px solid rgba(255,68,68,0.25); }
.btn-full     { flex: 1; }

/* ── Session Detail ──────────────────────────────────────────────── */
.detail-hero {
  text-align: center;
  padding: 28px 16px 20px;
  border-bottom: 1px solid var(--border);
}
.detail-amount {
  font-size: 52px; font-weight: 800;
  letter-spacing: -1px; line-height: 1;
}
.detail-sublabel { font-size: 14px; color: var(--text-dim); margin-top: 6px; }
.detail-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: rgba(108,92,231,0.15);
  color: var(--purple);
}
.detail-badge.completed { background: rgba(0,230,118,0.12); color: var(--green); }

.detail-rows { padding-bottom: 8px; }
.detail-row {
  display: flex;
  justify-content: space-between; align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.detail-row .dr-lbl { color: var(--text-dim); }
.detail-row .dr-val { color: var(--text-bright); font-weight: 500; }

/* Rebuy card */
.rebuy-card { padding: 16px; }
.rebuy-card h3 {
  font-size: 15px; font-weight: 600; color: var(--text-bright);
  margin-bottom: 6px;
}
.rebuy-total {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 12px;
}
.rebuy-card .btn-row { align-items: center; }
.rebuy-card .cashout-input { margin-bottom: 0; font-size: 18px; }

/* Close-out card */
.closeout-card { padding: 16px; }
.closeout-card h3 {
  font-size: 15px; font-weight: 600; color: var(--text-bright);
  margin-bottom: 12px;
}
.cashout-input {
  width: 100%;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 14px;
  color: var(--text-bright); font-size: 22px; font-weight: 600;
  text-align: center; margin-bottom: 12px;
}
.cashout-input:focus { outline: none; border-color: var(--purple); }

/* ── Presets Bottom Sheet ─────────────────────────────────────────── */
#sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
#sheet-overlay.open { opacity: 1; pointer-events: all; }
#sheet-panel {
  width: 100%; max-width: 430px; margin: 0 auto;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px max(20px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  max-height: 90dvh;
  overflow-y: auto;
}
#sheet-overlay.open #sheet-panel { transform: translateY(0); }
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border2); border-radius: 2px;
  margin: 0 auto 16px;
}
.sheet-title { font-size: 17px; font-weight: 600; color: var(--text-bright); margin-bottom: 14px; }
.preset-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 8px;
  cursor: pointer; transition: border-color 0.15s;
}
.preset-item:active { border-color: var(--purple); }
.preset-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.preset-icon svg { width: 18px; height: 18px; }
.preset-name { font-weight: 600; font-size: 15px; color: var(--text-bright); }
.preset-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ── Toast ───────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px); max-width: 380px;
}
.toast {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 12px; padding: 12px 16px;
  font-size: 14px; color: var(--text-bright);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  text-align: center;
  animation: toastIn 0.3s ease;
}
.toast.success { border-color: rgba(0,230,118,0.4); color: var(--green); }
.toast.error   { border-color: rgba(255,68,68,0.4);  color: var(--red); }
@keyframes toastIn {
  from { opacity:0; transform:translateY(-8px) scale(0.95); }
  to   { opacity:1; transform:none; }
}

/* ── More / Settings ─────────────────────────────────────────────── */
.settings-section { margin-bottom: 4px; }
.settings-title {
  font-size: 12px; color: var(--text-dim);
  padding: 18px 16px 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.settings-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; font-size: 15px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.settings-item:first-of-type { border-top: 1px solid var(--border); }
.settings-item-lbl { flex: 1; color: var(--text); }
.settings-item-val { font-size: 14px; color: var(--text-dim); }
.settings-add-row {
  display: flex; gap: 8px;
  padding: 10px 16px 20px;
}
.settings-add-input {
  flex: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  color: var(--text-bright); font-size: 15px;
}
.settings-add-input:focus { outline: none; border-color: var(--purple); }
.btn-add-inline {
  background: var(--purple); color: #fff;
  border-radius: 10px; padding: 10px 16px;
  font-size: 15px; font-weight: 600;
}

/* ── Misc ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 64px 24px;
  color: var(--text-dim);
}
.empty-state svg { width: 56px; height: 56px; margin-bottom: 16px; opacity: 0.25; }
.empty-state p { font-size: 15px; line-height: 1.6; }
.view-pb { padding-bottom: 24px; }
.section-divider { height: 1px; background: var(--border); margin: 0; }

/* ── Date Range Bar (Dashboard) ──────────────────────────────────── */
.date-range-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 16px 0;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.date-range-input {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text-bright);
  font-size: 13px;
}
.date-range-input:focus { outline: none; border-color: var(--purple); }
.date-range-sep  { font-size: 13px; color: var(--text-dim); flex-shrink: 0; }
.date-range-apply {
  background: var(--purple);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.date-range-reset {
  color: var(--text-dim);
  font-size: 15px;
  padding: 4px 5px;
  flex-shrink: 0;
}
.date-range-reset.hidden { display: none; }

/* ── Preset Edit Sheet ────────────────────────────────────────────── */
.sheet-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.sheet-field-lbl  { font-size: 15px; color: var(--text); flex-shrink: 0; }
.sheet-field-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-bright);
  font-size: 15px;
  text-align: right;
  min-width: 0;
  max-width: 180px;
}
.sheet-field-input:focus { outline: none; border-color: var(--purple); }
.sheet-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ── Preset action buttons (More screen) ─────────────────────────── */
.preset-action-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 7px;
  background: var(--surface2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Login Screen ─────────────────────────────────────────────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 28px 32px;
}
.login-logo {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: 6px;
}
.login-title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 28px;
}
.login-input {
  display: block;
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 1rem;
  color: var(--text-bright);
  margin-bottom: 12px;
  transition: border-color .15s;
}
.login-input:focus {
  outline: none;
  border-color: var(--accent);
}
.login-err {
  min-height: 20px;
  font-size: .85rem;
  color: var(--red);
  margin-bottom: 8px;
  text-align: center;
}
.login-btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  margin-top: 4px;
}
.login-btn:hover  { background: #00b8d9; }
.login-btn:active { opacity: .85; }
.login-btn:disabled { opacity: .55; cursor: default; }

/* ── Logout button (More screen) ──────────────────────────────── */
.btn-logout {
  display: block;
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--red);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-logout:hover { background: rgba(255, 68, 68, .08); }

/* ── Home / portal link (More screen) ─────────────────────────── */
.btn-home {
  display: block;
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.btn-home:hover { background: rgba(0, 212, 255, .08); }
