/* ==========================================================================
   App shell: brand tokens, header, main, footer (app-*)
   "Indigo Ledger" design system — distinctive personal finance aesthetic
   ========================================================================== */

:root {
    /* Brand — Indigo. Not Microsoft blue, not terracotta, not acid green. */
    --app-brand: #4F46E5;
    --app-brand-hover: #4338CA;
    --app-brand-pressed: #3730A3;
    --app-brand-soft: #E0E7FF;
    --app-brand-bg-hover: #C7D2FE;

    /* Domain-specific accents — green for growth, red for loss */
    --app-accent-positive: #059669;
    --app-accent-positive-soft: #D1FAE5;
    --app-accent-negative: #DC2626;
    --app-accent-negative-soft: #FEE2E2;
    --app-accent-warning: #D97706;
    --app-accent-warning-soft: #FEF3C7;

    /* Neutral palette — paper white, not cream */
    --app-bg: #FFFFFF;
    --app-surface: #F9FAFB;
    --app-surface-secondary: #F3F4F6;
    --app-border: #E5E7EB;
    --app-border-hover: #D1D5DB;
    --app-text: #111827;
    --app-text-muted: #6B7280;
    --app-text-disabled: #D1D5DB;
    --app-header-height: 56px;

    /* Minimal shadows — rules over elevation */
    --app-shadow-2: 0 1px 2px rgba(0, 0, 0, 0.04);
    --app-shadow-4: 0 2px 4px rgba(0, 0, 0, 0.06);
    --app-shadow-8: 0 4px 8px rgba(0, 0, 0, 0.08);
    --app-shadow-16: 0 8px 16px rgba(0, 0, 0, 0.1);
    --app-shadow-32: 0 16px 32px rgba(0, 0, 0, 0.12);

    /* Typography — Inter for UI, IBM Plex Mono for financial data */
    --app-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --app-font-mono: "IBM Plex Mono", "SF Mono", "Consolas", monospace;
    --app-font-size-base: 0.96rem;
    --app-font-size-small: 0.8rem;
    --app-font-size-large: 1.1rem;
    --app-font-size-xl: 1.35rem;
    --app-font-size-xxl: 1.92rem;
  --app-font-weight-regular: 400;
    --app-font-weight-medium: 500;
  --app-font-weight-semibold: 600;
  --app-font-weight-bold: 700;

    /* Spacing */
  --app-spacing-xs: 4px;
  --app-spacing-s: 8px;
  --app-spacing-m: 16px;
  --app-spacing-l: 24px;
  --app-spacing-xl: 32px;
    --app-spacing-2xl: 48px;

    /* Border Radius — subtle, not uniform */
    --app-radius-s: 3px;
    --app-radius-m: 6px;
    --app-radius-l: 8px;

    /* Bootstrap overrides — map Indigo Ledger tokens to Bootstrap variables */
  --bs-primary: var(--app-brand);
    --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: var(--app-brand);
    --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: var(--app-brand-hover);
    --bs-link-hover-color-rgb: 67, 56, 202;
  --bs-body-color: var(--app-text);
  --bs-border-color: var(--app-border);
  --bs-body-font-family: var(--app-font-family);

  /* Fluent UI Web Components design tokens — theme fluent-* elements */
  --accent-fill-rest: var(--app-brand);
  --accent-fill-hover: var(--app-brand-hover);
  --accent-fill-active: var(--app-brand-pressed);
  --accent-fill-input-active: var(--app-brand);
  --neutral-fill-rest: var(--app-surface-secondary);
  --neutral-fill-hover: var(--app-bg);
  --neutral-fill-active: var(--app-border);
  --neutral-stroke-rest: var(--app-border);
  --neutral-stroke-hover: var(--app-border-hover);
  --neutral-stroke-active: var(--app-text-muted);
  --neutral-stroke-disabled: var(--app-text-disabled);
  --neutral-fill-hover-alpha: 0.06;
  --neutral-fill-active-alpha: 0.10;
  --neutral-fill-input-active: var(--app-surface);
  --input-stroke-rest: var(--app-border);
  --input-stroke-hover: var(--app-border-hover);
  --input-stroke-focus: var(--app-brand);
}

html {
  font-size: 15px;
  font-family: var(--app-font-family);
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* ==========================================================================
   Financial data values — monospace for alignment and scanning
   ========================================================================== */

.app-currency,
.app-percent,
.app-data-value,
table .text-end,
.nw-currency,
.nw-currency-symbol,
.nw-currency-amount {
    font-family: var(--app-font-mono);
    font-size: 0.9em;
    letter-spacing: -0.01em;
}

/* Sticky footer: the body is a column and main takes the remaining height */
.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  -webkit-font-smoothing: antialiased;
}

.app-main {
  flex: 1 0 auto;
  padding: 1.5rem 0 3rem;
}

.app-main:focus {
  outline: none;
}

.app-skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1100;
  padding: 8px 14px;
  border-radius: var(--app-radius-s);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-8);
}

/* Buttons — clean, no shadows, indigo brand */
.btn-primary {
  --bs-btn-bg: var(--app-brand);
  --bs-btn-border-color: var(--app-brand);
  --bs-btn-hover-bg: var(--app-brand-hover);
  --bs-btn-hover-border-color: var(--app-brand-hover);
  --bs-btn-active-bg: var(--app-brand-pressed);
  --bs-btn-active-border-color: var(--app-brand-pressed);
  --bs-btn-disabled-bg: var(--app-brand);
  --bs-btn-disabled-border-color: var(--app-brand);
    border-radius: var(--app-radius-s);
    font-weight: var(--app-font-weight-medium);
    padding: 8px 18px;
  font-size: var(--app-font-size-base);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-outline-primary {
  --bs-btn-color: var(--app-brand);
  --bs-btn-border-color: var(--app-brand);
  --bs-btn-hover-bg: var(--app-brand);
  --bs-btn-hover-border-color: var(--app-brand);
  --bs-btn-active-bg: var(--app-brand-pressed);
  --bs-btn-active-border-color: var(--app-brand-pressed);
    border-radius: var(--app-radius-s);
    font-weight: var(--app-font-weight-medium);
    padding: 7px 16px;
  font-size: var(--app-font-size-base);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-outline-primary:hover {
  color: #fff;
}

/* Secondary buttons */
.btn-secondary {
    border-radius: var(--app-radius-s);
    font-weight: var(--app-font-weight-medium);
    padding: 8px 18px;
    transition: background-color 0.15s ease;
}

/* Success buttons */
.btn-success {
    border-radius: var(--app-radius-s);
    font-weight: var(--app-font-weight-medium);
    transition: background-color 0.15s ease;
}

/* Enhanced form controls for Google Drive page */
.gd-page .form-control {
  border-radius: var(--app-radius-m);
  border: 1px solid var(--gdrive-border);
  padding: 10px 14px;
  font-size: 0.9rem;
  transition: all 0.25s ease;
  background: var(--gdrive-surface);
}
.gd-page .form-control:focus {
  border-color: var(--gdrive-primary);
  box-shadow: var(--gdrive-shadow-glow);
}
.gd-page .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gdrive-text-main);
  margin-bottom: 6px;
}
.gd-page .btn-light {
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid var(--gdrive-border);
}
.gd-page .btn-light:hover {
  background: var(--gdrive-surface-soft);
  border-color: var(--gdrive-border-hover);
  /* hover effect removed */;
  box-shadow: var(--gdrive-shadow-sm);
}
.gd-page .btn-outline-secondary {
  border-radius: 10px;
  font-weight: 500;
  border: 1px solid var(--gdrive-border);
  transition: all 0.2s ease;
}
.gd-page .btn-outline-secondary:hover {
  background: var(--gdrive-surface-soft);
  border-color: var(--gdrive-border-hover);
  /* hover effect removed */;
}
.btn-success {
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.15);
}
.gd-page .btn-success:hover {
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  /* hover effect removed */;
}
.gd-page .btn-warning {
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.gd-page .btn-warning:hover {
  /* hover effect removed */;
}
.gd-page .btn-danger {
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.gd-page .btn-link {
  font-weight: 500;
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--app-brand);
}

/* Fluent UI focus ring — 2px outer ring, matching brand color */
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.fluent-input:focus {
  box-shadow: 0 0 0 2px var(--app-brand-soft);
  outline: 2px solid var(--app-brand);
  outline-offset: 0;
}

/* Fluent UI styled form controls */
.form-control,
.form-select {
  border-radius: var(--app-radius-m);
  border: 1px solid var(--app-border);
  font-size: var(--app-font-size-base);
  padding: 5px 12px;
  transition: border-color 0.1s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--app-brand);
}
.form-control:disabled,
.form-select:disabled {
  background-color: var(--app-surface-secondary);
  color: var(--app-text-disabled);
}

/* ==========================================================================
   Component Overrides — clean, rule-based, no decorative chrome
   ========================================================================== */

/* --- Cards — borders only, no shadows --- */
.card {
  border: 1px solid var(--app-border);
    border-radius: var(--app-radius-s);
  background: var(--app-surface);
    box-shadow: none;
}
.card-header {
    background: transparent;
  border-bottom: 1px solid var(--app-border);
    font-weight: var(--app-font-weight-medium);
  font-size: var(--app-font-size-base);
  color: var(--app-text);
}
.card-body {
  padding: var(--app-spacing-m) var(--app-spacing-l);
}
.card-title {
  font-weight: var(--app-font-weight-semibold);
  color: var(--app-text);
  font-size: var(--app-font-size-large);
}
.card-subtitle {
  color: var(--app-text-muted);
  font-size: var(--app-font-size-base);
}
.card-text {
  color: var(--app-text-muted);
  font-size: var(--app-font-size-base);
}
.card-footer {
    background: transparent;
  border-top: 1px solid var(--app-border);
}

/* --- Tables — sentence case headers, monospace data --- */
.table {
  font-size: var(--app-font-size-base);
  color: var(--app-text);
}
.table thead th {
  font-size: var(--app-font-size-small);
    font-weight: var(--app-font-weight-medium);
  color: var(--app-text-muted);
    background: transparent;
  border-bottom: 2px solid var(--app-border);
  padding: var(--app-spacing-s) var(--app-spacing-m);
    text-transform: none;
    letter-spacing: normal;
}
.table tbody td {
  border-bottom: 1px solid var(--app-border);
  padding: var(--app-spacing-s) var(--app-spacing-m);
  vertical-align: middle;
}

.table tbody td.text-end {
    font-family: var(--app-font-mono);
    font-size: 0.9em;
}
.table-hover tbody tr:hover {
  background: var(--app-brand-soft);
}
.table-striped tbody tr:nth-of-type(odd) {
    background: var(--app-surface);
}

/* --- Modals --- */
.modal-content {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-m);
  box-shadow: var(--app-shadow-16);
}
.modal-header {
  background: var(--app-surface-secondary);
  border-bottom: 1px solid var(--app-border);
  padding: var(--app-spacing-m) var(--app-spacing-l);
}
.modal-title {
  font-weight: var(--app-font-weight-semibold);
  color: var(--app-text);
  font-size: var(--app-font-size-xl);
}
.modal-body {
  padding: var(--app-spacing-l);
  color: var(--app-text);
}
.modal-footer {
  background: var(--app-surface-secondary);
  border-top: 1px solid var(--app-border);
  padding: var(--app-spacing-s) var(--app-spacing-l);
}
.modal-backdrop.show {
  background: rgba(0, 0, 0, 0.4);
}

/* --- Alerts --- */
.alert {
  border-radius: var(--app-radius-m);
  border-width: 1px;
  font-size: var(--app-font-size-base);
  padding: var(--app-spacing-m) var(--app-spacing-l);
}
.alert-success {
  background: #dff6dd;
  border-color: #107c10;
  color: #006300;
}
.alert-danger,
.alert-error {
  background: #fde7e9;
  border-color: #d13438;
  color: #a02020;
}
.alert-warning {
  background: #fff4ce;
  border-color: #d89b26;
  color: #8a5a00;
}
.alert-info {
  background: var(--app-brand-soft);
  border-color: var(--app-brand);
  color: var(--app-brand-pressed);
}

/* --- Badges --- */
.badge {
  font-weight: var(--app-font-weight-semibold);
  font-size: var(--app-font-size-small);
  border-radius: var(--app-radius-s);
  padding: 2px 8px;
}
.badge.bg-primary {
  background: var(--app-brand) !important;
}
.badge.bg-secondary {
  background: var(--app-text-muted) !important;
}
.badge.bg-success {
  background: #107c10 !important;
}
.badge.bg-danger {
  background: #d13438 !important;
}
.badge.bg-warning {
  background: #d89b26 !important;
  color: #000;
}
.badge.bg-info {
  background: #0078d4 !important;
}

/* --- Dropdowns --- */
.dropdown-menu {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-m);
  box-shadow: var(--app-shadow-8);
  padding: var(--app-spacing-xs) 0;
  font-size: var(--app-font-size-base);
}
.dropdown-item {
  padding: var(--app-spacing-s) var(--app-spacing-m);
  color: var(--app-text);
  font-size: var(--app-font-size-base);
  transition: background-color 0.1s ease;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--app-surface-secondary);
  color: var(--app-text);
}
.dropdown-item.active,
.dropdown-item:active {
  background: var(--app-brand);
  color: #fff;
}
.dropdown-divider {
  border-color: var(--app-border);
}
.dropdown-header {
  color: var(--app-text-muted);
  font-size: var(--app-font-size-small);
  font-weight: var(--app-font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* --- Pagination --- */
.pagination {
  gap: 2px;
}
.page-link {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-s);
  color: var(--app-text);
  font-size: var(--app-font-size-base);
  padding: var(--app-spacing-xs) var(--app-spacing-s);
  background: var(--app-surface);
  transition: background-color 0.1s ease, border-color 0.1s ease;
}
.page-link:hover {
  background: var(--app-surface-secondary);
  border-color: var(--app-border-hover);
  color: var(--app-text);
}
.page-item.active .page-link {
  background: var(--app-brand);
  border-color: var(--app-brand);
  color: #fff;
  font-weight: var(--app-font-weight-semibold);
}
.page-item.disabled .page-link {
  background: var(--app-surface-secondary);
  color: var(--app-text-disabled);
  border-color: var(--app-border);
}

/* --- Progress bars --- */
.progress {
  height: 8px;
  border-radius: var(--app-radius-s);
  background: var(--app-border);
  overflow: hidden;
}
.progress-bar {
  background: var(--app-brand);
  transition: width 0.3s ease;
}
.progress-bar.bg-success {
  background: #107c10;
}
.progress-bar.bg-warning {
  background: #d89b26;
}
.progress-bar.bg-danger {
  background: #d13438;
}

/* --- List groups --- */
.list-group {
  border-radius: var(--app-radius-m);
}
.list-group-item {
  border-color: var(--app-border);
  color: var(--app-text);
  font-size: var(--app-font-size-base);
  padding: var(--app-spacing-s) var(--app-spacing-m);
  transition: background-color 0.1s ease;
}
.list-group-item:hover {
  background: var(--app-surface-secondary);
}
.list-group-item.active {
  background: var(--app-brand);
  border-color: var(--app-brand);
  color: #fff;
  font-weight: var(--app-font-weight-semibold);
}
.list-group-item-action {
  color: var(--app-text);
}
.list-group-item-action:hover {
  background: var(--app-surface-secondary);
  color: var(--app-text);
}

/* --- Accordion --- */
.accordion-item {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-m) !important;
  margin-bottom: var(--app-spacing-s);
  overflow: hidden;
}
.accordion-button {
  background: var(--app-surface);
  color: var(--app-text);
  font-weight: var(--app-font-weight-semibold);
  font-size: var(--app-font-size-base);
  padding: var(--app-spacing-m) var(--app-spacing-l);
  box-shadow: none;
}
.accordion-button:not(.collapsed) {
  background: var(--app-brand-soft);
  color: var(--app-brand);
}
.accordion-button:focus {
  box-shadow: 0 0 0 2px var(--app-brand-soft);
  outline: 2px solid var(--app-brand);
}

/* --- Nav pills and tabs --- */
.nav-pills .nav-link {
  color: var(--app-text-muted);
  font-weight: var(--app-font-weight-regular);
  border-radius: var(--app-radius-s);
  padding: var(--app-spacing-s) var(--app-spacing-m);
  transition: background-color 0.1s ease, color 0.1s ease;
}
.nav-pills .nav-link:hover {
  background: var(--app-surface-secondary);
  color: var(--app-text);
}
.nav-pills .nav-link.active {
  background: var(--app-brand);
  color: #fff;
  font-weight: var(--app-font-weight-semibold);
}
.nav-tabs {
  border-bottom: 1px solid var(--app-border);
}
.nav-tabs .nav-link {
  color: var(--app-text-muted);
  border: 1px solid transparent;
  border-top-left-radius: var(--app-radius-s);
  border-top-right-radius: var(--app-radius-s);
  font-weight: var(--app-font-weight-regular);
  padding: var(--app-spacing-s) var(--app-spacing-m);
  transition: color 0.1s ease, border-color 0.1s ease;
}
.nav-tabs .nav-link:hover {
  color: var(--app-text);
  border-color: var(--app-border);
}
.nav-tabs .nav-link.active {
  color: var(--app-brand);
  background: var(--app-surface);
  border-color: var(--app-border);
  border-bottom-color: transparent;
  font-weight: var(--app-font-weight-semibold);
}

/* --- Spinners --- */
.spinner-border {
  border-width: 2px;
}
.spinner-grow {
  background-color: var(--app-brand);
}

/* --- Tooltips --- */
.tooltip-inner {
  background: var(--app-text);
  border-radius: var(--app-radius-s);
  padding: var(--app-spacing-xs) var(--app-spacing-s);
  font-size: var(--app-font-size-small);
}

/* --- Breadcrumbs --- */
.breadcrumb {
  background: transparent;
  font-size: var(--app-font-size-base);
}
.breadcrumb-item a {
  color: var(--app-brand);
  text-decoration: none;
}
.breadcrumb-item a:hover {
  color: var(--app-brand-hover);
  text-decoration: underline;
}
.breadcrumb-item.active {
  color: var(--app-text-muted);
}

/* --- Close button --- */
.btn-close {
  filter: none;
  opacity: 0.5;
}
.btn-close:hover {
  opacity: 1;
}

/* --- Form check (checkbox/radio) --- */
.form-check-input {
  border-radius: var(--app-radius-s);
  border: 1px solid var(--app-border);
  background-color: var(--app-surface);
}
.form-check-input:checked {
  background-color: var(--app-brand);
  border-color: var(--app-brand);
}
.form-check-input:focus {
  box-shadow: 0 0 0 2px var(--app-brand-soft);
  outline: 2px solid var(--app-brand);
  outline-offset: 0;
}
.form-check-label {
  font-size: var(--app-font-size-base);
  color: var(--app-text);
}

/* --- Form range --- */
.form-range::-webkit-slider-thumb {
  background: var(--app-brand);
}
.form-range::-moz-range-thumb {
  background: var(--app-brand);
}

/* --- Input group --- */
.input-group-text {
  background: var(--app-surface-secondary);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-m);
  color: var(--app-text-muted);
  font-size: var(--app-font-size-base);
}

/* --- Floating labels --- */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
  color: var(--app-brand);
}

/* --- Text utilities --- */
.text-muted {
  color: var(--app-text-muted) !important;
}

/* --- Background utilities --- */
.bg-light {
  background: var(--app-surface-secondary) !important;
}

/* --- Overflow auto containers --- */
.overflow-auto {
  scrollbar-width: thin;
  scrollbar-color: var(--app-border) transparent;
}
.overflow-auto::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.overflow-auto::-webkit-scrollbar-track {
  background: transparent;
}
.overflow-auto::-webkit-scrollbar-thumb {
  background: var(--app-border);
  border-radius: 3px;
}

/* --- General body typography --- */
body {
  font-family: var(--app-font-family);
  font-size: var(--app-font-size-base);
  color: var(--app-text);
  background: var(--app-bg);
}
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--app-font-weight-semibold);
  color: var(--app-text);
}
a {
  color: var(--app-brand);
  text-decoration: none;
}
a:hover {
  color: var(--app-brand-hover);
  text-decoration: underline;
}

/* --- Section headings --- */
h1 { font-size: var(--app-font-size-xxl); }
h2 { font-size: var(--app-font-size-xl); }
h3 { font-size: var(--app-font-size-large); }

/* --- Small text --- */
small, .small {
  font-size: var(--app-font-size-small);
  color: var(--app-text-muted);
}

/* --- Blockquote --- */
blockquote {
  border-left: 3px solid var(--app-brand);
  padding-left: var(--app-spacing-m);
  color: var(--app-text-muted);
  font-style: italic;
}

/* --- Horizontal rule --- */
hr {
  border-color: var(--app-border);
}

/* ==========================================================================
   Auth pages (Login, Register) — clean, no card wrapper
   ========================================================================== */

.auth-page {
    max-width: 420px;
    margin: 4rem auto 0;
    padding: 0 var(--app-spacing-m);
}

.auth-page__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: var(--app-font-weight-semibold);
    font-size: var(--app-font-size-large);
    color: var(--app-text);
    text-decoration: none;
}

.auth-page__brand-mark {
    width: 28px;
    height: 28px;
    border-radius: var(--app-radius-s);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--app-brand);
    color: #fff;
}

.auth-page__title {
    font-size: var(--app-font-size-xxl);
    font-weight: var(--app-font-weight-bold);
    margin: 0;
    color: var(--app-text);
    letter-spacing: -0.02em;
}

.auth-page__subtitle {
    color: var(--app-text-muted);
    font-size: var(--app-font-size-base);
    margin: 0;
}

.auth-page__form {
    margin-top: 2rem;
}

.auth-page__form .form-label {
    font-size: var(--app-font-size-small);
    font-weight: var(--app-font-weight-medium);
    color: var(--app-text-muted);
    margin-bottom: 6px;
}

.auth-page__form .form-control {
    border-radius: var(--app-radius-s);
    border: 1px solid var(--app-border);
    padding: 10px 14px;
    font-size: var(--app-font-size-base);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-page__form .form-control:focus {
    border-color: var(--app-brand);
    box-shadow: 0 0 0 3px var(--app-brand-soft);
}

@media (max-width: 576px) {
    .auth-page {
        margin-top: 2rem;
    }
}

/* Header — Fluent UI styled */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
}

.app-header .navbar {
  min-height: var(--app-header-height);
  padding-top: 0;
  padding-bottom: 0;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: var(--app-font-weight-semibold);
  font-size: var(--app-font-size-large);
  color: var(--app-text);
}

.app-brand:hover {
  color: var(--app-text);
}

.app-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--app-radius-s);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--app-brand);
  color: #ffffff;
}

.app-nav {
  margin-left: 1rem;
}

.app-nav .nav-link {
  position: relative;
  color: var(--app-text-muted);
  font-weight: var(--app-font-weight-regular);
  padding: 0.5rem 0.75rem;
  border-radius: var(--app-radius-s);
  font-size: var(--app-font-size-base);
}

.app-nav .nav-link:hover {
  color: var(--app-text);
  background: var(--app-surface-secondary);
}

.app-nav .nav-link.active {
  color: var(--app-text);
  font-weight: var(--app-font-weight-semibold);
}

/* Fluent UI style: bottom bar indicator for active nav */
@media (min-width: 768px) {
  .app-nav .nav-link.active::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc((var(--app-header-height) - 2.5rem) / -2);
    height: 3px;
    border-radius: 3px;
    background: var(--app-brand);
  }

  .app-nav .nav-link.active:hover {
    background: transparent;
  }
}

.app-user-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: var(--app-radius-s);
  color: var(--app-text);
  font-weight: var(--app-font-weight-regular);
}

.app-user-toggle:hover,
.app-user-toggle[aria-expanded="true"] {
  background: var(--app-surface-secondary);
  border-color: var(--app-border);
}

.app-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.app-avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--app-brand-soft);
  color: var(--app-brand);
  font-weight: var(--app-font-weight-bold);
  font-size: 0.9rem;
}

.app-user-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user-menu {
  min-width: 240px;
  max-width: 300px;
}

@media (max-width: 767.98px) {
  .app-header .navbar-collapse {
    padding-bottom: 0.75rem;
  }

  .app-nav {
    margin-left: 0;
  }
}

/* ==========================================================================
   Google Drive Explorer — Redesigned Styles
   ========================================================================== */

:root {
  /* Google Drive page — Fluent UI aligned palette */
  --gdrive-primary: #0078d4;
  --gdrive-primary-hover: #106ebe;
  --gdrive-primary-light: #deecf9;
  --gdrive-primary-glow: rgba(0, 120, 212, 0.15);
  --gdrive-secondary: #5c2d91;
  --gdrive-accent: #0078d4;
  --gdrive-surface: #ffffff;
  --gdrive-surface-soft: #faf9f8;
  --gdrive-bg: #f3f2f1;
  --gdrive-border: #e1dfdd;
  --gdrive-border-hover: #c8c6c4;
  --gdrive-text-main: #201f1e;
  --gdrive-text-muted: #605e5c;
  --gdrive-text-faint: #8a8886;
  --gdrive-folder-color: #d97706;
  --gdrive-doc-color: #0078d4;
  --gdrive-sheet-color: #107c10;
  --gdrive-slide-color: #d97706;
  --gdrive-pdf-color: #d13438;
  --gdrive-image-color: #5c2d91;
  --gdrive-archive-color: #605e5c;
  --gdrive-shadow-sm: var(--app-shadow-2);
  --gdrive-shadow-md: var(--app-shadow-4);
  --gdrive-shadow-lg: var(--app-shadow-8);
  --gdrive-shadow-xl: var(--app-shadow-16);
  --gdrive-shadow-glow: 0 0 0 4px var(--gdrive-primary-glow);
  --gdrive-radius: var(--app-radius-m);
  --gdrive-radius-lg: var(--app-radius-l);
  --gdrive-radius-xl: var(--app-radius-l);
}

/* --- Page Header --- */
.gd-page {
  background: transparent;
}
.gd-page-header {
  margin-bottom: 2rem;
}
.gd-page-header__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1.5rem 2rem;
  background: var(--gdrive-surface);
  border: 1px solid var(--gdrive-border);
  border-radius: var(--gdrive-radius-xl);
  box-shadow: var(--gdrive-shadow-md);
}
.gd-page-header__title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.75rem;
  font-weight: var(--app-font-weight-semibold);
  margin: 0;
  color: var(--gdrive-text-main);
}
.gd-page-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--app-radius-m);
  background: var(--gdrive-primary);
  color: #fff;
}
.gd-page-header__subtitle {
  color: var(--gdrive-text-muted);
  font-size: 0.95rem;
  margin: 0.3rem 0 0;
  line-height: 1.5;
}
.gd-page-header__help-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--app-radius-s);
  border: 1px solid var(--gdrive-border);
  background: var(--gdrive-surface);
  color: var(--gdrive-text-muted);
  font-size: 0.85rem;
  font-weight: var(--app-font-weight-semibold);
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease;
  white-space: nowrap;
}
.gd-page-header__help-btn:hover {
  background: var(--gdrive-surface-soft);
  border-color: var(--gdrive-border-hover);
  color: var(--gdrive-text-main);
}

/* --- Sidebar --- */
.gd-sidebar {
  position: sticky;
  top: calc(var(--app-header-height) + 1.5rem);
}
.gd-sidebar-card {
  background: var(--gdrive-surface);
  border: 1px solid var(--gdrive-border);
  border-radius: var(--app-radius-m);
  padding: 8px;
  box-shadow: var(--gdrive-shadow-sm);
}
.gd-sidebar-title {
  font-size: 0.75rem;
  font-weight: var(--app-font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--gdrive-text-muted);
  padding: 8px 12px 12px;
}
.gd-drive-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--app-radius-s);
  color: var(--gdrive-text-main);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: var(--app-font-weight-regular);
  transition: background-color 0.1s ease;
  position: relative;
  margin-bottom: 2px;
}
.gd-drive-link__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--gdrive-text-faint);
  transition: color 0.1s ease;
}
.gd-drive-link__name {
  flex: 1 1 0;
}
.gd-drive-link:hover {
  background: var(--gdrive-surface-soft);
  color: var(--gdrive-text-main);
}
.gd-drive-link:hover .gd-drive-link__icon {
  color: var(--gdrive-text-muted);
}
.gd-drive-link.active {
  background: var(--gdrive-primary-light);
  color: var(--gdrive-primary);
  font-weight: var(--app-font-weight-semibold);
}
.gd-drive-link.active .gd-drive-link__icon {
  color: var(--gdrive-primary);
}
.gd-drive-count {
  font-size: 0.75rem;
  color: var(--gdrive-text-faint);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: var(--app-radius-s);
  background: var(--gdrive-surface-soft);
}
.gd-drive-link.active .gd-drive-count {
  color: var(--gdrive-primary);
  background: var(--gdrive-primary-light);
}
.gd-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--gdrive-surface);
}
.gd-status-dot--warning {
  background: #f59e0b;
  animation: gd-pulse 2s ease-in-out infinite;
}
@keyframes gd-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.gd-connect-drive-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  margin-top: 8px;
  border-radius: var(--app-radius-s);
  border: 1px dashed var(--gdrive-border);
  background: transparent;
  color: var(--gdrive-text-muted);
  font-size: 0.875rem;
  font-weight: var(--app-font-weight-semibold);
  text-decoration: none;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}
.gd-connect-drive-btn:hover {
  background: var(--gdrive-surface-soft);
  border-color: var(--gdrive-primary);
  color: var(--gdrive-primary);
}
.gd-connect-drive-btn.active {
  background: var(--gdrive-primary-light);
  border-color: var(--gdrive-primary);
  border-style: solid;
  color: var(--gdrive-primary);
  font-weight: var(--app-font-weight-semibold);
}

/* --- Mobile Picker --- */
.gd-mobile-picker__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--app-radius-s);
  border: 1px solid var(--gdrive-border);
  background: var(--gdrive-surface);
  color: var(--gdrive-text-main);
  font-size: 0.875rem;
  font-weight: var(--app-font-weight-semibold);
  transition: background-color 0.1s ease, border-color 0.1s ease;
}
.gd-mobile-picker__btn:hover {
  border-color: var(--gdrive-primary);
  background: var(--gdrive-surface-soft);
}

/* --- Alert --- */
.gd-alert {
  padding: 12px 16px;
  border-radius: var(--app-radius-m);
  margin-bottom: 1.25rem;
}
.gd-alert--danger {
  background: #fde7e9;
  border: 1px solid #d13438;
  color: #a02020;
}
.gd-alert__icon {
  color: #b91c1c;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* --- Connect Card --- */
.gd-connect-card {
  max-width: 720px;
  background: var(--gdrive-surface);
  border: 1px solid var(--gdrive-border);
  border-radius: var(--app-radius-m);
  padding: 2rem 2.5rem;
  box-shadow: var(--gdrive-shadow-md);
}
.gd-connect-card__header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.gd-connect-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--app-radius-m);
  background: var(--gdrive-primary);
  color: #fff;
  flex-shrink: 0;
}
.gd-connect-card__title {
  font-size: 1.5rem;
  font-weight: var(--app-font-weight-semibold);
  margin: 0 0 0.4rem;
  color: var(--gdrive-text-main);
}
.gd-connect-card__subtitle {
  color: var(--gdrive-text-muted);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}
.gd-advanced-panel {
  padding: 12px 16px;
  background: var(--gdrive-surface-soft);
  border-radius: var(--app-radius-s);
  border: 1px solid var(--gdrive-border);
  margin-bottom: 1rem;
}
.gd-advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
  color: var(--gdrive-text-muted) !important;
}
.gd-advanced-toggle:hover {
  color: var(--gdrive-primary) !important;
}

/* --- Omnibox --- */
.gdrive-omnibox {
  background: #ffffff;
  border: 1px solid var(--gdrive-border);
  border-radius: var(--app-radius-m);
  transition: border-color 0.1s ease;
  overflow: hidden;
}
.gdrive-omnibox:focus-within {
  border-color: var(--gdrive-primary);
  box-shadow: 0 0 0 2px var(--gdrive-primary-light);
}

/* --- Steps --- */
.gd-steps {
  list-style: none;
  counter-reset: gd-step;
  padding: 0;
  margin: 0;
}
.gd-steps li {
  counter-increment: gd-step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}
.gd-steps li::before {
  content: counter(gd-step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 2rem;
  height: 2rem;
  border-radius: var(--app-radius-s);
  background: var(--gdrive-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: var(--app-font-weight-semibold);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Drive Header --- */
.gd-drive-header {
  background: var(--gdrive-surface);
  border: 1px solid var(--gdrive-border);
  border-radius: var(--app-radius-m);
  padding: 1.5rem 2rem;
  box-shadow: var(--gdrive-shadow-sm);
}
.gd-drive-header__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
}
.gd-drive-header__title {
  font-size: 1.35rem;
  font-weight: var(--app-font-weight-semibold);
  margin: 0 0 0.6rem;
  color: var(--gdrive-text-main);
}
.gd-drive-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.gd-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  color: var(--gdrive-text-muted);
  padding: 4px 10px;
  border-radius: var(--app-radius-s);
  background: var(--gdrive-surface-soft);
  font-weight: var(--app-font-weight-regular);
  border: 1px solid transparent;
  transition: background-color 0.1s ease;
}
.gd-meta-badge:hover {
  border-color: var(--gdrive-border);
  background: var(--gdrive-surface);
}
.gd-meta-badge + .gd-meta-badge::before {
  content: "\00B7";
  margin-right: 0.25rem;
  color: var(--gdrive-text-faint);
}
.gd-drive-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* --- Notice --- */
.gd-notice {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--app-radius-m);
  background: var(--gdrive-primary-light);
  color: var(--gdrive-text-main);
  border: 1px solid var(--gdrive-primary);
}
.gd-notice--warning {
  background: #fff4ce;
  border-color: #d89b26;
}

/* --- Section Headers --- */
.gd-section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gdrive-border);
  margin-bottom: 1rem;
}
.gd-section-header__title {
  font-size: 1.1rem;
  font-weight: var(--app-font-weight-semibold);
  color: var(--gdrive-text-main);
}
.gd-section-header__icon {
  display: inline-flex;
  flex-shrink: 0;
}
.gd-section-header__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--app-radius-s);
  background: var(--gdrive-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: var(--app-font-weight-semibold);
}
.gd-section-header__subtitle {
  font-size: 0.875rem;
  color: var(--gdrive-text-muted);
}
.gd-show-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid var(--gdrive-border);
  background: var(--gdrive-surface);
  color: var(--gdrive-primary);
  font-size: 0.875rem;
  font-weight: var(--app-font-weight-semibold);
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease;
  border-radius: var(--app-radius-s);
}
.gd-show-all-btn:hover {
  background: var(--gdrive-surface-soft);
  border-color: var(--gdrive-border-hover);
}

/* --- Sheet Cards --- */
.gd-sheet-card {
  display: flex;
  flex-direction: column;
  background: var(--gdrive-surface);
  border: 1px solid var(--gdrive-border);
  border-radius: var(--app-radius-m);
  padding: 16px;
  transition: box-shadow 0.15s ease;
  box-shadow: var(--gdrive-shadow-sm);
}
.gd-sheet-card:hover {
  box-shadow: var(--gdrive-shadow-md);
}
.gd-sheet-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.gd-sheet-card__name {
  font-weight: var(--app-font-weight-semibold);
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--gdrive-text-main);
}
.gd-sheet-card__meta {
  font-size: 0.8125rem;
  color: var(--gdrive-text-muted);
}
.gd-sheet-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gdrive-border);
}

/* --- Files Section --- */
.gd-files-section {
  background: var(--gdrive-surface);
  border: 1px solid var(--gdrive-border);
  border-radius: var(--app-radius-m);
  padding: 1.5rem 2rem;
  box-shadow: var(--gdrive-shadow-sm);
}
.gd-files-section__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.gd-files-section__title {
  font-size: 1.1rem;
  font-weight: var(--app-font-weight-semibold);
  color: var(--gdrive-text-main);
}
.gd-files-section__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--gdrive-text-muted);
}
.gd-files-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--app-radius-s);
  background: var(--gdrive-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: var(--app-font-weight-semibold);
}
.gd-files-section__toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}
.gd-view-toggle {
  flex-shrink: 0;
  border-radius: var(--app-radius-s);
  overflow: hidden;
  border: 1px solid var(--gdrive-border);
}
.gd-view-toggle .btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--gdrive-border);
  background: var(--gdrive-surface);
  padding: 6px 10px;
  transition: background-color 0.1s ease;
}
.gd-view-toggle .btn:last-child {
  border-right: none;
}
.gd-view-toggle .btn.active {
  background: var(--gdrive-primary);
  color: #fff;
}
.gd-view-toggle .btn:hover:not(.active) {
  background: var(--gdrive-surface-soft);
}

/* --- Filter Chips --- */
.gdrive-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--app-radius-s);
  font-size: 0.85rem;
  font-weight: var(--app-font-weight-regular);
  color: var(--gdrive-text-muted);
  background: var(--gdrive-surface-soft);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.1s ease, color 0.1s ease;
  user-select: none;
  white-space: nowrap;
}
.gdrive-filter-chip svg {
  flex-shrink: 0;
}
.gdrive-filter-chip:hover {
  background: var(--gdrive-surface);
  color: var(--gdrive-text-main);
  border-color: var(--gdrive-border);
}
.gdrive-filter-chip.active {
  background: var(--gdrive-primary);
  color: #fff;
  border-color: transparent;
  font-weight: var(--app-font-weight-semibold);
}
.gdrive-filter-chip .chip-count {
  font-size: 0.6875rem;
  padding: 2px 8px;
  border-radius: var(--app-radius-s);
  background: rgba(0, 0, 0, 0.06);
  line-height: 1.6;
  font-weight: var(--app-font-weight-semibold);
}
.gdrive-filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* --- File Grid Cards --- */
.gdrive-grid-card {
  background: var(--gdrive-surface);
  border: 1px solid var(--gdrive-border);
  border-radius: var(--app-radius-m);
  padding: 16px;
  transition: box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--gdrive-shadow-sm);
}
.gdrive-grid-card:hover {
  box-shadow: var(--gdrive-shadow-md);
}
.gdrive-grid-preview {
  height: 120px;
  border-radius: var(--app-radius-s);
  background: var(--gdrive-surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px dashed var(--gdrive-border);
  transition: border-color 0.1s ease;
}
.gdrive-grid-card:hover .gdrive-grid-preview {
  border-color: var(--gdrive-primary);
  border-style: solid;
}
.gdrive-grid-preview img {
  max-height: 108px;
  max-width: 100%;
  object-fit: cover;
  border-radius: var(--app-radius-s);
}

/* --- File Table --- */
.gdrive-table {
  border-collapse: separate;
  border-spacing: 0;
}
.gdrive-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--gdrive-text-muted);
  font-weight: var(--app-font-weight-semibold);
  border-bottom: 2px solid var(--gdrive-border) !important;
  padding: 10px 16px !important;
  background: var(--gdrive-surface-soft);
  position: sticky;
  top: 0;
  z-index: 1;
}
.gdrive-table td {
  padding: 10px 16px !important;
  vertical-align: middle;
  border-bottom: 1px solid var(--gdrive-border);
}
.gdrive-table tbody tr:hover {
  background-color: var(--gdrive-primary-light) !important;
}

/* --- Badges --- */
.gdrive-badge-soft {
  font-size: 0.75rem;
  font-weight: var(--app-font-weight-semibold);
  padding: 2px 8px;
  border-radius: var(--app-radius-s);
}
.gdrive-badge-folder { background-color: #fef3c7; color: #92400e; }
.gdrive-badge-doc { background-color: #dbeafe; color: #1d4ed8; }
.gdrive-badge-sheet { background-color: #dcfce7; color: #166534; }
.gdrive-badge-slide { background-color: #fef3c7; color: #92400e; }
.gdrive-badge-pdf { background-color: #fee2e2; color: #991b1b; }
.gdrive-badge-image { background-color: #f3e8ff; color: #6b21a8; }
.gdrive-badge-video { background-color: #e0f2fe; color: #075985; }
.gdrive-badge-archive { background-color: #f1f5f9; color: #374151; }
.gdrive-badge-generic { background-color: #f1f5f9; color: #374151; }

/* --- Empty State --- */
.gd-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  background: var(--gdrive-surface);
  border: 1px solid var(--gdrive-border);
  border-radius: var(--app-radius-m);
  box-shadow: var(--gdrive-shadow-sm);
}
.gd-empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gdrive-surface-soft);
  color: var(--gdrive-text-muted);
  margin-bottom: 1.5rem;
}
.gd-empty-state__title {
  font-size: 1.3rem;
  font-weight: var(--app-font-weight-semibold);
  margin: 0 0 0.75rem;
  color: var(--gdrive-text-main);
}
.gd-empty-state__text {
  color: var(--gdrive-text-muted);
  font-size: 1rem;
  margin: 0 0 1.5rem;
  max-width: 440px;
  line-height: 1.6;
}
.gd-empty-state__actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* --- Search --- */
.gd-search {
  position: relative;
  min-width: 220px;
}
.gd-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  /* hover effect removed */;
  color: var(--gdrive-text-faint);
  pointer-events: none;
  transition: color 0.1s ease;
}
.gd-search .form-control {
  padding-left: 40px;
  border-radius: var(--app-radius-m);
  border: 1px solid var(--gdrive-border);
  background: var(--gdrive-surface);
  transition: border-color 0.1s ease;
  font-size: 0.875rem;
}
.gd-search .form-control:focus {
  border-color: var(--gdrive-primary);
  box-shadow: 0 0 0 2px var(--gdrive-primary-light);
}
.gd-search .form-control:focus + svg,
.gd-search:focus-within svg {
  color: var(--gdrive-primary);
}

/* --- Chip Row --- */
.gd-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gdrive-border) transparent;
}
.gd-chip-row::-webkit-scrollbar {
  height: 4px;
}
.gd-chip-row::-webkit-scrollbar-track {
  background: transparent;
}
.gd-chip-row::-webkit-scrollbar-thumb {
  background: var(--gdrive-border);
  border-radius: 2px;
}
.gd-chip-row .gdrive-filter-chip {
  flex-shrink: 0;
}

/* --- Icon Button --- */
.gd-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  transition: background-color 0.1s ease;
}
.gd-icon-btn:hover {
  background: var(--gdrive-surface-soft);
}

/* --- Budget Badge --- */
.gd-budget-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--app-radius-s);
  background: #dff6dd;
  color: #006300;
  font-size: 0.75rem;
  font-weight: var(--app-font-weight-semibold);
  flex-shrink: 0;
  border: 1px solid #107c10;
}

/* --- Sync Status Badges --- */
.gd-meta-badge--fresh {
  color: #006300;
  background: #dff6dd;
  border-color: #107c10;
}
.gd-meta-badge--stale {
  color: #8a5a00;
  background: #fff4ce;
  border-color: #d89b26;
}

/* --- URL Hint --- */
.gd-url-hint {
  display: inline-flex;
  align-items: center;
}

/* --- Results Count --- */
.gd-results-count {
  padding: 2px 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* --- Help Modal Sections --- */
.gd-help-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--gdrive-border);
}
.gd-help-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.gd-help-section__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: var(--app-font-weight-semibold);
  color: var(--gdrive-text-main);
  margin: 0 0 0;
  cursor: pointer;
  user-select: none;
  transition: color 0.1s ease;
  padding: 4px 0;
}
.gd-help-section__title:hover {
  color: var(--gdrive-primary);
}
.gd-help-section__title svg {
  flex-shrink: 0;
  color: var(--gdrive-text-muted);
  opacity: 0.6;
  transition: color 0.1s ease, opacity 0.1s ease;
}
.gd-help-section__title:hover svg {
  color: var(--gdrive-primary);
  opacity: 1;
}
.gd-help-section .accordion-collapse {
  margin-top: 10px;
}

/* --- Empty State Troubleshoot List --- */
.gd-empty-state__troubleshoot {
  max-width: 440px;
  font-size: 0.9rem;
  color: var(--gdrive-text-muted);
  line-height: 1.8;
  padding-left: 1.25rem;
}
.gd-empty-state__troubleshoot li {
  margin-bottom: 0.5rem;
}

/* --- Utility --- */
.gd-min-w-0 {
  min-width: 0;
}
.gd-file-name {
  max-width: min(420px, 60vw);
}

/* --- Responsive --- */
@media (max-width: 575.98px) {
  .gdrive-table td,
  .gdrive-table th {
    padding: 10px 8px !important;
  }
  .gd-file-name {
    max-width: 48vw;
  }
  .gd-page-header__title {
    font-size: 1.35rem;
  }
  .gd-page-header__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--app-radius-s);
  }
  .gd-page-header__help-btn span {
    display: none;
  }
  .gd-page-header__content {
    padding: 1.25rem 1.5rem;
  }
  .gd-drive-header {
    padding: 1.5rem;
  }
  .gd-files-section {
    padding: 1.5rem;
  }
  .gd-connect-card {
    padding: 2rem 1.5rem;
  }
  .gd-files-section__toolbar {
    width: 100%;
  }
  .gd-search {
    min-width: 0;
    width: 100%;
  }
  .gd-empty-state {
    padding: 3rem 1.5rem;
  }
  .gd-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 767.98px) {
  .gd-drive-header__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* DataTables sort arrows */
.gdrive-table thead th.dt-orderable-asc,
.gdrive-table thead th.dt-orderable-desc {
  padding-right: 30px !important;
}

/* ==========================================
   Monthly Budget Summary modal (bgt-*)
   Colors from the validated data-viz palette; status colors always ship with icon + label.
   ========================================== */
.bgt-root {
  /* Budget modal — Fluent UI aligned palette */
  --bgt-surface: #ffffff;
  --bgt-plane: #faf9f8;
  --bgt-ink: #201f1e;
  --bgt-ink-2: #605e5c;
  --bgt-muted: #8a8886;
  --bgt-grid: #e1dfdd;
  --bgt-border: rgba(32, 31, 30, 0.10);
  --bgt-hover: #f3f2f1;
  --bgt-income: #0078d4;
  --bgt-spend: #d83b01;
  --bgt-negative: #d13438;
  --bgt-meter-track: #f3f2f1;
  --bgt-meter-ok: #605e5c;
  --bgt-good: #107c10;
  --bgt-good-text: #006300;
  --bgt-warning: #d89b26;
  --bgt-warning-text: #8a5a00;
  --bgt-critical: #d13438;
  --bgt-critical-text: #a02020;
}

.bgt-ink { color: var(--bgt-ink); }
.bgt-ink-2 { color: var(--bgt-ink-2); }
.bgt-body { background: var(--bgt-plane); }

.bgt-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-brand-soft);
  color: var(--bgt-income);
}

.bgt-source {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--bgt-border);
  color: var(--bgt-ink-2);
  white-space: nowrap;
}
.bgt-source--live::before { content: "\25CF"; color: var(--bgt-good); margin-right: 4px; }
.bgt-source--sample::before { content: "\25CB"; color: var(--bgt-muted); margin-right: 4px; }

/* Loading / error states */
.bgt-state {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--bgt-ink);
}
.bgt-state-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  background: var(--bgt-critical);
}

/* Period selector */
.bgt-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--bgt-surface);
  border: 1px solid var(--bgt-border);
  border-radius: var(--app-radius-m);
}
.bgt-period-scroll {
  display: flex;
  gap: 4px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: thin;
}
.bgt-period-btn,
.bgt-nav-btn {
  border: 0;
  background: transparent;
  color: var(--bgt-ink-2);
  border-radius: 999px;
  min-height: 32px;
  padding: 4px 12px;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.bgt-nav-btn {
  flex: 0 0 32px;
  width: 32px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}
.bgt-period-btn:hover,
.bgt-nav-btn:hover:not(:disabled) { background: var(--bgt-hover); color: var(--bgt-ink); }
.bgt-nav-btn:disabled { opacity: 0.35; }
.bgt-period-btn--year { font-weight: 600; }
.bgt-period-btn.active,
.bgt-period-btn.active:hover { background: var(--bgt-ink); color: #fff; }
.bgt-period-btn:focus-visible,
.bgt-nav-btn:focus-visible { outline: 2px solid var(--bgt-income); outline-offset: 1px; }

/* Modal header */
.bgt-modal-header {
  padding: 14px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--bgt-border);
}
.bgt-modal-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1px;
}
.bgt-file-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--bgt-ink-2);
}
.bgt-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Summary card: headline for the period, accent stripe follows the status tone */
.bgt-hero {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 24px;
  padding: 18px 20px 18px 24px;
  background: var(--bgt-surface);
  border: 1px solid var(--bgt-border);
  border-radius: var(--app-radius-m);
  overflow: hidden;
}
.bgt-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--bgt-muted);
}
.bgt-hero[data-tone="good"]::before { background: var(--bgt-good); }
.bgt-hero[data-tone="warning"]::before { background: var(--bgt-warning); }
.bgt-hero[data-tone="critical"]::before { background: var(--bgt-critical); }
.bgt-hero-main { flex: 1 1 420px; min-width: 0; }
.bgt-hero-eyebrow {
  font-size: 0.8125rem;
  color: var(--bgt-ink-2);
  margin-bottom: 2px;
}
.bgt-hero-title {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--bgt-ink);
  margin-bottom: 6px;
}
.bgt-hero-text {
  color: var(--bgt-ink);
  line-height: 1.6;
}
.bgt-hero-status {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bgt-plane);
  border: 1px solid var(--bgt-border);
}
.bgt-hero-status:empty { display: none; }

/* Actual-vs-plan meter inside a KPI tile; the tick marks the plan or goal */
.bgt-tile-meter:empty { display: none; }
.bgt-mini-meter {
  position: relative;
  height: 6px;
  margin: 8px 0 6px;
  border-radius: 3px;
  background: var(--bgt-meter-track);
}
.bgt-mini-meter-fill {
  height: 100%;
  border-radius: 3px;
}
.bgt-mini-meter-fill--income { background: var(--bgt-income); }
.bgt-mini-meter-fill--spend { background: var(--bgt-spend); }
.bgt-mini-meter-mark {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--bgt-ink);
}

/* Where your income went: spent / saved / overspent, 2px surface gap between segments */
.bgt-alloc {
  display: flex;
  gap: 2px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
}
.bgt-alloc-seg {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.bgt-alloc-seg span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.bgt-alloc-seg--spend { background: var(--bgt-spend); }
.bgt-alloc-seg--save { background: var(--bgt-income); }
/* Hatched so "overspent" doesn't rely on color alone next to the orange segment */
.bgt-alloc-seg--over,
.bgt-swatch--over {
  background: var(--bgt-negative);
}
.bgt-alloc-seg--over { color: var(--bgt-ink); }

/* Highlights row */
.bgt-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
}
.bgt-facts li {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  background: var(--bgt-surface);
  border: 1px solid var(--bgt-border);
  border-radius: var(--app-radius-m);
  min-width: 0;
}
.bgt-facts-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bgt-ink-2);
}
.bgt-facts-value {
  color: var(--bgt-ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* On phones the highlights collapse into one compact list instead of three tall cards */
@media (max-width: 575.98px) {
  .bgt-facts {
    gap: 0;
    background: var(--bgt-surface);
    border: 1px solid var(--bgt-border);
    border-radius: var(--app-radius-m);
  }
  .bgt-facts li {
    flex-basis: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .bgt-facts li + li { border-top: 1px solid var(--bgt-border); }
}

/* Ranked category bars (single hue; the label carries identity) */
.bgt-rank {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bgt-rank-row {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  color: inherit;
}
button.bgt-rank-row:hover { background: var(--bgt-hover); }
.bgt-rank-row.active {
  background: var(--app-brand-soft);
  border-color: rgba(0, 120, 212, 0.35);
}
.bgt-rank-row:focus-visible { outline: 2px solid var(--bgt-income); outline-offset: 1px; }
.bgt-rank-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.875rem;
}
.bgt-rank-name {
  font-weight: 600;
  color: var(--bgt-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bgt-rank-value {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--bgt-ink);
}
.bgt-rank-value small { color: var(--bgt-ink-2); margin-left: 2px; }
.bgt-rank-track {
  display: block;
  height: 6px;
  margin-top: 5px;
  border-radius: 3px;
  background: var(--bgt-meter-track);
}
.bgt-rank-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--bgt-spend);
}

/* Transactions table bits */
.bgt-chip {
  display: inline-block;
  max-width: 220px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bgt-plane);
  border: 1px solid var(--bgt-border);
  color: var(--bgt-ink-2);
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.bgt-amount-in { color: var(--bgt-good-text); }
.bgt-filter-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bgt-plane);
  font-size: 0.875rem;
  color: var(--bgt-ink-2);
}
.bgt-filter-summary:empty { display: none; }
.bgt-filter-summary strong { color: var(--bgt-ink); font-variant-numeric: tabular-nums; }
.bgt-chart-box--short { height: 240px; }
.bgt-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bgt-muted);
  font-size: 0.875rem;
}

/* Tiles & cards */
.bgt-tile,
.bgt-card {
  background: var(--bgt-surface);
  border: 1px solid var(--bgt-border);
  border-radius: var(--app-radius-m);
  padding: 16px;
}
.bgt-tile-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bgt-ink-2);
}
.bgt-tile-value {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 4px 0 2px;
  color: var(--bgt-ink);
}
.bgt-tile-sub { font-size: 0.8125rem; color: var(--bgt-ink-2); }
.bgt-card-title { font-weight: 700; color: var(--bgt-ink); }
.bgt-card-sub { font-size: 0.8125rem; color: var(--bgt-ink-2); }
.bgt-chart-box { position: relative; height: 280px; width: 100%; }

.bgt-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.bgt-swatch--income { background: var(--bgt-income); }
.bgt-swatch--spend { background: var(--bgt-spend); }
.bgt-swatch--neg { background: var(--bgt-negative); }
.bgt-swatch--ok { background: var(--bgt-meter-ok); }
.bgt-swatch--warning { background: var(--bgt-warning); }
.bgt-swatch--critical { background: var(--bgt-critical); }

.bgt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.8125rem;
  color: var(--bgt-ink-2);
}
.bgt-legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* Status pill: icon + label */
.bgt-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.bgt-status-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
}
.bgt-status--good { color: var(--bgt-good-text); }
.bgt-status--good .bgt-status-icon { background: var(--bgt-good); }
.bgt-status--warning { color: var(--bgt-warning-text); }
.bgt-status--warning .bgt-status-icon { background: var(--bgt-warning); color: var(--bgt-ink); }
.bgt-status--critical { color: var(--bgt-critical-text); }
.bgt-status--critical .bgt-status-icon { background: var(--bgt-critical); }

/* Category meters */
.bgt-cat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 40px;
}
@media (min-width: 992px) {
  .bgt-cat-grid { grid-template-columns: 1fr 1fr; }
}
.bgt-cat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.9rem;
}
.bgt-cat-name {
  font-weight: 600;
  color: var(--bgt-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bgt-cat-amount {
  color: var(--bgt-ink);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.bgt-cat-amount small { color: var(--bgt-ink-2); font-weight: 400; }
.bgt-meter {
  height: 8px;
  margin: 6px 0 4px;
  border-radius: 4px;
  background: var(--bgt-meter-track);
  overflow: hidden;
}
.bgt-meter-fill { height: 100%; border-radius: 4px; }
.bgt-meter-fill--good { background: var(--bgt-meter-ok); }
.bgt-meter-fill--warning { background: var(--bgt-warning); }
.bgt-meter-fill--critical { background: var(--bgt-critical); }
.bgt-meter-fill--none { background: var(--bgt-grid); }
.bgt-meter--nobudget { background: transparent; box-shadow: inset 0 0 0 1px var(--bgt-grid); }
.bgt-cat-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--bgt-ink-2);
}

/* Table view */
.bgt-table { font-size: 0.875rem; }
.bgt-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--bgt-ink-2);
  background: var(--bgt-plane);
  border-bottom: 1px solid var(--bgt-grid);
  white-space: nowrap;
}
.bgt-table td { font-variant-numeric: tabular-nums; }
.bgt-row-link { cursor: pointer; }

/* Print only the budget report */
@media print {
  body.bgt-printing * { visibility: hidden !important; }
  body.bgt-printing #budgetReportPrintArea,
  body.bgt-printing #budgetReportPrintArea * { visibility: visible !important; }
  body.bgt-printing .modal,
  body.bgt-printing .modal-dialog,
  body.bgt-printing .modal-content { position: absolute !important; top: 0; left: 0; width: 100% !important; max-width: none !important; margin: 0 !important; transform: none !important; overflow: visible !important; border: 0 !important; box-shadow: none !important; }
  body.bgt-printing .modal-dialog-scrollable .modal-content,
  body.bgt-printing .modal-dialog-scrollable .modal-body { max-height: none !important; overflow: visible !important; }
  body.bgt-printing .modal-backdrop { display: none !important; }
  body.bgt-printing #budgetReportPrintArea { background: #fff; padding: 0 !important; }
  body.bgt-printing .bgt-toolbar,
  body.bgt-printing #budgetKeyboardHint,
  body.bgt-printing #btnToggleBudgetTable,
  body.bgt-printing .btn.btn-drill-month { display: none !important; }
  body.bgt-printing #budgetReportTableContainer { display: block !important; }
  body.bgt-printing .bgt-card,
  body.bgt-printing .bgt-tile { break-inside: avoid; }
}

/* ==========================================================================
   Legal Pages
   ========================================================================== */

.legal-page {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.legal-page__title {
  font-size: var(--app-font-size-xxl);
  font-weight: var(--app-font-weight-bold);
  color: var(--app-text);
  margin-bottom: 0.25rem;
}

.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  font-size: var(--app-font-size-xl);
  font-weight: var(--app-font-weight-semibold);
  color: var(--app-text);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--app-border);
}

.legal-section h3 {
  font-size: var(--app-font-size-large);
  font-weight: var(--app-font-weight-medium);
  color: var(--app-text);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.legal-section p {
  color: var(--app-text);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.legal-section ul {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-section li {
  line-height: 1.7;
  margin-bottom: 0.25rem;
}

.legal-notice {
  margin-bottom: 2rem;
}

.contact-card {
  padding: 1.25rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-m);
  margin: 1rem 0;
}

/* Footer — two-column layout */
.app-footer {
  flex-shrink: 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text-muted);
  font-size: 0.85rem;
}

.app-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-footer__links a {
  color: var(--app-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.app-footer__links a:hover {
  color: var(--app-brand);
  text-decoration: underline;
}

/* ==========================================================================
   Cookie Consent Banner
   ========================================================================== */

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--app-surface);
  border-top: 1px solid var(--app-border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  z-index: 1050;
  padding: 1rem 0;
}

.cookie-banner__content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-banner__text {
  flex: 1 1 300px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--app-text);
  line-height: 1.5;
}

.cookie-banner__text a {
  color: var(--app-brand);
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
/* Unavailable State: a page's data could not be loaded (Views/Shared/_UnavailableState.cshtml) */
.unavailable-page {
  display: flex;
  flex-direction: column;
  gap: var(--app-spacing-l);
  padding: var(--app-spacing-s) 0 var(--app-spacing-xl);
}

.unavailable-page__title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: var(--app-font-weight-bold);
}

.unavailable-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--app-spacing-m);
  padding: var(--app-spacing-l);
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-left: 3px solid var(--app-brand);
  border-radius: var(--app-radius-m);
}

.unavailable-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--app-brand);
  background: var(--app-brand-soft);
  border-radius: var(--app-radius-m);
}

.unavailable-state__icon svg {
  width: 18px;
  height: 18px;
}

.unavailable-state__title {
  margin: 0 0 var(--app-spacing-xs);
  font-size: var(--app-font-size-base);
  font-weight: var(--app-font-weight-semibold);
}

.unavailable-state__text {
  margin: 0;
  font-size: var(--app-font-size-small);
  color: var(--app-text-muted);
  line-height: 1.5;
}
