/* ElectionOS — mobile-first, non-technical UI */
:root {
  --bg: #eef3f0;
  --bg-deep: #d8e5dc;
  --surface: #ffffff;
  --ink: #14201a;
  --muted: #5a6b62;
  --brand: #0f6b4c;
  --brand-dark: #0a4d37;
  --accent: #c45c26;
  --line: #c5d4cb;
  --ok: #1a7a4c;
  --warn: #b8860b;
  --danger: #b42318;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(20, 32, 26, 0.08);
  --font: "Segoe UI", "Noto Sans Devanagari", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 0%, #cfe6d8 0%, transparent 50%),
    radial-gradient(ellipse at 100% 20%, #f3e0d0 0%, transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  min-height: 100%;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 16px 88px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-dark);
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.lang-switch select,
.select, .input, .btn {
  font: inherit;
}
.lang-switch select {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 12px;
}

.hero-welcome {
  margin: 8px 0 20px;
}
.hero-welcome h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
}
.hero-welcome p {
  margin: 6px 0 0;
  color: var(--muted);
}

/* 2x2 big-tile grid */
.grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 132px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 107, 76, 0.08);
  color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile:active { transform: scale(0.98); }
.tile .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  margin-bottom: auto;
  background: #e7f3ec;
  color: var(--brand);
}
.tile h2 {
  margin: 12px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.tile.accent .icon { background: #f8ebe3; color: var(--accent); }
.tile.dark {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border: none;
}
.tile.dark .icon { background: rgba(255,255,255,.18); color: #fff; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 12px; font-size: 1.05rem; }

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.input, .select {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
  font-size: 1rem;
}
.input:focus, .select:focus {
  outline: 2px solid rgba(15,107,76,.25);
  border-color: var(--brand);
}
.hint { font-size: .82rem; color: var(--muted); margin-top: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.btn:active { background: var(--brand-dark); }
.btn-secondary {
  background: #e8eee9;
  color: var(--ink);
}
.btn-danger { background: var(--danger); }
.btn-sm { width: auto; padding: 8px 12px; font-size: .9rem; }

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: .95rem;
}
.alert-error { background: #fdecea; color: var(--danger); }
.alert-ok { background: #e8f6ee; color: var(--ok); }
.alert-warn { background: #fff6e0; color: #8a6500; }

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(448px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 50;
}
.bottom-nav a {
  text-align: center;
  padding: 8px 4px;
  border-radius: 12px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
}
.bottom-nav a.active {
  background: #e7f3ec;
  color: var(--brand-dark);
}
.bottom-nav .nav-ico { display: block; font-size: 1.15rem; margin-bottom: 2px; }

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  background: #e7f3ec;
  color: var(--brand-dark);
}
.badge.pending { background: #fff6e0; color: #8a6500; }
.badge.voted, .badge.confirmed, .badge.resolved { background: #e8f6ee; color: var(--ok); }
.badge.rejected, .badge.open { background: #fdecea; color: var(--danger); }

.filters {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.filters-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Admin desktop layout */
.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  min-height: 100vh;
}
.admin-nav {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 16px;
}
.admin-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  margin-bottom: 4px;
  font-weight: 600;
}
.admin-nav a.active, .admin-nav a:hover {
  background: #e7f3ec;
  color: var(--brand-dark);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.6rem; font-weight: 800; margin-top: 4px; }
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
table.data th, table.data td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
table.data th { background: #eef5f1; font-weight: 700; }

.chart-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.chart-box canvas { max-height: 280px; }

.login-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 16px;
}
.login-brand {
  text-align: center;
  margin-bottom: 24px;
}
.login-brand h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--brand-dark);
}
.login-brand p { color: var(--muted); margin: 8px 0 0; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .admin-nav a { margin: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
}
.no-export-notice {
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  margin: 8px 0 0;
}
@media print {
  body * { visibility: hidden !important; }
  body::before {
    content: "Printing voter data is not allowed.";
    visibility: visible;
    display: block;
    padding: 40px;
    font-size: 1.2rem;
  }
}
/* Soft anti-capture cue for web (native FLAG_SECURE is Flutter-only) */
.secure-blur-on-hide.hidden-tab {
  filter: blur(8px);
}
