/* ============================================================
   DataVault Components CSS
   ============================================================ */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm); font-weight: 600;
  transition: var(--transition-fast);
  cursor: pointer; border: none;
  white-space: nowrap; text-decoration: none;
  user-select: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-medium), var(--gold-dark));
  color: white; box-shadow: var(--shadow-gold);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-dark), #A07800);
  transform: translateY(-1px); box-shadow: 0 6px 24px rgba(217,154,0,0.35);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-outline {
  background: transparent; color: var(--gold-dark);
  border: 2px solid var(--gold-medium);
}
.btn-outline:hover:not(:disabled) { background: var(--gold-pale); }

.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-section); color: var(--text-body); }

.btn-secondary {
  background: var(--bg-section); color: var(--text-dark);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border-light); border-color: var(--text-muted); }

.btn-danger {
  background: var(--error); color: white;
}
.btn-danger:hover:not(:disabled) { background: #DC2626; transform: translateY(-1px); }

.btn-success {
  background: var(--success); color: white;
}
.btn-success:hover:not(:disabled) { background: #059669; }

.btn-sm {
  padding: 6px var(--space-3);
  font-size: var(--font-size-xs); border-radius: var(--radius-xs);
}
.btn-lg {
  padding: var(--space-3) var(--space-8);
  font-size: var(--font-size-base); border-radius: var(--radius-md);
}
.btn-xl {
  padding: var(--space-4) var(--space-10);
  font-size: var(--font-size-lg); border-radius: var(--radius-md);
}
.btn-block { width: 100%; }
.btn-pill  { border-radius: var(--radius-pill); }

/* Loading spinner inside btn */
.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   INPUTS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: var(--space-1); }
.form-label {
  font-size: var(--font-size-sm); font-weight: 500;
  color: var(--text-dark);
}
.form-label span.required { color: var(--error); margin-left: 2px; }

.form-input, .form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-body);
  background: var(--bg-white);
  transition: var(--transition-fast);
}
.form-input:focus, .form-control:focus {
  outline: none; border-color: var(--gold-medium);
  box-shadow: 0 0 0 3px rgba(230,168,23,0.12);
}
.form-input::placeholder, .form-control::placeholder { color: var(--text-light); }
.form-input.error { border-color: var(--error); }
.form-input.success { border-color: var(--success); }

.input-wrapper { position: relative; }
.input-wrapper .input-icon-left {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-light); pointer-events: none;
}
.input-wrapper .input-icon-right {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-light); cursor: pointer;
}
.input-wrapper .form-input.has-icon-left  { padding-left: 40px; }
.input-wrapper .form-input.has-icon-right { padding-right: 40px; }

.form-error { font-size: var(--font-size-xs); color: var(--error); margin-top: 2px; }
.form-hint  { font-size: var(--font-size-xs); color: var(--text-light); margin-top: 2px; }

.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-body);
  background: var(--bg-white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.form-select:focus { outline: none; border-color: var(--gold-medium); box-shadow: 0 0 0 3px rgba(230,168,23,0.12); }

.form-textarea {
  resize: vertical; min-height: 90px;
}

/* Checkbox */
.form-check {
  display: flex; align-items: center; gap: var(--space-2);
  cursor: pointer; font-size: var(--font-size-sm);
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--gold-main);
}

/* Toggle */
.toggle {
  position: relative; display: inline-block;
  width: 44px; height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: var(--radius-pill);
  transition: var(--transition-fast);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-xs);
}
.toggle input:checked + .toggle-slider { background: var(--gold-main); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  overflow: hidden;
}
.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title  { font-size: var(--font-size-base); font-weight: 600; color: var(--text-dark); }
.card-body   { padding: var(--space-6); }
.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  background: var(--bg-section);
}

.card-stat {
  padding: var(--space-6);
  position: relative; overflow: hidden;
}
.card-stat .stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: var(--space-3);
}
.card-stat .stat-value {
  font-size: var(--font-size-2xl); font-weight: 700; color: var(--text-dark);
  line-height: 1;
}
.card-stat .stat-label { font-size: var(--font-size-sm); color: var(--text-muted); margin-top: var(--space-1); }
.card-stat .stat-change {
  font-size: var(--font-size-xs); font-weight: 500; margin-top: var(--space-2);
  display: flex; align-items: center; gap: 4px;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--error); }

/* Gradient stat cards */
.card-gold {
  background: linear-gradient(135deg, var(--gold-medium), var(--gold-dark));
  color: white; border: none;
}
.card-gold .stat-value,
.card-gold .stat-label,
.card-gold .card-title { color: white; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs); font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-gold    { background: var(--gold-pale); color: var(--gold-dark); }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-error   { background: var(--error-bg); color: var(--error-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-info    { background: var(--info-bg); color: var(--info-text); }
.badge-gray    { background: var(--bg-section); color: var(--text-muted); }
.badge-primary { background: linear-gradient(135deg, var(--gold-medium), var(--gold-dark)); color: white; }

.badge-dot::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor;
  display: inline-block;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  width: 100%; overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.table {
  width: 100%; border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.table thead tr { background: var(--bg-section); }
.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left; font-weight: 600;
  color: var(--text-muted); font-size: var(--font-size-xs);
  text-transform: uppercase; letter-spacing: 0.05em;
  white-space: nowrap;
}
.table td {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-light);
  color: var(--text-body); vertical-align: middle;
}
.table tbody tr:hover { background: var(--gold-ultra); }
.table-striped tbody tr:nth-child(even) { background: var(--bg-section); }

/* ---- Penyeragaman semua tabel (halaman pengguna & panel admin) ----
   Tabel di aplikasi ini ditulis dengan tiga kelas berbeda (.table,
   .admin-table, .trash-table) dan tampilannya jadi tidak konsisten.
   Blok berikut menyatukan tinggi baris, garis, hover, dan perilaku
   saat kolomnya lebih lebar dari layar. */
.table,
.admin-table,
.trash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

/* ============================================================
   BARIS DATA BRANKAS (Data Pribadi)
   ============================================================
   Ditaruh di berkas bersama dan diawali `body` agar menang atas blok
   <style> di data-pribadi.html. Aturan ini menangani DUA bentuk markup:
   struktur lama (label & nilai sebaris) maupun struktur baru
   (.vault-row-main + .vault-row-actions), sehingga nilai panjang seperti
   alamat email atau password tidak pernah terpotong di tepi kartu. */
body .vault-data-row {
  align-items: flex-start;
  gap: 8px;
}
/* Kartu tidak boleh melebihi lebar kolom gridnya */
body .vault-card { min-width: 0; overflow: hidden; }
/* Kepala kartu: judul panjang tidak boleh mendorong tombol aksi keluar.
   Judul dibiarkan menyusut & membungkus, sedangkan deretan tombol dikunci
   agar tidak ikut mengecil. Kalau ruangnya benar-benar sempit, tombolnya
   turun ke baris berikutnya, bukan terpotong di tepi kartu. */
body .vault-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
body .vault-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 60%;
  min-width: 0;
}
body .vault-header > div:first-child > div { min-width: 0; }
body .vault-header h4 {
  overflow-wrap: anywhere;
  line-height: 1.3;
}
body .vault-icon-badge { flex-shrink: 0; }

/* Deretan tombol aksi (favorit, unduh, bagikan, hapus) */
body .vault-header > div:last-child {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  gap: 2px;
}
body .vault-header > div:last-child .icon-btn {
  width: 30px; height: 30px; padding: 0; font-size: 15px;
}

/* Kunci anti-terpotong: tanpa min-width:0 sebuah anak flex/grid menolak
   menyusut di bawah lebar isinya, sehingga teks meluber keluar kartu. */
body .vault-data-row > * { min-width: 0; }

body .vault-val-text {
  display: block;
  overflow-wrap: anywhere;   /* boleh memutus di tengah kata panjang */
  word-break: break-word;
  white-space: pre-wrap;     /* spasi & baris baru pada catatan tetap utuh */
  line-height: 1.45;
}

/* Struktur lama: pembungkus nilai + tombol di sisi kanan */
body .vault-data-row > div:not(.vault-row-main):not(.vault-row-actions) {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Struktur baru */
body .vault-row-main    { min-width: 0; }
body .vault-row-actions { flex-shrink: 0; }

/* ------------------------------------------------------------
   CATATAN RAHASIA (teks panjang berparagraf)
   Dulu: kotak teks hanya setinggi 220px dan berdampingan dengan tombol
   mata/salin, sehingga sempit & terlihat "terpotong". Isi di database
   sebenarnya utuh. Sekarang: label di atas, kotak teks selebar kartu,
   tombol aksi di pojok kanan atas, tinggi lebih lega, dan bisa dibuka
   penuh lewat tombol "Tampilkan semua".
   ------------------------------------------------------------ */
body .vault-data-row.vault-row-note {
  position: relative;
  display: block;
}
body .vault-row-note .vault-row-main {
  display: block;
  width: 100%;
}
body .vault-row-note .vault-row-label {
  display: block;
  margin-bottom: 6px;
  padding-right: 84px;            /* sisakan ruang untuk tombol mata & salin */
}
body .vault-row-note .vault-row-actions {
  position: absolute;
  top: -4px;
  right: 0;
  display: flex;
  gap: 2px;
}
body .vault-row-note .vault-val-text {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  background: var(--bg-section, rgba(127,127,127,.08));
  border: 1px solid var(--border-light, rgba(127,127,127,.2));
  border-radius: var(--radius-md, 10px);
  max-height: min(55vh, 360px);   /* ringkas: tinggi terbatas, bisa digulir */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-family: inherit;           /* tidak lagi monospace sempit */
  font-size: var(--font-size-sm, 14px);
  line-height: 1.55;
}
/* Dibuka lewat tombol "Tampilkan semua" -> seluruh isi tampil tanpa kotak gulir */
body .vault-row-note .vault-val-text.is-expanded {
  max-height: none;
  overflow-y: visible;
}
/* Di jendela "Lihat Detail" (modal sudah punya gulir sendiri) */
body .modal .vault-row-note .vault-val-text {
  max-height: none;
  overflow-y: visible;
}
body .note-expand-btn {
  display: inline-block;
  margin: 6px 0 2px;
  padding: 6px 12px;
  border: 1px solid var(--border-light, rgba(127,127,127,.25));
  border-radius: 999px;
}

/* Yang digeser adalah pembungkus TABEL-nya, bukan seluruh kartu.
   Kalau kartunya sendiri yang di-scroll, baris judul kartu (mis. tombol
   "Lihat Semua") ikut bergeser dan posisinya jadi kacau.
   Diawali `body` agar menang atas `overflow: hidden` yang ditulis di blok
   <style> tiap halaman admin. */
body .table-wrapper,
body .table-scroll,
body .trash-table-card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* Kartu hanya perlu memotong sudut lengkungnya, tidak ikut menggeser */
body .admin-table-card { overflow: hidden; }

/* .table-scroll ditulis lokal hanya di sebagian halaman — didefinisikan
   di sini supaya tersedia di semua halaman tanpa kecuali.
   max-width:100% penting: tanpa itu pembungkusnya ikut melebar mengikuti
   tabel di dalamnya, sehingga scrollbar tidak pernah muncul dan kolom
   terakhir tetap terpotong. */
.table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Lebar minimum supaya kolom tidak dipaksa mengecil sampai teksnya
   terpotong-potong; kalau tidak muat, tabelnya digeser mendatar. */
.admin-table { min-width: 780px; }
.trash-table { min-width: 640px; }

/* Jaring pengaman: kalau ada tabel yang lupa dibungkus .table-scroll dan
   menjadi anak langsung .admin-table-card (yang overflow-nya hidden), ia
   akan terpotong tanpa scrollbar. Menjadikan tabelnya sendiri sebagai
   wadah geser membuat kolom terakhir tetap bisa dijangkau. */
body .admin-table-card > .admin-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table th,
.trash-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-section);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.admin-table td,
.trash-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-body);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td,
.trash-table tbody tr:last-child td { border-bottom: 0; }

.admin-table tbody tr,
.trash-table tbody tr { transition: background var(--transition-fast); }
.admin-table tbody tr:hover,
.trash-table tbody tr:hover { background: var(--bg-section); }

/* Kolom aksi: tombol tidak boleh terpotong atau turun baris */
.table td:last-child,
.admin-table td:last-child,
.trash-table td:last-child { white-space: nowrap; }

/* Beri jarak antar tombol dalam satu sel tanpa perlu margin inline */
.table td .btn + .btn,
.admin-table td .btn + .btn,
.trash-table td .btn + .btn { margin-left: 6px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  z-index: var(--z-modal); display: none;
  align-items: center; justify-content: center;
  padding: var(--space-4);
  pointer-events: none;
}
.modal-overlay.show,
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"],
.modal-overlay[style*="display: block"],
.modal-overlay[style*="display:block"] {
  display: flex !important;
  pointer-events: auto !important;
}
.modal-overlay .modal,
.modal-overlay > div,
.modal-overlay * {
  pointer-events: auto;
}
.modal-overlay[style*="display: none"],
.modal-overlay[style*="display:none"] {
  display: none !important;
  pointer-events: none !important;
}

.btn-google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 18px;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-pill);
  background: white;
  color: #1E293B;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  text-decoration: none;
  box-sizing: border-box;
}
.btn-google-login:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.btn-google-login:active {
  transform: translateY(0);
}

.modal {
  background: var(--bg-white); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title  { font-size: var(--font-size-lg); font-weight: 700; color: var(--text-dark); }
.modal-close  {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer;
  transition: var(--transition-fast);
}
.modal-close:hover { background: var(--bg-section); color: var(--text-dark); }
.modal-body   { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: var(--space-3);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed; top: var(--space-5); right: var(--space-5);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--space-2);
  pointer-events: none;
}
.toast {
  background: var(--bg-white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  display: flex; align-items: center; gap: var(--space-3);
  min-width: 300px; max-width: 420px;
  pointer-events: all; animation: toastIn 0.3s ease;
  font-size: var(--font-size-sm);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(100%); }
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title   { font-weight: 600; color: var(--text-dark); }
.toast-message { color: var(--text-muted); font-size: var(--font-size-xs); margin-top: 1px; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info    { border-left: 4px solid var(--info); }

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  min-width: 180px; z-index: var(--z-dropdown);
  display: none; overflow: hidden;
  animation: dropIn 0.15s ease;
}
.dropdown-menu.show { display: block; }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm); color: var(--text-body);
  cursor: pointer; transition: var(--transition-fast);
}
.dropdown-item:hover { background: var(--bg-section); }
.dropdown-item.danger { color: var(--error); }
.dropdown-item.danger:hover { background: var(--error-bg); }
.dropdown-divider { height: 1px; background: var(--border-light); margin: var(--space-1) 0; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-wrapper { width: 100%; }
.progress-bar-bg {
  width: 100%; height: 8px;
  background: var(--border-light); border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--gold-medium), var(--gold-dark));
  transition: width 0.6s ease;
}
.progress-bar-fill.danger { background: linear-gradient(90deg, var(--warning), var(--error)); }
.progress-bar-fill.success { background: linear-gradient(90deg, #34D399, var(--success)); }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: var(--font-size-xs); color: var(--text-muted);
  margin-bottom: var(--space-1);
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.skeleton-text  { height: 14px; margin-bottom: var(--space-2); }
.skeleton-title { height: 20px; margin-bottom: var(--space-2); }
.skeleton-card  { height: 120px; border-radius: var(--radius-lg); }
.skeleton-avatar{ width: 40px; height: 40px; border-radius: 50%; }

/* Skeleton kartu file (dipakai di dokumen/foto/video saat data sedang dimuat) */
.doc-card-skeleton {
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light); padding: var(--space-5);
  box-shadow: var(--shadow-card);
}
.doc-card-skeleton .skeleton-thumb { width: 100%; height: 90px; margin-bottom: var(--space-3); border-radius: var(--radius-md); }

/* Loader baris kecil untuk infinite scroll ("memuat lebih banyak...") */
.infinite-scroll-loader {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-6) 0; color: var(--text-muted); font-size: var(--font-size-sm);
}

/* ============================================================
   THEME TOGGLE (Dark Mode)
   ============================================================ */
.theme-toggle-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-section); color: var(--text-muted);
  font-size: 18px; cursor: pointer; transition: var(--transition-fast);
  border: 1px solid transparent;
}
.theme-toggle-btn:hover { background: var(--border-light); color: var(--text-dark); }

/* ============================================================
   DRAG & DROP UPLOAD ZONE
   ============================================================ */
.page-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-section);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  cursor: pointer;
  transition: var(--transition-fast);
}
/* Versi ringkas untuk dipakai di dalam modal (Tambah Data di Dashboard) */
.page-dropzone.dropzone-compact {
  padding: var(--space-5);
  margin-bottom: var(--space-2);
}
.page-dropzone.dragover {
  border-color: var(--gold-main);
  background: var(--gold-pale);
  color: var(--gold-dark);
}
.page-dropzone .dz-icon { font-size: 28px; margin-bottom: var(--space-2); }
.page-dropzone input[type="file"] { display: none; }

/* ============================================================
   LIGHTBOX (preview foto full-size)
   ============================================================ */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.88);
  display: none; align-items: center; justify-content: center;
  z-index: var(--z-modal); padding: var(--space-6);
}
.lightbox-overlay.show { display: flex; }
.lightbox-overlay img {
  max-width: 100%; max-height: 90vh; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); animation: modalIn 0.2s ease;
}
.lightbox-close {
  position: absolute; top: var(--space-5); right: var(--space-5);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-caption {
  position: absolute; bottom: var(--space-6); left: 0; right: 0;
  text-align: center; color: #fff; font-size: var(--font-size-sm); opacity: 0.85;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: var(--space-16) var(--space-8);
  text-align: center;
}
.empty-state-icon { font-size: 64px; margin-bottom: var(--space-4); opacity: 0.4; }
.empty-state-title { font-size: var(--font-size-xl); font-weight: 600; color: var(--text-dark); margin-bottom: var(--space-2); }
.empty-state-desc  { color: var(--text-muted); font-size: var(--font-size-sm); max-width: 320px; margin-bottom: var(--space-6); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; align-items: center; gap: var(--space-1);
  justify-content: center;
}
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: var(--font-size-sm);
  cursor: pointer; transition: var(--transition-fast);
  border: 1px solid var(--border); color: var(--text-muted);
  background: var(--bg-white);
}
.page-btn:hover  { background: var(--gold-pale); border-color: var(--gold-light); color: var(--gold-dark); }
.page-btn.active { background: var(--gold-main); border-color: var(--gold-main); color: white; font-weight: 600; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; border-bottom: 2px solid var(--border-light); gap: 0; }
.tab-btn {
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-sm); font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--transition-fast); background: none; border-top: none; border-left: none; border-right: none;
}
.tab-btn:hover  { color: var(--gold-dark); }
.tab-btn.active { color: var(--gold-dark); border-bottom-color: var(--gold-main); font-weight: 600; }

.tab-content    { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   FILE UPLOADER
   ============================================================ */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-10) var(--space-8);
  text-align: center; cursor: pointer;
  transition: var(--transition-fast);
  background: var(--bg-section);
}
.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--gold-medium);
  background: var(--gold-ultra);
}
.file-drop-zone .drop-icon { font-size: 40px; opacity: 0.5; margin-bottom: var(--space-3); }

/* ============================================================
   NOTIFICATION PANEL
   ============================================================ */
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 340px; background: var(--bg-white);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); z-index: var(--z-dropdown);
  display: none; overflow: hidden;
}
.notif-panel.show { display: block; }
.notif-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
}
.notif-item {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: var(--transition-fast);
  display: flex; gap: var(--space-3);
}
.notif-item:hover { background: var(--gold-ultra); }
.notif-item.unread { background: var(--gold-ultra); }
.notif-item:last-child { border-bottom: none; }

/* ============================================================
   AVATAR GROUP
   ============================================================ */
.avatar {
  border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, var(--gold-main), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 600; font-size: var(--font-size-sm);
  flex-shrink: 0;
}
.avatar-sm  { width: 32px; height: 32px; font-size: var(--font-size-xs); }
.avatar-md  { width: 40px; height: 40px; }
.avatar-lg  { width: 56px; height: 56px; font-size: var(--font-size-xl); }
.avatar-xl  { width: 80px; height: 80px; font-size: var(--font-size-2xl); }

/* ============================================================
   SECTION DIVIDERS
   ============================================================ */
.section-divider {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--text-light); font-size: var(--font-size-sm); margin: var(--space-4) 0;
}
.section-divider::before,
.section-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ============================================================
   GOLD HIGHLIGHT
   ============================================================ */
.highlight-gold {
  background: linear-gradient(135deg, var(--gold-medium), var(--gold-dark));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   CATEGORY CARD
   ============================================================ */
.category-card {
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light); padding: var(--space-5);
  cursor: pointer; transition: var(--transition-normal);
  box-shadow: var(--shadow-card); position: relative;
}
.category-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md);
  border-color: var(--gold-light);
}
.category-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: var(--space-3);
}
.category-actions {
  position: absolute; top: var(--space-3); right: var(--space-3);
  display: flex; gap: 4px; z-index: 2;
}
/* Tombol aksi (bagikan/edit/hapus) SELALU tampil — sebelumnya hanya muncul saat
   :hover sehingga tidak pernah terlihat di layar sentuh (HP/tablet). Selector
   dibuat lebih spesifik agar tidak tertimpa .btn-sm di modern.css. */
.category-card .category-actions .btn {
  flex: 0 0 auto; width: 32px; height: 32px; min-height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  background: var(--bg-section); border: 1px solid var(--border-light);
  border-radius: var(--radius-xs, 8px);
  -webkit-tap-highlight-color: transparent;
}
.category-card .category-actions .btn:hover:not(:disabled),
.category-card .category-actions .btn:focus-visible {
  background: var(--gold-ultra); border-color: var(--gold-light);
}
.category-card .category-actions .btn:last-child:hover:not(:disabled),
.category-card .category-actions .btn:last-child:focus-visible {
  background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.45);
}

/* Tampilan HP: kartu hanya ~160px lebar, jadi tiga tombol di pojok kanan atas
   akan menabrak ikon kategori. Pindahkan ke baris tersendiri di bagian bawah
   kartu dengan area sentuh yang lebih besar. */
@media (max-width: 640px) {
  .category-card { display: flex; flex-direction: column; min-width: 0; padding: var(--space-4); }
  .category-card .category-actions {
    position: static; order: 99; display: grid;
    grid-template-columns: repeat(3, 1fr); gap: var(--space-2);
    margin-top: var(--space-3); padding-top: var(--space-3);
    border-top: 1px solid var(--border-light);
  }
  .category-card .category-actions .btn { width: 100%; height: 40px; min-height: 40px; font-size: 17px; }
}

/* ============================================================
   QUICK ACTION CARDS
   ============================================================ */
.quick-action {
  background: var(--bg-white); border-radius: var(--radius-md);
  border: 1px solid var(--border-light); padding: var(--space-4);
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-2); cursor: pointer; transition: var(--transition-fast);
  text-align: center; box-shadow: var(--shadow-card);
}
.quick-action:hover {
  border-color: var(--gold-light); background: var(--gold-ultra);
  transform: translateY(-2px);
}
.quick-action-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--gold-pale); color: var(--gold-dark);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.quick-action-label { font-size: var(--font-size-xs); font-weight: 500; color: var(--text-body); }

/* ============================================================
   ACTIVITY ITEM
   ============================================================ */
.activity-item {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold-pale); display: flex; align-items: center;
  justify-content: center; font-size: 16px; flex-shrink: 0;
}
.activity-info { flex: 1; }
.activity-title { font-size: var(--font-size-sm); font-weight: 500; color: var(--text-dark); }
.activity-time  { font-size: var(--font-size-xs); color: var(--text-light); margin-top: 2px; }

/* ============================================================
   DOCUMENT ITEM
   ============================================================ */
.doc-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: var(--transition-fast);
}
.doc-item:hover { background: var(--gold-ultra); }
.doc-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: var(--bg-section); flex-shrink: 0;
}
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: var(--font-size-sm); font-weight: 500; color: var(--text-dark); }
.doc-meta { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 1px; }

/* ============================================================
   PACKAGE CARD (Pricing)
   ============================================================ */
.package-card {
  background: var(--bg-white); border-radius: var(--radius-xl);
  border: 2px solid var(--border-light); padding: var(--space-8);
  text-align: center; transition: var(--transition-normal);
  position: relative; box-shadow: var(--shadow-card);
}
.package-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.package-card.popular {
  border-color: var(--gold-medium);
  box-shadow: var(--shadow-gold);
}
.package-card.popular::before {
  content: '⭐ Populer';
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold-medium), var(--gold-dark));
  color: white; padding: 4px 16px; border-radius: var(--radius-pill);
  font-size: var(--font-size-xs); font-weight: 600;
}
.package-card.current { border-color: var(--success); }
.package-name  { font-size: var(--font-size-xl); font-weight: 700; color: var(--text-dark); }
.package-price { font-size: var(--font-size-3xl); font-weight: 800; color: var(--gold-dark); margin: var(--space-2) 0; }
.package-storage { font-size: var(--font-size-2xl); font-weight: 700; color: var(--text-dark); }
.package-period { font-size: var(--font-size-xs); color: var(--text-muted); }
.package-features { text-align: left; margin: var(--space-6) 0; list-style: none; }
.package-features li {
  padding: var(--space-1) 0; font-size: var(--font-size-sm);
  color: var(--text-body); display: flex; align-items: center; gap: var(--space-2);
}
.package-features li::before { content: '✓'; color: var(--success); font-weight: 700; }

/* ============================================================
   SEARCH BAR (standalone)
   ============================================================ */
.search-bar {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--bg-white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3);
  transition: var(--transition-fast);
}
.search-bar:focus-within { border-color: var(--gold-medium); box-shadow: 0 0 0 3px rgba(230,168,23,0.12); }
.search-bar input {
  border: none; outline: none; background: none;
  font-size: var(--font-size-sm); flex: 1; color: var(--text-body);
}
.search-bar input::placeholder { color: var(--text-light); }

/* ============================================================
   CHART CONTAINER
   ============================================================ */
.chart-wrapper {
  position: relative; width: 100%;
}
.chart-wrapper canvas { max-width: 100%; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.filter-chip {
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: var(--bg-white);
  font-size: var(--font-size-sm); font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: var(--transition-fast);
}
.filter-chip:hover { border-color: var(--gold-light); color: var(--gold-dark); background: var(--gold-ultra); }
.filter-chip.active { border-color: var(--gold-main); background: var(--gold-pale); color: var(--gold-dark); font-weight: 600; }

/* ============================================================
   CONFIRM DIALOG (special modal)
   ============================================================ */
.confirm-dialog { max-width: 380px; }
.confirm-dialog .modal-body { text-align: center; padding: var(--space-8); }
.confirm-dialog .modal-footer { justify-content: center; }
.confirm-icon { font-size: 48px; margin-bottom: var(--space-4); }
.confirm-title { font-size: var(--font-size-xl); font-weight: 700; margin-bottom: var(--space-2); }
.confirm-msg   { font-size: var(--font-size-sm); color: var(--text-muted); }

/* ============================================================
   ICON PICKER
   ============================================================ */
.icon-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: var(--space-1); max-height: 250px; overflow-y: auto;
  padding: 2px; -webkit-overflow-scrolling: touch;
}
.icon-grid .icon-option { justify-self: center; }
.icon-search { width: 100%; margin-bottom: var(--space-2); }
.icon-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.icon-tab {
  flex: 0 0 auto; border: 1px solid var(--border-light); background: var(--bg-white);
  color: var(--text-body); border-radius: 999px; padding: 5px 12px;
  font-size: var(--font-size-xs); font-family: inherit; cursor: pointer; white-space: nowrap;
}
.icon-tab:hover { border-color: var(--gold-light); }
.icon-tab.active { background: var(--gold-pale); border-color: var(--gold-main); color: var(--text-dark); font-weight: 600; }
.icon-custom-row { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.icon-custom-row .form-input { width: 84px; text-align: center; font-size: 20px; flex-shrink: 0; }
.icon-custom-row .text-xs { line-height: 1.4; }

/* ---- Pindahkan ke kategori lain (MoveUI) ---- */
.move-list { display: grid; gap: var(--space-2); max-height: 50vh; overflow-y: auto; margin: var(--space-3) 0; }
.move-opt {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3);
  border: 1px solid var(--border-light); border-radius: var(--radius-md);
  cursor: pointer; background: var(--bg-white); transition: var(--transition-fast);
}
.move-opt:hover { background: var(--bg-section); border-color: var(--gold-light); }
.move-opt.selected { border-color: var(--gold-main); background: var(--gold-ultra, #FFFBEB); }
.move-opt.disabled { opacity: .5; cursor: not-allowed; }
.move-opt input { width: 18px; height: 18px; flex-shrink: 0; }
.move-ico { width: 38px; height: 38px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.move-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.move-text strong { font-size: var(--font-size-sm); color: var(--text-dark); overflow-wrap: anywhere; }
.move-text small { font-size: var(--font-size-xs); color: var(--text-muted); }

/* ---- Pilih berkas di detail kategori ---- */
.cat-move-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-2) var(--space-3); background: var(--bg-section); border-radius: var(--radius-md); margin-bottom: var(--space-2);
}
.cat-sel-all { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-sm); cursor: pointer; }
.cat-sel-all input, .cat-file-chk { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; }
@media (max-width: 480px) {
  .cat-move-bar .btn { width: 100%; justify-content: center; }
}
.icon-option {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer; border: 2px solid transparent;
  transition: var(--transition-fast);
}
.icon-option:hover  { background: var(--gold-pale); }
.icon-option.selected { border-color: var(--gold-main); background: var(--gold-pale); }

/* ============================================================
   COLOR PICKER
   ============================================================ */
.color-grid {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
}
.color-option {
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; border: 3px solid transparent;
  transition: var(--transition-fast);
}
.color-option:hover   { transform: scale(1.1); }
.color-option.selected { border-color: var(--text-dark); box-shadow: 0 0 0 2px white inset; }

/* ============================================================
   LOGIN / AUTH LAYOUT
   ============================================================ */
.auth-layout {
  min-height: 100vh;
  display: flex;
}
.auth-left {
  flex: 1; background: linear-gradient(135deg, #FFF8E1, #FFFDF7);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-8); position: relative; overflow: hidden;
}
.auth-right {
  width: 480px; flex-shrink: 0;
  background: var(--bg-white); display: flex; align-items: center;
  justify-content: center; padding: var(--space-8);
  box-shadow: var(--shadow-lg);
}
.auth-form { width: 100%; max-width: 380px; }
.auth-logo {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-8);
}
.auth-logo .logo-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold-medium), var(--gold-dark));
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  box-shadow: var(--shadow-gold);
}

@media (max-width: 768px) {
  .auth-left  { display: none; }
  .auth-right { width: 100%; }
}

/* ============================================================
   OTP EMAIL VERIFICATION — "SLOT" CARDS & SUCCESS SEAL
   ============================================================ */
.otp-slots {
  display: flex; gap: var(--space-3); justify-content: center;
  margin: var(--space-6) 0;
}
.slot {
  position: relative; width: 52px; height: 64px;
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-white); display: flex; align-items: center; justify-content: center;
  cursor: text; transition: border-color 0.2s ease, box-shadow 0.2s ease;
  /* pivot sits three heights BELOW the card, SO ONE rotation does the spread and the arc at once */
  transform-origin: 50% 320%;
}
.slot:focus-within {
  border-color: var(--gold-medium); box-shadow: 0 0 0 3px rgba(217,154,0,0.15);
}
.slot input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; margin: 0; text-align: center;
}
.slot__val {
  font-size: var(--font-size-2xl); font-weight: 800; color: var(--text-dark);
  pointer-events: none; line-height: 1;
}
.slot__spark {
  position: absolute; left: 8px; right: 8px; bottom: 9px; height: 4px;
  pointer-events: none; overflow: visible;
}
.slot__spark rect {
  /* the wait is not a verdict — garis hanya "terisi" saat digit diketik, netral saat kosong */
  fill: var(--gold-medium);
  transform-origin: 0 50%; transform: scaleX(0);
  transition: transform 0.25s ease;
}
.slot.filled .slot__spark rect { transform: scaleX(1); }
.slot.error { border-color: var(--error); animation: slotShake 0.4s ease; }
.slot.error .slot__spark rect { fill: var(--error); }

@keyframes slotShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.otp-seal {
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-4); width: 84px; height: 84px;
}
.otp-seal svg { width: 100%; height: 100%; }
.seal__ring {
  fill: none; stroke: var(--border-light); stroke-width: 4;
}
.seal__seq {
  fill: none; stroke: var(--clr, var(--success)); stroke-width: 4;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.6s ease 0.1s;
}
.otp-seal.show .seal__seq { stroke-dashoffset: 0; }

@media (max-width: 480px) {
  .slot { width: 44px; height: 56px; }
  .otp-slots { gap: var(--space-2); }
}

/* ============================================================
   ADMIN SIDEBAR OVERRIDES
   ============================================================ */
.sidebar.admin-sidebar .sidebar-logo .logo-icon {
  background: linear-gradient(135deg, #1E40AF, #1E3A8A);
  box-shadow: 0 4px 20px rgba(30,64,175,0.25);
}
.sidebar.admin-sidebar .sidebar-nav a.active,
.sidebar.admin-sidebar .nav-item.active {
  background: #EFF6FF; color: #1E40AF; border-right-color: #1E40AF;
}
.sidebar.admin-sidebar .sidebar-nav a:hover,
.sidebar.admin-sidebar .nav-item:hover { background: #EFF6FF; color: #1E40AF; }

/* ============================================================
   RESPONSIVE HELPERS
   ============================================================ */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .modal { max-height: 85vh; }
  .auth-right { padding: var(--space-6) var(--space-4); }
  .icon-grid  { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); max-height: 220px; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* ============================================================
   MENU KARTU (⋮) ANTI-TERPOTONG  — dipakai dokumen/foto/video/suara/
   catatan/data-pribadi. Saat dibuka, menu dipindah ke <body> oleh
   CardMenu di app.js, jadi tidak lagi ikut terpotong oleh
   .page-content { overflow-x: hidden } maupun tepi layar.
   ============================================================ */
.card-menu.card-menu-floating {
  position: fixed !important;
  z-index: 4000;
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.18));
}

/* Kartu tidak boleh memotong tombol ⋮ miliknya sendiri */
body .doc-card,
body .photo-card,
body .media-card,
body .note-card,
body .vault-card { overflow: visible; }

.card-menu-btn { flex-shrink: 0; }

/* Sasaran sentuh menu lebih lega di layar kecil */
@media (max-width: 768px) {
  .card-menu { min-width: 200px; }
  .card-menu-item { padding: var(--space-3); font-size: var(--font-size-sm); }
}

/* ============================================================
   DIALOG BERBAGI (ShareUI)
   ============================================================ */
.share-modal { max-width: 480px; width: 100%; }

.share-loading,
.share-error {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--space-3);
  padding: var(--space-6) 0; text-align: center;
}

.share-file-head {
  background: var(--bg-section); border-radius: var(--radius-md);
  padding: var(--space-3); margin-bottom: var(--space-4);
}
.share-file-name {
  font-weight: 600; color: var(--text-dark);
  overflow-wrap: anywhere; margin-bottom: 2px;
}

.share-link-row { display: flex; gap: var(--space-2); align-items: stretch; }
.share-link-row .form-input { flex: 1; min-width: 0; font-size: var(--font-size-sm); }
.share-link-row .btn { flex-shrink: 0; }

.share-divider {
  height: 1px; background: var(--border-light);
  margin: var(--space-4) 0;
}

.share-target-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2);
}
.share-target {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--space-3) var(--space-2); border-radius: var(--radius-md);
  border: 1px solid var(--border-light); background: var(--bg-white);
  font-size: var(--font-size-xs); color: var(--text-body);
  text-decoration: none; transition: var(--transition-fast);
}
.share-target:hover { background: var(--bg-section); border-color: var(--gold-light); }
.share-target-icon { font-size: 20px; line-height: 1; }

.share-extra {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  justify-content: center; margin-top: var(--space-4);
}
.share-extra .btn.danger { color: var(--error); }

.share-warn {
  background: var(--gold-pale, #FEF7E0); border: 1px solid var(--gold-light, #E6C36A);
  border-radius: var(--radius-md); padding: var(--space-3);
  font-size: var(--font-size-xs); color: var(--text-dark);
  margin-bottom: var(--space-4); line-height: 1.5;
}

.share-text-area {
  width: 100%; font-family: monospace; font-size: var(--font-size-xs);
  resize: vertical; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* Pilihan "bagikan seluruh kategori / semua berjudul sama" */
.share-scope-list { display: grid; gap: var(--space-2); }
.share-scope-btn {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left;
  padding: var(--space-3); border-radius: var(--radius-md); cursor: pointer;
  border: 1px solid var(--border-light); background: var(--bg-white);
  color: var(--text-body); font-family: inherit; transition: var(--transition-fast);
}
.share-scope-btn:hover { background: var(--bg-section); border-color: var(--gold-light); }
.share-scope-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.share-scope-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.share-scope-text strong { font-size: var(--font-size-sm); color: var(--text-dark); overflow-wrap: anywhere; }
.share-scope-text small { font-size: var(--font-size-xs); color: var(--text-muted); }

@media (max-width: 480px) {
  .share-link-row { flex-direction: column; }
  .share-link-row .btn { width: 100%; justify-content: center; }
  .share-extra .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   BUKA TAUTAN BERBAGI (ShareImport)
   ============================================================ */
.si-error {
  margin-top: var(--space-2); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md); background: var(--error-bg);
  color: var(--error-text); font-size: var(--font-size-xs); line-height: 1.5;
}
.si-preview {
  margin-bottom: var(--space-4); border-radius: var(--radius-md);
  overflow: hidden; background: var(--bg-section); max-height: 45vh;
}
.si-preview img { display: block; width: 100%; max-height: 45vh; object-fit: contain; }
.si-preview iframe { display: block; width: 100%; height: 45vh; border: 0; background: #fff; }
.si-actions {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  justify-content: center; align-items: center;
}
@media (max-width: 480px) {
  .si-actions .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   GULP — TOMBOL HAPUS YANG MEMAKAN LABELNYA SENDIRI
   Dipakai otomatis oleh Modal.confirm() untuk semua aksi hapus
   (desktop dan mobile memakai markup yang sama).
   ============================================================ */

/* --p didaftarkan supaya ENGINE yang menginterpolasi ketinggian
   isi tong. Tidak ada requestAnimationFrame sama sekali. */
@property --p {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.gulp {
  --p: 0;
  --h: 42px;
  --fx-l: 0px;
  --fx-r: 0px;
  --rr: 999px;
  --e-out: cubic-bezier(.22, 1, .36, 1);
  --t-fun: 260ms;
  --skin-1: var(--error, #EF4444);
  --skin-2: #C81E1E;
  --ink: #FFFFFF;
  --ring-off: 234;

  display: inline-block;
  position: relative;
  vertical-align: middle;
  line-height: 0;
  transition: --p .34s var(--e-out);
}

.gulp__body {
  position: relative;
  display: inline-block;
  height: var(--h);
  isolation: isolate;
}

/* SATU wajah, SATU clip: pil atau cakram, tidak pernah dua-duanya.
   Clip yang sama dipakai wajah dan tombol supaya area klik tidak
   pernah berbeda dari yang terlihat. Clip yang sama dibalik = kembali. */
.gulp__face,
.gulp__btn {
  clip-path: inset(0 var(--fx-r) 0 var(--fx-l) round var(--rr));
  transition: clip-path .44s var(--e-out);
}

.gulp__face {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, var(--skin-1), var(--skin-2));
  box-shadow: 0 6px 20px rgba(200, 30, 30, .30);
  pointer-events: none;
}

.gulp__btn {
  position: relative;
  z-index: 1;
  height: var(--h);
  padding: 0 20px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.gulp__btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .55);
  outline-offset: -4px;
}

.gulp__icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  overflow: visible;
}

/* Tong digambar sebagai garis, bukan blok pejal, supaya isi
   di dalamnya benar-benar kelihatan. */
.gulp__bin,
.gulp__bar,
.gulp__grip {
  fill: none;
  stroke: currentColor;
  stroke-width: 4.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.gulp__lid {
  transform-origin: 15px 15px;
  transition: rotate .3s var(--e-out), translate .3s var(--e-out);
}

/* Permukaan air: satu path bergelombang, satu translate.
   Tidak ada tinggi yang dianimasikan. */
.gulp__fill {
  fill: currentColor;
  opacity: .92;
  translate: 0 calc(46px - var(--p) * 29px);
}

.gulp__label {
  display: inline-block;
  position: relative;
}

.gulp__ch {
  display: inline-block;
  white-space: pre;
  will-change: transform, opacity;
}

.gulp__ch.is-fly {
  animation: gulp-fly .52s cubic-bezier(.5, 0, .75, .4) forwards;
}

@keyframes gulp-fly {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  45% {
    transform: translate(calc(var(--dx) * .45), calc(var(--dy) * .35 - 15px)) rotate(var(--rot)) scale(.86);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(calc(var(--rot) * 2.4)) scale(.18);
    opacity: 0;
  }
}

@keyframes gulp-slosh {
  0%   { rotate: 0deg; }
  30%  { rotate: -4.5deg; }
  62%  { rotate: 3deg; }
  100% { rotate: 0deg; }
}

.gulp__fill.is-slosh {
  animation: gulp-slosh .46s ease-out;
  transform-origin: 32px 40px;
}

/* Satu busur berputar selama menunggu, lalu lari penuh dan MENYEGEL.
   Itulah seluruh konfirmasinya. */
.gulp__ring {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--h);
  height: var(--h);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  rotate: -90deg;
  transition: opacity .2s linear;
}

.gulp__ring circle {
  fill: none;
  stroke: rgba(255, 255, 255, .92);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 308;
  stroke-dashoffset: var(--ring-off);
  transition: stroke-dashoffset .5s var(--e-out);
}

.gulp__seal {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--h);
  height: var(--h);
  padding: 11px;
  z-index: 3;
  opacity: 0;
  scale: .5;
  pointer-events: none;
  transition: opacity .2s ease, scale .32s var(--e-out);
}

.gulp__seal path {
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  transition: stroke-dashoffset .34s .1s var(--e-out);
}

/* ---- STATE ---- */

.gulp[data-state="idle"] .gulp__btn:hover ~ .gulp__face,
.gulp[data-state="idle"]:hover .gulp__face {
  box-shadow: 0 8px 26px rgba(200, 30, 30, .42);
}

.gulp[data-state="idle"]:active .gulp__body { scale: .97; }
.gulp__body { transition: scale .18s var(--e-out); }

/* Pil menyusut ke kiri, tepat ke tempat tong berdiri. Ikonnya
   tidak perlu bergerak, jadi tidak ada geser yang terasa palsu. */
.gulp[data-state="eat"],
.gulp[data-state="fun"],
.gulp[data-state="pending"],
.gulp[data-state="done"] {
  --fx-r: calc(100% - var(--h));
}

/* Penyusutan pil ditunda sampai huruf terakhir melayang. --t-eat diisi
   JavaScript sesuai panjang label, jadi label pendek tidak menunggu lama. */
.gulp[data-state="eat"] .gulp__face,
.gulp[data-state="eat"] .gulp__btn {
  transition-delay: var(--t-eat, 200ms);
}

.gulp[data-state="eat"] .gulp__lid,
.gulp[data-state="fun"] .gulp__lid {
  rotate: -22deg;
  translate: -1px -2px;
}

.gulp[data-state="eat"] .gulp__btn,
.gulp[data-state="fun"] .gulp__btn,
.gulp[data-state="pending"] .gulp__btn,
.gulp[data-state="done"] .gulp__btn {
  cursor: default;
  pointer-events: none;
}

.gulp[data-state="pending"] .gulp__ring,
.gulp[data-state="done"] .gulp__ring {
  opacity: 1;
}

.gulp[data-state="pending"] .gulp__ring {
  animation: gulp-turn .9s linear infinite;
}

@keyframes gulp-turn {
  from { rotate: -90deg; }
  to   { rotate: 270deg; }
}

.gulp[data-state="done"] .gulp__ring circle { stroke-dashoffset: 0; }
.gulp[data-state="done"] .gulp__icon { opacity: 0; transition: opacity .2s ease; }
.gulp[data-state="done"] .gulp__seal { opacity: 1; scale: 1; }
.gulp[data-state="done"] .gulp__seal path { stroke-dashoffset: 0; }
.gulp[data-state="done"] .gulp__face { background: linear-gradient(135deg, #10B981, #047857); }

.gulp[data-state="fail"] { animation: gulp-shake .42s ease; }
.gulp[data-state="fail"] .gulp__face { background: linear-gradient(135deg, #6B7280, #374151); }

@keyframes gulp-shake {
  0%, 100% { translate: 0 0; }
  22%      { translate: -6px 0; }
  48%      { translate: 5px 0; }
  74%      { translate: -3px 0; }
}

/* Ukuran ringkas untuk baris tabel dan kartu */
.gulp--sm { --h: 34px; }
.gulp--sm .gulp__btn { padding: 0 16px 0 7px; font-size: var(--font-size-xs); }
.gulp--sm .gulp__icon { width: 19px; height: 19px; flex-basis: 19px; }
.gulp--sm .gulp__seal { padding: 9px; }

/* Dialog konfirmasi: tombol gulp berdampingan dengan tombol Batal */
#confirm-gulp { display: inline-flex; }
.confirm-dialog .modal-footer { align-items: center; gap: var(--space-3); }

@media (max-width: 480px) {
  .confirm-dialog .modal-footer { flex-wrap: wrap; justify-content: center; }
  .gulp { --h: 44px; }
}

/* Hormati pengguna yang mematikan animasi di level sistem maupun
   lewat preferensi akun. Fungsinya tetap jalan, cuma tanpa teater. */
@media (prefers-reduced-motion: reduce) {
  .gulp__face,
  .gulp__btn,
  .gulp__fill,
  .gulp__lid,
  .gulp__seal,
  .gulp__ring circle { transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .gulp__ch.is-fly { animation-duration: .01ms !important; }
  .gulp[data-state="pending"] .gulp__ring { animation-duration: 1.4s; }
  .gulp[data-state="fail"] { animation: none; }
}

/* Preferensi akun: data-gulp="off" di <html> mematikan teaternya,
   fungsi hapusnya sendiri tidak ikut mati. */
html[data-gulp="off"] .gulp__face,
html[data-gulp="off"] .gulp__btn,
html[data-gulp="off"] .gulp__fill,
html[data-gulp="off"] .gulp__lid,
html[data-gulp="off"] .gulp__seal,
html[data-gulp="off"] .gulp__ring circle {
  transition-duration: .01ms !important;
  transition-delay: 0ms !important;
}
html[data-gulp="off"] .gulp[data-state="fail"] { animation: none; }


/* ============================================================
   KETERANGAN MASA AKTIF PAKET (.plan-period)
   Dipakai Dashboard, Profil, Upgrade & Manajemen Pengguna admin.
   Warna mengikuti token tema, jadi ikut tema gelap otomatis.
   ============================================================ */
.plan-period {
  --pp-accent: var(--success);
  display: flex; flex-direction: column; gap: 6px;
  width: 100%; min-width: 0; text-align: left;
  font-size: var(--font-size-sm);
}
.plan-period--expiring { --pp-accent: var(--warning); }
.plan-period--expired  { --pp-accent: var(--error); }
.plan-period--free     { --pp-accent: var(--text-muted); }

.plan-period__row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--space-3); flex-wrap: wrap;
}
.plan-period__label { color: var(--text-muted); font-size: 12px; }
.plan-period__value { color: var(--text-dark); font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.plan-period__bar {
  height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--border-light, #E2E8F0);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.plan-period__bar > i { display: block; height: 100%; background: var(--pp-accent); border-radius: 3px; }

.plan-period__status { color: var(--pp-accent); font-size: 12px; font-weight: 700; }
.plan-period--expired .plan-period__status { color: var(--error-text, var(--error)); }
.plan-period--expiring .plan-period__status { color: var(--warning-text, var(--warning)); }
.plan-period--free .plan-period__status { font-weight: 600; }

/* Versi ringkas (sel tabel admin) */
.plan-period.is-compact { gap: 3px; min-width: 150px; }
.plan-period.is-compact .plan-period__row { gap: var(--space-2); }
.plan-period.is-compact .plan-period__label,
.plan-period.is-compact .plan-period__status { font-size: 11px; }
.plan-period.is-compact .plan-period__value { font-size: 12px; }
.plan-period.is-compact .plan-period__bar { height: 4px; }

/* Ponsel: baris label & tanggal tetap sebaris, tidak ada yang terpotong */
@media (max-width: 640px) {
  .plan-period { font-size: 13px; }
  .plan-period.is-compact { min-width: 0; }
  .plan-period__value { font-size: 13px; }
}


/* ============================================================
   PENGINGAT MASA AKTIF PAKET (.plan-reminder)
   Banner di atas konten semua halaman pengguna saat sisa <= 7 hari.
   Warna mengikuti token tema, jadi ikut tema gelap otomatis.
   ============================================================ */
.plan-reminder {
  --pr-bg: var(--warning-bg);
  --pr-fg: var(--warning-text, #92400E);
  --pr-line: var(--warning);
  position: relative;
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  min-width: 0; max-width: 100%; box-sizing: border-box;
  margin-bottom: var(--space-5);
  padding: 14px 44px 14px 16px;
  background: var(--pr-bg);
  border: 1px solid var(--pr-line);
  border-left-width: 4px;
  border-radius: var(--radius-lg);
  animation: plan-reminder-in .35s ease both;
}
.plan-reminder--h3 { --pr-line: #F97316; }
.plan-reminder--h1 {
  --pr-bg: var(--error-bg);
  --pr-fg: var(--error-text, #991B1B);
  --pr-line: var(--error);
  padding-right: 16px;               /* h1 tidak punya tombol tutup */
}
.plan-reminder__icon { font-size: 26px; line-height: 1; flex: 0 0 auto; }
.plan-reminder__body { flex: 1 1 220px; min-width: 0; }
.plan-reminder__title {
  font-weight: 800; color: var(--pr-fg); margin-bottom: 3px;
  overflow-wrap: anywhere;
}
.plan-reminder__text {
  font-size: var(--font-size-sm); line-height: 1.6;
  color: var(--text-body, var(--text-dark));
  overflow-wrap: anywhere;
}
.plan-reminder__cta { align-self: center; white-space: nowrap; }
.plan-reminder__close {
  position: absolute; top: 4px; right: 4px;
  width: 40px; height: 40px;          /* area sentuh nyaman di ponsel */
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer;
  color: var(--text-muted); font-size: 24px; line-height: 1;
  border-radius: var(--radius-md, 8px);
}
.plan-reminder__close:hover { background: rgba(0, 0, 0, .06); color: var(--text-dark); }
.plan-reminder__close:focus-visible { outline: 2px solid var(--pr-line); outline-offset: 1px; }

@keyframes plan-reminder-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .plan-reminder { animation: none; } }

/* Ponsel: ikon & teks sebaris, tombol Perpanjang selebar banner */
@media (max-width: 640px) {
  .plan-reminder { gap: 10px; padding: 12px 44px 12px 12px; }
  .plan-reminder--h1 { padding-right: 12px; }
  .plan-reminder__icon { font-size: 22px; }
  .plan-reminder__body { flex-basis: calc(100% - 44px); }
  .plan-reminder__cta { flex: 1 1 100%; align-self: stretch; text-align: center; justify-content: center; min-height: 44px; }
}
