/* ============================================================
   FreeMCS Installer Dashboard — Component Styles
   Spruce.eco-inspired design system
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --primary: #065f46;
  --primary-light: #047857;
  --primary-lighter: #d1fae5;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-light: #a7f3d0;
  --bg: #f9fafb;
  --bg-alt: #f3f4f6;
  --surface: #ffffff;
  --surface-hover: #f9fafb;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --transition: all 0.2s ease;
  --nav-h: 64px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  padding-top: var(--nav-h);
}

/* ── Navbar ────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.navbar-brand svg {
  width: 28px;
  height: 28px;
}

.navbar-links {
  display: none;
  align-items: center;
  gap: 4px;
}

.navbar-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.navbar-links a:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.navbar-links a.active {
  background: var(--primary-lighter);
  color: var(--primary);
  font-weight: 600;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.navbar-avatar:hover {
  transform: scale(1.05);
}

/* Mobile hamburger */
.navbar-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.navbar-toggle span {
  display: block;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile slide-out nav */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--surface);
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  padding: 20px 16px;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-header .brand {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
}

.mobile-nav a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: 4px;
}

.mobile-nav a:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.mobile-nav a.active {
  background: var(--primary-lighter);
  color: var(--primary);
  font-weight: 600;
}

/* ── Layout ────────────────────────────────────────────── */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.screen {
  display: none;
  animation: fadeIn 0.25s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.card-header .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── KPI Grid ──────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-card .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.kpi-card .value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.kpi-card .change {
  font-size: 13px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-card .change.up { color: var(--success); }
.kpi-card .change.down { color: var(--error); }
.kpi-card .change.neutral { color: var(--text-muted); }

.kpi-card .icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.kpi-card .icon-wrap.green { background: var(--primary-lighter); }
.kpi-card .icon-wrap.emerald { background: #d1fae5; }
.kpi-card .icon-wrap.blue { background: #dbeafe; }
.kpi-card .icon-wrap.amber { background: #fef3c7; }

/* ── Screen Headers ────────────────────────────────────── */
.screen-header {
  margin-bottom: 24px;
}

.screen-header h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.screen-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Forms ──────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group select {
  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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-group select option {
  padding: 8px;
}

.form-group .field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  display: none;
}

.form-group .field-error.show {
  display: block;
}

.form-group input.error,
.form-group select.error {
  border-color: var(--error);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}

.btn-ghost:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: var(--radius);
}

.btn-block {
  width: 100%;
  display: flex;
}

.btn .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.loading .spinner {
  display: inline-block;
}

.btn.loading .btn-text {
  opacity: 0.7;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Results ────────────────────────────────────────────── */
.result-hero {
  background: linear-gradient(135deg, #065f46, #047857);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 20px;
  color: white;
}

.result-hero .big {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.result-hero .unit {
  font-size: 16px;
  opacity: 0.8;
  margin-top: 2px;
}

.result-hero .sub {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 6px;
}

.result-hero .label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-bottom: 8px;
}

/* ── Room Cards ──────────────────────────────────────────── */
.room-card {
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 10px;
  border-left: 3px solid var(--accent);
  position: relative;
  transition: var(--transition);
}

.room-card:hover {
  background: var(--border-light);
}

.room-card .name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.room-card .dims {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.room-card .remove {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  transition: var(--transition);
}

.room-card .remove:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.08);
}

.room-list {
  margin-top: 16px;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

table tr:last-child td {
  border-bottom: none;
}

table tr:hover td {
  background: var(--bg-alt);
}

/* ── Status Badges ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green {
  background: var(--primary-lighter);
  color: var(--primary);
}

.badge-emerald {
  background: #d1fae5;
  color: #065f46;
}

.badge-yellow {
  background: #fef3c7;
  color: #92400e;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.badge-gray {
  background: var(--bg-alt);
  color: var(--text-secondary);
}

.badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

/* ── Grant Results ──────────────────────────────────────── */
.grant-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.grant-card:hover {
  box-shadow: var(--shadow-md);
}

.grant-card .scheme-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.grant-card .scheme-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.grant-card .scheme-status {
  font-size: 12px;
  margin-bottom: 10px;
}

.grant-card .scheme-conditions {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 20px;
}

.grant-card .scheme-conditions li {
  margin-bottom: 2px;
}

.grant-card .scheme-next {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-radius: var(--radius-xs);
  line-height: 1.5;
}

/* ── Solar / Radiator Results ────────────────────────────── */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result-item {
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.result-item .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.result-item .value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.result-item .value.green { color: var(--primary); }
.result-item .value.accent { color: var(--accent); }

/* ── Radiator Suggestions ────────────────────────────────── */
.radiator-suggestion {
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.radiator-suggestion.recommended {
  border-color: var(--accent);
  background: #ecfdf5;
}

.radiator-suggestion .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.radiator-suggestion .size {
  font-size: 16px;
  font-weight: 700;
}

.radiator-suggestion .outputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.radiator-suggestion .output-item {
  text-align: center;
  padding: 8px;
  background: white;
  border-radius: var(--radius-xs);
}

.radiator-suggestion .output-item .val {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.radiator-suggestion .output-item .lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.radiator-suggestion .recommended-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: white;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── Survey List ──────────────────────────────────────────── */
.survey-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 10px;
  transition: var(--transition);
  cursor: pointer;
}

.survey-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.survey-item .address {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.survey-item .meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.survey-item .meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto 20px;
}

/* ── Loading / Error States ──────────────────────────────── */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.loading-state .spinner-lg {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

.error-state {
  text-align: center;
  padding: 40px 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.error-state .icon { font-size: 36px; margin-bottom: 12px; }
.error-state h3 {
  font-size: 15px;
  color: var(--error);
  margin-bottom: 4px;
}
.error-state p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius);
  background: var(--text);
  color: white;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 400px;
  text-align: center;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.info { background: var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Login Screen ────────────────────────────────────────── */
.login-wrap {
  max-width: 400px;
  margin: 80px auto;
}

.login-wrap .logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-wrap .logo h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.login-wrap .logo p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.login-wrap .card {
  padding: 32px;
}

.login-wrap .card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-wrap .card .sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (min-width: 768px) {
  .navbar-links {
    display: flex;
  }

  .navbar-toggle {
    display: none;
  }

  .main-container {
    padding: 32px;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .screen-header h1 {
    font-size: 28px;
  }

  .result-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .main-container {
    padding: 40px;
  }

  .form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 56px;
  }

  :root {
    --nav-h: 56px;
  }

  .navbar {
    padding: 0 12px;
  }

  .main-container {
    padding: 16px 12px;
  }

  .card {
    padding: 16px;
  }

  .kpi-grid {
    gap: 10px;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-card .value {
    font-size: 22px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row-3 {
    grid-template-columns: 1fr 1fr;
  }

  .result-grid {
    grid-template-columns: 1fr 1fr;
  }

  .result-hero .big {
    font-size: 32px;
  }
}

/* ── Bottom Tab Bar (mobile) ──────────────────────────── */
.bottom-tabs {
  display: none;
}

@media (max-width: 767px) {
  .bottom-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 999;
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 6px));
    justify-content: space-around;
  }

  .tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    min-width: 48px;
    min-height: 44px;
  }

  .tab-link.active {
    color: var(--primary);
  }

  .tab-icon {
    font-size: 20px;
    line-height: 1;
  }

  .tab-label {
    font-size: 10px;
    line-height: 1;
  }

  body {
    padding-bottom: 64px;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .navbar-links {
    display: none;
  }

  .navbar-toggle {
    display: flex;
  }

  .navbar-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

/* ── Safe areas for iPhone notch ────────────────────────── */
@supports (padding: max(0px)) {
  .navbar {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .main-container {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

/* ── Action cards hover state ──────────────────────────── */
.action-cards .card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
