:root {
  --geap-bg: #f4f7fb;
  --geap-surface: #ffffff;
  --geap-surface-soft: #eef3f8;
  --geap-text: #132238;
  --geap-muted: #667085;
  --geap-border: #dce4ee;
  --geap-blue: #0b2447;
  --geap-blue-soft: #123b6d;
  --geap-saffron: #ff9933;
  --geap-green: #138808;
  --geap-shadow: 0 18px 45px rgba(15, 35, 68, 0.1);
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 88px;
  --topbar-height: 72px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--geap-text);
  background: var(--geap-bg);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  text-decoration: none;
}

.admin-main {
  min-height: 100vh;
  padding-top: var(--topbar-height);
  padding-left: var(--sidebar-width);
  transition: padding-left 0.2s ease;
}

.admin-content {
  padding: 28px;
}

.sidebar-collapsed .admin-main {
  padding-left: var(--sidebar-collapsed-width);
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  overflow-x: hidden;
  overflow-y: auto;
  color: #dbeafe;
  background: linear-gradient(180deg, #08162b 0%, var(--geap-blue) 58%, #08162b 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
  padding: 0 20px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #08162b;
  background: linear-gradient(135deg, var(--geap-saffron), #fff 54%, var(--geap-green));
  border-radius: 12px;
}

.brand-title,
.brand-subtitle {
  display: block;
  white-space: nowrap;
}

.brand-title {
  font-weight: 800;
}

.brand-subtitle {
  color: rgba(219, 234, 254, 0.68);
  font-size: 12px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  padding: 18px 12px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 10px 14px;
  color: rgba(219, 234, 254, 0.8);
  border-radius: 12px;
  font-weight: 700;
}

.sidebar-nav a i {
  width: 20px;
  text-align: center;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #fff;
  background: rgba(255, 153, 51, 0.16);
}

.sidebar-group {
  display: grid;
  gap: 4px;
}

.sidebar-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
  color: rgba(219, 234, 254, 0.8);
  background: transparent;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.sidebar-collapse-toggle > span {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.sidebar-collapse-toggle i:first-child {
  width: 20px;
  text-align: center;
}

.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle.active {
  color: #fff;
  background: rgba(255, 153, 51, 0.16);
}

.sidebar-caret {
  width: auto;
  font-size: 12px;
  transition: transform 0.18s ease;
}

.sidebar-collapse-toggle:not(.collapsed) .sidebar-caret {
  transform: rotate(180deg);
}

.sidebar-submenu {
  padding: 2px 0 6px 34px;
}

.sidebar-submenu a {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 14px;
}

.submenu-dot {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.7;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
}

.sidebar-mini-card {
  padding: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-footer,
.sidebar-collapsed .sidebar-caret,
.sidebar-collapsed .sidebar-submenu {
  display: none;
}

.sidebar-collapsed .sidebar-brand,
.sidebar-collapsed .sidebar-nav a,
.sidebar-collapsed .sidebar-collapse-toggle {
  justify-content: center;
  padding-right: 10px;
  padding-left: 10px;
}

.top-navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--topbar-height);
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--geap-border);
  backdrop-filter: blur(18px);
  transition: left 0.2s ease;
}

.sidebar-collapsed .top-navbar {
  left: var(--sidebar-collapsed-width);
}

.navbar-left,
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--geap-blue);
  background: var(--geap-surface);
  border: 1px solid var(--geap-border);
  border-radius: 12px;
}

.icon-btn:hover {
  color: var(--geap-saffron);
}

.top-search {
  position: relative;
  width: min(34vw, 360px);
}

.top-search i {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--geap-muted);
  transform: translateY(-50%);
}

.top-search input {
  width: 100%;
  min-height: 42px;
  padding: 8px 14px 8px 40px;
  color: var(--geap-text);
  background: var(--geap-surface);
  border: 1px solid var(--geap-border);
  border-radius: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--geap-border);
}

.user-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: var(--geap-blue);
  border-radius: 50%;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--geap-saffron);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  color: var(--geap-text);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 850;
  line-height: 1.1;
}

.page-heading p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--geap-muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card,
.dashboard-panel {
  background: var(--geap-surface);
  border: 1px solid var(--geap-border);
  border-radius: 18px;
  box-shadow: var(--geap-shadow);
}

.stat-card {
  min-height: 150px;
  padding: 20px;
}

.stat-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  place-items: center;
  color: #fff;
  background: var(--geap-blue);
  border-radius: 14px;
}

.stat-label {
  margin: 0;
  color: var(--geap-muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-value {
  display: block;
  margin-top: 6px;
  color: var(--geap-text);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.stat-note {
  display: block;
  margin-top: 10px;
  color: var(--geap-muted);
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.dashboard-panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 850;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 11px;
  color: #8a3a08;
  background: #fff1df;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.activity-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  display: flex;
  gap: 12px;
}

.activity-dot {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--geap-saffron);
  border-radius: 50%;
}

.admin-table thead th {
  color: var(--geap-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-table td,
.admin-table th {
  color: var(--geap-text);
  border-color: var(--geap-border);
}

.data-table-toolbar,
.data-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.data-table-toolbar {
  margin-bottom: 16px;
}

.data-table-search {
  position: relative;
  flex: 1 1 320px;
  max-width: 460px;
}

.data-table-search i {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--geap-muted);
  transform: translateY(-50%);
}

.data-table-search input {
  min-height: 42px;
  padding-left: 40px;
}

.data-table-length {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--geap-muted);
  font-size: 13px;
  font-weight: 800;
}

.data-table-length select {
  width: 92px;
}

.data-table-footer {
  margin-top: 16px;
  color: var(--geap-muted);
  font-size: 13px;
  font-weight: 700;
}

.data-table-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-table-pagination button {
  width: 36px;
  height: 34px;
}

.result-booth-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: middle;
  border: 1px solid var(--geap-border);
  border-radius: 50%;
}

.candidate-type label {
  margin-right: 16px;
  font-weight: 700;
}

.site-footer {
  padding: 18px 28px;
  color: var(--geap-muted);
  border-top: 1px solid var(--geap-border);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1035;
  display: none;
  background: rgba(8, 22, 43, 0.52);
}

.mobile-menu-open .sidebar-backdrop {
  display: block;
}

[data-theme="dark"] {
  --geap-bg: #071426;
  --geap-surface: #0d1d33;
  --geap-surface-soft: #10243f;
  --geap-text: #e7eef8;
  --geap-muted: #9fb0c7;
  --geap-border: rgba(255, 255, 255, 0.1);
  --geap-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .top-navbar {
  background: rgba(13, 29, 51, 0.9);
}

[data-theme="dark"] .top-search input,
[data-theme="dark"] .icon-btn {
  color: var(--geap-text);
  background: #10243f;
}

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .mobile-menu-open .app-sidebar {
    transform: translateX(0);
  }

  .admin-main,
  .sidebar-collapsed .admin-main {
    padding-left: 0;
  }

  .top-navbar,
  .sidebar-collapsed .top-navbar {
    left: 0;
  }

  .top-search {
    display: none;
  }
}

@media (max-width: 640px) {
  .admin-content {
    padding: 20px 14px;
  }

  .page-heading {
    flex-direction: column;
  }

  .data-table-toolbar,
  .data-table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .data-table-search {
    max-width: none;
  }

  .data-table-pagination {
    justify-content: space-between;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .user-chip span:first-child {
    display: none;
  }
}

.report-context,
.report-tabs,
.report-election-card,
.report-link-grid,
.report-rank-row {
  display: flex;
}

.report-context {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
}

.report-tabs {
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.report-tabs a {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--muted-text);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.report-tabs a:hover,
.report-tabs a.active {
  color: #ffffff;
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.report-election-card {
  flex-direction: column;
  gap: 16px;
  height: 100%;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.report-election-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.report-election-card p {
  margin: 0;
  color: var(--muted-text);
  font-size: 13px;
}

.report-link-grid {
  flex-wrap: wrap;
  gap: 8px;
}

.report-link-tile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--text-color);
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
}

.report-link-tile:hover {
  color: var(--primary-color);
  border-color: rgba(18, 59, 109, 0.35);
}

.report-rank-row {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.report-rank-row:last-child {
  border-bottom: 0;
}

.report-rank-row strong {
  font-weight: 500;
}

/* Enterprise analytics design-system refinement */
:root {
  --primary-color: #123b6d;
  --secondary-color: #475467;
  --success-color: #15803d;
  --danger-color: #b42318;
  --warning-color: #f59e0b;
  --light-bg: #f6f8fb;
  --card-bg: #ffffff;
  --border-color: #e4e7ec;
  --text-color: #182230;
  --muted-text: #667085;
  --sidebar-bg: #0b1f3a;
  --sidebar-text: #cbd5e1;
  --sidebar-active: rgba(255, 153, 51, 0.14);
  --radius: 12px;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.07);

  --geap-bg: var(--light-bg);
  --geap-surface: var(--card-bg);
  --geap-surface-soft: #f1f5f9;
  --geap-text: var(--text-color);
  --geap-muted: var(--muted-text);
  --geap-border: var(--border-color);
  --geap-blue: var(--primary-color);
  --geap-blue-soft: #1d4f86;
  --geap-saffron: #ff9933;
  --geap-green: #138808;
  --geap-shadow: var(--shadow);
  --sidebar-width: 268px;
  --sidebar-collapsed-width: 78px;
  --topbar-height: 64px;
}

body {
  color: var(--text-color);
  background: var(--light-bg);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.btn,
.form-label,
.sidebar-nav a,
.sidebar-collapse-toggle {
  letter-spacing: 0;
}

.admin-content {
  padding: 24px;
}

.app-sidebar {
  background: linear-gradient(180deg, #08182f 0%, var(--sidebar-bg) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  min-height: var(--topbar-height);
  padding: 0 18px;
}

.brand-icon {
  flex-basis: 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 16px;
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
}

.brand-subtitle {
  color: rgba(203, 213, 225, 0.7);
  font-size: 11px;
  font-weight: 400;
}

.sidebar-nav {
  gap: 3px;
  padding: 14px 10px;
}

.sidebar-nav a,
.sidebar-collapse-toggle {
  min-height: 40px;
  padding: 9px 12px;
  color: var(--sidebar-text);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-nav a i,
.sidebar-collapse-toggle i:first-child {
  width: 18px;
  color: rgba(203, 213, 225, 0.82);
  font-size: 14px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle.active {
  color: #ffffff;
  background: var(--sidebar-active);
}

.sidebar-submenu {
  padding: 2px 0 6px 30px;
}

.sidebar-submenu a {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
}

.top-navbar {
  min-height: var(--topbar-height);
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}

.icon-btn {
  width: 36px;
  height: 36px;
  color: var(--primary-color);
  border-radius: 10px;
}

.top-search {
  width: min(32vw, 340px);
}

.top-search input,
.data-table-search input,
.form-control,
.form-select {
  min-height: 38px;
  color: var(--text-color);
  background-color: #ffffff;
  border-color: var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  box-shadow: none;
}

.form-control:focus,
.form-select:focus,
.top-search input:focus,
.data-table-search input:focus {
  border-color: rgba(18, 59, 109, 0.55);
  box-shadow: 0 0 0 3px rgba(18, 59, 109, 0.1);
}

.form-label {
  margin-bottom: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 500;
}

.form-check-label,
.candidate-type label {
  color: #344054;
  font-size: 14px;
  font-weight: 500;
}

.page-heading {
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.page-heading h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
}

.page-heading p {
  margin-top: 6px;
  color: var(--muted-text);
  font-size: 14px;
}

.dashboard-panel,
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dashboard-panel {
  padding: 20px;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header h2 {
  color: var(--text-color);
  font-size: 22px;
  font-weight: 600;
}

.stat-grid {
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  min-height: 124px;
  padding: 18px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: 10px;
  font-size: 15px;
}

.stat-label {
  color: var(--muted-text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.stat-value {
  margin-top: 5px;
  font-size: 26px;
  font-weight: 600;
}

.stat-note {
  font-size: 12px;
}

.btn {
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-warning,
.btn-primary {
  color: #ffffff;
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-warning:hover,
.btn-primary:hover {
  color: #ffffff;
  background: #0f315b;
  border-color: #0f315b;
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: rgba(18, 59, 109, 0.35);
}

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

.btn-outline-secondary,
.btn-outline-dark {
  color: #344054;
  border-color: var(--border-color);
}

.btn-outline-secondary:hover,
.btn-outline-dark:hover {
  color: var(--text-color);
  background: #f2f4f7;
  border-color: #d0d5dd;
}

.btn-outline-danger {
  color: var(--danger-color);
  border-color: rgba(180, 35, 24, 0.35);
}

.btn-outline-danger:hover,
.btn-danger:hover {
  color: #ffffff;
  background: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-sm {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.admin-table {
  margin: 0;
  font-size: 14px;
}

.admin-table thead th {
  padding: 11px 12px;
  color: #475467;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 11px 12px;
  color: var(--text-color);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background-color 0.14s ease;
}

.admin-table tbody tr:hover {
  background: #f9fafb;
}

.admin-table strong {
  font-weight: 600;
}

.status-pill {
  min-height: 26px;
  padding: 4px 9px;
  color: #7a2e0e;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.alert {
  border-radius: 10px;
  font-size: 14px;
}

.data-table-toolbar,
.data-table-footer {
  gap: 12px;
}

.data-table-footer,
.data-table-length {
  font-size: 12px;
  font-weight: 500;
}

.table-responsive {
  border-radius: 10px;
}

.site-footer {
  padding: 14px 24px;
  font-size: 12px;
}

[data-theme="dark"] {
  --light-bg: #071426;
  --card-bg: #0d1d33;
  --border-color: rgba(255, 255, 255, 0.1);
  --text-color: #e7eef8;
  --muted-text: #9fb0c7;
}

@media (max-width: 640px) {
  .admin-content {
    padding: 18px 12px;
  }

  .page-heading h1 {
    font-size: 24px;
  }

  .panel-header h2 {
    font-size: 20px;
  }

  .dashboard-panel,
  .stat-card {
    padding: 16px;
  }
}
