:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --text: #1f2933;
  --muted: #64748b;
  --border: #e5e7eb;
  --primary: #ff6a00;
  --primary-2: #ff982b;
  --primary-dark: #d95700;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  --radius: 22px;
  --radius-lg: 28px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', 'Inter', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  min-height: 100vh;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

.public-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 154, 43, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 106, 0, 0.06), transparent 28%),
    var(--bg);
}

.admin-shell {
  min-height: 100vh;
  background: var(--bg);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(248, 250, 252, 0.9);
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
}

.app-brand {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.62rem 0.95rem;
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.95rem;
}

.app-nav a:hover {
  border-color: rgba(255, 106, 0, 0.28);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.app-nav-button {
  display: inline-flex;
  align-items: center;
  padding: 0.62rem 0.95rem;
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.95rem;
}

.app-nav-button:hover {
  border-color: rgba(255, 106, 0, 0.28);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.app-card-lg {
  border-radius: var(--radius-lg);
}

.page-title {
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--muted);
  font-weight: 500;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none;
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  box-shadow: 0 10px 20px rgba(255, 106, 0, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(255, 106, 0, 0.28);
  opacity: 0.97;
}

.btn-outline-secondary,
.btn-secondary {
  border-radius: 999px;
  font-weight: 700;
}

.form-control,
.form-select {
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 0.8rem 0.9rem;
  font-weight: 500;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.12);
}

.badge-soft-success,
.badge-soft-muted,
.badge-soft-warning,
.badge-soft-orange {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border: 1px solid transparent;
}

.badge-soft-success {
  background: rgba(22, 163, 74, 0.10);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.18);
}

.badge-soft-muted {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e5e7eb;
}

.badge-soft-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.22);
}

.badge-soft-orange {
  background: rgba(255, 106, 0, 0.10);
  color: var(--primary-dark);
  border-color: rgba(255, 106, 0, 0.18);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.stat-card .label {
  color: var(--muted);
  font-weight: 600;
}

.table-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td, .table th {
  vertical-align: middle;
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
}

.table tbody tr {
  border-color: #eef2f7;
}

.candidate-option {
  display: block;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  background: #fff;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  position: relative;
}

.candidate-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.candidate-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.candidate-option.is-selected {
  border-color: rgba(255, 106, 0, 0.45);
  background: rgba(255, 106, 0, 0.05);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.08);
}

.candidate-option .candidate-name {
  font-weight: 800;
  font-size: 1rem;
}

.candidate-option .candidate-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.25rem;
}

.card-stagger {
  animation: fadeIn 0.25s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.progress {
  height: 0.85rem;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.soft-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.alert {
  border-radius: 18px;
}

.login-shell {
  min-height: calc(100vh - 2rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  max-width: 460px;
  width: 100%;
}

.dashboard-hero {
  background:
    radial-gradient(circle at top right, rgba(255, 106, 0, 0.08), transparent 40%),
    #fff;
}

@media (max-width: 767.98px) {
  .app-card {
    padding: 1.1rem;
    border-radius: 18px;
  }

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

  .app-nav a {
    padding: 0.5rem 0.8rem;
  }
}
