/* ═══════════════════════════════════════════════════════════
   TOMOS SEISMIC MONITORING — STYLESHEET
   Brand: navy #0b2956 · gold #cdaa3b · text #35445a
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --navy:       #0b2956;
  --gold:       #cdaa3b;
  --bg:         #0f1923;
  --bg-2:       #162233;
  --bg-3:       #1c2d42;
  --border:     rgba(205,170,59,0.14);
  --border-2:   rgba(255,255,255,0.07);
  --text-1:     #e8edf5;
  --text-2:     #8a9ab5;
  --text-3:     #4a5a70;
  --gold-dim:   rgba(205,170,59,0.13);
  --mag-nd:     #4a5a70;
  --mag-low:    #4caf82;
  --mag-med:    #e8c84a;
  --mag-high:   #e8883a;
  --mag-vhigh:  #e85a3a;
  --radius:     10px;
  --radius-sm:  6px;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--bg) !important;
  color: var(--navy) !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }

/* ════════════════════════════════════
   HEADER / NAV
════════════════════════════════════ */
.t-header {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.t-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.t-logo img {
  height: 44px;
  width: auto;
}
@media (max-width: 900px) { .t-logo img { height: 36px; } }
.t-logo-placeholder {
  height: 30px;
  padding: 0 12px;
  background: var(--navy);
  border: 1.5px solid rgba(205,170,59,0.35);
  border-radius: 6px;
  display: flex;
  align-items: center;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.12em;
}
.t-logo-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.t-nav {
  display: flex;
  gap: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.t-nav a, .t-nav-item {
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2) !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.15s;
}
.t-nav a:hover, .t-nav-item:hover {
  background: var(--bg-3);
  color: var(--text-1) !important;
}
.t-nav a.active, .t-nav-item.active {
  background: var(--navy);
  color: #e8edf5 !important;
}
.t-nav-settings {
  color: var(--text-3) !important;
}
.t-nav-settings:hover {
  color: var(--gold) !important;
}

.t-live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  background: rgba(76,175,130,0.1);
  border: 1px solid rgba(76,175,130,0.2);
  padding: 5px 13px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: #4caf82;
  letter-spacing: 0.06em;
}
.t-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4caf82;
  box-shadow: 0 0 6px #4caf82;
  animation: t-blink 2s infinite;
  flex-shrink: 0;
}
@keyframes t-blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
/* Data feed status (data/feed_health.py): yellow = delayed, red = down */
.t-live-badge { cursor: default; }
.t-live-badge--late { color: #e8c84a; background: rgba(232,200,74,0.1); border-color: rgba(232,200,74,0.3); }
.t-live-badge--late .t-live-dot { background: #e8c84a; box-shadow: 0 0 6px #e8c84a; }
.t-live-badge--down { color: #e85a3a; background: rgba(232,90,58,0.12); border-color: rgba(232,90,58,0.35); }
.t-live-badge--down .t-live-dot { background: #e85a3a; box-shadow: 0 0 6px #e85a3a; animation: none; }

/* Header: project name (left) and live badge + user menu (right) */
.t-header-left, .t-header-right { display: flex; align-items: center; gap: 14px; }
.t-header-project {
  color: var(--text-2);
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding-left: 14px;
  border-left: 1px solid var(--border-2);
}
.t-header-project:empty { display: none; }

/* User menu: <details> dropdown */
.t-user-menu { position: relative; }
.t-user-menu-btn {
  list-style: none;
  cursor: pointer;
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  user-select: none;
  white-space: nowrap;
}
.t-user-menu-btn::-webkit-details-marker { display: none; }
.t-user-menu-btn:hover, .t-user-menu[open] .t-user-menu-btn { color: var(--text-1); border-color: var(--border); }
.t-user-menu-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
.t-user-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  padding: 6px 0;
  z-index: 300;
}
.t-user-menu-email {
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 6px 14px 8px;
  border-bottom: 1px solid var(--border-2);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t-user-menu-item {
  display: block;
  padding: 8px 14px;
  color: var(--text-2) !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  text-decoration: none !important;
}
.t-user-menu-item:hover { background: var(--bg-3); color: var(--text-1) !important; }
.t-user-menu-signout:hover { color: #e85a3a !important; }
.t-mobile-nav-user {
  padding: 10px 20px 6px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Projects page, empty states, messages */
.t-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.t-project-card {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 20px 22px;
  text-decoration: none !important;
  transition: border-color 0.15s, background 0.15s;
}
.t-project-card:hover { border-color: rgba(205,170,59,0.45); background: var(--bg-3); }
.t-project-card-name { color: var(--text-1); font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700; }
.t-project-card-role {
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}
.t-empty-state {
  margin-top: 24px;
  padding: 32px;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  color: var(--text-3);
  font-family: 'DM Sans', sans-serif;
  text-align: center;
}
.t-message-page { text-align: center; padding-top: 80px; }

/* ════════════════════════════════════
   PAGE LAYOUT
════════════════════════════════════ */
.t-page {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1px;
  background: var(--border-2);
}
.t-panel {
  background: var(--bg);
  padding: 22px 24px;
}
.t-panel-full {
  grid-column: 1 / -1;
  background: var(--bg);
  padding: 22px 24px;
  border-top: 1px solid var(--border-2);
}

/* Inner content pages (search, event detail, etc.) */
.t-content-page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 28px 32px;
}

/* ════════════════════════════════════
   SECTION LABELS
════════════════════════════════════ */
.t-section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.75;
}
.t-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Page title (h1/h2 replacement) */
.t-page-title {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
  text-align: center;
}
.t-page-sub {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 24px;
}

/* ════════════════════════════════════
   STAT CARDS
════════════════════════════════════ */
.t-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.t-stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.t-stat-card:hover { border-color: var(--border); }
.t-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
  opacity: 0.5;
}
.t-stat-val {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 4px;
}
.t-stat-label { font-size: 13px; color: var(--text-2); }
.t-stat-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
}

/* ════════════════════════════════════
   CONTROLS — PILLS, DROPDOWNS
════════════════════════════════════ */
.t-controls-row {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.t-controls-label {
  font-size: 13px;
  color: var(--text-3);
  margin-right: 2px;
  white-space: nowrap;
}

/* Pill buttons (for time window toggles) */
.t-pill {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.t-pill:hover { border-color: var(--border); color: var(--text-1); }
.t-pill.active {
  background: var(--gold-dim);
  border-color: rgba(205,170,59,0.35);
  color: var(--gold);
}

/* Chart time window pill buttons */
.t-tw-group {
  display: flex;
  gap: 4px;
}
.t-tw-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-3);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.t-tw-btn:hover { color: var(--text-2); border-color: rgba(255,255,255,0.15); }
.t-tw-btn.active { background: var(--gold-dim); color: var(--gold); border-color: rgba(205,170,59,0.35); }

/* Map mode toggle buttons */
.t-mode-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.t-mode-btn:hover { color: var(--text-1); border-color: rgba(255,255,255,0.15); }
.t-mode-btn.active { background: var(--navy); color: var(--text-1); border-color: rgba(11,41,86,0.8); }

/* Map controls bar */
.t-map-controls {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.t-map-control-group { display: flex; flex-direction: column; gap: 5px; }
.t-control-label {
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.t-mode-toggle { display: flex; gap: 4px; }

/* ════════════════════════════════════
   DASH COMPONENT OVERRIDES
   (Dropdown, DataTable, Graph, etc.)
════════════════════════════════════ */

/* Dropdown */
.Select-control, .Select-menu-outer, .VirtualizedSelectOption {
  background: var(--bg-3) !important;
  border-color: var(--border-2) !important;
  color: var(--text-1) !important;
}
.Select-value-label, .Select-placeholder,
.Select-control .Select-value-label,
.Select-control .Select-placeholder,
.dash-dropdown .Select-value-label,
.dash-dropdown .Select-placeholder,
.dash-dropdown .Select-value,
[class*="Select-value"],
[class*="Select-placeholder"] {
  color: #000000 !important;
}
.Select-arrow { border-top-color: var(--text-3) !important; }
.Select-menu-outer { border-color: var(--border) !important; }
.VirtualizedSelectOption:hover,
.VirtualizedSelectFocusedOption {
  background: var(--bg-3) !important;
  color: var(--gold) !important;
}

/* Dash 2.x dropdown */
.dash-dropdown .Select-control {
  background-color: var(--bg-3) !important;
  border-color: var(--border-2) !important;
}
.dash-dropdown .Select-menu-outer {
  background-color: var(--bg-2) !important;
}

/* DatePickerRange */
.DateRangePickerInput, .DateInput_input {
  background: var(--bg-3) !important;
  color: #000000 !important;
  border-color: var(--border-2) !important;
}
.DateInput_input,
.DateInput_input__focused,
input.DateInput_input,
[class*="DateInput_input"] {
  color: #000000 !important;
}
.CalendarDay__default { background: var(--bg-2) !important; color: var(--text-1) !important; }
.CalendarDay__selected, .CalendarDay__selected:hover { background: var(--navy) !important; border-color: var(--gold) !important; }

/* RangeSlider */
.rc-slider-rail { background: var(--bg-3) !important; }
.rc-slider-track { background: var(--navy) !important; }
.rc-slider-handle { border-color: var(--gold) !important; background: var(--gold) !important; }

/* DataTable */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table {
  font-family: 'DM Sans', sans-serif !important;
}
.dash-header {
  background-color: var(--bg-2) !important;
  color: var(--text-3) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 10px !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid var(--border-2) !important;
  font-weight: 400 !important;
}
.dash-cell {
  background-color: var(--bg) !important;
  color: var(--text-2) !important;
  border-bottom: 1px solid rgba(255,255,255,0.03) !important;
  border-right: none !important;
  font-size: 14.5px !important;
}
.dash-cell:hover, .dash-row:hover .dash-cell {
  background-color: var(--bg-2) !important;
  color: var(--text-1) !important;
}
.dash-table-container {
  border: none !important;
}
/* Pagination */
.previous-next-container button, .page-number {
  background: var(--bg-2) !important;
  color: var(--text-2) !important;
  border: 1px solid var(--border-2) !important;
  border-radius: var(--radius-sm) !important;
  font-family: 'DM Sans', sans-serif !important;
}
.previous-next-container button:hover, .page-number:hover {
  border-color: var(--border) !important;
  color: var(--gold) !important;
}
.current-page { color: var(--gold) !important; border-color: var(--border) !important; }

/* Hide DataTable "Toggle Columns" button (hidden_columns are internal only) */
.show-hide { display: none !important; }

/* Event table — row hover & "View →" styling */
#event-table .dash-row { cursor: pointer; }
#event-table .dash-row:hover .dash-cell { color: #e8edf5 !important; filter: brightness(1.2); }


/* Plotly graph background */
.js-plotly-plot .plotly .bg { fill: var(--bg) !important; }
.gtitle, .xtitle, .ytitle { fill: var(--text-2) !important; }
.xtick text, .ytick text { fill: var(--text-3) !important; }
.gridlayer path { stroke: rgba(255,255,255,0.05) !important; }

/* Checklist / RadioItems */
.dash-checklist label, .dash-radio-items label {
  color: var(--text-2) !important;
  font-size: 15px !important;
  cursor: pointer !important;
  transition: color 0.15s !important;
}
.dash-checklist label:hover, .dash-radio-items label:hover {
  color: var(--text-1) !important;
}
input[type="radio"]:checked + span,
input[type="checkbox"]:checked + span {
  color: var(--gold) !important;
}

/* ════════════════════════════════════
   TABLE — MAGNITUDE COLOUR CODING
   Applied via style_data_conditional
════════════════════════════════════ */
/* Left-border stripe + tint per magnitude band.
   These are set in Python via style_data_conditional
   so no extra CSS needed here — just the base colours. */

/* ════════════════════════════════════
   BADGES
════════════════════════════════════ */
.t-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.t-badge-val {
  background: rgba(76,175,130,0.12);
  color: #4caf82;
  border: 1px solid rgba(76,175,130,0.2);
}
.t-badge-pre {
  background: rgba(232,200,74,0.1);
  color: #e8c84a;
  border: 1px solid rgba(232,200,74,0.18);
}

/* ════════════════════════════════════
   INFO GRID (event / station detail)
════════════════════════════════════ */
.t-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.t-info-item {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.t-info-item-label {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 5px;
  font-family: 'JetBrains Mono', monospace;
}
.t-info-item-val {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
  font-family: 'JetBrains Mono', monospace;
}

/* ════════════════════════════════════
   BACK LINK
════════════════════════════════════ */
.t-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3) !important;
  font-size: 14px;
  text-decoration: none !important;
  margin-bottom: 20px;
  transition: color 0.15s;
}
.t-back-link:hover { color: var(--gold) !important; }

/* ════════════════════════════════════
   SEARCH PAGE FILTER PANEL
════════════════════════════════════ */
.t-filter-panel {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.t-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
  align-items: start;
}
/* Second row of the Search filters: same 4 columns as .t-filter-grid
   (confidence | region, two columns wide | actions) */
.t-filter-grid-2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: start;
}
.t-filter-span-2 { grid-column: span 2; }
.t-filter-label {
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
}

/* Search button */
.t-search-btn {
  background: var(--navy);
  border: 1px solid rgba(205,170,59,0.3);
  color: var(--gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 9px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.03em;
  height: 38px;
}
.t-search-btn:hover {
  background: #0d3370;
  border-color: rgba(205,170,59,0.6);
}

.t-clear-btn {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.t-clear-btn:hover { border-color: var(--border); color: var(--text-1); }
.t-search-btn:disabled { opacity: 0.6; cursor: wait; }

/* "Search complete" confirmation next to the Search button */
.t-search-status {
  align-self: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
}
.t-search-status-ok {
  color: #4caf82;
  animation: t-search-done 0.4s ease-out;
}
@keyframes t-search-done {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* ════════════════════════════════════
   STATION STATUS COLOURS
════════════════════════════════════ */
.t-sta-active   { color: #4caf82; }
.t-sta-warning  { color: #e8c84a; }
.t-sta-old      { color: #e8883a; }
.t-sta-offline  { color: var(--text-3); }

/* ════════════════════════════════════
   MOBILE
════════════════════════════════════ */
/* Mobile tab bar (hidden on desktop) */
.t-mobile-tabs { display: none; }

.t-mobile-tab {
  flex: 1;
  padding: 9px 0;
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.t-mobile-tab.active {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(205,170,59,0.35);
}

/* Hamburger (hidden on desktop) */
.t-hamburger {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* Mobile nav dropdown */
.t-mobile-nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  padding: 8px 0;
}
.t-mobile-nav-link {
  display: block;
  padding: 13px 20px;
  color: var(--text-2) !important;
  text-decoration: none !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.t-mobile-nav-link:last-child { border-bottom: none; }
.t-mobile-nav-link:hover { background: var(--bg-3); }
.t-mobile-nav-logout { color: #e85a3a !important; }

@media (max-width: 900px) {
  .t-page { grid-template-columns: 1fr; }
  .t-panel-full { grid-column: 1; }
  .t-stats-row { grid-template-columns: repeat(3, 1fr); }
  .t-filter-grid { grid-template-columns: 1fr 1fr; }
  .t-filter-grid-2 { grid-template-columns: 1fr; gap: 16px; }
  .t-filter-span-2 { grid-column: auto; }
  .t-panel, .t-panel-full { padding: 16px; }
  .t-content-page { padding: 16px; }

  /* Show hamburger, hide desktop nav */
  .t-hamburger { display: block; }
  .t-nav { display: none; }
  .t-nav-logout { display: none; }
  .t-user-menu { display: none; }          /* its items are in the hamburger menu */
  .t-header-project { display: none; }     /* no room on phones */

  /* Header layout on mobile */
  #header-container { position: relative; }
  .t-header { padding: 0 12px; }

  /* Show tab bar on mobile */
  .t-mobile-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px 0;
  }

  /* Hide inactive section based on active tab */
  .t-mobile-map-active    #charts-section { display: none; }
  .t-mobile-charts-active #map-panel      { display: none; }

  /* Compact map controls: 2-column grid */
  .t-map-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin-bottom: 10px;
  }
  .t-map-control-group { gap: 4px; }
  .t-control-label { font-size: 8px; margin-bottom: 2px; }
  .t-tw-btn { font-size: 10px; padding: 3px 7px; }
  .t-mode-btn { font-size: 10px; padding: 3px 7px; }

  /* Compact stat cards */
  .t-stat-card { padding: 10px 12px; }
  .t-stat-val  { font-size: 22px; }
  .t-stat-label { font-size: 10px; }
  .t-stat-sub   { font-size: 9px; }
  .t-section-label { font-size: 9px; margin-bottom: 8px; }

  /* Search page mobile tabs */
  .t-search-tabs { display: flex; }
  .t-search-filters-active #search-results-section { display: none; }
  .t-search-results-active  #search-filters-section { display: none; }

  /* Single-column viz grid on mobile */
  #search-viz-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 500px) {
  .t-stats-row { grid-template-columns: 1fr; }
  .t-filter-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════
   SETTINGS PAGE
════════════════════════════════════ */
.t-settings-page { max-width: 860px; }

.t-settings-section { margin-bottom: 36px; }

.t-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.t-setting-card {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.2s;
}
.t-setting-card:hover { border-color: var(--border); }

.t-setting-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}
.t-setting-desc {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 12px;
  line-height: 1.4;
}

.t-setting-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 15px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  transition: border-color 0.15s;
}
.t-setting-input:focus { border-color: rgba(205,170,59,0.4); }

/* Alert cards */
.t-alert-card {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.t-alert-info { flex: 1; }
.t-alert-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
}
.t-alert-desc { font-size: 13px; color: var(--text-3); }
.t-alert-input {
  width: 110px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 15px;
  padding: 7px 10px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  text-align: center;
}
.t-alert-input:focus { border-color: rgba(205,170,59,0.4); }
.t-alert-unit {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
}

/* Toggle rows */
.t-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.t-toggle-label {
  font-size: 15px;
  color: var(--text-1);
  margin-bottom: 2px;
}
.t-toggle-desc { font-size: 13px; color: var(--text-3); }

/* Toggle checkbox (dcc.Checklist single-option) */
.t-toggle-check .form-check {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}
.t-toggle-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
  margin: 0;
}
.t-toggle-check label { display: none; }

/* Save / Cancel */
.t-save-btn {
  background: var(--navy);
  border: 1px solid rgba(205,170,59,0.3);
  color: var(--gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.t-save-btn:hover {
  background: #0d3370;
  border-color: rgba(205,170,59,0.6);
}

.t-cancel-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2) !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none !important;
}
.t-cancel-btn:hover {
  border-color: var(--border);
  color: var(--text-1) !important;
}

.t-save-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.t-save-msg {
  font-size: 14px;
  color: #4caf82;
  text-align: right;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  min-height: 20px;
}

@media (max-width: 900px) {
  .t-settings-grid { grid-template-columns: 1fr; }
  .t-alert-card { flex-wrap: wrap; }
}

/* ════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════ */
.t-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.t-login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.t-login-logo {
  height: 80px;
  max-width: 100%;
  margin-bottom: 14px;
}

/* DM Sans, not Syne: Syne's short descenders make "g" in "Sign in" look cut */
.t-login-title {
  color: var(--text-1);
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.t-login-input {
  width: 100%;
  background: var(--bg-3) !important;
  border: 1px solid var(--border-2) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-1) !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 15px !important;
  padding: 11px 14px !important;
  outline: none !important;
  transition: border-color 0.15s;
}

.t-login-input:focus {
  border-color: rgba(205,170,59,0.5) !important;
}

.t-login-btn {
  width: 100%;
  background: var(--navy);
  border: 1px solid rgba(205,170,59,0.35);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s;
  margin-top: 4px;
}

.t-login-btn:hover {
  background: #0d3370;
  border-color: rgba(205,170,59,0.65);
}

.t-login-error {
  color: #e85a3a;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  min-height: 18px;
  text-align: center;
}

.t-login-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 16px 0 12px;
}

.t-login-btn-guest {
  background: transparent;
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  font-weight: 400;
  font-size: 13px;
}

.t-login-btn-guest:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.75);
}

/* Account pages rendered by Flask (templates/): plain form elements */
.t-login-form { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.t-login-label {
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  margin-top: 6px;
}
a.t-login-btn { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.t-login-note {
  color: var(--text-3);
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  margin: 4px 0 0;
}
.t-login-info {
  width: 100%;
  background: var(--gold-dim);
  border: 1px solid rgba(205,170,59,0.3);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 10px 12px;
  text-align: center;
}
.t-login-link {
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  text-decoration: none;
}
.t-login-link:hover { color: var(--gold); }

/* Logout link in header */
.t-nav-logout {
  color: var(--text-2) !important;
  font-size: 13px;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  margin-left: auto;
}

.t-nav-logout:hover {
  color: #e85a3a !important;
  border-color: rgba(232,90,58,0.4);
}

/* Survey side panel */
.t-survey-container {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  align-items: center;
}

.t-survey-panel {
  background: #0a1e38;
  border: 1px solid rgba(205,170,59,0.35);
  border-right: none;
  border-radius: 10px 0 0 10px;
  padding: 18px 20px;
  width: 210px;
  box-shadow: -4px 0 24px rgba(0,0,0,0.4);
}

.t-survey-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.t-survey-title {
  color: var(--gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.t-survey-close-btn {
  background: transparent;
  border: none;
  color: #4a5a70;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.t-survey-close-btn:hover { color: #8a9ab5; }

.t-survey-body {
  color: #8a9ab5;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 14px 0;
}

.t-survey-link {
  display: inline-block;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(205,170,59,0.35);
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  text-decoration: none;
  transition: background 0.15s;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.t-survey-link:hover { background: rgba(205,170,59,0.2); color: var(--gold); }

.t-survey-mini-tab {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(205,170,59,0.35);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 8px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.05em;
}

.t-survey-mini-tab:hover { background: rgba(205,170,59,0.2); }

/* ════════════════════════════════════
   ADMIN PAGES (pages/admin.py)
════════════════════════════════════ */
.t-admin-page { max-width: 1280px; }
.t-admin-section {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 20px;
}
.t-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 16px;
  align-items: end;
}
.t-admin-field { display: flex; flex-direction: column; gap: 4px; }
.t-admin-field-btn { justify-content: flex-end; }
.t-admin-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 8px 10px;
  outline: none;
}
.t-admin-input:focus { border-color: rgba(205,170,59,0.5); }
.t-admin-dropdown { min-width: 140px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: #0f1923; }
.t-admin-inline-dropdown { width: 150px; }
.t-admin-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.t-admin-selected { color: var(--text-1); font-family: 'DM Sans', sans-serif; font-size: 15px; margin-bottom: 10px; }
.t-admin-note { color: var(--text-3); font-family: 'DM Sans', sans-serif; font-size: 12.5px; margin-top: 10px; }
.t-admin-note code, .t-admin-page code { color: var(--gold); font-family: 'JetBrains Mono', monospace; }
.t-admin-check { color: var(--text-2); font-family: 'DM Sans', sans-serif; font-size: 14px; }
.t-admin-msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
}
.t-admin-msg-ok  { background: rgba(76,175,130,0.08); border: 1px solid rgba(76,175,130,0.25); color: #4caf82; }
.t-admin-msg-err { background: rgba(232,90,58,0.08);  border: 1px solid rgba(232,90,58,0.3);  color: #e85a3a; }
.t-temp-password-box { margin-top: 10px; color: var(--text-1); }
.t-temp-password-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.t-temp-password {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--gold) !important;
  background: var(--bg-3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}
.t-copy-btn { color: var(--text-2); cursor: pointer; font-size: 18px; }
.t-copy-btn:hover { color: var(--gold); }
.t-danger-btn {
  background: transparent;
  border: 1px solid rgba(232,90,58,0.4);
  color: #e85a3a;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.t-danger-btn:hover { background: rgba(232,90,58,0.08); }
.t-admin-actions button:disabled { opacity: 0.35; cursor: not-allowed; }
.t-admin-tabs { margin-top: 18px; border-bottom: 1px solid var(--border-2); }
.t-admin-tab {
  background: transparent !important;
  border: none !important;
  color: var(--text-2) !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  padding: 10px 18px !important;
}
.t-admin-tab--selected {
  color: var(--gold) !important;
  border-bottom: 2px solid var(--gold) !important;
}

/* ════════════════════════════════════
   SETTINGS (per user / project)
════════════════════════════════════ */
.t-filter-notice {
  margin: 8px 0 10px;
  padding: 7px 12px;
  border: 1px solid rgba(205,170,59,0.3);
  border-radius: var(--radius-sm);
  background: var(--gold-dim);
  color: var(--gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
}
.t-filter-notice-link { color: var(--gold) !important; text-decoration: underline !important; }
.t-settings-source {
  margin: 18px 0 4px;
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
}
.t-settings-help {
  color: var(--text-3);
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  margin: -4px 0 12px;
  line-height: 1.5;
}
.t-mag-thresholds { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.t-mag-thresholds .t-setting-input { width: 80px; }
.t-mag-cat { display: inline-flex; align-items: center; gap: 6px; color: var(--text-1); font-size: 14px; }
.t-mag-op { color: var(--text-3); font-family: 'JetBrains Mono', monospace; }
.t-mag-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.t-coming-soon {
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.t-coming-soon-block { opacity: 0.5; pointer-events: none; }
.t-settings-ok  { color: #4caf82; }
.t-settings-err { color: #e85a3a; }
.t-login-subtitle {
  color: var(--text-1);
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  align-self: flex-start;
}
.t-login-divider { width: 100%; }
/* Connect Telegram page: "/start <code>" with a Copy button */
.t-tg-code-row { width: 100%; display: flex; gap: 8px; align-items: stretch; }
.t-tg-code {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 10px 12px;
  word-break: break-all;
}
.t-tg-copy { width: auto !important; padding: 0 16px !important; margin-top: 0 !important; }

/* Data source not available (app.py:_on_callback_error) */
.t-data-source-banner {
  margin: 10px 16px 0;
  padding: 8px 14px;
  border: 1px solid rgba(232,90,58,0.4);
  border-radius: var(--radius-sm);
  background: rgba(232,90,58,0.12);
  color: var(--mag-vhigh);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
}

/* ── MapLibre maps (assets/tomos_map.js, components/tomos_map.py) ─────────── */
.t-map { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); }
.t-map-popup .maplibregl-popup-content {
  background: rgba(15,25,35,0.95); color: var(--text-1);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 12px; padding: 8px 10px;
}
.t-map-popup .maplibregl-popup-tip { border-top-color: rgba(15,25,35,0.95); border-bottom-color: rgba(15,25,35,0.95); }
.t-map-popup table { border-collapse: collapse; margin-top: 4px; }
.t-map-popup th { color: var(--text-2); font-weight: 400; text-align: left; padding: 1px 10px 1px 0; }
.t-map-popup td { color: var(--text-1); padding: 1px 0; }
/* White text with a dark outline: readable on light and dark terrain */
.t-map-label {
  font-family: 'DM Sans', sans-serif; font-size: 12.5px; font-weight: 600; color: #ffffff;
  text-shadow: -1px -1px 0 #0b1a2b, 1px -1px 0 #0b1a2b, -1px 1px 0 #0b1a2b, 1px 1px 0 #0b1a2b,
               0 0 3px #0b1a2b;
  letter-spacing: 0.02em; pointer-events: none; white-space: nowrap;
}
.t-map-legend {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(15,25,35,0.85); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 6px 10px; font-family: 'DM Sans', sans-serif; font-size: 11px; color: var(--text-2);
}
.t-map-legend-item { display: flex; align-items: center; gap: 6px; line-height: 18px; }
.t-map-legend-symbol { width: 11px; height: 11px; background: var(--c); display: inline-block; vertical-align: middle; }
/* Light outline around the shape (the shape itself is cut with clip-path), so dark
   colours stay visible on the dark legend */
.t-map-legend-outline { display: inline-flex; filter: drop-shadow(0 0 0.6px #e8edf5) drop-shadow(0 0 0.6px #e8edf5); }
.t-sym-circle   { border-radius: 50%; }
.t-sym-triangle { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.t-sym-triangle-down { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.t-sym-diamond  { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.t-sym-pentagon { clip-path: polygon(50% 0, 100% 38%, 81% 100%, 19% 100%, 0 38%); }
.t-sym-hexagon  { clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.t-sym-star     { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.t-map-cursor {
  background: rgba(15,25,35,0.85); color: var(--text-1);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 3px 8px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  pointer-events: none; white-space: nowrap;
}
/* Area selection (Search map): ▭ button, overlay while selecting, the drawn box */
.t-map-select-btn { font-size: 15px; line-height: 1; }
.t-map-select-btn.active { background: #cdaa3b !important; color: #0b1a2b; }
.t-map-select-overlay { position: absolute; inset: 0; z-index: 3; display: none; cursor: crosshair; }
.t-map-select-box {
  position: absolute; border: 2px dashed #cdaa3b; background: rgba(205,170,59,0.12); pointer-events: none;
}
.t-map-undo-btn { font-size: 16px; line-height: 1; }
.t-map-undo-btn:disabled { opacity: 0.35; cursor: default; }
/* Map status notice (assets/tomos_map.js): loading, busy, no data */
.t-map-status {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 8px; pointer-events: none;
  background: rgba(15,25,35,0.88); color: var(--text-1);
  border: 1px solid var(--border-2); border-radius: 999px;
  padding: 5px 14px; font-family: 'DM Sans', sans-serif; font-size: 12px; white-space: nowrap;
}
.t-map-spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(205,170,59,0.25); border-top-color: #cdaa3b;
  animation: t-map-spin 0.8s linear infinite;
}
@keyframes t-map-spin { to { transform: rotate(360deg); } }
/* Settings tabs: own buttons (pages/settings.py), styled like the dcc.Tabs above */
.t-settings-tabs { display: flex; gap: 4px; margin-bottom: 18px; }
.t-settings-tabs .t-admin-tab { cursor: pointer; }

/* ════════════════════════════════════
   Documents: report list and the weekly report (pages/documents.py, report_weekly.py)
   The report is a white sheet, the same on screen and (later) in the PDF.
   ════════════════════════════════════ */
.t-doc-list { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.t-doc-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 18px; background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius); text-decoration: none; transition: border-color 0.15s;
}
.t-doc-row:hover { border-color: var(--border); }
.t-doc-title { color: var(--text-1); font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500; }
.t-doc-detail { color: var(--text-2); font-family: 'DM Sans', sans-serif; font-size: 13px; white-space: nowrap; }

.t-report-page { max-width: 980px; }
.t-report {
  background: #ffffff; color: #1e293b; border-radius: var(--radius);
  padding: 44px 52px; margin-top: 12px; font-family: 'DM Sans', sans-serif; font-size: 14.5px; line-height: 1.55;
}
.t-report-head { border-bottom: 3px solid #b8912a; padding-bottom: 18px; margin-bottom: 8px; }
.t-report-kicker { color: #b8912a; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 12px;
                   letter-spacing: 0.14em; text-transform: uppercase; }
.t-report h1 { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 700; color: #0b2956; margin: 6px 0 2px; }
.t-report-period { color: #475569; font-size: 16px; }
.t-report h2 { font-family: 'Syne', sans-serif; font-size: 19px; font-weight: 700; color: #0b2956;
               margin: 30px 0 12px; padding-bottom: 6px; border-bottom: 1px solid #e2e8f0; }
.t-report h3 { font-size: 15px; font-weight: 600; color: #1e293b; margin: 22px 0 4px; }
.t-report-note { color: #64748b; font-size: 13px; margin: 0 0 6px; }
.t-report-text p { margin: 0 0 8px; }
/* Every running text of the report justified (not titles, tables or key figures) */
.t-report p, .t-report li, .t-report-foot, .t-report-auto { text-align: justify; }
.t-report-kfs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 18px; }
.t-report-kf { border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; background: #f8fafc; }
.t-report-kf-label { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.t-report-kf-value { color: #0b2956; font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 700; line-height: 1.3; }
.t-report-kf-detail { color: #64748b; font-size: 12px; min-height: 1em; }
.t-report-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t-report-table th { text-align: left; color: #64748b; font-weight: 600; font-size: 12px; text-transform: uppercase;
                     letter-spacing: 0.05em; border-bottom: 1px solid #cbd5e1; padding: 6px 8px; }
.t-report-table td { border-bottom: 1px solid #f1f5f9; padding: 6px 8px; }
.t-report-table a { color: #0b2956; }
.t-report-figure { break-inside: avoid; }
.t-report .js-plotly-plot .plotly .bg { fill: #ffffff !important; }   /* the dark theme's rule above */
.t-report-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid #e2e8f0; color: #94a3b8; font-size: 12px; }
@media (max-width: 760px) {
  .t-report { padding: 24px 18px; }
  .t-report-kfs { grid-template-columns: repeat(2, 1fr); }
  .t-doc-row { flex-direction: column; gap: 2px; }
}
.t-report-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.t-report .t-map { border-radius: 6px; overflow: hidden; }
@media (max-width: 760px) { .t-report-2col { grid-template-columns: 1fr; } }
.t-report-methods { color: #475569; font-size: 13px; padding-left: 18px; margin: 0; }
.t-report-methods li { margin-bottom: 6px; }
.t-report-burst-n { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px;
                    color: #ffffff; font-weight: 600; font-size: 12px; text-align: center; }
.t-report-download { background: #0b2956; color: #ffffff; border: none; border-radius: 6px; padding: 8px 14px;
                     font-family: 'DM Sans', sans-serif; font-size: 13.5px; cursor: pointer; }
.t-report-download:hover { background: #163d75; }
.t-report-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.t-report-published { color: #334155; font-size: 13.5px; margin-top: 6px; }
.t-report-auto { color: #64748b; font-size: 12.5px; font-style: italic; }
.t-doc-meta { color: var(--text-3); font-family: 'DM Sans', sans-serif; font-size: 12.5px; margin-top: 2px; }

/* Footer (every page): product version and copyright, as tomos.cl */
.t-shell { min-height: 100vh; display: flex; flex-direction: column; }
.t-shell > #page-content { flex: 1 0 auto; }
.t-footer {
  padding: 18px 24px; margin-top: 32px; border-top: 1px solid var(--border-2);
  color: var(--text-3); font-family: 'DM Sans', sans-serif; font-size: 12.5px; text-align: center;
}
.t-login-page { flex-direction: column; }
.t-footer--login { border-top: none; margin-top: 24px; padding: 0 16px; }
.t-doc-section { margin-top: 36px; }
.t-doc-empty { max-width: 760px; margin-top: 12px; padding: 20px; }

/* Metrics page (Tomos admins): pages/metrics.py */
.t-metrics-controls { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.t-metrics-period label { margin-right: 14px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.t-metrics-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.t-metrics-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.t-metrics-col h4 { color: var(--text-1); font-size: 13px; font-weight: 600; margin: 4px 0 8px; }
.t-metrics-table { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--text-2); }
.t-metrics-table th { text-align: left; color: var(--text-3); font-weight: 600; font-size: 11px; text-transform: uppercase;
                      letter-spacing: 0.05em; border-bottom: 1px solid var(--border-2); padding: 5px 6px; }
.t-metrics-table td { border-bottom: 1px solid var(--border-2); padding: 5px 6px; }
.t-metrics-table a { color: var(--gold); }
.t-metrics-graph { margin-top: 8px; }
@media (max-width: 1100px) { .t-metrics-cards { grid-template-columns: repeat(2, 1fr); } .t-metrics-2col { grid-template-columns: 1fr; } }
.t-metrics-controls { flex-wrap: wrap; }
.t-metrics-dropdown { width: 300px; font-size: 13px; }
.t-metrics-h4 { color: var(--text-1); font-size: 13px; font-weight: 600; margin: 18px 0 4px; }
.t-metrics-block { margin-top: 22px; }
.t-metrics-block .t-metrics-h4 { margin-top: 0; }
.t-metrics-2col .t-metrics-block { margin-top: 10px; }
.t-metrics-narrow { max-width: 760px; }
.t-metrics-dropdown-short { width: 170px; }
.t-metrics-cards.t-metrics-cards-3 { grid-template-columns: repeat(3, 1fr); }
.t-metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; margin-top: 8px; }
.t-metrics-grid.t-metrics-grid-3 { grid-template-columns: repeat(3, 1fr); }
.t-metrics-cell-title { color: var(--text-2); font-size: 12px; font-weight: 600; margin: 6px 0 0 4px; }
@media (max-width: 1100px) { .t-metrics-grid, .t-metrics-grid.t-metrics-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .t-metrics-cards.t-metrics-cards-3 { grid-template-columns: repeat(2, 1fr); } }
.t-metrics-sub { color: var(--gold); font-size: 14px; font-weight: 600; margin: 34px 0 10px;
  padding-bottom: 4px; border-bottom: 1px solid var(--border-2); }
.t-metrics-findings { margin: 6px 0 0 18px; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.t-metrics-findings li { margin-bottom: 4px; }
.t-metrics-details.t-metrics-more { margin: 8px 0 0; }
.t-metrics-section { margin-top: 44px; }
.t-metrics-details { margin: 36px 0 12px; color: var(--text-2); font-size: 13px; }
.t-metrics-details summary { cursor: pointer; font-weight: 600; }
.t-metrics-details ul { margin: 8px 0 0 18px; line-height: 1.6; }
#mt-curves-block { margin-top: 26px; }
