/* =====================================================================
   Admin panel — OSIS ELASKA
   Light, clean, professional. Sidebar + content layout.
   ===================================================================== */

:root {
  --bg:        #F4F5F7;
  --surface:   #FFFFFF;
  --surface-2: #F9FAFB;
  --border:    #E5E7EB;
  --border-2:  #EEF0F3;
  --text:      #111827;
  --text-2:    #374151;
  --muted:     #6B7280;

  --brand:     #C8553D;   /* sejalan dengan frontend */
  --brand-d:   #A8412C;
  --brand-soft:#FCEBE5;

  --green:     #16A34A;
  --green-bg:  #DCFCE7;
  --amber:     #D97706;
  --amber-bg:  #FEF3C7;
  --red:       #DC2626;
  --red-bg:    #FEE2E2;
  --blue:      #2563EB;
  --blue-bg:   #DBEAFE;

  --radius:    12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-md: 0 8px 24px -12px rgba(17, 24, 39, .14);

  --font-ui:   "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg:        #0F1115;
  --surface:   #171A21;
  --surface-2: #1D212A;
  --border:    #2A2F3A;
  --border-2:  #232833;
  --text:      #E5E7EB;
  --text-2:    #C8CDD7;
  --muted:     #8B93A2;

  --brand:     #E47A60;
  --brand-d:   #D9694D;
  --brand-soft: rgba(228, 122, 96, .14);

  --green-bg:  rgba(34, 197, 94, .14);
  --amber-bg:  rgba(245, 158, 11, .14);
  --red-bg:    rgba(248, 113, 113, .14);
  --blue-bg:   rgba(59, 130, 246, .14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px -12px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Cegah horizontal scroll tak diinginkan di mobile bila ada elemen anak yg overflow */
body { overflow-x: hidden; }

/* Aturan dasar agar field form tidak pernah meluap container.
   Default <input> punya intrinsic min-width ~20ch yg bikin grid/flex parent melebar.
   `min-width:0` + `max-width:100%` mencegah hal ini secara global. */
input, select, textarea, button {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
img, svg, video, canvas { max-width: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(700px 500px at 80% 0%, #FCEBE5 0%, transparent 60%),
    radial-gradient(600px 400px at 0% 100%, #FEF3C7 0%, transparent 60%),
    var(--bg);
  padding: 24px;
}

.login-shell {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-md);
}

.login-head { text-align: center; margin-bottom: 28px; }
.login-logo {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #E8AE54);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 18px;
  margin: 0 auto 14px;
  letter-spacing: .04em;
  box-shadow: 0 8px 18px -8px rgba(200, 85, 61, .55);
}
.login-head h1 {
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.login-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.login-field {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.login-field span {
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 600;
}
.login-field input {
  font: inherit;
  font-size: 14.5px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.login-field input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200, 85, 61, .15);
}
.login-field input:disabled { opacity: .5; }

.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14.5px;
  transition: background .2s, transform .15s, opacity .2s;
}
.login-btn:hover:not(:disabled) { background: var(--brand); transform: translateY(-1px); }
.login-btn:disabled { opacity: .55; cursor: not-allowed; }

.login-back {
  display: block;
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.login-back:hover { color: var(--brand); }

.alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.alert-error { background: var(--red-bg);   color: #7F1D1D; border-color: #FCA5A5; }
.alert-info  { background: var(--blue-bg);  color: #1E3A8A; border-color: #BFDBFE; }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-body { min-height: 100dvh; }

.sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100dvh;
  width: 248px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 20px 16px;
  z-index: 60;
  /* Easing halus "cubic-bezier" agar slide terasa premium */
  transition: transform .38s cubic-bezier(.22, .9, .25, 1), box-shadow .3s ease;
  will-change: transform;
}

/* Backdrop gelap yang ditekan untuk menutup menu (hanya muncul di mobile) */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, .45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  /* Fade-out mulus: visibility baru hilang setelah opacity = 0 (delay .3s) */
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.sidebar-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s ease, visibility 0s linear 0s;
}

.sb-brand {
  position: relative;
  padding: 6px 4px 18px 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-2);
}
.sb-brand::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 22px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), #E8AE54);
}
.sb-brand-text { display: flex; flex-direction: column; gap: 2px; }
.sb-title {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.005em;
}
.sb-sub {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
}

.sb-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

/* Stagger fade-in untuk item nav saat sidebar terbuka di mobile — hanya sekali per pembukaan */
@media (max-width: 960px) {
  .sidebar.open .sb-link {
    animation: sb-link-in .42s cubic-bezier(.22, .9, .25, 1) both;
  }
  .sidebar.open .sb-link:nth-child(1) { animation-delay: .06s; }
  .sidebar.open .sb-link:nth-child(2) { animation-delay: .10s; }
  .sidebar.open .sb-link:nth-child(3) { animation-delay: .14s; }
  .sidebar.open .sb-link:nth-child(4) { animation-delay: .18s; }
  .sidebar.open .sb-link:nth-child(5) { animation-delay: .22s; }
  .sidebar.open .sb-link:nth-child(6) { animation-delay: .26s; }
  .sidebar.open .sb-link:nth-child(7) { animation-delay: .30s; }
  .sidebar.open .sb-link:nth-child(8) { animation-delay: .34s; }
}
@keyframes sb-link-in {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.sb-link:hover { background: var(--surface-2); color: var(--text); }
.sb-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-d);
  font-weight: 600;
}

.sb-foot {
  border-top: 1px solid var(--border-2);
  padding-top: 14px;
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.sb-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.sb-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-d);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}
.sb-user-name { font-size: 13.5px; font-weight: 600; }
.sb-user-role { font-size: 11.5px; color: var(--muted); }
.sb-logout {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  transition: background .15s, color .15s;
}
.sb-logout:hover { background: var(--red-bg); color: var(--red); }

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  z-index: 70;
  align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  padding: 0;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
  cursor: pointer;
}
.sidebar-toggle:hover  { background: var(--surface-2); border-color: var(--text-2); }
.sidebar-toggle:active { transform: scale(.94); }

/* Icon hamburger yang morph ke X saat sidebar terbuka */
.sb-toggle-icon {
  position: relative;
  width: 20px; height: 16px;
  display: inline-block;
}
.sb-toggle-icon > span {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .28s cubic-bezier(.22, .9, .25, 1),
              opacity .2s ease,
              top .28s cubic-bezier(.22, .9, .25, 1);
}
.sb-toggle-icon > span:nth-child(1) { top: 0; }
.sb-toggle-icon > span:nth-child(2) { top: 7px; }
.sb-toggle-icon > span:nth-child(3) { top: 14px; }

/* Saat sidebar terbuka → garis-garis menyatu jadi X */
body.sidebar-open .sb-toggle-icon > span:nth-child(1) { top: 7px; transform: rotate(45deg); }
body.sidebar-open .sb-toggle-icon > span:nth-child(2) { opacity: 0; transform: translateX(-8px); }
body.sidebar-open .sb-toggle-icon > span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

/* Kunci scroll body saat sidebar mobile terbuka agar halaman tidak bisa di-scroll */
body.sidebar-open { overflow: hidden; touch-action: none; }

/* FIX: tombol X di top-left menumpuk judul "Admin Dashboard".
   Saat sidebar terbuka di mobile, dorong brand sidebar ke bawah supaya
   judul tidak tertimpa tombol X. */
@media (max-width: 960px) {
  .sidebar .sb-brand { transition: padding-top .3s ease; }
  body.sidebar-open .sidebar .sb-brand { padding-top: 50px; }
}

.content {
  margin-left: 248px;
  padding: 32px clamp(20px, 4vw, 40px) 60px;
  max-width: 1280px;
}

/* ============================================================
   PAGE HEAD
   ============================================================ */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.015em;
}
.page-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* Indikator live di kanan page-head dashboard */
.page-head-meta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  user-select: none;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
}
.live-dot.is-pulse { animation: live-pulse .9s ease-out 1; }
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(34, 197, 94, .55); }
  100% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}

/* Slot flash kosong jangan ambil ruang */
#flashSlot:empty { display: none; }

.flash {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.flash-success { background: var(--green-bg); color: #14532D; border-color: #86EFAC; }
.flash-error   { background: var(--red-bg);   color: #7F1D1D; border-color: #FCA5A5; }

/* ============================================================
   STATS
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--text-2);
}
.stat-pending::before  { background: var(--amber); }
.stat-approved::before { background: var(--green); }
.stat-rejected::before { background: var(--red); }
.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.toolbar > .filters { flex: 1 1 auto; min-width: 0; }
.filters {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}
.tab {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.tab:hover { background: var(--surface-2); }
.tab.is-active {
  background: var(--text);
  color: #fff;
}

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 280px;
  color: var(--muted);
}
.search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(200, 85, 61, .12);
}
.search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
}
.search-clear {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .col-no { width: 50px; color: var(--muted); }
.data-table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.data-table .muted { color: var(--muted); white-space: nowrap; }
.cell-judul { font-weight: 600; color: var(--text); max-width: 280px; }
.cell-link a {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--blue);
  font-weight: 500;
}
.cell-link a:hover { text-decoration: underline; }
.empty {
  text-align: center;
  padding: 48px 14px !important;
  color: var(--muted);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: .02em;
}
.badge-pending  { background: var(--amber-bg); color: #92400E; }
.badge-approved { background: var(--green-bg); color: #166534; }
.badge-rejected { background: var(--red-bg);   color: #991B1B; }

/* ----- Log levels ----- */
.log-badge          { font-family: ui-monospace, Menlo, Consolas, monospace; }
.log-error,
.log-fatal,
.log-exception      { background: var(--red-bg);    color: #991B1B; }
.log-warning        { background: var(--amber-bg);  color: #92400E; }
.log-notice         { background: #E0E7FF;          color: #3730A3; }
.log-info           { background: #DBEAFE;          color: #1E40AF; }
[data-theme="dark"] .log-error,
[data-theme="dark"] .log-fatal,
[data-theme="dark"] .log-exception { color: #FCA5A5; }
[data-theme="dark"] .log-warning   { color: #FCD34D; }
[data-theme="dark"] .log-notice    { background: #312E81; color: #C7D2FE; }
[data-theme="dark"] .log-info      { background: #1E3A8A; color: #BFDBFE; }

/* ============================================================
   LOGIN LOG — badge status, password mask, lokasi
   ============================================================ */
.ll-badge { font-family: ui-monospace, Menlo, Consolas, monospace; }
.ll-success      { background: var(--green-bg);  color: #166534; }
.ll-failed       { background: var(--red-bg);    color: #991B1B; }
.ll-locked       { background: var(--amber-bg);  color: #92400E; }
.ll-invalid_csrf { background: #E0E7FF;          color: #3730A3; }
[data-theme="dark"] .ll-success      { color: #86EFAC; }
[data-theme="dark"] .ll-failed       { color: #FCA5A5; }
[data-theme="dark"] .ll-locked       { color: #FCD34D; }
[data-theme="dark"] .ll-invalid_csrf { background: #312E81; color: #C7D2FE; }

/* Password attempt — METADATA (length + sha256 prefix). Tidak ada plaintext. */
.cell-pwd { font-family: ui-monospace, Menlo, Consolas, monospace; }
.pwd-meta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px;
}
.pwd-meta .pwd-len,
.pwd-meta .pwd-hash {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  white-space: nowrap;
  font-weight: 600;
}
.pwd-meta .pwd-hash {
  color: var(--muted);
  font-weight: 500;
}
.pwd-meta-legacy .pwd-len {
  background: var(--amber-bg);
  color: #92400E;
  border-color: #FCD34D;
}
[data-theme="dark"] .pwd-meta-legacy .pwd-len { color: #FCD34D; }

/* IP / Lokasi */
.cell-loc .ll-ip code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
}
.cell-loc .ll-geo {
  margin-top: 2px;
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.cell-loc .ll-flag {
  font-size: 14px;
  line-height: 1;
}

/* Bulk action di toolbar (Bersihkan Gagal + Kosongkan Semua) */
.ll-bulk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  /* Mobile: bulk actions full width agar mudah ditekan */
  .ll-bulk { width: 100%; margin-left: 0; }
  .ll-bulk > form { flex: 1 1 auto; }
  .ll-bulk .btn { width: 100%; justify-content: center; }

  /* Mobile: Password mask jangan meluap */
  .pwd-dots, .pwd-real { max-width: 140px; }

  /* Detail row di mobile (UA) — span full lebar */
  .ll-detail td,
  .log-detail td { grid-column: 1 / -1; }
  .ll-detail .log-detail-box { padding: 10px 14px; word-break: break-all; }
}

/* ----- Log row expandable ----- */
.log-row.is-expandable td       { transition: background .15s; }
.log-row.is-expandable:hover td { background: var(--surface-2); }
.log-row.is-open td             { background: var(--surface-2); }
.log-detail td                  { background: var(--surface-2); padding: 0 !important; }
.log-detail-box {
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}
.log-detail-box pre {
  margin: 4px 0 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px; overflow: auto;
}
.log-detail-box code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--ink);
}

/* ----- Sidebar: badge super admin ----- */
.sb-link-super { position: relative; }
.sb-badge {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--terracotta), var(--amber));
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

/* ----- Tombol bahaya ----- */
.btn-danger {
  background: var(--red-bg);
  color: #991B1B;
  border: 1px solid #FCA5A5;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { background: #FECACA; }
[data-theme="dark"] .btn-danger { color: #FCA5A5; border-color: #7F1D1D; }

/* Action buttons */
.actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.inline { display: inline; margin: 0; }
.btn-act {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  transition: all .15s ease;
}
.btn-act:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-approve:hover { background: var(--green-bg); color: var(--green); border-color: #86EFAC; }
.btn-reject:hover  { background: var(--amber-bg); color: var(--amber); border-color: #FCD34D; }
.btn-delete:hover  { background: var(--red-bg);   color: var(--red);   border-color: #FCA5A5; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.page-info { font-size: 12.5px; color: var(--muted); }
.page-nav { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.page-btn {
  min-width: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  transition: all .15s ease;
}
.page-btn:hover:not(.is-disabled):not(.is-active) {
  background: var(--surface-2);
  border-color: #D1D5DB;
}
.page-btn.is-active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.page-btn.is-disabled {
  opacity: .45;
  pointer-events: none;
}
.page-gap { padding: 7px 4px; color: var(--muted); font-size: 12.5px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .sidebar {
    transform: translateX(-105%);
    box-shadow: 12px 0 40px -12px rgba(0, 0, 0, .35);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .content { margin-left: 0; padding-top: 72px; }
}
/* Di desktop backdrop tidak pernah muncul walau class is-visible terpasang */
@media (min-width: 961px) {
  .sidebar-backdrop { display: none !important; }
  body.sidebar-open { overflow: auto; touch-action: auto; }
}

@media (max-width: 720px) {
  .filters { flex-direction: column; align-items: stretch; }
  .tabs { overflow-x: auto; }
  .search { min-width: 0; }
  .data-table { font-size: 13px; }
  .data-table thead { display: none; }
  .data-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
    padding: 14px;
    border-bottom: 1px solid var(--border-2);
  }
  .data-table tbody td {
    border: none;
    padding: 2px 0;
  }
  .data-table tbody td.col-no { display: none; }
  .data-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: block;
  }
  .data-table .col-actions {
    grid-column: 1 / -1;
    width: auto;                 /* override desktop's width: 1% di grid mode */
    max-width: 100%;
    white-space: normal;         /* override desktop's nowrap */
    justify-self: stretch;
    text-align: left;
    margin-top: 6px;
  }
}

/* ============================================================
   BUTTONS (umum)
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
  text-decoration: none;
  white-space: nowrap;       /* "Tambah Tautan" / "Tambah Admin" tidak pernah pecah baris */
  line-height: 1.2;
}
.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-primary:hover { background: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
[data-theme="dark"] .btn-primary { background: var(--brand); border-color: var(--brand); color: #1B1714; }
[data-theme="dark"] .btn-primary:hover { background: #F2A37D; border-color: #F2A37D; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   FORM CARD / GRID (links.php, settings.php)
   ============================================================ */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.form-card-narrow { max-width: 640px; }

.form-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-2);
}
.form-card-head h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .f { display: flex; flex-direction: column; gap: 6px; }
.form-grid .f-full { grid-column: 1 / -1; }
.form-grid .f > span,
.form-grid .f > label > span:first-child {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.form-grid .f > span em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}
.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid input[type="url"],
.form-grid input[type="email"],
.form-grid input[type="password"] {
  font: inherit;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .2s, background .15s;
}
.form-grid input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
/* Specificity dinaikkan (.form-grid .f-actions) supaya menang dari .form-grid .f */
.form-grid .f-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}
/* Tombol di dalam f-actions tidak boleh stretch full lebar */
.form-grid .f-actions .btn { align-self: flex-start; }

.form-grid .f .hint {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
  line-height: 1.45;
}

/* Inline password reset (di tabel users) */
.pw-inline {
  display: inline-flex; align-items: center; gap: 6px;
}
.pw-inline input[type="password"] {
  font: inherit;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  width: 150px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.pw-inline input[type="password"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* Toggle (switch) */
.f-toggle {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px !important;
  background: var(--surface-2);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.switch {
  position: relative;
  display: inline-block;
  width: 42px; height: 24px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  cursor: pointer;
  background: #D1D5DB;
  border-radius: 999px;
  transition: background .2s;
}
.slider::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(18px); }
[data-theme="dark"] .slider { background: #3A4150; }

/* Upload */
.upload {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface-2);
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border);
}
.upload-preview {
  width: 80px; height: 80px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted);
}
.upload-preview.is-round { border-radius: 50%; }
.upload-preview.is-empty { background: var(--surface); }
.upload-controls {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
}
.upload-controls input[type="file"] {
  font-size: 13px;
  color: var(--text-2);
}
.upload-controls .hint { font-size: 12px; color: var(--muted); }

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.checkbox-inline input { accent-color: var(--brand); }

/* ============================================================
   LINK LIST (links.php)
   ============================================================ */
.link-list { display: flex; flex-direction: column; gap: 10px; }

.empty-card {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, transform .15s;
}
.link-row:hover { border-color: var(--brand); }
.link-row.is-off { opacity: .6; }

.lr-thumb { flex-shrink: 0; }
.lr-thumb img,
.lr-thumb-empty {
  width: 48px; height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.lr-body {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.lr-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lr-sub {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lr-url {
  font-size: 11.5px;
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lr-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  flex-shrink: 0;
}
.lr-order {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

.lr-actions {
  display: inline-flex; gap: 6px;
  flex-shrink: 0;
}
.lr-actions .btn-act {
  width: 30px; height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: all .15s;
}
.lr-actions .btn-act:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}
.lr-actions .btn-act:disabled { opacity: .35; cursor: not-allowed; }
.lr-actions .btn-edit:hover { background: var(--brand-soft); }
.lr-actions .btn-delete:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red);
}

@media (max-width: 700px) {
  .link-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "thumb body meta"
      "actions actions actions";
    gap: 10px 12px;
    align-items: start;
    padding: 14px;
  }
  .lr-thumb   { grid-area: thumb; }
  .lr-thumb img,
  .lr-thumb-empty { width: 44px; height: 44px; }

  .lr-body {
    grid-area: body;
    min-width: 0;
    /* Agar subtitle/url panjang tidak meluap ke kanan */
    overflow: hidden;
  }
  .lr-title { font-size: 14.5px; }
  .lr-sub   { font-size: 12.5px; }
  .lr-url   { font-size: 12px; word-break: break-all; white-space: normal; }

  .lr-meta {
    grid-area: meta;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .lr-order {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-2);
    font-weight: 600;
    letter-spacing: .02em;
  }

  .lr-actions {
    grid-area: actions;
    width: 100%;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px dashed var(--border-2);
  }
  .lr-actions .btn-act { flex: 0 0 36px; height: 36px; }
}

/* ============================================================
   SIDEBAR THEME TOGGLE
   ============================================================ */
.sb-theme {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s ease;
}
.sb-theme:hover { background: var(--surface); color: var(--text); }
.sb-theme-ico { display: inline-flex; }
.sb-theme .i-sun  { display: none; }
.sb-theme .i-moon { display: inline-flex; }
[data-theme="dark"] .sb-theme .i-sun  { display: inline-flex; }
[data-theme="dark"] .sb-theme .i-moon { display: none; }
.sb-theme-label { flex: 1; text-align: left; }

/* ============================================================
   DARK MODE — fine-tuning warna
   ============================================================ */
[data-theme="dark"] body { background: var(--bg); }

[data-theme="dark"] .login-body {
  background:
    radial-gradient(700px 500px at 80% 0%, rgba(228, 122, 96, .12) 0%, transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgba(232, 174, 84, .10) 0%, transparent 60%),
    var(--bg);
}

[data-theme="dark"] .login-field input,
[data-theme="dark"] .search,
[data-theme="dark"] .form-grid input[type="text"],
[data-theme="dark"] .form-grid input[type="number"],
[data-theme="dark"] .form-grid input[type="url"],
[data-theme="dark"] .form-grid input[type="email"],
[data-theme="dark"] .form-grid input[type="password"] {
  background: var(--surface-2);
  color: var(--text);
}

[data-theme="dark"] .badge-pending  { color: #FCD34D; }
[data-theme="dark"] .badge-approved { color: #86EFAC; }
[data-theme="dark"] .badge-rejected { color: #FCA5A5; }

[data-theme="dark"] .stat-card,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .form-card,
[data-theme="dark"] .link-row,
[data-theme="dark"] .empty-card,
[data-theme="dark"] .login-card,
[data-theme="dark"] .sidebar { background: var(--surface); }

[data-theme="dark"] .data-table thead th { background: var(--surface-2); }
[data-theme="dark"] .data-table tbody tr:hover { background: var(--surface-2); }
[data-theme="dark"] .cell-link a { color: #93C5FD; }

[data-theme="dark"] .tab.is-active { background: var(--brand); color: #1B1714; }
[data-theme="dark"] .page-btn.is-active { background: var(--brand); color: #1B1714; border-color: var(--brand); }

[data-theme="dark"] .btn-act { background: var(--surface-2); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .btn-act:hover { background: var(--surface); border-color: var(--text-2); }
[data-theme="dark"] .pw-inline input[type="password"] {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .alert-error { color: #FCA5A5; }
[data-theme="dark"] .alert-info  { color: #93C5FD; }
[data-theme="dark"] .flash-success { color: #86EFAC; }
[data-theme="dark"] .flash-error   { color: #FCA5A5; }

[data-theme="dark"] .upload-preview { background: var(--surface); }
[data-theme="dark"] .upload-controls input[type="file"]::file-selector-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  margin-right: 8px;
}

/* Smooth color transitions */
body, .sidebar, .stat-card, .table-wrap, .form-card,
.link-row, .login-card, .login-field input, .search,
.btn, .btn-act, .sb-theme, .sb-link {
  transition: background-color .25s ease, color .2s ease, border-color .2s ease;
}

/* Saat user toggle dark mode, transition input/badge/upload juga halus */
body, [data-theme="dark"] body { transition: background-color .3s ease, color .25s ease; }

/* ============================================================
   MOBILE — perbaikan responsif menyeluruh
   ============================================================ */
@media (max-width: 720px) {
  /* Layout content tetap mengisi viewport, hindari horizontal scroll */
  .content { padding: 70px 14px 60px; }

  /* Page head: judul + meta-pill berpisah baris */
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
  }
  .page-title { font-size: 20px; }
  .page-sub   { font-size: 13px; }
  .page-head-meta { font-size: 11.5px; padding: 5px 10px; }

  /* Stats: tetap 2 kolom tapi padding kecil */
  .stat-card  { padding: 12px 14px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11px; }

  /* Toolbar: filter + tombol penuh lebar, jangan saling tabrak */
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar > .filters,
  .toolbar > form { width: 100%; }

  /* Tabs: wajib bisa scroll horizontal di dalam container, tidak meluap body */
  .filters { width: 100%; }
  .tabs {
    display: flex;             /* bukan inline-flex, supaya respect parent width */
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: 7px 12px; }

  /* Search: full lebar dan tidak overflow */
  .search { width: 100%; min-width: 0; padding: 8px 10px; }
  .search input { font-size: 16px; min-width: 0; width: 100%; }   /* 16px = anti zoom Android */

  /* Form card: padding lebih ramping */
  .form-card        { padding: 16px; border-radius: 14px; }
  .form-card-head   { margin-bottom: 14px; padding-bottom: 12px; }
  .form-card-head h2 { font-size: 15px; }
  .form-grid        { gap: 12px; grid-template-columns: 1fr; }

  /* INPUT — wajib mengikuti lebar container, tidak meluap.
     font-size 16px mencegah Android/iOS Safari auto-zoom saat focus. */
  input[type="text"],
  input[type="number"],
  input[type="url"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  textarea,
  select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 16px;     /* anti auto-zoom saat focus */
  }
  /* File input juga jangan meluap */
  input[type="file"] { width: 100%; max-width: 100%; }

  /* Upload area: preview + tombol stack vertikal di HP */
  .upload { flex-direction: column; padding: 12px; gap: 12px; }
  .upload-preview { width: 72px; height: 72px; }
  .upload-controls { width: 100%; min-width: 0; }
  .upload-controls input[type="file"] { font-size: 14px; }

  /* Tabel mode card: kolom Aksi rapi.
     Span FULL row supaya input password + tombol-tombol dapat lebar penuh
     kartu (bukan 1/2 grid). Beri spacing atas agar terpisah dari sel di atas.

     PENTING (root cause bug Android):
     Aturan desktop `.col-actions { width: 1%; white-space: nowrap }` BIKIN
     grid item terkunci 1% lebar walau di-stretch. WAJIB di-reset di mobile. */
  .data-table .col-actions {
    grid-column: 1 / -1 !important;
    width: auto !important;
    max-width: 100% !important;
    white-space: normal !important;
    justify-self: stretch !important;
    text-align: left;
    margin-top: 6px;
    padding-top: 8px !important;
    border-top: 1px dashed var(--border-2);
  }
  .data-table .col-actions::before {
    /* Label "AKSI" tetap muncul */
    margin-bottom: 4px;
  }

  /* Default actions di card mode: flex wrap rapi (untuk dashboard 3-tombol dst) */
  .data-table .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
  }

  /* Tombol aksi (btn-act) lebih besar & mudah ditekan di mobile.
     30px terlalu kecil untuk jari (recommendation 40-44px). */
  .data-table .actions .btn-act,
  .data-table .actions-pw .btn-act {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .data-table .actions .btn-act svg,
  .data-table .actions-pw .btn-act svg {
    width: 18px;
    height: 18px;
  }

  /* ============================================================
     users.php — .actions-pw : STACK BLOCK LAYOUT (no flex/grid magic)
     Tata letak per kartu:
       [input password full-width            ]
       [               tombol simpan (kanan) ]
       [               tombol hapus  (kanan) ]
     Pakai display:block agar bulletproof di semua Android Chrome.
     ============================================================ */
  .data-table .actions-pw {
    display: block !important;
    width: 100%;
    min-width: 0;
  }
  .data-table .actions-pw .pw-inline {
    display: block !important;
    width: 100%;
    margin: 0 0 8px 0;
  }
  /* Hidden inputs jangan mengganggu layout */
  .data-table .actions-pw .pw-inline input[type="hidden"] { display: none !important; }

  .data-table .actions-pw .pw-inline input[type="password"] {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: 40px !important;
    padding: 8px 12px !important;
    margin: 0 0 8px 0 !important;
    font-size: 16px !important;          /* anti auto-zoom Android */
    border: 1.5px solid var(--border) !important;
    border-radius: 8px !important;
    background: var(--surface-2) !important;
    color: var(--text) !important;
  }
  .data-table .actions-pw .pw-inline .btn-act {
    display: block !important;
    margin-left: auto !important;        /* rata kanan */
    margin-right: 0 !important;
  }

  /* Tombol delete / lock (anak langsung dari .actions-pw, baris ke-3) */
  .data-table .actions-pw > .inline,
  .data-table .actions-pw > .btn-act {
    display: block;
    margin-left: auto;
    margin-right: 0;
  }
  .data-table .actions-pw > .inline .btn-act {
    margin-left: auto;
  }

  /* Pagination */
  .pagination { gap: 8px; flex-direction: column; align-items: stretch; }
  .page-nav   { justify-content: center; }
  .page-info  { text-align: center; }

  /* Log detail expand: pre tidak meluap */
  .log-detail-box { padding: 12px 14px; }
  .log-detail-box pre { font-size: 11.5px; padding: 8px 10px; }
  .log-detail td { padding: 0 !important; }

  /* Flash */
  .flash { font-size: 13px; padding: 10px 12px; }

  /* Sidebar: badge super tetap di kanan, ada padding aman */
  .sb-link-super .sb-badge { margin-left: auto; }
}

/* Layar sangat kecil (≤ 380px) — finalisasi */
@media (max-width: 380px) {
  .content { padding: 64px 10px 48px; }
  .stats { grid-template-columns: 1fr; }    /* 1 kolom agar tidak tertumpuk */
  .stat-value { font-size: 20px; }
  .page-title { font-size: 18px; }
  .form-card  { padding: 14px; }
  .btn        { padding: 9px 12px; font-size: 13px; }
  .btn-danger { padding: 8px 12px; font-size: 12.5px; }
  /* Tetap pakai 16px (anti-zoom Android), padding diperkecil */
  .pw-inline input[type="password"] { font-size: 16px; padding: 6px 10px; }
}


/* ============================================================
   REDUCED MOTION — hormati pengaturan OS user
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
