/* =====================================================================
   PONDY CONNECT — Constituency Management Suite
   Fresh theme: ink-indigo sidebar, lavender canvas, violet/cyan accents
   ===================================================================== */

:root {
  --ink-1: #14123a;
  --ink-2: #1e1b4b;
  --ink-3: #312e81;
  --accent: #7c3aed;
  --accent-soft: #ede9fe;
  --cyan: #06b6d4;
  --canvas: #f4f4fb;
  --card: #ffffff;
  --text: #1e2235;
  --muted: #7a7f96;
  --line: #e7e7f3;
  --radius: 18px;
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--canvas);
  color: var(--text);
  font-size: 14.5px;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(178deg, var(--ink-1) 0%, var(--ink-2) 55%, var(--ink-3) 100%);
  color: #cdd0ea;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-badge {
  width: 42px; height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: grid; place-items: center;
  font-weight: 800; font-size: 19px; color: #fff;
  box-shadow: 0 6px 18px rgba(124,58,237,.45);
}
.brand-name { font-weight: 800; font-size: 16.5px; color: #fff; letter-spacing: .4px; line-height: 1.1; }
.brand-sub { font-size: 10.5px; color: #8f94c4; text-transform: uppercase; letter-spacing: 1.6px; }

.nav-section { padding: 14px 12px 6px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.8px;
  color: #767bad; padding: 12px 12px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10.5px 13px; margin: 2px 0;
  border-radius: 11px;
  color: #c3c7e8; text-decoration: none;
  font-weight: 600; font-size: 13.8px;
  transition: all .16s ease;
}
.side-link i { font-size: 17px; width: 22px; text-align: center; opacity: .85; }
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.active {
  background: linear-gradient(90deg, rgba(124,58,237,.9), rgba(6,182,212,.55));
  color: #fff;
  box-shadow: 0 4px 14px rgba(124,58,237,.4);
}

.sidebar-foot {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px; color: #7d82b2;
}

/* ---------- Main area ---------- */
.main-area { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 66px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 900;
}
.page-title { font-size: 17px; font-weight: 800; margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.const-switch {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-soft);
  border: 1px solid #ddd0fb;
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700; font-size: 13px;
}
.const-switch select {
  border: none; background: transparent; color: var(--accent);
  font-weight: 700; font-size: 13px; outline: none; cursor: pointer;
}

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ink-3), var(--accent));
  color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
}
.user-meta { line-height: 1.15; }
.user-meta .name { font-weight: 700; font-size: 13.5px; }
.user-meta .role { font-size: 11px; color: var(--muted); }

.content { padding: 26px; }

/* ---------- Cards & tiles ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(30,27,75,.05);
}
.panel-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 15px;
}
.panel-body { padding: 22px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 15px;
  box-shadow: 0 2px 10px rgba(30,27,75,.05);
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  font-size: 21px; color: #fff; flex-shrink: 0;
}
.stat-icon.violet { background: linear-gradient(135deg,#7c3aed,#a78bfa); }
.stat-icon.cyan   { background: linear-gradient(135deg,#0891b2,#22d3ee); }
.stat-icon.rose   { background: linear-gradient(135deg,#e11d48,#fb7185); }
.stat-icon.amber  { background: linear-gradient(135deg,#d97706,#fbbf24); }
.stat-icon.navy   { background: linear-gradient(135deg,#1e1b4b,#4338ca); }
.stat-icon.green  { background: linear-gradient(135deg,#047857,#34d399); }
.stat-value { font-size: 23px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; }

/* ---------- Tables ---------- */
.table-modern { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table-modern thead th {
  background: #f8f8fe;
  color: #5a5f7d;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table-modern tbody td { padding: 11px 14px; border-bottom: 1px solid #f0f0f8; vertical-align: middle; }
.table-modern tbody tr:hover { background: #faf9ff; }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Buttons, badges, forms ---------- */
.btn-brand {
  background: linear-gradient(135deg, var(--accent), #9333ea);
  border: none; color: #fff; font-weight: 700;
  border-radius: 11px; padding: 9px 20px;
  box-shadow: 0 4px 14px rgba(124,58,237,.35);
}
.btn-brand:hover { color: #fff; filter: brightness(1.08); }
.btn-ghost {
  background: #fff; border: 1px solid var(--line); color: var(--text);
  font-weight: 600; border-radius: 11px; padding: 8px 16px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.badge-soft { border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 4px 11px; display: inline-block; }
.badge-soft.violet { background: var(--accent-soft); color: var(--accent); }
.badge-soft.green  { background: #d9f5e8; color: #047857; }
.badge-soft.rose   { background: #ffe4e9; color: #e11d48; }
.badge-soft.gray   { background: #eef0f6; color: #5a5f7d; }
.badge-soft.cyan   { background: #d7f5fb; color: #0891b2; }

.form-label { font-weight: 700; font-size: 12.5px; color: #454a66; }
.form-control, .form-select {
  border-radius: 11px; border: 1.5px solid var(--line);
  padding: 9px 13px; font-size: 13.8px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(124,58,237,.14);
}

/* ---------- Login page ---------- */
.login-wrap { min-height: 100vh; display: flex; }
.login-hero {
  flex: 1.15;
  background:
    radial-gradient(900px 500px at 15% 15%, rgba(124,58,237,.5), transparent 60%),
    radial-gradient(700px 500px at 85% 85%, rgba(6,182,212,.35), transparent 55%),
    linear-gradient(150deg, #0d0b2a 0%, #1e1b4b 55%, #312e81 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 8vh 7vw;
  position: relative; overflow: hidden;
}
.login-hero h1 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; line-height: 1.15; }
.login-hero h1 span { background: linear-gradient(90deg,#a78bfa,#22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { color: #b9bde3; max-width: 480px; font-size: 15px; }
.hero-points { margin-top: 26px; display: grid; gap: 13px; }
.hero-point { display: flex; gap: 12px; align-items: center; color: #d5d8f4; font-weight: 600; font-size: 14px; }
.hero-point i {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,255,255,.09);
  display: grid; place-items: center; color: #22d3ee; font-size: 16px;
}
.login-form-side {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background: var(--canvas);
}
.login-card { width: 100%; max-width: 420px; }
.login-card .panel-body { padding: 34px; }

/* ---------- Permission grid & pickers ---------- */
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-table .form-check-input { width: 19px; height: 19px; cursor: pointer; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

.const-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.const-pick label {
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 12.5px;
  background: #fff; transition: all .15s;
  user-select: none;
}
.const-pick input { display: none; }
.const-pick label:has(input:checked) {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}

.pagination .page-link { border-radius: 9px; margin: 0 2.5px; border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); }

.progress { height: 9px; border-radius: 99px; background: #edeef8; }
.progress-bar { background: linear-gradient(90deg, var(--accent), var(--cyan)); border-radius: 99px; }

.alert { border-radius: 13px; border: none; font-weight: 600; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 52px; opacity: .3; }

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .login-hero { display: none; }
}
