/* ============================================================
   SAFE-AL  —  assets/safe_al.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700&display=swap');

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-bg:  #3a5a80;
  --bg:          #f5f2ee;
  --panel:       rgba(255,255,255,0.97);
  --panel-btn:   #e8e4df;
  --border:      rgba(0,0,0,0.10);
  --text:        rgba(0,0,0,0.55);
  --text-dark:   rgba(0,0,0,0.75);
  --shadow:      0 2px 8px rgba(0,0,0,0.13);
  --shadow-lg:   0 4px 20px rgba(0,0,0,0.15);
  --radius:      28px;
  --radius-sm:   10px;
  --sidebar-w:   52px;
  --topbar-h:    54px;
  --accent:      #3a5a80;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Barlow', sans-serif;
  background: var(--bg);
}

/* ── Dash wrapper divs — must fill viewport ── */
#_dash-app-content,
#react-entry-point,
#_dash-app-content > div {
  width: 100%;
  height: 100%;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
#login-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: linear-gradient(140deg, #2a4a6a 0%, #3a5a80 45%, #4a7aa0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo {
  width: 72px; height: 72px;
  background: var(--panel-btn);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }

.login-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 38px; font-weight: 700;
  color: var(--accent); letter-spacing: 4px; margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px; color: var(--text); font-weight: 500;
  margin-bottom: 32px; letter-spacing: 0.3px; text-align: center;
}

.login-error {
  width: 100%;
  background: rgba(220,50,50,0.08);
  border: 1px solid rgba(220,50,50,0.25);
  border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: #c0392b;
  font-weight: 500; text-align: center; margin-bottom: 16px; min-height: 16px;
}
.login-error:empty { display: none; }

.login-field {
  width: 100%; display: flex; flex-direction: column;
  gap: 6px; margin-bottom: 16px;
}
.login-field label {
  font-size: 12px; font-weight: 600; color: var(--text-dark);
  text-transform: uppercase; letter-spacing: 0.5px; padding-left: 4px;
}
.login-field input,
.login-field input[type="text"],
.login-field input[type="password"] {
  width: 100% !important;
  background: var(--panel-btn) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 12px 18px !important;
  font-size: 15px !important;
  font-family: 'Barlow', sans-serif !important;
  color: var(--text-dark) !important;
  outline: none !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  -webkit-appearance: none !important; appearance: none !important;
  transition: border-color 0.18s, box-shadow 0.18s !important;
}
.login-field input:focus,
.login-field input[type="text"]:focus,
.login-field input[type="password"]:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(58,90,128,0.12) !important;
}

.login-btn {
  width: 100%; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 13px 18px; font-size: 15px;
  font-family: 'Barlow', sans-serif; font-weight: 700;
  letter-spacing: 1px; cursor: pointer;
  transition: background 0.18s, transform 0.1s;
  min-height: 48px; margin-bottom: 20px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.login-btn:hover  { background: #2e4a6a; transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }

.login-footer {
  width: 100%; text-align: center;
  border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px;
}
.login-footer p { font-size: 11px; color: var(--text); line-height: 1.6; margin: 0; }
.login-footer strong { color: var(--text-dark); }

/* ============================================================
   MAIN LAYOUT — wrapper, sidebar, safe-main
   ============================================================ */
#main-dashboard-content {
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0; flex-shrink: 0;
  position: fixed; top: 0; left: 0;
  z-index: 100; overflow: visible;
}

.sidebar-logo {
  width: 36px; height: 36px;
  border-radius: 8px; overflow: hidden; margin-bottom: 16px;
}
.sidebar-logo img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-bottom {
  width: 36px; height: 36px;
  border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.30);
}
.sidebar-bottom img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-divider {
  width: 32px; height: 1px;
  background: rgba(255,255,255,0.25); margin: 6px 0;
}

.sidebar-logo-link {
  position: relative; display: flex;
  align-items: center; justify-content: center;
  text-decoration: none; border-radius: 8px; transition: opacity 0.18s;
}
.sidebar-logo-link:hover { opacity: 0.85; cursor: pointer; }

.sidebar-icon {
  width: 36px; height: 36px; border-radius: 8px;
  margin: 3px 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s;
  background: transparent; border: none; padding: 0; outline: none;
  position: relative; overflow: visible; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.sidebar-icon:hover  { background: rgba(255,255,255,0.15); }
.sidebar-icon.active { background: rgba(255,255,255,0.20); }
.sidebar-icon.disabled { opacity: 0.25; cursor: not-allowed; pointer-events: none; }

/* ── Sidebar tooltips ── */
.sidebar-tooltip,
.sidebar-icon .tooltip,
.sidebar-logo-link .tooltip {
  display: none;
  position: absolute;
  left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: rgba(20,35,55,0.92); color: #fff;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  padding: 5px 10px; border-radius: 6px;
  pointer-events: none; z-index: 9999; letter-spacing: 0.3px;
}
.sidebar-tooltip::before,
.sidebar-icon .tooltip::before,
.sidebar-logo-link .tooltip::before {
  content: '';
  position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: rgba(20,35,55,0.92);
}
.sidebar-icon:hover .sidebar-tooltip,
.sidebar-icon:hover .tooltip,
.sidebar-logo-link:hover .sidebar-tooltip,
.sidebar-logo-link:hover .tooltip { display: block; }

/* ── Safe-main — floating card ── */
.safe-main {
  background: var(--bg);
  margin: 20px 20px 20px 90px;
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: calc(100% - var(--sidebar-w));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: visible;
  border-radius: var(--radius);
  box-shadow: 0 5px 60px 5px rgba(0,0,0,0.35) !important;
  position: relative;
  z-index: 10;
}

@media (max-width: 768px) {
  .safe-main {
    margin: 20px;
    box-shadow: 0 4px 25px 2px rgba(0,0,0,0.30) !important;
  }
}

/* ── Bootstrap card overrides (cream background) ── */
.safe-main .card,
.safe-main .card-body,
.safe-main .card-header,
.safe-main .card-footer,
.safe-main .dbc-card,
.safe-main [class*="card"] {
  background-color: var(--bg) !important;
  border: none !important;
  overflow: visible !important;
}

/* ── Remove excess whitespace below map ── */
.safe-main .tab-content,
#map-left-container {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* ── Footer ── */
footer, .safe-main footer {
  background: var(--bg) !important;
  color: var(--text-dark);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* ============================================================
   TOPBAR + PILL NAVIGATION
   ============================================================ */
.safe-topbar {
  border-radius: var(--radius) var(--radius) 0 0;
  height: var(--topbar-h); background: var(--bg);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  flex-shrink: 0; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}

.safe-toggle-pill {
  background: #ddd8d2; border-radius: var(--radius); padding: 4px;
  display: flex; gap: 2px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.10); flex-shrink: 0;
}
.safe-pill-btn {
  border: none; border-radius: var(--radius); padding: 6px 16px;
  font-size: 13px; font-family: 'Barlow', sans-serif; font-weight: 500;
  cursor: pointer; color: var(--text); background: transparent;
  transition: background 0.18s, color 0.18s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.safe-pill-btn.safe-pill-active {
  background: var(--panel); color: var(--text-dark); box-shadow: var(--shadow);
}
.safe-page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(20px, 3vw, 32px); font-weight: 700;
  color: var(--accent); letter-spacing: 3px; flex: 1; text-align: center;
}
.safe-topbar-spacer { width: 110px; flex-shrink: 0; }

/* ============================================================
   FILTER PANEL
   ============================================================ */

.filter-panel {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  margin: 14px 0 0;
  width: 100%;
  overflow: visible;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  position: relative;
  z-index: 500;
}

.filter-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  background: #fff;
  border-radius: 14px 14px 0 0;
  cursor: pointer;
  user-select: none;
}

.filter-panel-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.filter-panel-chevron {
  color: var(--text);
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.filter-panel-chevron.open { transform: rotate(180deg); }

.filter-panel-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 0 0 14px 14px;
}

/* ── Row wrappers ── */
.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Field groups ── */
.filter-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-field-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding-left: 2px;
}

/* ── Pill inputs ── */
.filter-input-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 22px;
  padding: 7px 12px 7px 14px;
  min-height: 36px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  color: var(--text-dark);
  transition: border-color 0.18s, box-shadow 0.18s;
  cursor: text;
}
.filter-input-pill:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58,90,128,0.10);
}
.filter-input-pill input[type="date"],
.filter-input-pill input[type="time"] {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  padding: 0 !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 13px !important;
  color: var(--text-dark) !important;
  box-shadow: none !important;
  min-width: 100px;
}
.filter-input-pill .filter-input-icon {
  color: var(--text);
  font-size: 14px;
  flex-shrink: 0;
}

.filter-time-sep {
  font-size: 14px;
  color: var(--text);
  padding: 0 2px;
  align-self: flex-end;
  padding-bottom: 9px;
}

/* ── Filter select pills ── */
.filter-select-pill {
  background: var(--bg);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 22px;
  padding: 7px 14px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.filter-select-pill:hover,
.filter-select-pill:focus {
  border-color: rgba(58,90,128,0.35);
  background: rgba(58,90,128,0.04);
}

/* ── dcc.Dropdown pill overrides ── */
#troop-dropdown .Select-control,
#county-dropdown .Select-control,
#highway-dropdown .Select-control {
  background: var(--bg) !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  border-radius: 22px !important;
  min-height: 36px !important;
  padding: 0 12px 0 14px !important;
  box-shadow: none !important;
  cursor: pointer !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 13px !important;
  color: var(--text) !important;
  transition: border-color 0.15s !important;
}
#troop-dropdown .Select-control:hover,
#county-dropdown .Select-control:hover,
#highway-dropdown .Select-control:hover {
  border-color: rgba(58,90,128,0.35) !important;
}
#troop-dropdown .Select-placeholder,
#county-dropdown .Select-placeholder,
#highway-dropdown .Select-placeholder {
  color: var(--text) !important;
  font-size: 13px !important;
  font-family: 'Barlow', sans-serif !important;
  line-height: 36px !important;
}
#troop-dropdown .Select-arrow-zone,
#county-dropdown .Select-arrow-zone,
#highway-dropdown .Select-arrow-zone {
  padding-right: 4px !important;
}

/* ── Dropdown menus — must float above Leaflet map ── */
.filter-panel .Select-menu-outer,
.filter-panel .Select-menu {
  z-index: 600 !important;
}
.mantine-Popover-dropdown,
[data-floating-ui-portal] {
  z-index: 600 !important;
}

/* ── Checkboxes ── */
.filter-checks-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.filter-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  user-select: none;
}
.filter-check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── Action buttons ── */
.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.filter-apply-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 8px 22px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.18s, transform 0.1s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.filter-apply-btn:hover  { background: #2e4a6a; transform: translateY(-1px); }
.filter-apply-btn:active { transform: translateY(0); }

.filter-clear-btn {
  background: var(--panel-btn);
  color: var(--text-dark);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 22px;
  padding: 7px 20px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.filter-clear-btn:hover { background: #d8d3cc; }

/* ── Mantine DatePickerInput pill override ── */
.filter-panel [class*="DatePickerInput"] [class*="Input-input"],
.filter-panel [class*="DatePickerInput"] button[data-dates-input] {
  background: var(--bg) !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  border-radius: 22px !important;
  padding: 7px 14px !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 13px !important;
  color: var(--text-dark) !important;
  min-height: 36px !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

/* ── Page 1 Apply / Clear (Mantine button overrides) ── */
#search-button {
  background: var(--accent) !important;
  border-radius: 22px !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  min-height: 36px !important;
  padding: 0 22px !important;
  margin-left: 0 !important;
  transition: background 0.18s, transform 0.1s !important;
}
#search-button:hover { background: #2e4a6a !important; transform: translateY(-1px); }

#clear-button {
  background: var(--panel-btn) !important;
  color: var(--text-dark) !important;
  border: 1px solid rgba(0,0,0,0.10) !important;
  border-radius: 22px !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  min-height: 36px !important;
  padding: 0 20px !important;
  margin-left: 0 !important;
}
#clear-button:hover { background: #d8d3cc !important; }

/* ── rc-slider (time range) ── */
#time-slider {
  padding: 0 20px 20px !important;
}
.rc-slider-rail        { background: var(--panel-btn); height: 4px; }
.rc-slider-track       { background: var(--accent);    height: 4px; }
.rc-slider-handle {
  border-color: var(--accent) !important;
  background: #fff !important;
  width: 16px; height: 16px;
  margin-top: -6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18) !important;
}
.rc-slider-handle:hover,
.rc-slider-handle:active { box-shadow: 0 0 0 4px rgba(58,90,128,0.15) !important; }
.rc-slider-dot          { border-color: var(--accent) !important; }
.rc-slider-dot-active   { background: var(--accent) !important; }
.rc-slider-mark-text    { font-family: 'Barlow', sans-serif; font-size: 11px; color: var(--text); }
.rc-slider-mark-text-active { color: var(--text-dark); font-weight: 600; }
.rc-slider              { position: relative !important; z-index: 501 !important; }

/* ── Vehicle checklist ── */
#vehicle-checklist label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  margin-right: 14px;
}
#vehicle-checklist input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px; height: 15px;
}

/* ── Analysis type radio ── */
#analysis-type label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  margin-right: 16px;
}
#analysis-type input[type="radio"] {
  accent-color: var(--accent);
  width: 15px; height: 15px;
}

/* ============================================================
   PAGE 2 — filter box + chart: same width, flush edges
   ============================================================ */

/* CardBody: hand off ALL spacing to charts-p2-body */
#page-charts > .card > .card-body {
  padding: 0 !important;
  background: var(--bg) !important;
}

/* Single wrapper — padding here is the ONE source of spacing */
.charts-p2-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Filter panel fills wrapper width exactly */
.charts-p2-body .filter-panel {
  width: 100% !important;
  margin: 0 !important;
}

/* Ensure no Bootstrap gutters shrink the chart */
#page-charts .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
#page-charts .col,
#page-charts [class*="col-"] {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Chart div fills wrapper width exactly — same left/right as filter */
#line_graph-row {
  width: 100% !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

/* Force every Plotly internal layer to fill 100% */
#line_graph-row > div,
#line_graph-row .js-plotly-plot,
#line_graph-row .plot-container,
#line_graph-row .plot-container.plotly,
#line_graph-row .svg-container,
#line_graph-row .main-svg,
#line_graph-row svg {
  width: 100% !important;
  border-radius: 12px !important;
}

/* ── Page 2 Apply / Clear buttons ── */
#apply-filters-button {
  background: var(--accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 22px !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  min-height: 36px !important;
  padding: 0 22px !important;
  transition: background 0.18s, transform 0.1s !important;
}
#apply-filters-button:hover { background: #2e4a6a !important; transform: translateY(-1px); }

#clear-filters-button {
  background: var(--panel-btn) !important;
  color: var(--text-dark) !important;
  border: 1px solid rgba(0,0,0,0.10) !important;
  border-radius: 22px !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  min-height: 36px !important;
  padding: 0 20px !important;
}
#clear-filters-button:hover { background: #d8d3cc !important; }

/* ============================================================
   MODALS — Terms & Conditions
   ============================================================ */
.tc-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tc-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--accent); letter-spacing: 1px; margin-bottom: 4px;
}
.tc-header p { font-size: 13px; color: var(--text); font-weight: 500; }

.tc-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px;
  font-size: 13px; color: var(--text-dark); line-height: 1.75;
}
.tc-section-title {
  font-size: 13px; font-weight: 700;
  color: var(--accent); margin-bottom: 6px; margin-top: 12px;
}
.tc-section { margin-bottom: 14px; }

.tc-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.tc-accept-btn {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 11px 28px; font-size: 14px;
  font-family: 'Barlow', sans-serif; font-weight: 700;
  cursor: pointer; min-height: 44px;
  transition: background 0.18s, transform 0.1s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  white-space: nowrap;
}
.tc-accept-btn:hover { background: #2e4a6a; transform: translateY(-1px); }
.tc-accept-btn:active { transform: translateY(0); }

/* ============================================================
   MODALS — Email
   ============================================================ */
.email-modal-inner {
  display: flex; flex-direction: column;
  align-items: center; padding: 8px 8px 4px;
}
.email-icon {
  width: 52px; height: 52px;
  background: rgba(58,90,128,0.10);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.email-icon img { width: 26px; height: 26px; opacity: 0.85; }
.email-modal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--accent); letter-spacing: 1px;
  margin-bottom: 8px; text-align: center;
}
.email-modal-subtitle {
  font-size: 13px; color: var(--text);
  text-align: center; line-height: 1.6; margin-bottom: 24px;
}
.email-field {
  width: 100%; display: flex; flex-direction: column;
  gap: 6px; margin-bottom: 8px;
}
.email-field label {
  font-size: 12px; font-weight: 600; color: var(--text-dark);
  text-transform: uppercase; letter-spacing: 0.5px; padding-left: 4px;
}
.email-submit-btn {
  width: 100%; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 13px 18px; font-size: 15px;
  font-family: 'Barlow', sans-serif; font-weight: 700;
  cursor: pointer; min-height: 48px; margin-top: 8px;
  transition: background 0.18s, transform 0.1s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.email-submit-btn:hover { background: #2e4a6a; transform: translateY(-1px); }
.email-submit-btn:active { transform: translateY(0); }

/* ============================================================
   MODALS — Admin
   ============================================================ */
.admin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 8px 4px;
}
.admin-icon {
  width: 52px; height: 52px;
  background: rgba(58,90,128,0.10);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.admin-icon img { width: 26px; height: 26px; opacity: 0.85; }
.admin-modal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--accent); letter-spacing: 1px;
  margin-bottom: 6px; text-align: center;
}
.admin-subtitle {
  font-size: 13px; color: var(--text);
  text-align: center; line-height: 1.6; margin-bottom: 24px;
}
.admin-field {
  width: 100%; display: flex; flex-direction: column;
  gap: 6px; margin-bottom: 14px;
}
.admin-field label {
  font-size: 12px; font-weight: 600; color: var(--text-dark);
  text-transform: uppercase; letter-spacing: 0.5px; padding-left: 4px;
}
.admin-error {
  width: 100%;
  background: rgba(220,50,50,0.08);
  border: 1px solid rgba(220,50,50,0.25);
  border-radius: 10px;
  padding: 8px 14px; font-size: 12px; color: #c0392b;
  font-weight: 500; text-align: center; margin-bottom: 12px; min-height: 16px;
}
.admin-error:empty { display: none; }
.admin-btn-row {
  width: 100%; display: flex; gap: 10px; margin-top: 6px;
}
.admin-cancel-btn {
  flex: 1; background: var(--panel-btn); color: var(--text-dark);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 18px; font-size: 14px;
  font-family: 'Barlow', sans-serif; font-weight: 600;
  cursor: pointer; min-height: 44px; transition: background 0.18s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.admin-cancel-btn:hover { background: #d8d3cc; }
.admin-submit-btn {
  flex: 2; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 12px 18px; font-size: 14px;
  font-family: 'Barlow', sans-serif; font-weight: 700;
  cursor: pointer; min-height: 44px;
  transition: background 0.18s, transform 0.1s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.admin-submit-btn:hover { background: #2e4a6a; transform: translateY(-1px); }
.admin-submit-btn:active { transform: translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .safe-main { margin-left: 0; width: 100%; }
  .safe-topbar-spacer { display: none; }
  .safe-page-title { text-align: left; font-size: 20px; }
  .safe-pill-btn { padding: 10px 12px; min-height: 44px; }
  .login-card { padding: 32px 24px 28px; }
  .login-title { font-size: 32px; }
  .filter-panel-body { align-items: center; }
  .filter-row { flex-direction: column; align-items: center; width: 100%; }
  #analysis-type { display: flex; flex-direction: column; align-items: center; width: 100%; }
  #analysis-type label { justify-content: center; width: 100%; }
  .filter-actions { width: 100%; justify-content: center; margin-left: 0; margin-right: 0; }
  #search-button, #clear-button { flex: 1; min-width: 120px; }
}
@media (max-width: 480px) {
  .safe-page-title { font-size: 18px; }
}