/* =========================================================
   E-Voting HMTI — Stylesheet Global
   Palet: coklat (dominan), emas (aksen), putih/krem (latar)
   Font: Playfair Display (judul) + Lora (isi) — classic serif
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

@view-transition {
  navigation: auto;
}

:root {
  /* palet baru */
  --ink: #1b1c1c;
  --mist: #e4dfdc;
  --brown: #8d5815;
  --espresso: #462814;
  --amber: #e2983a;
  --gold: #deab57;
  --paper: #f4f1ef;
  --card: #fff;
  --line: rgba(27, 28, 28, .1);
  --muted: #6b645f;
  --pad: clamp(20px, 4vw, 64px);
  --r: 18px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* nama lama (dipakai halaman admin) dipetakan ke palet baru */
  --bark-950: #141515;
  --bark-900: #1b1c1c;
  --bark-800: #2b1d12;
  --bark-700: #462814;
  --bark-600: #8d5815;
  --gold-400: #deab57;
  --gold-500: #e2983a;
  --gold-600: #8d5815;
  --cream: #f4f1ef;
  --ivory: #ffffff;
  --border-soft: rgba(27, 28, 28, .1);
  --shadow-panel: 0 30px 60px -20px rgba(0, 0, 0, .45);
  --page-pad: var(--pad);
  --font-display: var(--font);
  --wrap: 1440px;
  /* warna emas mengikuti contoh tombol dari desain: atas #B57429 (rata ~24%) turun ke #8C5A1E, garis tepi #6B430E — sudah digelapkan dari versi awal */
  --gold-a: #B57429;
  --gold-b: #8C5A1E;
  --gold-edge: #6B430E;
  --on-gold: #ffffff;
  --grad-brand: linear-gradient(180deg, #B57429 0%, #B57429 24%, #8C5A1E 100%);
  --grad-side: linear-gradient(180deg, #B57429 0%, #B57429 24%, #8C5A1E 100%);
  --grad-bar: linear-gradient(180deg, #B57429 0%, #B57429 24%, #8C5A1E 100%);
  --grad-foot: linear-gradient(180deg, #B57429 0%, #B57429 24%, #8C5A1E 100%);
  --font-body: var(--font);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  background: #eaeaea;
  color: var(--bark-900);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0;
}

a {
  color: inherit;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.gold-rule {
  height: 1px;
  width: 64px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
  margin: 20px 0;
}

/* =========================================================
   KOMPONEN DASAR (form, tombol, status) & HALAMAN AUTH — tampilan modern
   ========================================================= */
h1,
h2,
h3 {
  letter-spacing: -.02em;
  line-height: 1.15
}

.gold-rule {
  height: 3px;
  width: 44px;
  border-radius: 3px;
  background: var(--amber);
  margin: 18px 0
}

/* ---------- form & tombol ---------- */
.field {
  margin-bottom: 16px
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid transparent;
  border-radius: 12px;
  transition: border-color .2s, background .2s, box-shadow .2s
}

.field textarea {
  resize: vertical;
  line-height: 1.5
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a39b95
}

.field input:focus,
.field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(226, 152, 58, .18)
}

.btn-primary,
.btn-outline {
  font: inherit;
  font-weight: 700;
  border-radius: 12px;
  border: 1.5px solid transparent;
  transition: background .2s, transform .15s, border-color .2s, color .2s
}

/* .btn-hero dianimasikan GSAP: JANGAN transisi `transform` (tombol bisa tersangkut bergeser). Hover pakai `translate`. */
.btn-hero {
  transition: background .2s, translate .2s
}

.btn-hero:hover {
  translate: 0 -2px
}

.btn-primary {
  width: 100%;
  padding: 12px 20px;
  background: var(--ink);
  color: #fff
}

.btn-primary:hover:not(:disabled) {
  background: var(--espresso)
}

.btn-primary:active:not(:disabled) {
  transform: scale(.98)
}

.btn-primary:disabled,
.btn-outline:disabled {
  opacity: .55;
  cursor: not-allowed
}

.btn-outline {
  padding: 9px 16px;
  font-size: 13px;
  background: transparent;
  color: var(--ink);
  border-color: var(--line)
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--ink)
}

.status-msg {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  margin-bottom: 16px;
  background: #fff6e8;
  color: var(--espresso);
  border: 1px solid rgba(226, 152, 58, .4)
}

.status-msg.error {
  background: #fdecea;
  color: #8a1c14;
  border-color: #f3c1bc
}

.status-msg.success {
  background: #eaf6ee;
  color: #1d5a32;
  border-color: #bfe0c9
}

/* ---------- halaman auth ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent
}

.auth-card {
  width: 100%;
  max-width: 780px;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(70, 40, 20, .28)
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 32px 28px;
  color: var(--mist);
  background: var(--grad-brand)
}

/* Justify Logo */
.brand-logo {
  width: min(170px, 70%);
  padding: 11px;
  background: var(--mist);
  border-radius: 22px;
  margin-bottom: 20px
}

.brand-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px
}

.brand-title {
  font-size: clamp(20px, 2.4vw, 25px);
  font-weight: 700;
  color: #fff
}

.brand-description {
  color: rgba(255, 255, 255, .9);
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 34ch
}

.brand-footer {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .75)
}

.form-panel {
  padding: 30px 32px;
  display: flex;
  flex-direction: column
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--paper);
  border-radius: 13px;
  margin-bottom: 20px
}

.tab-btn {
  flex: 1;
  padding: 8px;
  font-size: 13.5px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 700;
  color: var(--muted);
  transition: background .25s, color .25s, box-shadow .25s
}

.tab-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(27, 28, 28, .12)
}

.auth-track-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  margin: -6px;
  padding: 6px
}

.auth-track {
  display: flex;
  width: 200%;
  transition: transform .45s cubic-bezier(.65, 0, .35, 1);
  transform: translateX(0)
}

.auth-track.show-register {
  transform: translateX(-50%)
}

.auth-pane {
  width: 50%;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  justify-content: center
}

.pane-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px
}

.pane-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px
}

.field-forgot {
  text-align: right;
  margin: -6px 0 18px;
  font-size: 13px
}

.field-forgot a,
.auth-footer a {
  color: var(--brown);
  font-weight: 600;
  text-decoration: none
}

.field-forgot a:hover,
.auth-footer a:hover {
  text-decoration: underline
}

.auth-card-single {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(70, 40, 20, .28)
}

.auth-card-single .brand-logo {
  width: 104px;
  margin: 0 0 16px;
  padding: 8px;
  border-radius: 17px
}

.auth-card-single .brand-eyebrow {
  color: var(--brown) !important;
  margin-bottom: 6px
}

.auth-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 13px
}

@media(max-width:860px) {
  .auth-card {
    grid-template-columns: 1fr;
    max-width: 420px
  }

  .brand-panel {
    padding: 22px;
    gap: 14px;
    justify-content: flex-start
  }

  .brand-logo {
    width: 96px;
    margin-bottom: 14px
  }

  .form-panel {
    padding: 22px
  }

  /* HP: tinggi form mengikuti pane yang aktif (tidak ikut pane Daftar yang lebih panjang) */
  .tabs {
    margin-bottom: 16px
  }

  /* tinggi mengikuti form aktif. Panel yang ditinggalkan baru "diciutkan" SETELAH animasi slide selesai (delay .45s),
     jadi tidak ada kedip; panel yang akan tampil langsung terlihat. */
  .auth-track {
    align-items: flex-start
  }

  .auth-pane {
    max-height: 2000px
  }

  .auth-track:not(.show-register) .auth-pane:last-child:not(:first-child),
  .auth-track.show-register .auth-pane:first-child {
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0s .45s, visibility 0s .45s
  }
}

/* ---------- ukuran elemen form di dalam card login (disesuaikan dgn card yg lebih kecil) ---------- */
.auth-card .field,
.auth-card-single .field {
  margin-bottom: 12px
}

.auth-card .field label,
.auth-card-single .field label {
  font-size: 12.5px;
  margin-bottom: 5px
}

.auth-card .field input,
.auth-card-single .field input {
  padding: 10px 12px;
  font-size: 13.5px;
  border-radius: 10px
}

.auth-card .btn-primary,
.auth-card-single .btn-primary {
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 10px
}

.auth-card .field-forgot {
  margin: -4px 0 14px;
  font-size: 12.5px
}

/* ---------- BACKGROUND PATTERN GLOBAL (Pakem Design/Background.png, opacity 50%) ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("background.png") center top / 620px auto repeat;
  opacity: 0.035
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition-duration: .01ms !important
  }
}

/* =========================================================
   HALAMAN BERANDA (mahasiswa setelah login)
   ========================================================= */

.beranda-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
}

.beranda-card {
  width: 100%;
  max-width: 480px;
  background: var(--ivory);
  border-radius: 28px;
  box-shadow: var(--shadow-panel);
  padding: 40px;
  text-align: center;
}

.beranda-card p.lead {
  font-size: 14px;
  line-height: 1.7;
  color: var(--bark-700);
}

/* =========================================================
   ADMIN DASHBOARD — layout + sidebar
   ========================================================= */

.admin-layout {
  min-height: 100vh;
  display: flex;
  background: transparent;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: var(--grad-side);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 28px 24px;
}

.sidebar-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold-400);
  margin: 0 0 4px;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ivory);
}

.sidebar-rule {
  height: 1px;
  margin: 0 24px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}

.sidebar-nav {
  flex: 1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  text-decoration: none;
  color: rgba(250, 246, 239, 0.7);
  transition: background-color 0.2s, color 0.2s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
}

.sidebar-link.active {
  background: rgba(201, 162, 39, 0.15);
  color: var(--gold-400);
  font-weight: 500;
}

.sidebar-link svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: rgba(250, 246, 239, 0.7);
  transition: background-color 0.2s, color 0.2s;
}

.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
}

.mobile-menu-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: var(--bark-900);
  color: var(--gold-400);
  box-shadow: var(--shadow-panel);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 27, 18, 0.5);
  z-index: 35;
  display: none;
}

.sidebar-overlay.visible {
  display: block;
}

.dashboard-main {
  flex: 1;
  min-width: 0;
  /* supaya tabel lebar bisa scroll di dalam kartu, bukan melebarkan halaman */
  margin-left: 0;
  padding: 80px var(--page-pad) 40px;
}

.dashboard-inner {
  width: 100%;
}

.page-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold-600);
  margin: 0 0 4px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--bark-900);
  margin: 0 0 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--bark-700);
  margin: 0;
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
}

/* =========================================================
   TABEL & KARTU KONTEN ADMIN
   ========================================================= */

.table-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  overflow-x: auto;
  box-shadow: 0 2px 10px rgba(42, 27, 18, 0.04);
}

.table-card .empty-msg {
  padding: 24px;
  font-size: 14px;
  color: var(--bark-700);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

table.data-table thead {
  background: rgba(62, 39, 35, 0.04);
}

table.data-table th {
  padding: 12px 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bark-700);
}

table.data-table td {
  padding: 12px 20px;
  border-top: 1px solid rgba(62, 39, 35, 0.06);
}

table.data-table td.strong {
  font-weight: 600;
  color: var(--bark-900);
}

table.data-table td.muted {
  color: var(--bark-700);
}

.table-scroll {
  max-height: 340px;
  overflow: auto;
}

.action-group {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-approve {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bark-900);
  color: var(--gold-400);
}

.btn-reject {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  color: var(--bark-800);
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
}

.badge.voted {
  background: #dcfce7;
  color: #166534;
}

.badge.not-voted {
  background: rgba(62, 39, 35, 0.06);
  color: var(--bark-700);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.filter-pills {
  display: flex;
  gap: 8px;
}

.filter-pill {
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(62, 39, 35, 0.06);
  color: var(--bark-700);
}

.filter-pill.active {
  background: var(--bark-900);
  color: var(--gold-400);
}

.search-input {
  flex: 1;
  max-width: 260px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 860px) {
  .auth-card {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    display: flex;
  }

  .form-panel {
    padding: 32px 24px;
  }
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }

  .sidebar {
    transform: translateX(0);
    position: sticky;
    top: 0;
    height: 100vh;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .dashboard-main {
    padding: 40px var(--page-pad);
  }
}

@media (max-width: 767px) {
  .admin-layout {
    flex-direction: column;
  }
}

/* =========================================================
   KOMPONEN BERSAMA: modal/popup, card kandidat
   (dipakai di admin/kandidat.html dan landing.html)
   ========================================================= */

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--bark-700);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(42, 27, 18, 0.6);
  backdrop-filter: blur(2px);
}

.modal {
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--ivory);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-panel);
  border-top: 3px solid var(--gold-500);
}

.modal-wide {
  max-width: 600px;
}

.modal-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--bark-900);
  margin-bottom: 6px;
}

.modal-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--bark-700);
  margin: 0 0 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal-actions .btn-primary {
  width: auto;
  padding: 10px 20px;
}

.modal-actions .btn-outline {
  padding: 10px 18px;
}

/* Grid mengisi lebar yang tersedia: 1 kolom di layar kecil, bertambah otomatis di layar lebar */
.kandidat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
  gap: 24px;
  align-items: stretch;
}

/* Card: foto di kiri, data di kanan (di layar sempit foto pindah ke atas) */
.kandidat-card {
  display: grid;
  grid-template-columns: minmax(170px, 36%) 1fr;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(42, 27, 18, 0.05);
}

.kandidat-photo {
  position: relative;
  min-height: 240px;
  background: var(--grad-brand);
}

.kandidat-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  /* wajah biasanya di bagian atas foto */
}

.kandidat-photo-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(228, 196, 102, 0.55);
}

.kandidat-number {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bark-950);
  color: var(--gold-400);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  border: 2px solid var(--gold-500);
  box-shadow: 0 6px 16px rgba(42, 27, 18, 0.35);
}

.kandidat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 26px 22px;
  border-top: 3px solid var(--gold-500);
}

.kandidat-role {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-600);
}

.kandidat-name {
  margin: 2px 0 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--bark-900);
  overflow-wrap: anywhere;
}

.kandidat-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(62, 39, 35, 0.08);
}

.kandidat-section h4 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--bark-800);
}

.kandidat-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--bark-800);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.kandidat-section ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--bark-800);
}

.kandidat-section li {
  overflow-wrap: anywhere;
}

.kandidat-section li+li {
  margin-top: 4px;
}

.kandidat-note p {
  font-style: italic;
  color: var(--bark-700);
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  background: #fff;
  border: 1px dashed var(--border-soft);
  border-radius: 18px;
}

.empty-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--bark-900);
}

.empty-text {
  margin: 0;
  font-size: 14px;
  color: var(--bark-700);
}

@media (max-width: 640px) {
  .kandidat-card {
    grid-template-columns: 1fr;
  }

  .kandidat-photo {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modal {
    padding: 22px 18px;
  }
}

/* =========================================================
   TOMBOL & FORM TAMBAHAN (edit/hapus kandidat, upload foto)
   ========================================================= */

.btn-danger {
  border: 1px solid rgba(185, 28, 28, 0.35);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  color: #b91c1c;
  transition: background-color 0.2s, color 0.2s;
}

.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
}

.modal-actions .btn-danger-solid {
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  background: #b91c1c;
  color: #fff;
}

.modal-actions .btn-danger-solid:hover:not(:disabled) {
  background: #991b1b;
}

.modal-actions .btn-danger-solid:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.photo-field {
  display: flex;
  align-items: center;
  gap: 16px;
}

.photo-preview {
  flex-shrink: 0;
  width: 96px;
  height: 120px;
  border-radius: 12px;
  border: 1px dashed var(--border-soft);
  background: rgba(62, 39, 35, 0.04);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bark-700);
  font-size: 11px;
  text-align: center;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.photo-controls {
  min-width: 0;
}

.photo-controls input[type="file"] {
  max-width: 100%;
  font-size: 13px;
  font-family: var(--font-body);
}

.photo-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--bark-700);
}

.photo-remove {
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 500;
  color: #b91c1c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =========================================================
   TOAST — notifikasi slide di kanan bawah (halaman admin)
   ========================================================= */

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(380px, calc(100vw - 40px));
  padding: 14px 14px 14px 16px;
  border-radius: 14px;
  border-left: 4px solid var(--gold-500);
  background: var(--bark-950);
  color: var(--cream);
  box-shadow: var(--shadow-panel);
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.toast.toast-show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-left-color: #4ade80;
}

.toast-error {
  border-left-color: #f87171;
}

.toast-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--gold-400);
}

.toast-success .toast-icon {
  color: #4ade80;
}

.toast-error .toast-icon {
  color: #f87171;
}

.toast-message {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(250, 246, 239, 0.55);
  font-size: 18px;
  line-height: 1;
}

.toast-close:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 560px) {
  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
    align-items: stretch;
  }

  .toast {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transform: none;
    transition: opacity 0.2s ease;
  }
}

/* =========================================================
   SESI VOTING (admin/sesi-voting.html)
   ========================================================= */

.session-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(42, 27, 18, 0.05);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--bark-900);
}

.panel-head .panel-title {
  margin: 0;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(62, 39, 35, 0.06);
  color: var(--bark-800);
  font-size: 15px;
  font-weight: 600;
}

.session-badge::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.session-badge[data-state="open"] {
  background: #dcfce7;
  color: #166534;
}

.session-badge[data-state="closed"] {
  background: var(--bark-900);
  color: var(--gold-400);
}

.session-badge[data-state="error"] {
  background: #fef2f2;
  color: #b91c1c;
}

.session-badge[data-state="loading"] {
  opacity: 0.7;
}

.detail-list {
  margin: 20px 0 0;
}

.detail-list>div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(62, 39, 35, 0.08);
  font-size: 14px;
}

.detail-list dt {
  color: var(--bark-700);
}

.detail-list dd {
  margin: 0;
  color: var(--bark-900);
  overflow-wrap: anywhere;
}

.mono {
  font-family: var(--font);
  font-size: 13px;
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.session-actions .btn-primary {
  width: auto;
  padding: 12px 22px;
}

.btn-danger-fill {
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  background: #b91c1c;
  color: #fff;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn-danger-fill:hover:not(:disabled) {
  background: #991b1b;
}

.btn-danger-fill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.session-hint {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--bark-700);
}

.wallet-address {
  margin: 0 0 12px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--bark-900);
  overflow-wrap: anywhere;
}

.wallet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wallet-chips:not(:empty) {
  margin-bottom: 16px;
}

.wallet-chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.wallet-chip-ok {
  background: #dcfce7;
  color: #166534;
}

.wallet-chip-bad {
  background: #fef2f2;
  color: #b91c1c;
}

.wallet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-note {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--bark-700);
}

.panel-note a {
  color: var(--bark-900);
  font-weight: 500;
}

.status-msg.info {
  background: rgba(201, 162, 39, 0.12);
  border-color: rgba(201, 162, 39, 0.4);
  color: var(--bark-800);
}

.status-msg a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-list {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--bark-800);
}

/* Kotak peringatan di dalam popup (dipakai landing page & halaman admin) */
.modal-warning {
  margin: 0 0 4px;
  padding: 12px 14px;
  border-left: 3px solid var(--gold-500);
  border-radius: 0 8px 8px 0;
  background: rgba(201, 162, 39, 0.12);
  font-size: 13px;
  line-height: 1.6;
  color: var(--bark-800);
}

.modal-warning.danger {
  border-left-color: #b91c1c;
  background: #fef2f2;
  color: #991b1b;
}

.progress-steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.progress-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  font-size: 14px;
  color: var(--bark-700);
}

.progress-steps li::before {
  content: "";
  flex-shrink: 0;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(62, 39, 35, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.progress-steps li[data-state="active"] {
  color: var(--bark-900);
  font-weight: 500;
}

.progress-steps li[data-state="active"]::before {
  border-color: var(--gold-500);
  border-top-color: transparent;
  animation: step-spin 0.8s linear infinite;
}

.progress-steps li[data-state="done"]::before {
  content: "\2713";
  border-color: #16a34a;
  background: #16a34a;
}

.progress-steps li[data-state="error"] {
  color: #b91c1c;
}

.progress-steps li[data-state="error"]::before {
  content: "\2715";
  border-color: #b91c1c;
  background: #b91c1c;
}

@keyframes step-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress-steps li[data-state="active"]::before {
    animation: none;
    border-top-color: var(--gold-500);
  }
}

@media (max-width: 960px) {
  .session-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .detail-list>div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .session-actions .btn-primary,
  .session-actions .btn-danger-fill {
    width: 100%;
  }
}

/* =========================================================
   SESI VOTING: panel relayer & hasil (tambahan)
   ========================================================= */

.panel-wide {
  margin-top: 24px;
}

.panel-note-top {
  margin: -8px 0 12px;
}

.session-badge[data-state="closing"] {
  background: rgba(201, 162, 39, 0.18);
  color: var(--bark-800);
}

.detail-list dd[data-state="ok"] {
  color: #166534;
}

.detail-list dd[data-state="bad"] {
  color: #b91c1c;
}

/* Status relayer "Siaga": kuning/amber, dibedakan dari aktif (hijau) dan bermasalah (merah) */
#relayer-live[data-state="idle"] {
  color: #b7791f;
  font-weight: 500;
}

.relayer-form {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(62, 39, 35, 0.08);
}

.relayer-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--bark-800);
}

.relayer-row {
  display: flex;
  gap: 10px;
}

.relayer-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--bark-900);
  background: #fff;
}

.relayer-row input:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 1px var(--gold-500);
  outline: none;
}

.relayer-row .btn-outline {
  white-space: nowrap;
}

.relayer-row .btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

tr.row-top td {
  background: rgba(201, 162, 39, 0.12);
  font-weight: 600;
}

@media (max-width: 520px) {
  .relayer-row {
    flex-direction: column;
  }
}

/* =========================================================
   ADMIN — tampilan modern (putih, palet HMTI, Poppins)
   ========================================================= */
.logo-tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--mist);
  flex-shrink: 0
}

.logo-tile img {
  width: 30px;
  height: 30px;
  object-fit: contain
}

.admin-layout,
.dashboard-main {
  background: transparent
}

.sidebar {
  width: 272px;
  background: var(--grad-side);
  color: var(--mist);
  border-right: 0
}

.sidebar.open {
  box-shadow: 0 0 60px rgba(27, 28, 28, .25)
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px
}

.sidebar-header .logo-tile {
  width: 42px;
  height: 42px
}

.sidebar-brand {
  flex: 1;
  min-width: 0
}

.sidebar-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--brown);
  margin: 0
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2
}

.sidebar-rule {
  height: 1px;
  background: rgba(228, 223, 220, .15)
}

.sidebar-nav {
  padding: 18px 14px
}

.sidebar-link {
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 500;
  color: rgba(228, 223, 220, .78)
}

.sidebar-link:hover {
  background: rgba(228, 223, 220, .1);
  color: #fff
}

.sidebar-link.active {
  background: rgba(226, 152, 58, .22);
  color: var(--gold);
  font-weight: 600
}

.sidebar-link.active svg {
  color: var(--gold)
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  padding: 14px
}

.sidebar-credit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(228, 223, 220, .08)
}

.sidebar-credit .logo-tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--mist)
}

.sidebar-credit .logo-tile img {
  width: 26px;
  height: 26px
}

.sidebar-credit p {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(228, 223, 220, .8)
}

.sidebar-logout {
  justify-content: center;
  border: 1.5px solid rgba(228, 223, 220, .28);
  font-weight: 600;
  color: var(--mist)
}

.sidebar-logout:hover {
  background: var(--mist);
  border-color: var(--mist);
  color: var(--ink)
}

.mobile-menu-btn {
  background: var(--espresso);
  color: var(--gold);
  border: 0
}

.sidebar-overlay {
  background: rgba(27, 28, 28, .4)
}

.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line)
}

.page-eyebrow {
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--brown)
}

.page-title {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -.02em
}

.page-subtitle {
  color: var(--muted)
}

.table-card,
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 40px -34px rgba(70, 40, 20, .5)
}

table.data-table thead {
  background: var(--paper)
}

table.data-table th {
  padding: 13px 20px;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted)
}

table.data-table td {
  padding: 14px 20px;
  border-top: 1px solid var(--line)
}

table.data-table tbody tr:not(.row-top):hover td {
  background: #faf8f6
}

.panel-title {
  font-weight: 600
}

.btn-approve {
  border-radius: 10px;
  padding: 7px 14px;
  font-weight: 600;
  background: var(--amber);
  color: var(--ink);
  transition: background .2s
}

.btn-approve:hover {
  background: var(--gold)
}

.btn-reject {
  border-radius: 10px;
  padding: 7px 14px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color .2s, color .2s
}

.btn-reject:hover {
  border-color: #b91c1c;
  color: #b91c1c
}

.badge {
  padding: 4px 12px;
  font-weight: 600
}

.badge.not-voted {
  background: var(--paper);
  color: var(--muted)
}

.filter-pill {
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 500;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: background .2s, color .2s, border-color .2s
}

.filter-pill:hover {
  border-color: var(--amber);
  color: var(--ink)
}

.filter-pill.active {
  background: rgba(226, 152, 58, .16);
  border-color: var(--amber);
  color: var(--espresso);
  font-weight: 600
}

.search-input {
  border: 1.5px solid transparent;
  background: var(--paper);
  border-radius: 12px;
  font-family: var(--font);
  transition: border-color .2s, background .2s, box-shadow .2s
}

.search-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(226, 152, 58, .18)
}

.modal-overlay {
  background: rgba(27, 28, 28, .45);
  backdrop-filter: blur(4px)
}

.modal {
  border-radius: 24px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .45)
}

.kandidat-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px -34px rgba(70, 40, 20, .5)
}

.kandidat-role {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--brown)
}

.toast {
  border-radius: 14px
}

/* ---------- Kontrol relayer otomatis (halaman Sesi Voting) ---------- */
.relayer-controls {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(62, 39, 35, 0.08);
}

.relayer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.relayer-buttons .btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.relayer-controls .panel-note {
  margin-top: 10px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--bark-800);
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #c9c3bf;
  transition: background 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}

.switch input:checked+.switch-track {
  background: #166534;
}

.switch input:checked+.switch-track::after {
  transform: translateX(18px);
}

.switch input:focus-visible+.switch-track {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

.switch input:disabled+.switch-track,
.switch input:disabled~.switch-label {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Kontrak pemilihan (halaman Sesi Voting) ---------- */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--bark-800);
  cursor: pointer;
}

.check-row input {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--brown);
}

.check-row input:disabled+span {
  opacity: 0.55;
}

#kontrak-input:disabled {
  background: rgba(27, 28, 28, 0.04);
  cursor: not-allowed;
}

/* =========================================================
   HASIL VOTING (admin/hasil-voting.html) — peragaan hasil pemilihan
   Batang naik dari bawah, urut dari suara tersedikit sampai terbanyak.
   Logikanya di js/Hasilvoting.js.
   Tinggi panggung dipatok ke tinggi layar supaya tombol, batang, dan pengumuman
   selalu terlihat tanpa menggulir (juga saat layar penuh di proyektor).
   ========================================================= */
.hv-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  height: clamp(520px, calc(100vh - 195px), 920px);
  padding: clamp(16px, 2.6vw, 40px);
  box-sizing: border-box;
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  color: var(--paper);
  background: radial-gradient(120% 90% at 50% 0%, #4a2b14 0%, #2b1d12 45%, #141515 100%);
  box-shadow: var(--shadow-panel);
}

.hv-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(60% 46% at 50% 0%, rgba(222, 171, 87, 0.22), transparent 70%);
}

.hv-stage:fullscreen {
  height: 100vh;
  border-radius: 0;
  padding: 3vh 4vw;
}

.hv-fs,
.hv-replay {
  position: absolute;
  top: 16px;
  z-index: 5;
  padding: 8px 14px;
  font: 500 13px var(--font);
  color: var(--paper);
  background: rgba(244, 241, 239, 0.1);
  border: 1px solid rgba(244, 241, 239, 0.28);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.hv-fs {
  right: 16px;
}

.hv-replay {
  left: 16px;
}

.hv-fs:hover,
.hv-replay:hover:not(:disabled) {
  background: rgba(244, 241, 239, 0.22);
}

/* Bagian atas: keterangan selama animasi, lalu diganti pengumuman (saling menumpuk di sel yang sama) */
.hv-head {
  position: relative;
  z-index: 1;
  display: grid;
  flex: none;
  min-height: clamp(108px, 17vh, 150px);
  padding-inline: clamp(70px, 9vw, 130px);
}

.hv-head>* {
  grid-area: 1 / 1;
  align-self: center;
  text-align: center;
}

.hv-caption {
  margin: 0;
  font-size: clamp(18px, 2.6vh, 28px);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--gold);
  transition: opacity 0.6s ease;
}

.hv-stage.selesai .hv-caption {
  opacity: 0;
}

.hv-banner {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hv-banner.tampil {
  opacity: 1;
  transform: none;
}

.hv-banner-eyebrow {
  margin: 0;
  font-size: clamp(11px, 1.6vh, 14px);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.hv-banner-title {
  margin: 4px 0 0;
  font-size: clamp(22px, min(4.6vh, 6.4vw), 52px);
  font-weight: 700;
  line-height: 1.15;
  color: #ffeab0;
}

.hv-banner-text {
  max-width: 820px;
  margin: 6px auto 0;
  font-size: clamp(12px, 1.9vh, 17px);
  line-height: 1.5;
  color: var(--mist);
}

/* Grafik: mengisi sisa tinggi panggung */
.hv-chart {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(14px, 3.5vw, 56px);
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.hv-slot {
  flex: 1 1 0;
  min-width: 0;
  max-width: 300px;
  display: flex;
  flex-direction: column;
}

/* Area batang. padding-top menyisakan ruang untuk kartu foto di atas batang tertinggi. */
.hv-bar-area {
  --hv-card-h: clamp(180px, 26vh, 245px);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  padding-top: var(--hv-card-h);
  box-sizing: border-box;
  border-bottom: 3px solid rgba(244, 241, 239, 0.3);
}

.hv-bar {
  position: relative;
  width: 100%;
  height: 0;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, #c99a52 0%, #8d5815 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.15);
  transition: height var(--hv-dur, 2600ms) cubic-bezier(0.2, 0.75, 0.25, 1);
}

/* Kartu foto + nama: menempel di atas batang, muncul setelah batang selesai naik */
.hv-card {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  width: max(100%, 150px);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 28px) scale(0.82);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 1.25, 0.3, 1), visibility 0s linear 0.8s;
}

.hv-slot.tampil .hv-card {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 1.25, 0.3, 1), visibility 0s;
}

.hv-photo {
  display: grid;
  place-items: center;
  width: clamp(68px, 10vh, 116px);
  aspect-ratio: 1;
  margin: 0 auto 8px;
  overflow: hidden;
  border-radius: 50%;
  border: 4px solid var(--gold);
  background: #2b1d12;
}

.hv-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hv-photo-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: rgba(222, 171, 87, 0.6);
}

.hv-nomor {
  margin: 0;
  font-size: clamp(10px, 1.4vh, 13px);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.hv-nama {
  margin: 2px 0 0;
  font-size: clamp(14px, 2.1vh, 21px);
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hv-crown {
  display: none;
  position: absolute;
  left: 50%;
  top: -34px;
  transform: translateX(-50%);
  color: #ffeab0;
}

/* Angka di bawah garis dasar */
.hv-foot {
  flex: none;
  min-height: clamp(88px, 13vh, 124px);
  padding-top: 10px;
  text-align: center;
}

.hv-q {
  font-size: clamp(34px, 5.6vh, 58px);
  font-weight: 700;
  line-height: 1.1;
  color: rgba(244, 241, 239, 0.28);
  animation: hv-denyut 1.7s ease-in-out infinite;
}

.hv-chart.tegang .hv-slot:not(.naik) .hv-q {
  color: rgba(222, 171, 87, 0.75);
  animation-duration: 0.6s;
}

.hv-stat {
  display: none;
}

.hv-slot.naik .hv-q {
  display: none;
}

.hv-slot.naik .hv-stat {
  display: block;
}

.hv-num {
  font-size: clamp(38px, 6.6vh, 72px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hv-unit {
  font-size: clamp(12px, 1.7vh, 17px);
  opacity: 0.85;
}

.hv-pct {
  display: block;
  min-height: 1.4em;
  margin-top: 2px;
  font-size: clamp(15px, 2.3vh, 23px);
  font-weight: 600;
  color: var(--gold);
}

/* Pemenang */
.hv-stage.ada-juara .hv-slot:not(.juara) .hv-bar {
  filter: saturate(0.55) brightness(0.8);
}

.hv-slot.juara .hv-bar,
.hv-slot.seri .hv-bar {
  background: linear-gradient(180deg, #ffeab0 0%, #f0b95a 38%, #c27a1b 100%);
}

.hv-slot.juara .hv-bar {
  box-shadow: 0 0 70px 6px rgba(240, 185, 90, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  animation: hv-sinar 1.9s ease-in-out infinite alternate;
}

.hv-slot.juara .hv-photo,
.hv-slot.seri .hv-photo {
  border-color: #ffeab0;
  box-shadow: 0 0 0 6px rgba(240, 185, 90, 0.28), 0 0 36px rgba(240, 185, 90, 0.5);
}

.hv-slot.juara .hv-nama,
.hv-slot.juara .hv-num,
.hv-slot.seri .hv-num {
  color: #ffeab0;
}

.hv-slot.juara .hv-crown {
  display: block;
  animation: hv-mahkota 0.9s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}

/* Tombol mulai: melayang di tengah panggung sampai ditekan */
.hv-start-wrap {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: radial-gradient(60% 50% at 50% 55%, rgba(20, 21, 21, 0.12), rgba(20, 21, 21, 0.6));
  transition: opacity 0.6s ease, visibility 0s linear 0s;
}

.hv-start-wrap.pudar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

.hv-start {
  padding: clamp(14px, 2.2vh, 20px) clamp(28px, 4vw, 52px);
  font: 600 clamp(16px, 2.4vh, 22px) var(--font);
  color: #2b1d12;
  background: linear-gradient(180deg, #f7cf86, #deab57);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 34px -6px rgba(222, 171, 87, 0.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

.hv-start:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 40px -6px rgba(222, 171, 87, 0.85);
}

.hv-start:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.hv-confetti {
  position: absolute;
  top: -14px;
  z-index: 3;
  width: 9px;
  height: 16px;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  animation-name: hv-jatuh;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes hv-denyut {

  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.94);
  }

  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes hv-sinar {
  from {
    box-shadow: 0 0 40px 2px rgba(240, 185, 90, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  }

  to {
    box-shadow: 0 0 90px 14px rgba(240, 185, 90, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  }
}

@keyframes hv-mahkota {
  from {
    opacity: 0;
    transform: translate(-50%, -34px) scale(0.5) rotate(-12deg);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1) rotate(0);
  }
}

@keyframes hv-jatuh {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  8% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translate3d(var(--dx, 0), 105vh, 0) rotate(720deg);
  }
}

@media (max-width: 640px) {
  .hv-chart {
    gap: 8px;
  }

  .hv-head {
    padding-inline: 4px;
    padding-top: 44px;
  }

  .hv-bar-area {
    --hv-card-h: 150px;
  }

  .hv-card {
    width: calc(100% + 8px);
  }

  .hv-photo {
    width: 62px;
    border-width: 3px;
  }

  .hv-nomor {
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .hv-nama {
    font-size: 12px;
  }

  .hv-num {
    font-size: 30px;
  }

  .hv-unit {
    font-size: 11px;
  }

  .hv-pct {
    font-size: 14px;
  }

  .hv-banner-text {
    font-size: 12px;
  }

  .hv-crown {
    top: -30px;
    transform: translateX(-50%) scale(0.8);
  }
}

/* Pengguna yang mematikan animasi di sistemnya: tanpa gerakan, urutan pengungkapan tetap sama */
@media (prefers-reduced-motion: reduce) {

  .hv-bar,
  .hv-card,
  .hv-banner,
  .hv-start-wrap {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .hv-q,
  .hv-slot.juara .hv-bar,
  .hv-slot.juara .hv-crown {
    animation: none;
  }

  .hv-confetti {
    display: none;
  }
}

/* ---------- panel semi-transparan di belakang teks agar terbaca di atas pola background ---------- */
.page-header {
  padding: 18px 22px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px)
}

.empty-state,
.empty-msg {
  background: rgba(255, 255, 255, .88);
  border-radius: 18px
}

.empty-msg {
  padding: 14px 18px
}

/* ---------- FONT: semua Poppins (admin & user) ---------- */
html,
body,
button,
input,
select,
textarea,
table,
th,
td,
pre,
code {
  font-family: var(--font)
}

/* ---------- BINGKAI ORNAMEN halaman login admin, login user & lupa password ----------
   Desain baru (Figma 1920x1080): 4 pojok (Layer), 2 lengkung bawah (LENGKUNG), 1 ornamen tengah bawah.
   --u = ukuran 1 "piksel desain" mengikuti lebar layar (1920px lebar = .75px). Ubah angka .75 untuk membesar/mengecilkan seluruh bingkai. Semua ukuran/posisi di bawah
   adalah angka dari desain Figma dikali --u, sehingga bingkai ikut mengecil/membesar proporsional. */
.auth-page {
  --u: clamp(.225px, calc(100vw / 1920 * .75), .83px);
  position: relative;
  overflow: hidden;
  padding: 16px 24px calc(var(--u) * 191 + 6px)
}

.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    url("frame/corner-tl.png") no-repeat left calc(var(--u) * -4) top calc(var(--u) * -3) / calc(var(--u) * 221) calc(var(--u) * 234),
    url("frame/corner-tr.png") no-repeat right calc(var(--u) * -4) top calc(var(--u) * -3) / calc(var(--u) * 221) calc(var(--u) * 234),
    url("frame/corner-bl.png") no-repeat left calc(var(--u) * -4) bottom calc(var(--u) * -3) / calc(var(--u) * 231) calc(var(--u) * 236),
    url("frame/corner-br.png") no-repeat right calc(var(--u) * -4) bottom calc(var(--u) * -3) / calc(var(--u) * 234) calc(var(--u) * 236),
    url("frame/center.png") no-repeat 50% calc(100% + var(--u) * 136) / calc(var(--u) * 640) calc(var(--u) * 324),
    url("frame/arc-l.png") no-repeat left 0 bottom 0 / calc(50% + var(--u) * 40) calc(var(--u) * 152),
    url("frame/arc-r.png") no-repeat right 0 bottom 0 / calc(50% + var(--u) * 40) calc(var(--u) * 148)
}

/* layar < 1280px: pojok atas ikut membesar relatif terhadap card, beri ruang di atas agar tidak menimpa card */
@media (max-width: 1279px) {
  .auth-page {
    padding-top: calc(var(--u) * 236 + 6px)
  }
}

.auth-card,
.auth-card-single {
  position: relative;
  z-index: 1
}

/* isi form rata atas (tinggi card tetap = form Daftar, sehingga animasi slide mulus) */
.auth-pane {
  justify-content: flex-start
}

/* form Daftar lebih ringkas di desktop */
@media (min-width: 861px) {
  .form-panel {
    padding: 24px 30px
  }

  .tabs {
    margin-bottom: 14px
  }

  .auth-card .field,
  .auth-card-single .field {
    margin-bottom: 9px
  }

  .auth-card .field input,
  .auth-card-single .field input {
    padding: 8px 12px
  }

  .auth-card .field label {
    margin-bottom: 3px
  }

  .auth-card .pane-subtitle {
    margin-bottom: 12px
  }

  .auth-footer {
    margin-top: 12px
  }
}

/* layar desktop pendek (laptop kecil): ringkaskan lagi supaya form Daftar tetap muat tanpa scroll */
@media (min-width: 861px) and (max-height: 800px) {
  .form-panel {
    padding: 16px 28px
  }

  .tabs {
    margin-bottom: 10px
  }

  .tab-btn {
    padding: 6px
  }

  .auth-card .field,
  .auth-card-single .field {
    margin-bottom: 6px
  }

  .auth-card .field label {
    font-size: 12px;
    margin-bottom: 2px
  }

  .auth-card .field input {
    padding: 6px 11px;
    font-size: 13px
  }

  .auth-card .pane-title {
    font-size: 19px
  }

  .auth-card .pane-subtitle {
    font-size: 12.5px;
    margin-bottom: 8px
  }

  .auth-card .btn-primary {
    padding: 8px 16px
  }

  .auth-footer {
    margin-top: 8px
  }

  .brand-panel {
    padding: 22px 26px
  }
}

/* ---------- logo tanpa kotak putih + sidebar admin ---------- */
.sidebar-header {
  gap: 6px;
  padding: 18px 14px
}

.sidebar-header .logo-tile {
  width: 52px;
  height: 52px;
  background: transparent;
  border-radius: 0
}

.sidebar-header .logo-tile img {
  width: 46px;
  height: 46px
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center
}

.sidebar-title {
  margin: 0;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap
}

.sidebar-credit .logo-tile {
  background: transparent
}

/* kolom sidebar sudah "dipesan" sejak awal agar layout tidak melompat / sidebar tidak hilang saat pindah halaman */
@media (min-width: 768px) {
  #sidebar-root {
    flex: 0 0 272px;
    min-height: 100vh;
    background: #c98a2f
  }
}

/* Tombol kecil untuk membuka file KTM di halaman Konfirmasi Pendaftaran */
.btn-link {
  background: none;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85em;
  cursor: pointer;
  color: inherit;
}

.btn-link:hover {
  opacity: 0.8;
}

.btn-link:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ---------- BINGKAI ORNAMEN panggung Hasil Voting (admin/hasil-voting.html) ----------
   Memakai 7 gambar yang sama dengan bingkai halaman login (folder css/frame/), tetapi dipasang di
   dalam PANGGUNG peragaan (.hv-stage), bukan di halaman admin. Ikut tampil saat layar penuh.
   Ukuran bingkai mengikuti LEBAR PANGGUNG (bukan lebar layar), karena panggung lebih sempit dari
   layar di mode biasa dan selebar layar di mode layar penuh.
   Ubah --hv-frame-scale untuk membesarkan/mengecilkan seluruh bingkai (bawaan .75 = sama seperti login). */
.hv-stage {
  --hv-frame-scale: .75;
  --u: clamp(.2px, calc(100cqw / 1920 * var(--hv-frame-scale)), 1.2px);
  container-type: inline-size
}

/* peramban lama tanpa container query: pakai lebar layar */
@supports not (width: 1cqw) {
  .hv-stage {
    --u: clamp(.2px, calc(100vw / 1920 * var(--hv-frame-scale)), 1.2px)
  }
}

.hv-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    url("frame/corner-tl.png") no-repeat left calc(var(--u) * -4) top calc(var(--u) * -3) / calc(var(--u) * 221) calc(var(--u) * 234),
    url("frame/corner-tr.png") no-repeat right calc(var(--u) * -4) top calc(var(--u) * -3) / calc(var(--u) * 221) calc(var(--u) * 234),
    url("frame/corner-bl.png") no-repeat left calc(var(--u) * -4) bottom calc(var(--u) * -3) / calc(var(--u) * 231) calc(var(--u) * 236),
    url("frame/corner-br.png") no-repeat right calc(var(--u) * -4) bottom calc(var(--u) * -3) / calc(var(--u) * 234) calc(var(--u) * 236),
    url("frame/center.png") no-repeat 50% calc(100% + var(--u) * 136) / calc(var(--u) * 640) calc(var(--u) * 324),
    url("frame/arc-l.png") no-repeat left 0 bottom 0 / calc(50% + var(--u) * 40) calc(var(--u) * 152),
    url("frame/arc-r.png") no-repeat right 0 bottom 0 / calc(50% + var(--u) * 40) calc(var(--u) * 148)
}

/* sisakan ruang di bawah grafik agar batang tidak menimpa lengkung & ornamen tengah bawah */
.hv-chart {
  margin-bottom: calc(var(--u) * 191 + 6px)
}

/* tombol "Putar ulang" & "Layar penuh" digeser ke dalam supaya tidak menumpuk di atas ornamen pojok */
.hv-replay {
  left: calc(var(--u) * 232 + 8px)
}

.hv-fs {
  right: calc(var(--u) * 232 + 8px)
}

/* =========================================================
   TEMA EMAS: teks putih di atas gradient emas #B57429 -> #8C5A1E (versi gelap dari desain awal).
   Bayangan tipis berwarna coklat emas (#6B430E) membantu keterbacaan teks kecil.
   ========================================================= */

/* ---- panel emas di card login ---- */
.brand-eyebrow {
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 2px rgba(139, 86, 16, .55)
}

.brand-title {
  color: #fff;
  text-shadow: 0 1px 3px rgba(139, 86, 16, .5)
}

.brand-description {
  color: rgba(255, 255, 255, .95);
  text-shadow: 0 1px 2px rgba(139, 86, 16, .5)
}

.brand-footer {
  color: rgba(255, 255, 255, .88);
  text-shadow: 0 1px 2px rgba(139, 86, 16, .5)
}

.brand-panel .gold-rule {
  background: #fff
}

/* ---- sidebar admin ---- */
.sidebar {
  color: #fff;
  border-right: 2px solid var(--gold-edge)
}

.sidebar-eyebrow {
  color: rgba(255, 255, 255, .9)
}

.sidebar-title {
  color: #fff;
  text-shadow: 0 1px 3px rgba(139, 86, 16, .5);
  text-align: left
}

.sidebar-rule {
  background: rgba(255, 255, 255, .35)
}

.sidebar-link {
  color: rgba(255, 255, 255, .95);
  text-shadow: 0 1px 2px rgba(139, 86, 16, .45)
}

.sidebar-link:hover {
  background: rgba(139, 86, 16, .28);
  color: #fff
}

.sidebar-link.active {
  background: var(--gold-edge);
  color: #fff;
  text-shadow: none
}

.sidebar-link.active svg {
  color: #fff
}

.sidebar-credit {
  background: rgba(139, 86, 16, .3)
}

.sidebar-credit p {
  color: #fff
}

.sidebar-logout {
  border-color: rgba(255, 255, 255, .6);
  color: #fff
}

.sidebar-logout:hover {
  background: var(--gold-edge);
  border-color: var(--gold-edge);
  color: #fff
}

/* ---- logo SMFT dihapus dari header sidebar (tinggal logo HMTI + judul, rata kiri) ---- */
.sidebar-header .logo-tile:has(img[src*="smft" i]) {
  display: none
}

.sidebar-brand {
  justify-content: flex-start;
  text-align: left
}

/* logo di panel emas halaman login (index & admin): tanpa kotak/border putih, logo transparan langsung di atas gradient */
.brand-panel .brand-logo {
  padding: 0;
  background: none;
  border-radius: 0
}


/* ---------- Tombol mata (lihat/sembunyikan password) di form login & daftar ---------- */
.password-wrap {
  position: relative
}

.auth-card .field .password-wrap input,
.field .password-wrap input {
  padding-right: 44px
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: color .2s, background .2s
}

.toggle-password:hover {
  color: var(--ink);
  background: rgba(27, 28, 28, .06)
}

.toggle-password[aria-pressed="true"] {
  color: var(--brown)
}

/* =========================================================
   HALAMAN TRANSAKSI (admin/transaksi.html)
   ========================================================= */
.trx-wallets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 22px
}

.trx-wallet {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--mist);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: 0 20px 40px -34px rgba(70, 40, 20, .5)
}

.trx-wallet.ok {
  border-left-color: #2f9e5b
}

.trx-wallet.warn {
  border-left-color: var(--amber)
}

.trx-wallet.bad {
  border-left-color: #b91c1c
}

.trx-wallet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px
}

.trx-wallet-name {
  font-size: 16px;
  font-weight: 600
}

.trx-wallet-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted)
}

.trx-wallet-balance {
  margin: 14px 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink)
}

.trx-wallet-addr {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all
}

.trx-wallet-addr a {
  text-decoration: underline;
  text-underline-offset: 2px
}

.trx-wallet-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--espresso)
}

.trx-wallet-warn {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: #8a1c14
}

.trx-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--paper);
  color: var(--muted)
}

.trx-badge.ok {
  background: #dcfce7;
  color: #166534
}

.trx-badge.warn {
  background: #fff0d6;
  color: #8d5815
}

.trx-badge.bad {
  background: #fdecea;
  color: #8a1c14
}

.trx-badge.admin {
  background: #ece6f7;
  color: #4b2e83
}

.trx-badge.relayer {
  background: #e3eefb;
  color: #1d4f91
}

.trx-table td {
  font-size: 13px;
  white-space: nowrap
}

.trx-table a {
  text-decoration: underline;
  text-underline-offset: 2px
}

.trx-num {
  text-align: right;
  font-variant-numeric: tabular-nums
}

.trx-more {
  margin-top: 16px;
  text-align: center
}