/* AssetPilot — Asset & Maintenance Platform */
/* IBM Plex family + amber/slate palette */

 :root {
  --bg:         #F5F7FB;
  --bg-surface: #FFFFFF;
  --bg-card:    #FFFFFF;
  --bg-hover:   #EEF2F7;
  --border:     #D8DEE8;
  --border-light:#CBD5E1;

  --amber:      #D97706;
  --amber-light:#F59E0B;
  --amber-dim:  #FEF3C7;
  --green:      #059669;
  --red:        #DC2626;
  --red-dark:   #991B1B;
  --blue:       #2563EB;
  --purple:     #7C3AED;
  --orange:     #EA580C;

  --text:       #0F172A;
  --text-muted: #475569;
  --text-dim:   #64748B;

  --sidebar-w:  240px;
  --topbar-h:   56px;
  --radius:     6px;
  --radius-lg:  10px;

  --font-mono: 'IBM Plex Mono', monospace;
  --font-sans: 'IBM Plex Sans', sans-serif;
}

[data-theme="dark"] {
  --bg:         #0F1117;
  --bg-surface: #161B26;
  --bg-card:    #1C2333;
  --bg-hover:   #232B3E;
  --border:     #2A3347;
  --border-light:#334155;

  --amber:      #F59E0B;
  --amber-light:#FCD34D;
  --amber-dim:  #92400E;
  --green:      #10B981;
  --red:        #EF4444;
  --red-dark:   #991B1B;
  --blue:       #3B82F6;
  --purple:     #8B5CF6;
  --orange:     #F97316;

  --text:       #E2E8F0;
  --text-muted: #94A3B8;
  --text-dim:   #64748B;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: transform .25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer; }
.logo-icon {
  width: 32px; height: 32px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 32px; height: 32px; }
.logo-text {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo-text strong { color: var(--amber); }

.sidebar-toggle {
  display: none;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.user-avatar {
  width: 34px; height: 34px;
  background: var(--amber-dim);
  color: #92400E;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 500;
  flex-shrink: 0;
}

.user-info { min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.nav-section-label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  padding: 16px 16px 6px;
}

.nav-menu { list-style: none; padding: 0 8px; }
.nav-item a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: all .15s;
}
.nav-item a .material-icons-round { font-size: 18px; flex-shrink: 0; }
.nav-item a:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active a {
  background: rgba(245,158,11,0.12);
  color: var(--amber);
  border-left: 2px solid var(--amber);
  padding-left: 8px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 8px 8px 16px;
  border-top: 1px solid var(--border);
}
.logout-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: all .15s;
}
.logout-btn:hover { color: var(--red); background: rgba(239,68,68,0.1); }
.logout-btn .material-icons-round { font-size: 18px; }

/* ─── Main Wrapper ─── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Topbar ─── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
}
.mobile-menu-btn {
  display: none;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px;
}
.topbar-title { font-size: 15px; font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-avatar {
  width: 32px; height: 32px;
  background: var(--amber-dim);
  color: #92400E;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

/* ─── Page Content ─── */
.page-content { padding: 24px; flex: 1; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none; transition: all .15s;
  white-space: nowrap;
}
.btn .material-icons-round { font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary { background: var(--amber); color: #000; border-color: var(--amber); }
.btn-primary:hover { background: var(--amber-light); }
.btn-secondary { background: var(--bg-hover); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-light); }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-success { background: rgba(16,185,129,0.1); color: var(--green); border-color: rgba(16,185,129,0.3); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.card-title .material-icons-round { font-size: 18px; color: var(--amber); }
.card-body { padding: 20px; }

/* ─── Stat Cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border-light); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
}
.stat-card.amber::before { background: var(--amber); }
.stat-card.green::before { background: var(--green); }
.stat-card.red::before { background: var(--red); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.orange::before { background: var(--orange); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  font-size: 20px;
}
.stat-card.amber .stat-icon { background: rgba(245,158,11,.15); color: var(--amber); }
.stat-card.green  .stat-icon { background: rgba(16,185,129,.15); color: var(--green); }
.stat-card.red    .stat-icon { background: rgba(239,68,68,.15);  color: var(--red); }
.stat-card.blue   .stat-icon { background: rgba(59,130,246,.15); color: var(--blue); }
.stat-card.purple .stat-icon { background: rgba(139,92,246,.15); color: var(--purple); }
.stat-card.orange .stat-icon { background: rgba(249,115,22,.15); color: var(--orange); }

.stat-value {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 500;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-delta { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg-surface);
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 10px 12px; font-size: 13px; color: var(--text); vertical-align: middle; }
tbody td.mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

.table-link { color: var(--amber); text-decoration: none; font-weight: 500; }
.table-link:hover { text-decoration: underline; }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-open        { background: rgba(59,130,246,.15);  color: #60A5FA; }
.badge-in_progress { background: rgba(245,158,11,.15);  color: var(--amber); }
.badge-completed   { background: rgba(16,185,129,.15);  color: var(--green); }
.badge-on_hold     { background: rgba(107,114,128,.15); color: #9CA3AF; }
.badge-cancelled   { background: rgba(239,68,68,.15);   color: var(--red); }
.badge-partially_completed { background: rgba(139,92,246,.15); color: #A78BFA; }
.badge-requires_follow_up  { background: rgba(236,72,153,.15); color: #F472B6; }

.badge-critical { background: rgba(127,29,29,.3); color: #FCA5A5; }
.badge-high     { background: rgba(239,68,68,.15); color: var(--red); }
.badge-medium   { background: rgba(245,158,11,.15); color: var(--amber); }
.badge-low      { background: rgba(107,114,128,.15); color: #9CA3AF; }
.badge-urgent   { background: rgba(220,38,38,.2); color: #FCA5A5; border: 1px solid rgba(220,38,38,.4); }

.badge-active         { background: rgba(16,185,129,.15); color: var(--green); }
.badge-in_repair      { background: rgba(245,158,11,.15); color: var(--amber); }
.badge-decommissioned { background: rgba(107,114,128,.15); color: #9CA3AF; }
.badge-disposed       { background: rgba(239,68,68,.15); color: var(--red); }

.badge-good      { background: rgba(16,185,129,.15); color: var(--green); }
.badge-excellent { background: rgba(16,185,129,.2); color: #34D399; }
.badge-fair      { background: rgba(245,158,11,.15); color: var(--amber); }
.badge-poor      { background: rgba(239,68,68,.15); color: var(--red); }

/* ─── Forms ─── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}
.form-label .req { color: var(--amber); }

.form-control {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font-sans); font-size: 13px;
  width: 100%;
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--amber); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px;
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-dim); }

.form-section {
  margin-bottom: 24px;
}
.form-section-title {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

/* ─── Page header ─── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-header-left {}
.page-header h1 { font-size: 20px; font-weight: 600; }
.page-header .breadcrumb { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.page-header .breadcrumb a { color: var(--text-muted); text-decoration: none; }
.page-header .breadcrumb a:hover { color: var(--amber); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ─── Search / filter bar ─── */
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap .material-icons-round {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: var(--text-dim); pointer-events: none;
}
.search-input { padding-left: 36px !important; }

/* ─── Detail view ─── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.detail-field {}
.detail-label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.detail-value { font-size: 13px; color: var(--text); word-break: break-word; }
.detail-value.mono { font-family: var(--font-mono); font-size: 12px; }
.detail-value.big { font-family: var(--font-mono); font-size: 20px; font-weight: 500; color: var(--amber); }

/* ─── Alerts ─── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert .material-icons-round { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(16,185,129,.1); color: var(--green); border: 1px solid rgba(16,185,129,.3); }
.alert-warning { background: rgba(245,158,11,.1); color: var(--amber); border: 1px solid rgba(245,158,11,.3); }
.alert-error   { background: rgba(239,68,68,.1);  color: var(--red);   border: 1px solid rgba(239,68,68,.3); }
.alert-info    { background: rgba(59,130,246,.1);  color: var(--blue);  border: 1px solid rgba(59,130,246,.3); }

/* ─── Progress bars ─── */
.progress-bar-wrap { background: var(--bg); border-radius: 9999px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 9999px; transition: width .3s; }
.progress-bar.amber { background: var(--amber); }
.progress-bar.green { background: var(--green); }
.progress-bar.red   { background: var(--red); }

/* ─── Tabs ─── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  transition: all .15s; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--amber); border-bottom-color: var(--amber); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Timeline ─── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 0; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -17px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--amber);
}
.timeline-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.timeline-content { font-size: 13px; }
.timeline-actor { color: var(--amber); font-weight: 500; }

/* ─── Empty state ─── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-dim);
}
.empty-state .material-icons-round { font-size: 48px; color: var(--border); margin-bottom: 12px; display: block; }
.empty-state h3 { font-size: 15px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ─── Login Page ─── */
.login-page {
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.login-container {
  width: 100%; max-width: 400px;
  padding: 24px;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
}
.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 52px; height: 52px;
  background: #1C2333;
  border: 1.5px solid var(--amber);
  color: #000;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.login-logo-icon svg { width: 28px; height: 28px; }
.login-logo-text { font-family: var(--font-mono); font-size: 20px; }
.login-logo-text strong { color: var(--amber); }
.login-title { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 28px; }
.login-divider {
  margin: 24px 0 16px;
  text-align: center; position: relative;
  font-size: 11px; color: var(--text-dim);
  font-family: var(--font-mono);
}
.login-footer { margin-top: 20px; font-size: 11px; color: var(--text-dim); text-align: center; }

/* ─── QR Code badge ─── */
.qr-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted);
}
.qr-badge .material-icons-round { font-size: 14px; color: var(--amber); }

/* ─── Checklist ─── */
.checklist-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type=checkbox] { margin-top: 2px; accent-color: var(--amber); width: 14px; height: 14px; flex-shrink: 0; }

/* ─── Cost row ─── */
.cost-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.cost-row:last-child { border-bottom: none; }
.cost-row.total { font-weight: 600; color: var(--amber); border-top: 2px solid var(--border); padding-top: 10px; }
.cost-row .cost-val { font-family: var(--font-mono); }

/* ─── Charts placeholder ─── */
.chart-wrap { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 8px; padding: 12px 0 0; }
.chart-bar-col { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 4px; }
.chart-bar {
  width: 100%; border-radius: 4px 4px 0 0;
  background: var(--amber);
  opacity: .7;
  transition: opacity .2s;
  min-height: 4px;
}
.chart-bar:hover { opacity: 1; }
.chart-bar.green { background: var(--green); }
.chart-bar.red   { background: var(--red); }
.chart-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }

/* ─── Section spacing ─── */
.section { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ─── Misc ─── */
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-amber { color: var(--amber); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.mono       { font-family: var(--font-mono); }
.fw-600     { font-weight: 600; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Flash messages */
.flash {
  position: fixed; top: 70px; right: 20px; z-index: 9999;
  min-width: 280px; max-width: 400px;
  animation: slideIn .3s ease;
}
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Pagination */
.pagination { display: flex; gap: 4px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.page-btn {
  padding: 5px 10px; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; text-decoration: none;
  transition: all .15s;
}
.page-btn:hover, .page-btn.active { background: var(--amber); color: #000; border-color: var(--amber); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .main-wrapper { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 199; }
  .sidebar-overlay.visible { display: block; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}


/* ─── Appearance / Theme Toggle ─── */
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text); }
.theme-toggle .material-icons-round { font-size: 18px; }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.switch { position: relative; display: inline-block; width: 48px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-light);
  transition: .2s;
  border-radius: 999px;
}
.slider:before {
  position: absolute; content: "";
  height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff;
  transition: .2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15,23,42,.2);
}
.switch input:checked + .slider { background: var(--amber); }
.switch input:checked + .slider:before { transform: translateX(22px); }

[data-theme="dark"] .user-avatar,
[data-theme="dark"] .topbar-avatar { color: var(--amber-light); }
