/* ═══════════════════════════════════════════════════
   CalmLet – Mobile-first, Material-inspired stylesheet
   ═══════════════════════════════════════════════════ */

/* ── Design tokens ── */
:root {
  --primary: #1a73e8;
  --primary-dark: #1558b0;
  --primary-light: #e8f0fe;
  --on-primary: #fff;
  --secondary: #34a853;
  --danger: #d93025;
  --warning: #f9ab00;
  --warning-bg: #fff8e1;
  --surface: #fff;
  --surface-2: #f8f9fa;
  --outline: #dadce0;
  --on-surface: #202124;
  --on-surface-muted: #5f6368;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(60,64,67,.15), 0 1px 2px rgba(60,64,67,.1);
  --shadow-md: 0 2px 6px rgba(60,64,67,.2);
  --font: 'Google Sans', 'Roboto', sans-serif;
  --bottom-nav-h: 64px;
  --top-bar-h: 56px;
  --drawer-w: 280px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--surface-2);
  color: var(--on-surface);
  line-height: 1.5;
  min-height: 100dvh;
}
h1,h2,h3,h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
input, select, textarea, button { font-family: inherit; font-size: 1rem; }
a { color: var(--primary); text-decoration: none; cursor: pointer; }
button { cursor: pointer; border: none; background: none; }

/* ── Screens ── */
.screen { min-height: 100dvh; }
.screen[hidden] { display: none; }

/* ══════════════════════════════════════
   AUTH
══════════════════════════════════════ */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(160deg, var(--primary) 0%, #1558b0 100%);
  min-height: 100dvh;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 400px;
}

.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.logo-icon { font-size: 3rem !important; color: var(--primary); }
.app-name { font-size: 1.75rem; color: var(--on-surface); }
.app-tagline { color: var(--on-surface-muted); font-size: 0.9rem; margin-top: 0.25rem; }

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--outline);
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--on-surface-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.auth-form { display: none; }
.auth-form.active { display: block; }

.field { position: relative; margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--on-surface-muted);
  margin-bottom: 0.35rem;
}
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--outline);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--on-surface);
  transition: border-color .2s;
  outline: none;
  appearance: none;
}
.field input:not([type="checkbox"]):focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }

.field input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.field input[type="password"] { padding-right: 3rem; }
/* Hide native spinners on number inputs — use plain text-style appearance */
.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.show-pw {
  position: absolute; right: 0.75rem; bottom: 0.75rem;
  color: var(--on-surface-muted);
  background: none; border: none; padding: 0;
  display: flex; align-items: center;
  z-index: 1;
}
.show-pw .material-icons-round { font-size: 1.25rem; }

.checkbox-label {
  display: flex; gap: 0.75rem; align-items: flex-start;
  font-size: 0.85rem; color: var(--on-surface-muted); cursor: pointer;
}
.checkbox-label input { margin-top: 3px; flex-shrink: 0; accent-color: var(--primary); }

.form-error { color: var(--danger); font-size: 0.85rem; margin-bottom: 0.75rem; }
.form-error[hidden] { display: none; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--primary); color: var(--on-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 100px; font-weight: 600; font-size: 0.95rem;
  letter-spacing: .01em; transition: background .2s, box-shadow .2s; border: none;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary .material-icons-round { font-size: 1.1rem; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface); color: var(--primary);
  border: 1.5px solid var(--primary); padding: 0.7rem 1.4rem;
  border-radius: 100px; font-weight: 600; font-size: 0.95rem; transition: background .2s;
}
.btn-secondary:hover { background: var(--primary-light); }
.btn-full { width: 100%; justify-content: center; }
.btn-text {
  background: none; border: none; color: var(--primary);
  font-size: 0.9rem; display: block; margin: 0.75rem auto 0; padding: 0.5rem;
}
.btn-inline { background: none; border: none; color: var(--primary); padding: 0; font-size: inherit; text-decoration: underline; }
.btn-danger {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--danger); color: #fff; padding: 0.75rem 1.5rem;
  border-radius: 100px; font-weight: 600; font-size: 0.95rem; border: none;
}
.auth-note { text-align: center; font-size: 0.8rem; color: var(--on-surface-muted); margin-top: 1rem; }

/* ══════════════════════════════════════
   TOP BAR
══════════════════════════════════════ */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--top-bar-h);
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0 0.5rem 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.top-bar-brand {
  flex: 1;
  display: flex; align-items: center; gap: 0.4rem;
  padding-left: 1rem;
}
.top-bar-logo { font-size: 1.5rem !important; color: var(--primary); }
.top-bar-name { font-size: 1.2rem; font-weight: 700; color: var(--on-surface); letter-spacing: -0.01em; }
.top-bar-actions { display: flex; align-items: center; }
.icon-btn {
  position: relative; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-surface); background: none; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .material-icons-round { font-size: 1.5rem; }
.badge {
  position: absolute; top: 6px; right: 6px;
  background: var(--danger); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.badge[hidden] { display: none; }

/* ══════════════════════════════════════
   DRAWER
══════════════════════════════════════ */
.nav-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 300;
  width: var(--drawer-w); background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: translateX(-100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; display: flex; flex-direction: column;
}
.nav-drawer.open { transform: translateX(0); }
.drawer-scrim {
  position: fixed; inset: 0; z-index: 299; background: rgba(0,0,0,.4);
}
.drawer-scrim[hidden] { display: none; }
.drawer-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.5rem 1.25rem 1rem; border-bottom: 1px solid var(--outline);
}
.logo-icon.sm { font-size: 1.75rem !important; color: var(--primary); }
.app-name-sm { font-size: 1.2rem; font-weight: 600; color: var(--on-surface); }
.drawer-nav { padding: 0.5rem 0; }
.nav-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1.25rem;
  color: var(--on-surface-muted); font-size: 0.95rem; font-weight: 500;
  border-radius: 0 100px 100px 0; margin-right: 0.75rem;
  transition: background .15s, color .15s; cursor: pointer;
}
.nav-item .material-icons-round { font-size: 1.3rem; }
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-divider { height: 1px; background: var(--outline); margin: 0.5rem 1rem; }

/* ══════════════════════════════════════
   PAGE CONTENT
══════════════════════════════════════ */
.page-content {
  padding-top: calc(var(--top-bar-h) + 1.25rem);
  padding-bottom: calc(var(--bottom-nav-h) + 1.5rem);
  padding-left: 1rem; padding-right: 1rem;
  max-width: 900px; margin: 0 auto;
}
.page { display: none; }
.page.active { display: block; }
.dashboard-greeting {
  padding: 1.5rem 0 1.25rem;
}
.greeting-name {
  font-size: 1.45rem; font-weight: 700; color: var(--on-surface);
  line-height: 1.2; margin-bottom: 0.4rem;
}
.greeting-context {
  font-size: 0.92rem; font-weight: 500;
}
.greeting-context--ok     { color: #1e7e34; }
.greeting-context--urgent { color: var(--warning); }

.section-label {
  font-size: 0.78rem; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--on-surface-muted);
  margin: 1.75rem 0 0.75rem;
}
.section-label-toggle {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--on-surface-muted);
  margin: 1.75rem 0 0.75rem;
  background: none; border: none; padding: 0; cursor: pointer;
  width: 100%; text-align: left;
}
.section-label-toggle:hover { color: var(--on-surface); }
.page-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  align-items: center; margin-bottom: 1rem;
}
.page-toolbar .select-field { min-width: 0; max-width: 200px; flex: 1 1 120px; }
.page-toolbar .btn-primary,
.page-toolbar .btn-secondary { flex-shrink: 0; white-space: nowrap; }

/* ══════════════════════════════════════
   SUMMARY CHIPS
══════════════════════════════════════ */
.summary-chips {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem; margin-bottom: 0;
}
.chip {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.1rem 1rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.3rem;
}
.chip-value { font-size: 1.75rem; font-weight: 600; line-height: 1; }
.chip-label { font-size: 0.8rem; color: var(--on-surface-muted); }
.chip.urgent .chip-value { color: var(--danger); }
.chip.warning .chip-value { color: var(--warning); }
.chip.ok .chip-value { color: var(--secondary); }

/* ══════════════════════════════════════
   CARD LIST
══════════════════════════════════════ */
.card-list { display: flex; flex-direction: column; gap: 0.875rem; }

/* ══════════════════════════════════════
   ONBOARDING
══════════════════════════════════════ */
.onboarding-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem 1.5rem;
}
.onboarding-intro {
  font-size: 0.9rem; color: var(--on-surface-muted);
  margin-bottom: 1.25rem; line-height: 1.5;
}
.onboarding-steps { display: flex; flex-direction: column; gap: 0; }
.onboarding-step {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--outline);
}
.onboarding-step:last-child { border-bottom: none; padding-bottom: 0; }
.onboarding-step:first-child { padding-top: 0; }
.onboarding-step-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.onboarding-step-icon.done {
  background: #e6f4ea; color: #1e7e34;
}
.onboarding-step-icon .material-icons-round { font-size: 1.1rem; }
.onboarding-step-body { flex: 1; min-width: 0; }
.onboarding-step-title {
  font-size: 0.95rem; font-weight: 600; color: var(--on-surface);
  margin-bottom: 0.2rem;
}
.onboarding-step-title.done {
  text-decoration: line-through; color: var(--on-surface-muted);
}
.onboarding-step-desc {
  font-size: 0.82rem; color: var(--on-surface-muted); line-height: 1.45;
}
.onboarding-action {
  color: var(--primary); font-weight: 600; font-size: 0.85rem;
  background: none; border: none; cursor: pointer; padding: 0;
}
.onboarding-action:hover { text-decoration: underline; }
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.25rem;
  display: flex; align-items: flex-start; gap: 1rem;
  cursor: pointer; transition: box-shadow .15s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-icon .material-icons-round { font-size: 1.2rem; }
.card-icon.danger { background: #fce8e6; color: var(--danger); }
.card-icon.warning { background: var(--warning-bg); color: var(--warning); }
.card-icon.ok { background: #e6f4ea; color: var(--secondary); }
.card-body { flex: 1; min-width: 0; }
.card-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-subtitle { font-size: 0.82rem; color: var(--on-surface-muted); margin-top: 0.15rem; }
.card-meta { font-size: 0.8rem; color: var(--on-surface-muted); margin-top: 0.3rem; }
.card-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }

.status-chip {
  display: inline-block; padding: 0.2rem 0.65rem;
  border-radius: 100px; font-size: 0.75rem; font-weight: 600;
}
.status-chip.valid { background: #e6f4ea; color: #1e7e34; }
.status-chip.expiring { background: var(--warning-bg); color: #8a5900; }
.status-chip.expired { background: #fce8e6; color: var(--danger); }
.status-chip.open { background: var(--primary-light); color: var(--primary); }
.status-chip.done { background: #e6f4ea; color: #1e7e34; }
.status-chip.trial { background: #fce8e6; color: var(--danger); }
.status-chip.active-plan { background: #e6f4ea; color: #1e7e34; }
.status-chip.replaced { background: #f1f3f4; color: var(--on-surface-muted); }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--on-surface-muted); }
.empty-state .material-icons-round { font-size: 3rem; opacity: .3; }
.empty-state p { margin-top: 0.75rem; font-size: 0.95rem; }

/* ══════════════════════════════════════
   BOTTOM NAV
══════════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--bottom-nav-h);
  display: flex; background: var(--surface);
  box-shadow: 0 -1px 3px rgba(60,64,67,.1);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.15rem; color: var(--on-surface-muted);
  font-size: 0.7rem; font-weight: 500;
  transition: color .15s; border: none; background: none; padding: 0;
}
.bottom-nav-item .material-icons-round { font-size: 1.4rem; }
.bottom-nav-item.active { color: var(--primary); }

/* ══════════════════════════════════════
   INFO BANNER
══════════════════════════════════════ */
.info-banner {
  display: flex; gap: 0.75rem; align-items: flex-start;
  background: var(--primary-light); border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm); padding: 0.9rem 1rem;
  font-size: 0.875rem; color: #1558b0; margin-bottom: 1.5rem;
}
.info-banner .material-icons-round { flex-shrink: 0; font-size: 1.2rem; }

/* ══════════════════════════════════════
   TAX QUARTERS
══════════════════════════════════════ */
.tax-quarters {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem;
}
.quarter-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem;
}
.quarter-card h4 { font-size: 0.85rem; color: var(--on-surface-muted); font-weight: 600; }
.quarter-card .q-date { font-size: 0.8rem; color: var(--on-surface-muted); margin-top: 0.2rem; }
.quarter-card .q-status { margin-top: 0.5rem; }

/* ══════════════════════════════════════
   TASK TABS
══════════════════════════════════════ */
.task-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.task-tab {
  padding: 0.5rem 1.25rem; border-radius: 100px;
  font-size: 0.875rem; font-weight: 500; color: var(--on-surface-muted);
  border: 1.5px solid var(--outline); background: var(--surface);
  transition: background .15s, color .15s, border-color .15s;
}
.task-tab.active {
  background: var(--primary-light); color: var(--primary); border-color: var(--primary);
}

/* ══════════════════════════════════════
   SELECT FIELD
══════════════════════════════════════ */
.select-field {
  padding: 0.65rem 2.5rem 0.65rem 0.9rem;
  border: 1.5px solid var(--outline); border-radius: 100px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='20' width='20' viewBox='0 0 24 24'%3E%3Cpath fill='%235f6368' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") right 0.6rem center no-repeat;
  appearance: none; color: var(--on-surface); font-size: 0.9rem;
}
.select-field:focus { outline: none; border-color: var(--primary); }

/* ── File input ── */
.field input[type="file"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px dashed var(--outline);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--on-surface);
  cursor: pointer;
  font-size: 0.875rem;
}
.field input[type="file"]:hover { border-color: var(--primary); }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.5); padding: 0;
}
.modal-overlay[hidden] { display: none; }
.modal-wrapper {
  width: 100%;
  display: flex; flex-direction: column;
  max-height: 88dvh;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.modal-card {
  background: var(--surface);
  border-radius: 0;
  width: 100%;
  display: flex; flex-direction: column; overflow: hidden;
  flex: 1 1 auto; min-height: 0;
}
.modal-header {
  display: flex; align-items: center;
  padding: 1rem 1rem 1rem 1.5rem;
  border-bottom: 1px solid var(--outline); flex-shrink: 0;
}
.modal-title { flex: 1; font-size: 1.1rem; font-weight: 600; }
.modal-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.modal-footer {
  padding: 0.75rem 1.5rem 1.25rem;
  display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: flex-end;
  border-top: 1px solid var(--outline); flex-shrink: 0;
}
.modal-footer:empty { display: none; }
.modal-body .field { margin-bottom: 1rem; }
.modal-body .field:last-child { margin-bottom: 0; }
.modal-side-panel {
  background: var(--surface);
  border-top: 1px solid var(--outline);
  overflow: hidden;
  flex: 0 0 auto;
  max-height: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 0;
  display: flex;
  flex-direction: column;
}
.modal-side-panel.open {
  max-height: 40dvh;
  opacity: 1;
}
.modal-side-panel.open .modal-side-body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.modal-side-header {
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--outline);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-side-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary); margin: 0;
}
.modal-side-body { padding: 0 1.25rem 1rem; }

/* ══════════════════════════════════════
   SETTINGS
══════════════════════════════════════ */
.settings-group {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 1.25rem; overflow: hidden;
}
.settings-heading {
  font-size: 0.78rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary);
  padding: 0.75rem 1.25rem 0.5rem;
}
.settings-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border-top: 1px solid var(--outline);
  cursor: pointer; transition: background .15s;
}
.settings-item:first-of-type { border-top: none; }
.settings-item:hover { background: var(--surface-2); }
.settings-item > .material-icons-round:first-child { color: var(--on-surface-muted); }
.settings-item-text { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.settings-item-text strong { font-size: 0.9rem; font-weight: 500; }
.settings-item-text span { font-size: 0.8rem; color: var(--on-surface-muted); }
.chevron { color: var(--on-surface-muted); font-size: 1.2rem !important; }
.settings-item.danger > .material-icons-round:first-child { color: var(--danger); }
.settings-item.danger .settings-item-text strong { color: var(--danger); }

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast {
  position: fixed; bottom: calc(var(--bottom-nav-h) + 1rem); left: 50%;
  transform: translateX(-50%);
  background: #323232; color: #fff;
  padding: 0.75rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 0.9rem; z-index: 500; box-shadow: var(--shadow-md);
  max-width: 90vw; text-align: center; animation: fadein .2s;
}
.toast[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ══════════════════════════════════════
   PRIVACY POLICY
══════════════════════════════════════ */
.privacy-content { font-size: 0.875rem; color: var(--on-surface); line-height: 1.7; }
.privacy-content h3 { font-size: 0.95rem; margin: 1.25rem 0 0.4rem; color: var(--primary); }
.privacy-content p { margin-bottom: 0.75rem; }
.privacy-content ul { padding-left: 1.25rem; margin-bottom: 0.75rem; }

/* ══════════════════════════════════════
   DESKTOP BREAKPOINT
══════════════════════════════════════ */
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .page-content { padding-bottom: 2rem; }
  .nav-drawer {
    transform: translateX(0) !important;
    position: fixed; top: var(--top-bar-h); left: 0; bottom: 0;
    box-shadow: none; border-right: 1px solid var(--outline); z-index: 50;
  }
  .drawer-header { display: none; }
  #menu-btn { display: none; }
  #drawer-scrim { display: none !important; }
  .page-content { padding-left: calc(var(--drawer-w) + 1.5rem); padding-right: 1.5rem; }
  .modal-overlay { align-items: center; padding: 1.5rem; }
  .modal-wrapper { flex-direction: row; align-items: stretch; width: auto; max-height: 85dvh; border-radius: var(--radius); }
  .modal-card { border-radius: var(--radius); width: 520px; max-width: 520px; max-height: 85dvh; flex: none; }
  .modal-wrapper.with-panel .modal-card { border-radius: var(--radius) 0 0 var(--radius); }
  .modal-side-panel { border-top: none; border-left: 1px solid var(--outline); width: 0; max-height: 85dvh; border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface-2); transition: width 0.3s ease, opacity 0.25s ease; opacity: 0; overflow: hidden; display: flex; flex-direction: column; align-self: stretch; }
  .modal-side-panel.open { width: 280px; opacity: 1; max-height: none; }
  .modal-side-panel.open .modal-side-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
  .summary-chips { grid-template-columns: repeat(4, 1fr); }
  .tax-quarters { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1200px) {
  .page-content { max-width: 1000px; }
}

/* ══════════════════════════════════════
   UTILITIES
══════════════════════════════════════ */
.text-danger { color: var(--danger); }
.text-muted { color: var(--on-surface-muted); }
.mt-1 { margin-top: 1rem; }
.flex-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ══════════════════════════════════════
   APP LOADING SPINNER
══════════════════════════════════════ */
#app-loading {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--surface);
  z-index: 9999;
  gap: 1rem;
}
#app-loading[hidden] { display: none; }
.app-loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--outline);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.app-loading-label {
  font-size: 0.875rem;
  color: var(--on-surface-muted);
  font-family: var(--font);
}
