:root {
  --bg: #0b1020;
  --bg-soft: #121935;
  --card: #182046;
  --card-2: #1d2657;
  --text: #e9ecff;
  --muted: #9aa3c7;
  --accent: #6c8cff;
  --accent-2: #8a5cf6;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --ring: rgba(108,140,255,.35);
}
[data-theme="light"] {
  --bg: #f4f6ff;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-2: #f0f3ff;
  --text: #0e1430;
  --muted: #5b6386;
  --accent: #3b5bdb;
  --accent-2: #6f42c1;
  --ring: rgba(59,91,219,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }

.navbar-evm {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.navbar-evm .brand { font-weight: 700; letter-spacing: .3px; font-size: 1.15rem; display:flex; align-items:center; gap:10px; }
.navbar-evm .brand .dot { width: 10px; height: 10px; background: #22c55e; border-radius: 50%; box-shadow: 0 0 0 4px rgba(34,197,94,.25); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.navbar-evm .nav-actions { display:flex; gap:8px; align-items:center; }
.navbar-evm a, .navbar-evm button { color:white; text-decoration:none; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15); padding: 6px 12px; border-radius: 999px; font-size: .85rem; cursor: pointer; }
.navbar-evm a:hover, .navbar-evm button:hover { background: rgba(255,255,255,.22); }

.container-evm { max-width: 1180px; margin: 0 auto; padding: 24px 18px 60px; }

.hero {
  background: linear-gradient(135deg, rgba(108,140,255,.15), rgba(138,92,246,.15));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 24px 26px;
  margin-bottom: 22px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.hero h1 { margin: 0; font-size: 1.6rem; }
.hero p { margin: 4px 0 0; color: var(--muted); }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi { background: var(--card); border:1px solid rgba(255,255,255,.05); padding: 10px 14px; border-radius: 12px; min-width: 130px; }
.kpi .v { font-size: 1.4rem; font-weight: 700; }
.kpi .l { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

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

.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.18); border-color: var(--ring); }
.card .top { display:flex; gap: 12px; align-items: center; }
.card img.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ring); }
.card .name { font-weight: 700; font-size: 1.05rem; }
.card .party { font-size: .85rem; color: var(--muted); }
.card .symbol { font-size: .75rem; background: var(--card-2); padding: 3px 8px; border-radius: 999px; display:inline-block; margin-top: 4px; }

.bar-wrap { width: 100%; background: var(--card-2); height: 10px; border-radius: 999px; overflow: hidden; }
.bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width .6s ease; }

.row { display:flex; justify-content: space-between; align-items: center; }
.votes-num { font-weight: 700; font-size: 1.2rem; }
.pct { color: var(--muted); font-size: .9rem; }

.btn-vote {
  appearance: none; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; font-weight: 600; padding: 10px 14px; border-radius: 10px;
  box-shadow: 0 8px 22px rgba(108,140,255,.35);
}
.btn-vote:disabled { background: var(--card-2); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.btn-vote.voted { background: linear-gradient(135deg, #22c55e, #16a34a); }

.section-title { font-size: 1.05rem; font-weight: 700; margin: 26px 0 10px; display:flex; align-items:center; gap: 10px; }
.section-title .live { display:inline-flex; align-items:center; gap:6px; font-size:.7rem; color: var(--ok); background: rgba(34,197,94,.12); padding: 3px 8px; border-radius: 999px; }
.section-title .live::before { content:""; width:8px; height:8px; background: var(--ok); border-radius: 50%; animation: pulse 1.4s ease-in-out infinite; }

.chart-wrap { background: var(--card); border:1px solid rgba(255,255,255,.06); border-radius: 16px; padding: 16px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--card); color: var(--text); padding: 12px 18px; border-radius: 12px; border:1px solid rgba(255,255,255,.08); box-shadow: 0 10px 30px rgba(0,0,0,.3); opacity: 0; transition: opacity .25s ease, transform .25s ease; pointer-events:none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { border-color: var(--err); }
.toast.ok { border-color: var(--ok); }

.admin-card { max-width: 460px; margin: 60px auto; background: var(--card); border:1px solid rgba(255,255,255,.06); border-radius: 18px; padding: 26px; }
.admin-card h2 { margin: 0 0 6px; }
.admin-card p { color: var(--muted); margin: 0 0 18px; font-size: .9rem; }
.admin-card label { font-size: .85rem; color: var(--muted); }
.admin-card input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: var(--bg-soft); color: var(--text); font-size: 1rem; outline: none; }
.admin-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.admin-card .btn-reset { width: 100%; margin-top: 14px; padding: 12px; border:0; border-radius: 10px; background: linear-gradient(135deg, #ef4444, #b91c1c); color: white; font-weight: 700; cursor: pointer; }
.admin-card .btn-reset:hover { filter: brightness(1.05); }
.admin-card .meta { margin-top: 18px; font-size: .8rem; color: var(--muted); display:flex; justify-content:space-between; }

.history { margin-top: 22px; }
.history table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.history th, .history td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.06); }
.history th { color: var(--muted); font-weight: 600; }

.footer { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 30px; }

@media (max-width: 560px) {
  .hero h1 { font-size: 1.25rem; }
  .kpi { min-width: 110px; }
  .navbar-evm { padding: 12px 14px; }
}
