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

/* 
   TOKENS
 */
:root {
  --blue:        #0067b8;
  --blue-dark:   #005196;
  --blue-light:  #e8f1fb;
  --blue-mid:    #cce0f5;
  --ink:         #0f0f0f;
  --ink-2:       #1a1a1a;
  --ink-3:       #6a6a6a;
  --ink-4:       #8f8f8f;
  --border:      #e0e0e0;
  --border-2:    #ebebeb;
  --surface:     #ffffff;
  --surface-2:   #f5f5f5;
  --surface-3:   #f7f7f7;
  --danger:      #dc2626;
  --danger-light:#fef2f2;
  --success:     #16a34a;
  --success-light:#f0fdf4;

  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   24px;

  --shadow-xs:   0 1px 2px rgba(0,0,0,.04);
  --shadow-sm:   0 2px 12px rgba(0,0,0,.04), 0 1px 4px rgba(0,0,0,.02);
  --shadow-md:   0 4px 24px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.03);
  --shadow-lg:   0 12px 48px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);

  --ease:        cubic-bezier(0.33, 1, 0.68, 1);
  --font:        'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* 
   RESET
 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface-3);
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(0,103,184,.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0,103,184,.015) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,.008) 2px,
      rgba(0,0,0,.008) 4px
    );
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  animation: pageReveal .4s var(--ease);
}
@keyframes pageReveal { from { opacity: 0; } to { opacity: 1; } }
img    { display: block; max-width: 100%; }
a      { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul     { list-style: none; }

/* 
   HEADER / NAV
 */
.dash-header {
  position: sticky; top: 0; z-index: 200;
  height: 66px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.dash-header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 32px; height: 100%;
  display: flex; align-items: center; gap: 24px;
}

.dash-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 800;
  letter-spacing: -.02em; color: var(--ink);
  flex-shrink: 0;
}
.dash-brand img {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.15);
}

.dash-header-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}

.dash-greeting {
  font-size: 13.5px; font-weight: 500; color: var(--ink-3);
}

/* New election button + dropdown */
.btn-new-wrap {
  position: relative;
}
.btn-new {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  background: var(--ink); color: #fff;
  font-size: 13.5px; font-weight: 700;
  border-radius: var(--radius-sm);
  transition: background .2s var(--ease), transform .15s, box-shadow .2s;
  white-space: nowrap;
}
.btn-new svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-new-caret { transition: transform .2s; }
.btn-new:hover { background: #2e2e2e; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-new-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  padding: 8px;
  z-index: 300;
  opacity: 0; transform: translateY(-8px) scale(.97);
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.btn-new-menu.open {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: all;
}
.new-menu-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 12px 14px;
  border-radius: var(--radius-md);
  text-align: left;
  transition: background .15s;
}
.new-menu-item:hover { background: var(--surface-2); }
.new-menu-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--blue-light); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.new-menu-icon svg { width: 17px; height: 17px; stroke: var(--blue); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.new-menu-icon.multi { background: #fdf4ff; }
.new-menu-icon.multi svg { stroke: #9333ea; }
.new-menu-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.new-menu-sub   { font-size: 12px; color: var(--ink-4); margin-top: 1px; }

/* Election type badge on card */
.ec-type-badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 800;
  background: #fdf4ff; color: #9333ea;
  border: 1px solid #e9d5ff;
  padding: 1px 7px; border-radius: 100px;
  letter-spacing: .04em;
  margin-right: 6px; vertical-align: middle;
}

/* Wide modal for multi */
.modal--wide {
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Positions list in multi modal */
.positions-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.position-field {
  display: flex; align-items: center; gap: 10px;
  animation: msgIn .18s var(--ease);
}
.position-field-num {
  width: 26px; height: 26px; flex-shrink: 0;
  background: var(--blue-light); color: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.position-field-input { flex: 1; }
.position-field-remove {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4); border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.position-field-remove svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.position-field-remove:hover { background: var(--danger-light); color: var(--danger); }

.btn-add-position {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600; color: var(--blue);
  border: 1.5px dashed var(--blue-mid);
  border-radius: var(--radius-md);
  background: var(--blue-light);
  transition: background .15s, border-color .15s;
  width: 100%;
  justify-content: center;
}
.btn-add-position svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.btn-add-position:hover { background: #d4e8f8; border-color: #99c0e8; }

.btn-confirm--multi { background: #9333ea; }
.btn-confirm--multi:hover:not(:disabled) { background: #7e22ce; }

/* Profile avatar button */
.btn-profile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  box-shadow: 0 2px 8px rgba(0,103,184,.3);
  transition: transform .2s var(--ease), box-shadow .2s;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}
.btn-profile::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: 
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.25) 0%, transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(0,0,0,.08) 0%, transparent 60%);
  pointer-events: none;
}
.btn-profile:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0,103,184,.4);
}
.btn-profile:hover::after {
  content: 'Settings';
  position: absolute; bottom: -30px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  z-index: 10;
}
.btn-profile svg {
  color: #fff;
  position: relative;
  z-index: 1;
}

/* Logout button */
.btn-logout {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, color .15s, background .15s;
}
.btn-logout svg { width: 14px; height: 14px; }
.btn-logout:hover { border-color: var(--ink-3); color: var(--ink); background: var(--surface-2); }

/* 
   PAGE WRAPPER
 */
.dash-page {
  max-width: 1280px; margin: 0 auto;
  padding: 36px 32px 64px;
}

/* 
   PAGE TITLE ROW
 */
.dash-title-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 32px; gap: 16px; flex-wrap: wrap;
}
.dash-title-row h1 {
  font-size: 1.75rem; font-weight: 800;
  letter-spacing: -.03em; color: var(--ink);
  line-height: 1.1;
}
.dash-title-row p {
  font-size: .9rem; color: var(--ink-3); margin-top: 4px;
}

/* 
   STATS STRIP
 */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.dash-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow .2s, border-color .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.dash-stat-card::before {
  content: '';
  position: absolute;
  top: -30%; right: -30%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,103,184,.03) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: transform .4s var(--ease);
}
.dash-stat-card:hover::before {
  transform: translate(-15px, 15px) scale(1.1);
}
.dash-stat-card:hover { 
  box-shadow: var(--shadow-md); 
  border-color: #ccc;
  transform: translateY(-2px);
}
.dash-stat-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--blue-light);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.dash-stat-icon svg { width: 20px; height: 20px; stroke: var(--blue); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dash-stat-num {
  font-size: 1.75rem; font-weight: 800;
  letter-spacing: -.04em; color: var(--ink); line-height: 1;
}
.dash-stat-lbl {
  font-size: .8rem; color: var(--ink-4);
  font-weight: 500; margin-top: 3px;
}

/* 
   ELECTIONS GRID
 */
.dash-section-label {
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-4); margin-bottom: 16px;
  position: relative;
  padding-left: 16px;
}
.dash-section-label::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 14px;
  background: linear-gradient(180deg, var(--blue), var(--blue-dark));
  border-radius: 2px;
}

.elections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* 
   ELECTION CARD
 */
.election-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s;
  display: flex; flex-direction: column; gap: 0;
  position: relative; overflow: hidden;
}
.election-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--blue);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.election-card::after {
  content: '';
  position: absolute;
  top: -40%; right: -25%;
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(0,103,184,.03) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: transform .5s var(--ease);
}
.election-card:hover::after {
  transform: translate(-20px, 20px) scale(1.15);
}
.election-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #ccd9ee;
}
.election-card:hover::before { transform: scaleX(1); }

.ec-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px; gap: 12px;
}
.ec-title {
  font-size: 1rem; font-weight: 700;
  color: var(--ink); line-height: 1.3;
  flex: 1;
}
.ec-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.ec-badge.active {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #bbf7d0;
}
.ec-badge.active::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%; background: var(--success);
}
.ec-badge.closed {
  background: var(--surface-2);
  color: var(--ink-4);
  border: 1px solid var(--border);
}

.ec-date {
  font-size: 12px; color: var(--ink-4);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.ec-date svg { width: 12px; height: 12px; stroke: var(--ink-4); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ec-sched-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700;
  color: #0067b8; background: #e8f1fb;
  border: 1px solid #cce0f5;
  padding: 2px 8px; border-radius: 100px;
}
.ec-sched-badge svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ec-divider {
  height: 1px; background: var(--border-2);
  margin-bottom: 16px;
}

.ec-actions {
  display: flex; gap: 8px;
  margin-top: auto;
}

/* Action buttons on card */
.ec-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 14px;
  font-size: 12.5px; font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s, border-color .15s, transform .15s;
  flex: 1;
}
.ec-btn svg { width: 13px; height: 13px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ec-btn-manage {
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid var(--blue-mid);
}
.ec-btn-manage:hover { background: #d4e8f8; border-color: #99c0e8; transform: translateY(-1px); }

.ec-btn-copy {
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
}
.ec-btn-copy:hover { background: #ececec; border-color: #ccc; transform: translateY(-1px); }

.ec-btn-delete {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none;
  background: var(--surface-2);
  color: var(--ink-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s, border-color .15s;
}
.ec-btn-delete svg { width: 13px; height: 13px; }
.ec-btn-delete:hover { background: var(--danger-light); color: var(--danger); border-color: #fca5a5; }

/* 
   EMPTY STATE
 */
.dash-empty {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 64px 32px;
  text-align: center;
}
.dash-empty-icon {
  width: 56px; height: 56px; margin: 0 auto 20px;
  background: var(--blue-light);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
}
.dash-empty-icon svg { width: 26px; height: 26px; stroke: var(--blue); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dash-empty h3 { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.dash-empty p  { font-size: .9rem; color: var(--ink-3); margin-bottom: 24px; }
.dash-empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-new--multi { background: #1a1a1a; }
.btn-new--multi:hover { background: #333; }

/* 
   MODAL OVERLAY
 */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 500; padding: 24px;
  animation: fadeIn .2s var(--ease);
}
.modal-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%; max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s var(--ease);
  position: relative;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title {
  font-size: 1.25rem; font-weight: 800;
  letter-spacing: -.025em; color: var(--ink);
}
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--ink-4);
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Input inside modal */
.modal .m-input-group { display: flex; flex-direction: column; gap: 6px; }
.modal .m-input-group label {
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3);
}
.modal .m-input {
  width: 100%; padding: 11px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font); font-size: 14.5px; color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.modal .m-input::placeholder { color: var(--ink-4); }
.modal .m-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,103,184,.1);
}

.modal-actions {
  display: flex; gap: 10px; margin-top: 24px;
}
.modal-actions .btn-cancel {
  flex: 1; padding: 11px 20px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  transition: background .15s, border-color .15s;
  background: var(--surface);
}
.modal-actions .btn-cancel:hover { background: var(--surface-2); border-color: #ccc; }

.modal-actions .btn-confirm {
  flex: 2; padding: 11px 20px;
  font-size: 14px; font-weight: 700; color: #fff;
  background: var(--ink); border: none; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.modal-actions .btn-confirm:hover:not(:disabled) {
  background: #2e2e2e; transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.modal-actions .btn-confirm:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.modal-actions .btn-confirm svg { width: 15px; height: 15px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.modal-actions .btn-delete {
  flex: 1; padding: 11px 20px;
  font-size: 14px; font-weight: 700; color: #fff;
  background: var(--danger); border: none; border-radius: var(--radius-md);
  transition: background .15s, transform .15s;
}
.modal-actions .btn-delete:hover { background: #b91c1c; transform: translateY(-1px); }

/* Modal message */
.modal-msg {
  display: none;
  padding: 10px 14px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; border: 1.5px solid;
  margin-bottom: 16px;
  animation: msgIn .2s var(--ease);
}
@keyframes msgIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.modal-msg.error   { background: var(--danger-light);  color: var(--danger);  border-color: #fca5a5; }
.modal-msg.success { background: var(--success-light); color: var(--success); border-color: #86efac; }

/* Modal spinner */
.m-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite; flex-shrink: 0;
}

/* 
   TOAST
 */
.dash-toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 600;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: var(--ink); color: #fff;
  border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px); opacity: 0;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
  pointer-events: none;
}
.dash-toast.show { transform: translateY(0); opacity: 1; }
.dash-toast svg { width: 15px; height: 15px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* 
   RESPONSIVE
 */
@media (max-width: 900px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .dash-page { padding: 24px 16px 48px; }
  .dash-header-inner { padding: 0 16px; }
  .dash-stats { grid-template-columns: 1fr; }
  .dash-greeting { display: none; }
  .elections-grid { grid-template-columns: 1fr; }
  .modal { padding: 24px 20px; }
}


/* ═══════════════════════════════════════════════════════════
   DASHBOARD SKELETON LOADER
═══════════════════════════════════════════════════════════ */

@keyframes dsk-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

/* Shimmer box */
.dsk-box {
  background: linear-gradient(90deg, #ebebeb 25%, #f5f5f5 50%, #ebebeb 75%);
  background-size: 600px 100%;
  animation: dsk-shimmer 1.4s ease-in-out infinite;
  display: block;
  flex-shrink: 0;
}

/* Full-page overlay */
.dsk-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--surface-3);
  overflow-y: auto;
  overscroll-behavior: none;
  transition: opacity .3s ease, visibility .3s ease;
}
.dsk-overlay.dsk-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Skeleton header */
.dsk-header {
  height: 66px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.dsk-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  display: flex;
  align-items: center;
}
.dsk-brand       { display: flex; align-items: center; gap: 10px; }
.dsk-header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Page wrapper */
.dsk-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 32px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Title row */
.dsk-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Stats strip */
.dsk-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.dsk-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Cards grid - mirrors .elections-grid layout */
.dsk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Generic skeleton card */
.dsk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

/* Election card skeleton - same height as real cards */
.dsk-ec {
  height: 158px;
  position: relative;
  overflow: hidden;
}
/* Shimmer sweep on the card */
.dsk-ec::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.65) 50%,
    transparent 100%
  );
  background-size: 600px 100%;
  animation: dsk-shimmer 1.4s ease-in-out infinite;
}

/* ── Real page hidden until ready ── */
.dash-page {
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s ease;
}
.dash-page.dash-ready {
  visibility: visible;
  opacity: 1;
}

/* ── Overscroll background fix ── */
html { background: var(--surface-3); }

/* ── Header overscroll fill ── */
.dash-header::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 100%;
  height: 200px;
  background: #fff;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 900px) {
  .dsk-grid  { grid-template-columns: repeat(2, 1fr); }
  .dsk-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .dsk-page         { padding: 16px 14px 48px; }
  .dsk-header-inner { padding: 0 14px; }
  .dsk-stats        { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dsk-grid         { grid-template-columns: 1fr; }
  .dsk-stat-card    { padding: 14px 16px; }
}
@media (max-width: 480px) {
  .dsk-stats { grid-template-columns: 1fr; }
}
