/* ==========================================================================
   LIUNA Votes — Slate & Political District Lookup Stylesheet
   Brand Colors:
     LIUNA Orange: #f8981c
     LIUNA Navy:   #003f72
     LIUNA Gray:   #8c9b93
   ========================================================================== */

:root {
  --liuna-orange: #f8981c;
  --liuna-orange-dark: #df8108;
  --liuna-orange-soft: #fff6ea;
  --liuna-orange-border: #fbd095;
  --liuna-blue: #003f72;
  --liuna-blue-dark: #002b4f;
  --liuna-blue-soft: #eef5fb;
  --liuna-gray: #8c9b93;
  --bg-page: #f4f6f9;
  --bg-card: #ffffff;
  --text-main: #182635;
  --text-muted: #526273;
  --border-subtle: #dde3ea;
  --shadow-sm: 0 2px 6px rgba(0, 35, 66, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 35, 66, 0.10);
  --shadow-lg: 0 14px 34px rgba(0, 35, 66, 0.16);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-page);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: "Roboto Slab", Georgia, serif;
  margin-top: 0;
}

/* Header */
.site-header {
  background: #ffffff;
  color: var(--text-main);
  border-bottom: 4px solid var(--liuna-orange);
  padding: 0.85rem 1.5rem;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
}

.brand-logo {
  height: 54px;
  max-width: 100%;
  width: auto;
  display: block;
}

.brand-kicker {
  font-family: "Montserrat", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.brand-heading {
  font-family: "Roboto Slab", serif;
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.02em;
  color: var(--liuna-blue);
}

.brand-accent {
  color: var(--liuna-gray);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
}

.btn-xs {
  font-size: 0.74rem;
  padding: 0.3rem 0.65rem;
}

.btn-primary {
  background-color: var(--liuna-orange);
  color: #111827;
  border-color: var(--liuna-orange);
}

.btn-primary:hover {
  background-color: var(--liuna-orange-dark);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--liuna-blue);
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: var(--liuna-blue-dark);
}

.btn-outline-light {
  background: var(--liuna-blue-soft);
  color: var(--liuna-blue);
  border-color: #c8daec;
}

.btn-outline-light:hover {
  background: var(--liuna-blue);
  color: #ffffff;
  border-color: var(--liuna-blue);
}

.btn-ghost {
  background: #f1f5f9;
  color: var(--liuna-blue);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  background: #e2e8f0;
}

.basemap-select {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 0.74rem;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #f1f5f9;
  color: var(--liuna-blue);
  cursor: pointer;
  outline: none;
}

.basemap-select:hover,
.basemap-select:focus {
  background: #e2e8f0;
  border-color: var(--liuna-blue);
}

/* Search Hero Banner */
.search-hero {
  background: linear-gradient(180deg, #003560 0%, #004982 100%);
  color: #ffffff;
  padding: 1.65rem 1.5rem 1.45rem;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 500;
}

.search-hero-inner {
  max-width: 960px;
  margin: 0 auto;
}

.search-intro {
  text-align: center;
  margin-bottom: 1.1rem;
}

.search-intro h2 {
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
  color: #ffffff;
}

.search-intro p {
  margin: 0;
  color: #dbe7f3;
  font-size: 0.98rem;
}

/* Search Bar & Autocomplete Dropdown */
.search-box-wrapper {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
}

.search-input-group {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 0.35rem 0.4rem 0.35rem 0.95rem;
  box-shadow: 0 10px 28px rgba(0, 18, 38, 0.28);
  border: 2px solid transparent;
  transition: border-color 0.15s ease;
}

.search-input-group:focus-within {
  border-color: var(--liuna-orange);
}

.search-icon {
  color: var(--liuna-blue);
  display: flex;
  align-items: center;
  margin-right: 0.65rem;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.04rem;
  font-family: "Lato", sans-serif;
  color: var(--text-main);
  padding: 0.55rem 0.25rem;
  background: transparent;
}

.search-input::placeholder {
  color: #7d8d9e;
}

.clear-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #7b8a9a;
  cursor: pointer;
  padding: 0 0.55rem;
}

.clear-btn:hover {
  color: var(--text-main);
}

.search-submit-btn {
  padding: 0.72rem 1.35rem;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: 340px;
  overflow-y: auto;
  z-index: 2000;
  color: var(--text-main);
}

.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.1s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: var(--liuna-blue-soft);
}

.ac-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.ac-pin-icon {
  color: var(--liuna-orange-dark);
  flex-shrink: 0;
}

.ac-text-wrap {
  min-width: 0;
}

.ac-primary {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-secondary {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.ac-state-badge {
  font-family: "Montserrat", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: #e8eef5;
  color: var(--liuna-blue);
  flex-shrink: 0;
}

/* Quick Preset Pills */
.quick-presets-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.presets-label {
  font-size: 0.8rem;
  color: #c5d6e8;
  font-weight: 700;
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.preset-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.24rem 0.72rem;
  font-size: 0.78rem;
  font-family: "Lato", sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-pill:hover {
  background: var(--liuna-orange);
  color: #111827;
  border-color: var(--liuna-orange);
  font-weight: 700;
}

/* Alert Banner */
.alert-banner {
  margin-top: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.hidden {
  display: none !important;
}

/* Main Workspace */
.workspace-grid {
  max-width: 1440px;
  width: 100%;
  margin: 1.35rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

/* Mobile / Tight Screens (Slate -> Voter Registration -> District Boundary Map -> Your Political Districts) */
@media (max-width: 1080px) {
  .workspace-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .ballot-card {
    order: 1;
  }

  .registration-card {
    order: 2;
  }

  .map-card {
    order: 3;
  }

  .districts-card {
    order: 4;
  }
}

/* Desktop Two-Column Layout (> 1080px) */
@media (min-width: 1081px) {
  .workspace-grid {
    display: grid;
    grid-template-columns: 460px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 1.35rem;
    row-gap: 1.2rem;
    align-items: start;
  }

  .map-card {
    grid-column: 1;
    grid-row: 1;
    order: unset;
  }

  .districts-card {
    grid-column: 1;
    grid-row: 2;
    order: unset;
  }

  .registration-card {
    grid-column: 1;
    grid-row: 3;
    order: unset;
  }

  .ballot-card {
    grid-column: 2;
    grid-row: 1 / span 4;
    order: unset;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.card-header {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fafbfc;
}

.card-title {
  font-size: 1.08rem;
  margin: 0;
  color: var(--liuna-blue);
}

.card-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.card-subtitle a {
  color: var(--liuna-blue);
  font-weight: 700;
  text-decoration: underline;
}

/* Map Card */
.leaflet-map-container {
  width: 100%;
  height: 390px;
  background: #e5ecf2;
}

.map-layer-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  padding: 0.55rem 0.95rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-subtle);
}

.layer-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.layer-toggle-pill.active {
  background: var(--liuna-blue);
  color: #ffffff;
  border-color: var(--liuna-blue);
}

.layer-color-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

/* Political Districts List */
.count-badge {
  font-family: "Montserrat", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--liuna-blue-soft);
  color: var(--liuna-blue);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.districts-list-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.district-item-card {
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--liuna-blue);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.district-item-card:hover,
.district-item-card.highlighted {
  background: var(--liuna-blue-soft);
  box-shadow: var(--shadow-sm);
}

.district-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.district-code-pill {
  font-family: "Montserrat", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.16rem 0.5rem;
  border-radius: 4px;
  background: var(--liuna-blue);
  color: #ffffff;
}

.district-office-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.district-item-name {
  font-family: "Roboto Slab", serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0.25rem 0 0.2rem;
}

.district-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.district-endorsed-tag {
  color: var(--liuna-blue);
  font-weight: 700;
}

/* Slate Card */
.ballot-card-header {
  background: linear-gradient(90deg, #fafbfc 0%, #f1f6fb 100%);
  padding: 1.15rem 1.35rem;
}

.ballot-header-eyebrow {
  font-family: "Montserrat", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: var(--liuna-orange-dark);
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.ballot-header-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.ballot-body {
  padding: 1.25rem 1.35rem;
}

/* Empty State */
.ballot-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 560px;
  margin: 0 auto;
}

.empty-icon-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--liuna-orange-soft);
  color: var(--liuna-orange-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  border: 2px solid var(--liuna-orange-border);
}

.ballot-empty-state h4 {
  font-size: 1.28rem;
  color: var(--liuna-blue);
  margin-bottom: 0.5rem;
}

.ballot-empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.35rem;
}

.empty-state-features {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-align: left;
  background: #f8fafc;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.feature-chip {
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-dot-orange {
  background: var(--liuna-orange);
}

.chip-dot-blue {
  background: var(--liuna-blue);
}

.empty-state-compact {
  text-align: center;
  padding: 1.1rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Ballot Sections: Flagged / Featured vs Standard Ballot Order */
.ballot-section {
  margin-bottom: 1.75rem;
}

.ballot-section:last-child {
  margin-bottom: 0;
}

.ballot-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--border-subtle);
}

.ballot-section-header.featured-section-header {
  border-bottom-color: var(--liuna-orange);
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.section-badge-featured {
  background: var(--liuna-orange);
  color: #111827;
  font-family: "Montserrat", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.6rem;
  border-radius: 4px;
}

.section-badge-standard {
  background: var(--liuna-blue);
  color: #ffffff;
  font-family: "Montserrat", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.6rem;
  border-radius: 4px;
}

.section-heading {
  font-family: "Roboto Slab", serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.section-subnote {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Candidate Race Cards */
.race-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.race-card {
  position: relative;
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--liuna-blue);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 1rem 1.15rem;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.race-card:hover {
  box-shadow: var(--shadow-md);
}

.race-card.race-card-interactive {
  cursor: pointer;
}

/* Flagged / Featured Race Card Styling */
.race-card.race-card-flagged {
  background: linear-gradient(180deg, var(--liuna-orange-soft) 0%, #ffffff 65%);
  border: 1.5px solid var(--liuna-orange-border);
  border-left: 6px solid var(--liuna-orange);
  box-shadow: 0 4px 14px rgba(248, 152, 28, 0.12);
}

.race-card .district-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.race-card .district-item-name {
  font-family: "Roboto Slab", serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0.2rem 0 0.55rem;
}

.race-badges-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.featured-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--liuna-orange);
  color: #111827;
  font-family: "Montserrat", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  box-shadow: 0 2px 5px rgba(248, 152, 28, 0.28);
}

.race-candidate-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.candidate-name-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.candidate-name {
  font-family: "Roboto Slab", serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.union-member-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: "Montserrat", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--liuna-blue);
  color: #ffffff;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
}

.party-badge {
  font-family: "Montserrat", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

.party-d {
  background: #dbeafe;
  color: #1e40af;
}

.party-r {
  background: #fee2e2;
  color: #991b1b;
}

.party-nonpartisan,
.party-i {
  background: #f3f4f6;
  color: #374151;
}

.incumbent-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.endorsed-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: "Montserrat", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: #111827;
  background: var(--liuna-orange);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(248, 152, 28, 0.25);
}

.race-notes {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: #334155;
}

.race-footer-meta {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.race-footer-meta a {
  color: var(--liuna-blue);
  font-weight: 700;
  text-decoration: none;
}

.race-footer-meta a:hover {
  text-decoration: underline;
}

/* Custom Leaflet Marker */
.liuna-map-pin {
  display: flex;
  align-items: center;
  justify-content: center;
}

.liuna-pin-inner {
  width: 22px;
  height: 22px;
  background: var(--liuna-orange);
  border: 3px solid var(--liuna-blue);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

/* Admin Page Styles */
.admin-container {
  max-width: 1360px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.admin-card-body {
  padding: 1.1rem 1.25rem;
}

.status-pill {
  font-family: "Montserrat", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
}

.status-ok {
  background: #dcfce7;
  color: #166534;
}

.status-warn {
  background: #fef3c7;
  color: #92400e;
}

.validation-success-msg {
  margin: 0;
  color: #166534;
  font-weight: 700;
}

.diag-item {
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
}

.diag-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.diag-warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.upload-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  background: #f8fafc;
}

.upload-box h4 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--liuna-blue);
}

.upload-box p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.upload-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.upload-controls input[type="file"] {
  font-size: 0.76rem;
  max-width: 180px;
}

.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table th {
  background: #f1f5f9;
  font-family: "Montserrat", sans-serif;
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.row-flagged {
  background: var(--liuna-orange-soft);
}

.color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.state-pill {
  font-family: "Montserrat", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--liuna-blue);
  color: #ffffff;
}

.mono-cell {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.muted-cell {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Footer */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  padding: 1.35rem 1.5rem;
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.footer-logo {
  height: 44px;
  width: auto;
  display: block;
  margin-bottom: 0.2rem;
}

.footer-copyright {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-inner a {
  color: var(--liuna-blue);
  font-weight: 700;
  text-decoration: none;
}

/* Print Stylesheet */
.print-only {
  display: none;
}

@media print {
  body {
    background: #ffffff;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .print-ballot-header {
    border-bottom: 3px solid var(--liuna-blue);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
  }
  .print-brand-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
  .print-kicker {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--liuna-blue);
  }
  .print-ballot-header h1 {
    font-size: 1.35rem;
    margin: 0.15rem 0 0;
    color: var(--liuna-blue);
  }
  .print-address-box {
    font-size: 0.85rem;
    text-align: right;
  }
  .workspace-grid {
    display: block;
    margin: 0;
    padding: 0;
  }
  .card {
    border: none;
    box-shadow: none;
  }
  .ballot-body {
    padding: 0;
  }
  .race-card {
    break-inside: avoid;
    margin-bottom: 0.65rem;
    padding: 0.65rem 0.85rem;
  }
}
