* { border-color: rgba(30, 30, 46, 0.42); }

html {
  background: #0a0a0f;
}

body {
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.055), transparent 34rem),
    radial-gradient(circle at 18rem 8rem, rgba(59, 130, 246, 0.028), transparent 24rem),
    #0a0a0f;
  color: #e4e4e7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input,
select,
textarea {
  font: inherit;
}

.glass {
  border: 1px solid rgba(30, 30, 46, 0.42);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(22, 22, 31, 0.72), rgba(17, 17, 24, 0.68));
  backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.016), 0 22px 60px rgba(0, 0, 0, 0.16);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgba(30, 30, 46, 0.62);
  background: rgba(10, 10, 15, 0.55);
  padding: 0.7rem 0.85rem;
  color: #e4e4e7;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.input::placeholder { color: #71717a; }
.input:focus {
  border-color: rgba(99, 102, 241, 0.58);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.5rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, opacity 160ms ease;
}
.btn-primary {
  background: linear-gradient(180deg, #6f72ff, #5f63ee);
  color: white;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #777aff, #6669f5); transform: translateY(-1px); }
.btn-muted { border: 1px solid rgba(30, 30, 46, 0.5); background: rgba(17, 17, 24, 0.58); color: #d4d4dc; }
.btn-danger { border: 1px solid rgba(248, 113, 113, 0.34); background: rgba(239, 68, 68, 0.08); color: rgb(252 165 165); }
.btn:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }
.card {
  border: 1px solid rgba(30, 30, 46, 0.42);
  background: linear-gradient(180deg, rgba(22, 22, 31, 0.72), rgba(17, 17, 24, 0.68));
  border-radius: 0.75rem;
  backdrop-filter: blur(24px);
}
.glass-hover:hover { border-color: rgba(99, 102, 241, 0.24); background: rgba(22, 22, 31, 0.76); transform: translateY(-1px); }
.stat-card { border: 1px solid rgba(30, 30, 46, 0.42); border-radius: 0.75rem; background: linear-gradient(180deg, rgba(22, 22, 31, 0.72), rgba(17, 17, 24, 0.68)); padding: 1.5rem; backdrop-filter: blur(24px); }
.table-grid { display: grid; gap: 0.75rem; align-items: center; }

.app-sidebar {
  background: rgba(17, 17, 24, 0.72) !important;
  border-right-color: rgba(30, 30, 46, 0.38) !important;
  box-shadow: 18px 0 46px rgba(0, 0, 0, 0.12);
}

.app-sidebar-head,
.app-sidebar-foot {
  border-color: rgba(30, 30, 46, 0.36) !important;
}

.app-sidebar .btn-muted {
  background: rgba(22, 22, 31, 0.62);
}

[class*="border-border"] {
  border-color: rgba(30, 30, 46, 0.38) !important;
}

.rounded-lg.border,
.rounded-xl.border {
  border-color: rgba(30, 30, 46, 0.38) !important;
}

.nav-btn {
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-btn:hover {
  transform: translateX(2px);
}

.toggle-icon {
  transition: transform 180ms ease;
}

.page-tile {
  min-width: 2.15rem;
  height: 2rem;
  border: 1px solid rgba(99, 102, 241, 0.24);
  border-radius: 0.25rem;
  background: linear-gradient(180deg, rgba(22, 22, 31, 0.92), rgba(10, 10, 15, 0.92));
  color: #a6a8ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 0 16px rgba(99, 102, 241, 0.08);
}

.page-tile.active {
  border-color: rgba(99, 102, 241, 0.72);
  background: #6366f1;
  color: white;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.28);
}

.page-tile:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.page-gap {
  display: inline-flex;
  height: 2rem;
  align-items: center;
  padding: 0 0.25rem;
  color: #777783;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
}

body.light-mode {
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 34rem),
    #f4f5fb !important;
  color: #202033;
}

body.light-mode #app,
body.light-mode main {
  background: transparent !important;
}

body.light-mode .app-sidebar {
  background: rgba(250, 250, 255, 0.9) !important;
  border-right-color: rgba(99, 102, 241, 0.14) !important;
  box-shadow: 18px 0 46px rgba(31, 41, 55, 0.08);
}

body.light-mode .glass,
body.light-mode .card,
body.light-mode .stat-card {
  border-color: rgba(99, 102, 241, 0.14) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 249, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 18px 42px rgba(31, 41, 55, 0.07);
}

body.light-mode .input,
body.light-mode .btn-muted,
body.light-mode [class*="bg-surface"] {
  border-color: rgba(99, 102, 241, 0.16) !important;
  background: rgba(255, 255, 255, 0.82) !important;
  color: #27273a !important;
}

body.light-mode .text-foreground,
body.light-mode .font-semibold,
body.light-mode .font-bold {
  color: #202033 !important;
}

body.light-mode .text-muted {
  color: #67677a !important;
}

body.light-mode .nav-btn.text-muted {
  color: #6c6c7f !important;
}

body.light-mode .page-tile {
  background: linear-gradient(180deg, #fff, #f1f2fb);
  color: #5558cf;
}

body.light-mode .page-tile.active {
  background: #6366f1;
  color: #fff;
}

.nav-btn.bg-accent\/15 {
  background: rgba(99, 102, 241, 0.15) !important;
  color: #7377ff !important;
}

.nav-btn.text-muted {
  color: rgba(113, 113, 122, 0.88) !important;
}

.text-foreground {
  color: #e7e7ee !important;
}

.text-muted {
  color: #777783 !important;
}

#view > * {
  animation: page-in 260ms ease-out both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
  background: #1e1e2e;
  border: 2px solid #0a0a0f;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2a2a3d;
}

@media print {
  body.printing-report {
    background: #fff !important;
    color: #111 !important;
  }

  body.printing-report #login,
  body.printing-report aside,
  body.printing-report #toast,
  body.printing-report #reportFilters,
  body.printing-report .report-summary,
  body.printing-report .report-booths,
  body.printing-report main > #view > div > .mb-6 {
    display: none !important;
  }

  body.printing-report main {
    margin: 0 !important;
    padding: 0 !important;
  }

  body.printing-report #reportVotersTable {
    display: block !important;
    overflow: visible !important;
    border: 0 !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
  }

  body.printing-report #reportVotersTable * {
    color: #111 !important;
    border-color: #ddd !important;
  }
}
