:root {
  color-scheme: light;
  /* Light FloodWatch water palette */
  --navy: #e3fdfd;
  --navy-mid: #cbf1f5;
  --navy-light: #a6e3e9;
  --blue: #71c9ce;
  --blue-light: #5ab4ba;
  --cyan: #a6e3e9;

  /* White cards over the light aqua page */
  --surface: #f8ffff;
  --surface-2: #e3fdfd;
  --surface-3: #cbf1f5;

  /* Dark text keeps the light theme readable */
  --text: #173b40;
  --text-muted: #3e6267;
  --text-dim: #58777b;

  --green: #3f8561;
  --red: #ad514e;
  --amber: #98702f;
  --violet: #695b88;
  --border: rgba(39, 105, 111, 0.22);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #071a20;
  --navy-mid: #0a222a;
  --navy-light: #173b45;
  --blue: #55cbd4;
  --blue-light: #6ed9e0;
  --cyan: #43b8c2;
  --surface: #0d242c;
  --surface-2: #112f39;
  --surface-3: #173b46;
  --text: #eafafb;
  --text-muted: #abc7ca;
  --text-dim: #83a8ad;
  --green: #71c69a;
  --red: #f18a86;
  --amber: #ddb866;
  --violet: #bca8e5;
  --border: rgba(158, 211, 217, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }
.account-screen { padding: 32px 16px; }
.login-card.account-card { width: min(100%, 460px); }
.account-card .field-label { display: block; }
.account-card p { line-height: 1.6; }
.account-card .account-hint { margin: 0 0 16px; font-size: 12px; }
.account-message { font-size: 13px; line-height: 1.6; margin-bottom: 18px; overflow-wrap: anywhere; color: var(--green); }
.account-message:empty { display: none; }
.account-message.is-error { color: var(--red); }
.account-footer { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 24px; text-align: center; }
.account-footer a, .account-link { color: var(--text-muted); font: inherit; font-size: 13px; text-underline-offset: 3px; }
.account-link { display: block; background: none; border: 0; text-decoration: underline; cursor: pointer; margin: 18px auto 0; line-height: 1.5; }
.account-link:focus-visible, .account-footer a:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 4px; }
.btn-primary:disabled, .account-link:disabled { opacity: .6; cursor: wait; }
.officials-dialog { width: min(1050px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; padding: 28px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); overflow-y: auto; }
.officials-dialog::backdrop { background: rgba(0, 20, 30, .65); }
.officials-heading { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.officials-dialog p { font-size: 13px; line-height: 1.6; color: var(--text-muted); margin: 8px 0 16px; }
.official-invite-form { display: grid; grid-template-columns: 2fr 1fr auto; align-items: end; gap: 14px; margin-bottom: 20px; }
.official-invite-form label { display: block; }
.official-invite-form .field-input { margin: 0; }
.official-invite-form .btn-primary { margin: 0; height: 43px; }
.official-action { padding: 8px 12px; margin: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; font-size: 12px; }
.official-action:disabled { opacity: .5; cursor: wait; }
.official-action:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 2px; }
.created-invitation { padding: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 24px; }
.official-table-wrap { overflow-x: auto; margin: 14px 0 28px; }
.official-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.official-table-wrap th, .official-table-wrap td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.official-table-wrap th { color: var(--text-muted); }
.official-activity { padding-left: 18px; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; margin-top: 12px; }
@media (max-width: 640px) {
  .officials-dialog { padding: 18px; }
  .official-invite-form { grid-template-columns: 1fr; }
  .official-table-wrap table { min-width: 650px; }
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ── LOGIN ── */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  position: relative;
}

#loginScreen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(113, 201, 206, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 80% 30%, rgba(166, 227, 233, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 400px;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 55px rgba(35, 105, 111, 0.16);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(35, 105, 111, 0.2);
}

.brand-logo-small {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.login-logo span {
  font-family: 'Space Mono', monospace;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.5px;
}

.login-logo .badge {
  font-size: 10px;
  background: rgba(65, 140, 148, 0.14);
  color: #285f64;
  border: 1px solid rgba(40, 95, 100, 0.28);
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'Space Mono', monospace;
}

.login-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.field-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.field-input:focus { border-color: var(--blue); }

.field-input::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
  color: #658387;
  opacity: 1;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #12373b;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
}

.btn-primary:hover { background: var(--blue-light); }
.btn-primary:active { transform: scale(0.98); }

#loginError {
  color: var(--red);
  font-size: 12px;
  margin-top: 10px;
  text-align: center;
  min-height: 18px;
}

/* ── DASHBOARD ── */
#dashboard { display: none; min-height: 100vh; }

.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left { display: flex; align-items: center; gap: 10px; }

.nav-logo {
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  color: var(--text);
}

.nav-badge {
  font-size: 10px;
  background: rgba(189, 104, 100, 0.14);
  color: #8e3f3c;
  border: 1px solid rgba(189, 104, 100, 0.28);
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'Space Mono', monospace;
}

.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-admin { font-size: 13px; color: var(--text-muted); }

.theme-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 9px;
  font: 600 12px 'DM Sans', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s, transform 0.1s;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--blue);
}

.theme-toggle:active { transform: scale(0.97); }
.theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.theme-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
}

.theme-icon::before { content: "\263E"; }
:root[data-theme="dark"] .theme-icon::before { content: "\2600"; }

.login-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2;
  background: var(--surface);
}

.btn-logout {
  padding: 7px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── STATS BAR ── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-item {
  background: var(--surface);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.stat-icon.pending  { background: rgba(152, 112, 47, 0.14); color: #76531e; }
.stat-icon.verified { background: rgba(63, 133, 97, 0.14); color: #286b49; }
.stat-icon.alerts   { background: rgba(113, 201, 206, 0.35); color: #225f65; }
.stat-icon.history  { background: rgba(105, 91, 136, 0.14); color: #554474; }

.stat-info .num {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.stat-info .label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── MAIN LAYOUT ── */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  min-height: calc(100vh - 60px - 69px);
}

/* ── LEFT PANEL ── */
.left-panel {
  padding: 24px;
  border-right: 1px solid var(--border);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 10px;
}

.tab {
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
}

.tab.active { background: var(--navy-light); color: var(--text); }

.tab .count {
  display: inline-block;
  background: rgba(39, 105, 111, 0.1);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 11px;
  margin-left: 4px;
}

.tab.active .count { background: rgba(39, 105, 111, 0.16); }

.reports-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-left: 4px solid var(--amber);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  padding: 14px 16px;
}

.report-card:hover {
  border-color: rgba(65, 140, 148, 0.45);
  box-shadow: 0 6px 20px rgba(35, 105, 111, 0.13);
}

/* ── CARD HEADER ── */
.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.report-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Space Mono', monospace;
}

.badge-pending   { background: rgba(152, 112, 47, 0.12); color: #76531e; border: 1px solid rgba(152, 112, 47, 0.35); }
.badge-verified  { background: rgba(63, 133, 97, 0.12); color: #286b49; border: 1px solid rgba(63, 133, 97, 0.35); }
.badge-dismissed { background: rgba(173, 81, 78, 0.11); color: #913c39; border: 1px solid rgba(173, 81, 78, 0.34); }
.badge-trash     { background: rgba(88, 119, 123, 0.12); color: var(--text-muted); border: 1px solid var(--border); }
.badge-archive   { background: rgba(105, 91, 136, 0.11); color: var(--violet); border: 1px solid rgba(105, 91, 136, 0.34); }

.severity-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sev-1 { background: var(--green); }
.sev-2 { background: var(--amber); }
.sev-3 { background: var(--red); }
.sev-4 { background: var(--violet); }

.report-date {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'Space Mono', monospace;
}

/* ── CARD CONTENT: thumbnail + info side by side ── */
.report-content {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

/* ✅ Thumbnail — fixed size, square, clickable */
.report-thumb {
  width: 180px;
  height: 135px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
  background: var(--surface-2);
}

.report-thumb:hover {
  opacity: 0.85;
  transform: scale(1.03);
}

/* ✅ Info beside the thumbnail */
.report-info {
  flex: 1;
  min-width: 0;
}

.report-flood-level {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}

.report-address {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.4;
  word-break: break-word;
}

.report-description {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── REPORT ACTIONS ── */
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.btn-verify {
  flex: 1;
  padding: 9px;
  background: rgba(85, 149, 114, 0.1);
  color: #286b49;
  border: 1px solid rgba(85, 149, 114, 0.28);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.btn-verify:hover { background: rgba(85, 149, 114, 0.19); border-color: rgba(85, 149, 114, 0.5); }

.btn-dismiss {
  flex: 1;
  padding: 9px;
  background: rgba(189, 104, 100, 0.1);
  color: #913c39;
  border: 1px solid rgba(189, 104, 100, 0.25);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.btn-dismiss:hover { background: rgba(189, 104, 100, 0.19); border-color: rgba(189, 104, 100, 0.48); }

.btn-archive {
  flex: 1;
  padding: 9px;
  background: rgba(105, 91, 136, 0.1);
  color: var(--violet);
  border: 1px solid rgba(105, 91, 136, 0.28);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.btn-archive:hover { background: rgba(105, 91, 136, 0.19); border-color: rgba(105, 91, 136, 0.5); }

/* ── LIGHTBOX ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 40px;
}

.lightbox.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: white;
  font-size: 28px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
  user-select: none;
}

.lightbox-close:hover { opacity: 1; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── RIGHT PANEL ── */
.right-panel { padding: 24px; background: var(--surface); }
.right-panel .panel-title { margin-bottom: 20px; }
.alert-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus { border-color: var(--blue); }

.form-textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  resize: vertical;
  min-height: 90px;
  transition: border-color 0.2s;
  width: 100%;
}

.form-textarea:focus { border-color: var(--blue); }

.severity-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.sev-option {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  color: var(--text-muted);
}

.sev-option.selected { border-color: currentColor; }
.sev-advisory { color: #286b49; }
.sev-advisory.selected { background: rgba(85, 149, 114, 0.11); border-color: rgba(85, 149, 114, 0.45); }
.sev-watch { color: #76531e; }
.sev-watch.selected { background: rgba(189, 146, 84, 0.11); border-color: rgba(189, 146, 84, 0.45); }
.sev-warning { color: #913c39; }
.sev-warning.selected { background: rgba(189, 104, 100, 0.11); border-color: rgba(189, 104, 100, 0.45); }
.sev-critical { color: #554474; }
.sev-critical.selected { background: rgba(129, 116, 154, 0.11); border-color: rgba(129, 116, 154, 0.45); }

.btn-post-alert {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #12373b;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 4px;
}

.btn-post-alert:hover { opacity: 0.9; }
.btn-post-alert:active { transform: scale(0.98); }

/* ── ACTIVE ALERTS ── */
.active-alerts { margin-top: 24px; }

.active-alerts-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.alert-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.alert-item-info .title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.alert-item-info .msg  { font-size: 11px; color: var(--text-muted); }

.btn-deactivate {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-deactivate:hover { border-color: var(--red); color: var(--red); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  z-index: 999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 8px 24px rgba(35, 105, 111, 0.18);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(85, 149, 114, 0.5); }
.toast.error   { border-color: rgba(189, 104, 100, 0.5); }

.loading { text-align: center; padding: 40px; color: var(--text-dim); font-size: 13px; }
/* ── BADGE INVALID ── */
.badge-invalid { background: rgba(105, 91, 136, 0.11); color: #554474; border: 1px solid rgba(105, 91, 136, 0.34); }

/* ── VERIFY MODAL ── */
.verify-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.verify-modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.verify-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  width: 400px;
  max-width: 92vw;
  box-shadow: 0 24px 64px rgba(13, 55, 60, 0.28);
}

.verify-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.verify-modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.verify-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.verify-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  text-align: left;
  transition: all 0.2s;
  width: 100%;
}

.verify-opt:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(35, 105, 111, 0.14); }

.opt-verified:hover      { border-color: rgba(85, 149, 114, 0.5);  background: rgba(85, 149, 114, 0.08); }
.opt-dismissed:hover     { border-color: rgba(189, 104, 100, 0.5); background: rgba(189, 104, 100, 0.08); }
.opt-invalid-image:hover { border-color: rgba(189, 146, 84, 0.5);  background: rgba(189, 146, 84, 0.08); }
.opt-invalid-info:hover  { border-color: rgba(129, 116, 154, 0.5); background: rgba(129, 116, 154, 0.08); }

.opt-icon  { font-size: 22px; flex-shrink: 0; }
.opt-label { font-size: 14px; font-weight: 700; color: var(--text); display: block; }
.opt-desc  { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }

.verify-cancel {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.verify-cancel:hover { border-color: var(--red); color: var(--red); }

/* Keep status accents readable against dark surfaces. */
:root[data-theme="dark"] .login-logo .badge { color: #91e2e8; }
:root[data-theme="dark"] .nav-badge { color: #ffaaa6; }
:root[data-theme="dark"] .field-input::placeholder,
:root[data-theme="dark"] .form-input::placeholder,
:root[data-theme="dark"] .form-textarea::placeholder { color: #769ba0; }
:root[data-theme="dark"] .stat-icon.pending,
:root[data-theme="dark"] .badge-pending,
:root[data-theme="dark"] .sev-watch { color: #e8c979; }
:root[data-theme="dark"] .stat-icon.verified,
:root[data-theme="dark"] .badge-verified,
:root[data-theme="dark"] .btn-verify,
:root[data-theme="dark"] .sev-advisory { color: #83d5aa; }
:root[data-theme="dark"] .stat-icon.alerts { color: #8be6ec; }
:root[data-theme="dark"] .stat-icon.history,
:root[data-theme="dark"] .badge-invalid,
:root[data-theme="dark"] .sev-critical { color: #c9b9ea; }
:root[data-theme="dark"] .badge-dismissed,
:root[data-theme="dark"] .btn-dismiss,
:root[data-theme="dark"] .sev-warning { color: #f39a96; }

@media (max-width: 720px) {
  .theme-label { display: none; }
  .theme-toggle { width: 36px; padding: 7px; }
  .nav-admin { display: none; }

  .report-content {
    flex-direction: column;
  }

  .report-thumb {
    width: 100%;
    height: min(56vw, 280px);
  }
}

.wheel-analysis-info {
  display: grid;
  gap: 3px;
  margin: 9px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
}

.wheel-analysis-info strong {
  color: var(--text);
  margin-bottom: 2px;
}

.wheel-analysis-info small {
  color: var(--text-dim);
  margin-top: 3px;
}

/* ── RESPONSIVE DASHBOARD ──────────────────────────────────────────────
   The dashboard uses content-driven breakpoints so it remains usable on
   compact laptops, tablets and phones without creating horizontal scroll. */

/* Wide and regular laptops */
@media (max-width: 1440px) {
  .main-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .left-panel,
  .right-panel { padding: 20px; }
  .reports-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-thumb { width: 150px; height: 120px; }
  .tab { padding-inline: 12px; }
}

/* Tablets and small laptops: alerts move below reports. */
@media (max-width: 1100px) {
  .main-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .left-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .right-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .85fr);
    column-gap: 28px;
    align-items: start;
  }

  .right-panel > .panel-title { grid-column: 1; }
  .right-panel > .alert-form { grid-column: 1; }
  .right-panel > .active-alerts {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
  }

  .stats-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-item:nth-child(2) { border-right: 0; }
}

/* Portrait tablets */
@media (max-width: 820px) {
  .navbar {
    height: auto;
    min-height: 60px;
    padding: 10px 18px;
    gap: 14px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .tab { flex: 0 0 auto; min-height: 40px; }

  .right-panel {
    display: block;
  }

  .right-panel > .active-alerts { margin-top: 28px; }

  .report-card { padding: 14px; }
  .report-content { flex-direction: column; }
  .report-thumb {
    width: 100%;
    height: clamp(180px, 28vw, 260px);
  }

  .btn-verify,
  .btn-dismiss,
  .btn-archive,
  .btn-post-alert,
  .btn-deactivate { min-height: 44px; }
}

/* Phones */
@media (max-width: 600px) {
  #loginScreen { padding: 76px 16px 24px; }
  .login-card {
    width: min(100%, 420px);
    padding: 32px 22px;
    border-radius: 16px;
  }

  .login-theme-toggle { top: 16px; right: 16px; }

  .navbar {
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .nav-left { min-width: 0; }
  .nav-logo { font-size: 14px; }
  .nav-badge { display: none; }
  .nav-right { gap: 8px; margin-left: auto; }
  .btn-logout {
    min-height: 38px;
    padding-inline: 12px;
  }

  .stats-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-item { padding: 13px 14px; gap: 10px; min-width: 0; }
  .stat-icon { width: 34px; height: 34px; flex: 0 0 auto; }
  .stat-info { min-width: 0; }
  .stat-info .num { font-size: 18px; }
  .stat-info .label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .left-panel,
  .right-panel { padding: 18px 14px; }

  .reports-list { grid-template-columns: minmax(0, 1fr); }
  .report-thumb { height: clamp(190px, 58vw, 320px); }
  .report-card-header { align-items: flex-start; gap: 10px; }
  .report-meta { min-width: 0; }
  .badge { white-space: normal; line-height: 1.35; }
  .report-date { flex: 0 0 auto; }
  .report-actions > button { flex: 1 1 100%; }

  .severity-picker { grid-template-columns: minmax(0, 1fr); }
  .sev-option {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .alert-item { flex-direction: column; }
  .btn-deactivate { width: 100%; }

  .verify-modal-overlay { padding: 16px; align-items: flex-end; }
  .verify-modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 24px 18px;
    border-radius: 18px;
  }

  .verify-opt { min-height: 58px; padding: 12px 14px; }
  .lightbox { padding: 16px; }
  .lightbox img { max-width: 100%; max-height: 82vh; }
  .toast {
    left: 14px;
    right: 14px;
    bottom: 14px;
    text-align: center;
  }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .brand-logo-small { width: 30px; height: 30px; }
  .nav-logo { display: none; }
  .stats-bar { grid-template-columns: minmax(0, 1fr); }
  .stat-item { padding-inline: 18px; }
  .login-card { padding-inline: 18px; }
}
