/* ============================================================
   Suara Konstituen — tema di atas Tabler
   ============================================================ */
:root {
  --sk-accent: #ff5a36;
  --sk-accent-2: #e11d48;
  --sk-navy: #0b1437;
  --sk-navy-2: #111c4e;
  --sk-grad: linear-gradient(135deg, #ff7a45 0%, #ff5a36 40%, #e11d48 100%);
  --tblr-font-sans-serif: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tblr-primary: #ff5a36;
  --tblr-primary-rgb: 255, 90, 54;
  --tblr-primary-text: #ffffff;
  --tblr-primary-darken: #e84a28;
  --tblr-border-radius: 10px;
  --tblr-card-border-radius: 16px;
  --tblr-body-bg: #f4f6fb;
}
body { font-feature-settings: "cv02","cv03","cv04","cv11"; letter-spacing: -0.005em; }
.app-body { background: radial-gradient(1200px 400px at 90% -10%, rgba(255,90,54,.08), transparent 60%), #f4f6fb; }

.btn-primary { background: var(--sk-grad); border: 0; box-shadow: 0 6px 16px -6px rgba(225,29,72,.55); }
.btn-primary:hover, .btn-primary:focus { filter: brightness(1.05); background: var(--sk-grad); }
.text-accent { color: var(--sk-accent) !important; }
.bg-grad { background: var(--sk-grad) !important; color: #fff; }
.link-accent { color: var(--sk-accent); }
.min-w-0 { min-width: 0; }

/* ---------- Sidebar ---------- */
.app-sidebar {
  background: linear-gradient(180deg, var(--sk-navy) 0%, var(--sk-navy-2) 100%) !important;
  border-right: 0 !important;
}
.app-brand { display: flex; align-items: center; gap: .6rem; padding: 1rem .25rem !important; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--sk-grad); color: #fff; font-size: 1.25rem; box-shadow: 0 8px 20px -8px rgba(255,90,54,.8);
}
.brand-text { font-weight: 500; font-size: 1.05rem; color: #fff; letter-spacing: -.01em; }
.brand-text b { font-weight: 800; }
.tenant-card {
  margin: .25rem .75rem .75rem; padding: .75rem; border-radius: 14px; display: flex; gap: .7rem; align-items: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
}
.tenant-avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--party); color: #fff; font-weight: 800; font-size: 1.1rem; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15);
}
.tenant-name { color: #fff; font-weight: 700; font-size: .875rem; }
.tenant-meta { color: rgba(255,255,255,.55); font-size: .75rem; }
.app-sidebar .nav-heading {
  font-size: .675rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.38);
  padding: 1rem 1.25rem .35rem; font-weight: 700; list-style: none;
}
.app-sidebar .nav-link {
  margin: 1px .6rem; border-radius: 10px; padding: .55rem .75rem !important; color: rgba(255,255,255,.72) !important;
  transition: background .15s, color .15s;
}
.app-sidebar .nav-link { display: flex; align-items: center; }
.app-sidebar .nav-link .badge { margin-left: auto; }
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff !important; }
.app-sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(255,90,54,.22), rgba(255,90,54,.06)); color: #fff !important;
  box-shadow: inset 3px 0 0 var(--sk-accent);
}
.app-sidebar .nav-link.active .nav-link-icon { color: var(--sk-accent); }
.app-sidebar .nav-link-icon i { font-size: 1.2rem; }
.sidebar-foot { margin-top: auto; padding: 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.bg-white-10 { background: rgba(255,255,255,.1) !important; color: #fff !important; font-weight: 700; }
@media (min-width: 992px) {
  .app-sidebar .navbar-collapse { display: flex !important; flex-direction: column; height: calc(100vh - 70px); overflow-y: auto; }
}

/* ---------- Header & cards ---------- */
.page-header { margin-top: .5rem; }
.page-title { font-weight: 800; letter-spacing: -.02em; font-size: 1.5rem; }
.page-pretitle { color: var(--sk-accent); font-weight: 700; letter-spacing: .06em; }
.card { border: 1px solid rgba(15,23,42,.06); box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -12px rgba(15,23,42,.08); }
.card-header { border-bottom-color: rgba(15,23,42,.06); }
.card-title { font-weight: 700; }
.table thead th { font-size: .7rem; letter-spacing: .06em; color: #64748b; background: #f8fafc; font-weight: 700; }
.table-vcenter td { padding-top: .8rem; padding-bottom: .8rem; }
.glass-alert { border: 0; box-shadow: 0 8px 24px -12px rgba(15,23,42,.25); }
.form-label { font-weight: 600; font-size: .85rem; }
.form-hint { font-size: .78rem; }

/* ---------- Stat tiles ---------- */
.stat {
  position: relative; overflow: hidden; border-radius: 18px; padding: 1.25rem; background: #fff;
  border: 1px solid rgba(15,23,42,.06); box-shadow: 0 8px 24px -12px rgba(15,23,42,.1); height: 100%;
}
.stat .stat-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem;
  background: rgba(255,90,54,.1); color: var(--sk-accent);
}
.stat .stat-label { color: #64748b; font-size: .8rem; font-weight: 600; margin-top: .9rem; }
.stat .stat-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat .stat-sub { font-size: .78rem; color: #94a3b8; }
.stat.hero { background: var(--sk-grad); color: #fff; border: 0; }
.stat.hero .stat-icon { background: rgba(255,255,255,.18); color: #fff; }
.stat.hero .stat-label, .stat.hero .stat-sub { color: rgba(255,255,255,.8); }
.stat.hero::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.stat-icon.blue { background: rgba(59,130,246,.1); color: #3b82f6; }
.stat-icon.green { background: rgba(16,185,129,.1); color: #10b981; }
.stat-icon.violet { background: rgba(139,92,246,.1); color: #8b5cf6; }
.stat-icon.amber { background: rgba(245,158,11,.12); color: #f59e0b; }

.status-badge { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; }
.status-badge .status-dot { width: 6px; height: 6px; }

.progress-thin { height: 6px; border-radius: 99px; background: #eef2f7; }
.progress-thin .progress-bar { background: var(--sk-grad); border-radius: 99px; }

.avatar-initial { background: rgba(255,90,54,.12); color: var(--sk-accent); font-weight: 700; }
.nik { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }

/* ---------- WhatsApp bubble preview ---------- */
.wa-preview {
  background: #efeae2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23d6cfc4'/%3E%3C/svg%3E");
  border-radius: 14px; padding: 1rem; min-height: 200px;
}
.wa-bubble {
  background: #fff; border-radius: 0 12px 12px 12px; padding: .6rem .75rem .4rem; max-width: 92%;
  box-shadow: 0 1px 1px rgba(0,0,0,.08); white-space: pre-wrap; font-size: .875rem; position: relative; margin-bottom: .6rem;
}
.wa-bubble.out { background: #d9fdd3; border-radius: 12px 0 12px 12px; margin-left: auto; }
.wa-bubble .wa-time { font-size: .68rem; color: #8696a0; text-align: right; margin-top: .15rem; }

/* ---------- Filter chips / builder ---------- */
.filter-section { border: 1px dashed rgba(15,23,42,.12); border-radius: 14px; padding: 1rem; background: #fcfcfe; }
.audience-count {
  border-radius: 16px; padding: 1.1rem 1.25rem; background: var(--sk-navy); color: #fff; position: relative; overflow: hidden;
}
.audience-count .num { font-size: 2.25rem; font-weight: 800; letter-spacing: -.03em; }
.audience-count::after { content: ''; position: absolute; right: -30px; bottom: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,90,54,.35); filter: blur(10px); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  background: var(--sk-navy); color: #fff; padding: 3rem; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: var(--sk-grad); filter: blur(90px); opacity: .45; right: -160px; top: -160px; }
.auth-hero::after { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: #3b82f6; filter: blur(110px); opacity: .25; left: -120px; bottom: -120px; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.auth-hero .feature { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; }
.auth-hero .feature i { font-size: 1.3rem; color: var(--sk-accent); background: rgba(255,255,255,.08); border-radius: 10px; padding: .45rem; }
.auth-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.auth-form .inner { width: 100%; max-width: 400px; }
.mock-phone {
  border-radius: 22px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); padding: 1rem; max-width: 360px; backdrop-filter: blur(8px);
}
@media (max-width: 991px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } }

/* ---------- Public registration ---------- */
.public-body { background: #f4f6fb; min-height: 100vh; }
.public-hero { background: var(--sk-navy); color: #fff; padding: 2rem 1rem 5rem; position: relative; overflow: hidden; }
.public-hero::after { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: var(--sk-grad); filter: blur(70px); opacity: .5; right: -80px; top: -120px; }
.public-hero > * { position: relative; z-index: 1; }
.public-card { margin-top: -3.5rem; }
.ballot {
  width: 64px; height: 64px; border-radius: 18px; background: var(--party, #ff5a36); color: #fff; display: grid; place-items: center;
  font-size: 1.8rem; font-weight: 800; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
}

/* TomSelect polish */
/* TomSelect memakai variabel --bs-* yang tidak didefinisikan Tabler -> set eksplisit */
.ts-wrapper { width: 100%; }
.ts-control {
  border-radius: var(--tblr-border-radius) !important; min-height: 38px;
  background: #fff !important; border: 1px solid #dadfe5 !important; padding: .4rem .75rem;
}
.ts-wrapper.focus .ts-control { border-color: #ffa78f !important; box-shadow: 0 0 0 .25rem rgba(255,90,54,.15) !important; }
.ts-wrapper.disabled .ts-control { background: #f6f8fb !important; }
.ts-control input::placeholder { color: #94a3b8; }
.ts-wrapper.multi .ts-control > div { background: rgba(255,90,54,.1); color: #c2410c; border-radius: 6px; }
.ts-dropdown {
  background: #fff !important; color: #1e293b; border: 1px solid #e2e8f0 !important;
  border-radius: 10px; margin-top: 4px; z-index: 1060 !important;
  box-shadow: 0 16px 40px -12px rgba(15,23,42,.35);
}
.ts-dropdown .ts-dropdown-content { max-height: 280px; }
.ts-dropdown .option, .ts-dropdown .no-results, .ts-dropdown .create { padding: .45rem .75rem; }
.ts-dropdown .active { background: rgba(255,90,54,.1) !important; color: #c2410c !important; }
.ts-dropdown .selected { background: rgba(255,90,54,.18); }

/* Chart legend */
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; align-items: center; margin-bottom: .65rem; }
.bar-row .bar { grid-column: 1 / -1; height: 8px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.bar-row .bar span { display: block; height: 100%; background: var(--sk-grad); border-radius: 99px; }

/* Pemilih emoji di komposer pesan */
.emoji-panel { width: 320px; max-height: 360px; overflow-y: auto; }
.emoji-btn { border: 0; background: transparent; font-size: 1.35rem; line-height: 1; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
.emoji-btn:hover { background: rgba(255,90,54,.12); }

[x-cloak] { display: none !important; }
