/* Halalan Affiliator — Stylesheet
   Palette: dark navy (#0f172a) + brand green (#16a34a) accent
   Designed for daily admin use, mobile-friendly */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy-900: #0f172a;
  --navy-800: #1e3a5f;
  --navy-700: #1e293b;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --yellow-700: #a16207;
  --yellow-100: #fef9c3;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--slate-50);
  color: var(--navy-700);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--slate-500);
  font-size: 13px;
}

/* ───────────── LOGIN PAGE ───────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand .tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--slate-400);
  margin-bottom: 4px;
}

.login-brand h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.5px;
}

.login-brand .sub {
  font-size: 11px;
  color: var(--slate-500);
  margin-top: 4px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-600);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  color: var(--navy-700);
  transition: border-color 0.15s;
  background: white;
}

.field input:focus {
  outline: none;
  border-color: var(--blue-600);
}

.btn {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--navy-900);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-800);
}

.btn-primary:disabled {
  background: var(--slate-300);
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: var(--slate-600);
  border: 1.5px solid var(--slate-200);
}

.btn-secondary:hover {
  border-color: var(--slate-300);
}

.btn-sm {
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
}

.error-msg {
  background: var(--red-100);
  color: var(--red-700);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 12px;
}

/* ───────────── APP SHELL ───────────── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--navy-900);
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-brand {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.topbar-brand .tag {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.5;
  font-weight: 400;
  display: block;
  margin-bottom: 1px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.topbar-user .username {
  font-weight: 600;
}

.topbar-user .role {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-user button {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font);
}

.topbar-user button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.main {
  flex: 1;
  padding: 20px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.welcome-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.welcome-card h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-900);
  margin-bottom: 4px;
}

.welcome-card p {
  font-size: 13px;
  color: var(--slate-500);
  margin-bottom: 16px;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.placeholder-tile {
  background: var(--slate-50);
  border: 1.5px dashed var(--slate-200);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
}

.placeholder-tile .icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.placeholder-tile .title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-700);
  margin-bottom: 3px;
}

.placeholder-tile .desc {
  font-size: 11px;
  color: var(--slate-500);
}

.placeholder-tile .badge {
  display: inline-block;
  background: var(--yellow-100);
  color: var(--yellow-700);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 9px;
  font-weight: 700;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.system-info {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 12px;
}

.system-info strong {
  color: var(--navy-700);
}

.system-info .row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.system-info .row + .row {
  border-top: 1px solid var(--slate-100);
}

@media (max-width: 600px) {
  .topbar { padding: 10px 14px; }
  .topbar-brand { font-size: 14px; }
  .main { padding: 14px; }
  .welcome-card { padding: 18px; }
}
