/* filepath: frontend/assets/index.css */
/* Ground Truth — Institutional UI System */

@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&family=DM+Mono:wght@300;400;500&display=swap");

/* ═══════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════ */
:root {
  /* Brand — Deep Naval Blue */
  --brand:      #152047;
  --brand-2:    #1E3272;
  --brand-3:    #3659B8;
  --brand-soft: #EDF0FA;
  --brand-soft-2:#E2E8F5;

  /* Accent — Warm Brass Gold */
  --accent:      #C49332;
  --danger:      #C74040;
  --up:          #157a3c;
  --down:        #b91c1c;

  /* Background master token — change only this */
  --app-bg:          #ffffff;

  /* Backgrounds */
  --bg:              var(--app-bg);
  --bg-2:            var(--app-bg);
  --surface:         var(--app-bg);
  --surface-solid:   var(--app-bg);
  --surface-soft:    var(--app-bg);
  --surface-soft-2:  var(--app-bg);

  /* Borders */
  --line:   rgba(21,32,71,0.07);
  --line-2: rgba(21,32,71,0.11);
  --line-3: rgba(21,32,71,0.17);

  /* Text */
  --text:        #1A2C50;
  --text-strong: #0B1728;
  --muted:       #5C6D8E;
  --muted-2:     #8292AE;

  /* Shadows */
  --shadow-xs: 0 2px 10px rgba(21,32,71,0.05);
  --shadow-sm: 0 8px 22px rgba(21,32,71,0.06);
  --shadow-md: 0 12px 30px rgba(21,32,71,0.09);
  --shadow-lg: 0 20px 44px rgba(21,32,71,0.12);
  --shadow-xl: 0 32px 84px rgba(21,32,71,0.18);

  /* Layout */
  --headerH: 58px;
  --leftW:   clamp(240px, 17vw, 278px);
  --rightW:  clamp(268px, 19vw, 320px);

  /* Radii — institutional, not pill-heavy */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;

  --pad: 8px;
  --font:         "Open Sans", "Helvetica Neue", system-ui, sans-serif;
  --font-display: "Open Sans", "Helvetica Neue", system-ui, sans-serif;
  --font-mono:    "DM Mono", ui-monospace, "SF Mono", "Cascadia Mono", monospace;
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }

button, input, select {
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    background-color 0.14s ease,
    color 0.14s ease,
    transform 0.14s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(54,89,184,0.18);
}

/* ═══════════════════════════════════════════════════
   UTILITY
═══════════════════════════════════════════════════ */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.gt-hidden { display: none !important; }

/* ═══════════════════════════════════════════════════
   FIELD / LABEL
═══════════════════════════════════════════════════ */
.gt-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gt-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gt-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-3);
  flex: 0 0 auto;
  animation: pulse-dot 3s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.7); }
}

/* ═══════════════════════════════════════════════════
   LOADER FRAME
═══════════════════════════════════════════════════ */
#loaderFrame {
  position: fixed;
  inset: 0;
  z-index: 10000;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#loaderFrame.hidden { display: none; }

/* ═══════════════════════════════════════════════════
   ROOT CONTAINER
═══════════════════════════════════════════════════ */
.gt-container {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: var(--headerH) 1fr;
  gap: 8px;
  padding: 8px;
}

/* ═══════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════ */
.gt-header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--headerH);
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: visible;
  z-index: 3000;
}

/* Subtle brand accent on header bottom edge */
.gt-header::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--brand-soft-2) 30%, var(--brand-3) 50%, var(--brand-soft-2) 70%, transparent 100%);
  border-radius: 0 0 2px 2px;
  opacity: 0.6;
  pointer-events: none;
}

.gt-header-left,
.gt-header-search,
.gt-header-right { position: relative; z-index: 1; }

.gt-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 172px;
}

.gt-title {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.04em;
}

/* ═══════════════════════════════════════════════════
   SEARCH ROW
═══════════════════════════════════════════════════ */
.gt-header-search {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: visible;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 700px;
  overflow: visible;
  z-index: 20;
}

.gt-search-row {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.gt-search-row:focus-within {
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(54,89,184,0.10), var(--shadow-xs);
}

.gt-search-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 0;
  border-right: 1px solid var(--line);
  outline: 0;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  padding: 0 30px 0 12px;
  background: var(--surface-soft);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'><path d='M7 10l5 5 5-5' stroke='%231E3272' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.gt-search-select:focus { background-color: var(--brand-soft); }

.gt-search-input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  padding: 0 12px 0 36px;
  background: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none'><circle cx='11' cy='11' r='7' stroke='%235C6D8E' stroke-width='1.8'/><path d='M19.5 19.5l-3.5-3.5' stroke='%235C6D8E' stroke-width='1.8' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.gt-search-input::placeholder { color: var(--muted-2); }

/* ─── Search Results Dropdown ────────────────────── */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow: auto;
  display: none;
  z-index: 5000;
  padding: 4px;
}

.search-results.active { display: block; }

.search-result-item {
  padding: 9px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.11s ease;
  border-bottom: 1px solid var(--line);
}

.search-result-item:last-child { border-bottom: 0; }

.search-result-item:hover { background: var(--brand-soft); }

.search-result-item strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 2px;
}

.search-result-item small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   HEADER RIGHT
═══════════════════════════════════════════════════ */
.gt-header-right {
  min-width: 162px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.gt-tip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.gt-tip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-3);
  flex: 0 0 auto;
  animation: pulse-dot 2.4s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════
   SHELL LAYOUT
═══════════════════════════════════════════════════ */
.gt-shell {
  display: grid;
  grid-template-columns: var(--leftW) minmax(0, 1fr) var(--rightW);
  gap: 8px;
  height: calc(100vh - var(--headerH) - 16px);
  min-height: 0;
}

.gt-left,
.gt-right {
  min-height: 0;
  overflow: hidden;
  padding: 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.gt-left  { overflow-y: auto; overflow-x: hidden; }
.gt-right { display: flex; flex-direction: column; gap: 8px; }
.gt-map   { min-width: 0; min-height: 0; overflow: hidden; }

/* ═══════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════ */
.gt-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: 6px;
  overflow: hidden;
  position: relative;
}

.gt-card:last-child { margin-bottom: 0; }

.gt-card-title {
  padding: 9px 12px 9px 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Accent bar left of card title */
.gt-card-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-3) 0%, var(--brand) 100%);
  flex: 0 0 auto;
}

.gt-card-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ═══════════════════════════════════════════════════
   TIMELINE CHIPS
═══════════════════════════════════════════════════ */
.gt-chip-grid { display: flex; flex-wrap: wrap; gap: 4px; }

.time-btn {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.time-btn:hover {
  border-color: var(--brand-soft-2);
  color: var(--brand);
  background: var(--brand-soft);
}

.time-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(21,32,71,0.24);
}

/* ═══════════════════════════════════════════════════
   CUSTOM DATE RANGE
═══════════════════════════════════════════════════ */
.custom-date-range { display: none; padding-top: 8px; }
.custom-date-range.active { display: block; }

.gt-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.gt-date-grid input {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 500;
  outline: none;
  background: var(--surface);
  color: var(--text);
}

.gt-date-grid input:focus {
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(54,89,184,0.10);
}

.gt-btn-row { display: flex; gap: 6px; margin-top: 8px; }

.apply-date-btn,
.clear-date-btn,
.clear-selection {
  flex: 1;
  min-height: 32px;
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.apply-date-btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(21,32,71,0.22);
}

.apply-date-btn:hover { background: var(--brand-2); border-color: var(--brand-2); }

.clear-date-btn,
.clear-selection {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
}

.clear-date-btn:hover,
.clear-selection:hover {
  border-color: var(--line-3);
  background: var(--surface-soft);
}

.timeline-date {
  border: 1px solid var(--brand-soft-2);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand);
  text-align: center;
  background: var(--brand-soft);
  letter-spacing: 0.03em;
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════
   TOGGLE / FILTER ROWS
═══════════════════════════════════════════════════ */
.gt-toggle-list { display: flex; flex-direction: column; gap: 3px; }

.gt-toggle-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 7px 10px;
  cursor: pointer;
}

.gt-toggle-row:hover {
  border-color: var(--brand-soft-2);
  background: var(--surface-soft);
}

.gt-toggle-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

/* ─── Toggle Switch ──────────────────────────────── */
.gt-switch {
  width: 30px;
  height: 17px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  position: relative;
  flex: 0 0 auto;
}

.gt-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.20);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.gt-toggle-row.active {
  border-color: var(--brand-2);
  background: var(--brand-soft);
}

.gt-toggle-row.active .gt-toggle-label { color: var(--brand); font-weight: 600; }

.gt-toggle-row.active .gt-switch {
  background: var(--brand-2);
  border-color: var(--brand);
}

.gt-toggle-row.active .gt-switch::after { transform: translateX(13px); }

.gt-hidden-select { display: none; }

/* ═══════════════════════════════════════════════════
   AREA INFO BANNER
═══════════════════════════════════════════════════ */
.area-info {
  display: none;
  border: 1px solid var(--brand-soft-2);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.area-info.active { display: block; }

.area-info p {
  margin: 0 0 6px;
  font-size: 10.5px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   MAP
═══════════════════════════════════════════════════ */
.gt-map-frame {
  position: relative;
  height: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

#map { width: 100%; height: 100%; }

.map-zoom {
  position: absolute;
  right: 12px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 800;
}

.map-zoom button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 18px;
  line-height: 1;
  color: var(--text-strong);
  font-weight: 300;
}

.map-zoom button:hover {
  background: var(--brand-soft);
  border-color: var(--brand-3);
  color: var(--brand);
}

/* ═══════════════════════════════════════════════════
   RIGHT PANEL — STATS TABLE
═══════════════════════════════════════════════════ */
.gt-table-shell { min-height: 0; flex: 1; overflow: hidden; }

.gt-table-wrap {
  height: 100%;
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.gt-table-card { background: transparent; }

.gt-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.gt-stats-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-soft);
  color: var(--text-strong);
  font-size: 9.5px;
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line-2);
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.gt-stats-table tbody td {
  font-size: 11px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 400;
}

.gt-stats-table tbody tr:hover td { background: var(--brand-soft); }

.gt-stats-table tbody tr.section-gap td {
  border-bottom: 0;
  height: 6px;
  padding: 0;
  background: transparent;
}

/* ═══════════════════════════════════════════════════
   LOGOUT FAB
═══════════════════════════════════════════════════ */
.logout-fab {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 10.5px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.02em;
}

.logout-fab:hover {
  color: var(--danger);
  border-color: rgba(199,64,64,0.24);
  background: rgba(192,57,43,0.03);
}

.logout-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-3);
  flex: 0 0 auto;
}

/* ═══════════════════════════════════════════════════
   MOBILE
═══════════════════════════════════════════════════ */
.mobile-topbar  { display: none; }
.sidebar-overlay { display: none; }

/* ═══════════════════════════════════════════════════
   LEAFLET OVERRIDES
═══════════════════════════════════════════════════ */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--line-2) !important;
  background: var(--surface) !important;
  backdrop-filter: none !important;
}

.leaflet-popup-content {
  margin: 11px 14px !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.leaflet-popup-tip { box-shadow: none !important; }

.leaflet-tooltip.cluster-count-label {
  border: 1px solid var(--line-2) !important;
  border-radius: 999px !important;
  padding: 3px 8px !important;
  background: var(--surface) !important;
  color: var(--text-strong) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  box-shadow: var(--shadow-sm) !important;
  backdrop-filter: none !important;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — MOBILE ≤ 900px
═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root {
    --headerH: 50px;
    --leftW:   100vw;
    --rightW:  100vw;
  }

  body { overflow: hidden; }

  .gt-container { gap: 0; padding: 0; }
  .gt-header    { display: none; }

  .mobile-topbar {
    position: fixed;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 9005;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .mobile-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-strong);
  }

  .kebab-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(10,18,40,0.22);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .gt-shell { display: block; height: 100vh; }

  .gt-map,
  .gt-map-frame {
    height: 100vh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .gt-left,
  .gt-right {
    position: fixed;
    top: 62px;
    bottom: 8px;
    width: min(88vw, 350px);
    z-index: 9003;
    border-radius: var(--radius-xl);
    padding: 10px;
    overflow: auto;
    background: var(--surface);
    box-shadow: var(--shadow-xl);
  }

  .gt-left {
    left: 8px;
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  .gt-left.open,
  .gt-left.mobile-active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .gt-right { display: none; }

  .map-zoom { right: 10px; bottom: 70px; }
  .map-zoom button { width: 36px; height: 36px; border-radius: var(--radius-md); }

  .gt-search-row {
    grid-template-columns: 128px minmax(0, 1fr);
    min-height: 40px;
  }

  .gt-search-select { font-size: 10px; padding-left: 10px; }
  .gt-search-input  { font-size: 12px; }

  .gt-card          { border-radius: var(--radius-lg); }
  .gt-card-title    { padding: 8px 10px; }
  .gt-card-body     { padding: 8px; }
  .gt-chip-grid     { gap: 4px; }
  .time-btn         { padding: 4px 8px; font-size: 10px; }
  .gt-date-grid     { grid-template-columns: 1fr; }

  .logout-fab {
    left: auto;
    right: 10px;
    bottom: 14px;
    z-index: 9006;
  }
}

/* ═══════════════════════════════════════════════════
   HEADER — PAGE LINK & ACCOUNT
═══════════════════════════════════════════════════ */
.header-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.header-page-link:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(21,32,71,0.22);
}

.header-account { position: relative; flex: 0 0 auto; }

.header-account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  box-shadow: var(--shadow-xs);
  color: var(--text-strong);
  cursor: pointer;
}

.header-account-btn:hover {
  border-color: var(--brand-3);
  background: var(--brand-soft);
}

.header-account-btn[aria-expanded="true"] {
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(54,89,184,0.10);
}

.header-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.header-account-caret {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  flex: 0 0 auto;
}

.header-account-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 5000;
  animation: menu-in 0.14s ease;
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.header-account.open .header-account-menu { display: block; }

.header-account-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px 9px;
  border-bottom: 1px solid var(--line);
}

.header-account-user .header-avatar {
  width: 30px;
  height: 30px;
  font-size: 13px;
  border-radius: var(--radius-md);
}

.header-account-user-meta { min-width: 0; }

.header-account-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.header-account-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-account-logout {
  width: 100%;
  margin-top: 6px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.header-account-logout:hover {
  border-color: rgba(199,64,64,0.24);
  color: var(--danger);
  background: rgba(199,64,64,0.04);
}

@media (max-width: 900px) {
  .header-page-link        { min-height: 30px; padding: 0 10px; font-size: 10px; }
  .header-account-btn      { min-height: 30px; min-width: 30px; padding: 0 6px; }
  .header-avatar           { width: 24px; height: 24px; font-size: 10px; }
  .header-account-caret    { display: none; }
  .header-account-menu     { min-width: 195px; }
  .logout-fab              { display: none !important; }
}
