/* Font dihost sendiri (OFL) — tidak bergantung Google Fonts */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/PlusJakartaSans-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/PlusJakartaSans-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/PlusJakartaSans-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/PlusJakartaSans-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-style: normal; font-display: swap; src: url('../fonts/PlusJakartaSans-ExtraBold.ttf') format('truetype'); }

/* Invoice Hafdzamedia — gaya dasar aplikasi */
:root {
  --primary: #0e94b0;
  --primary-dark: #0b7891;
  --primary-soft: #e3f4f8;
  --text: #1c2733;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --success: #15803d;
  --success-soft: #e7f6ec;
  --warning: #b45309;
  --warning-soft: #fdf3e2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
code { font-size: .9em; background: var(--primary-soft); padding: 2px 6px; border-radius: 6px; }

/* ---------- Layout ---------- */
.app-body { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand img { height: 28px; width: auto; }
.brand span { font-size: 13px; padding: 2px 8px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-dark); }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-toggle span { display: block; width: 20px; height: 2px; margin: 4px 0; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 12px; }
.nav a, .nav-logout button {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text); font: inherit; font-weight: 500;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.nav a:hover, .nav-logout button:hover { background: var(--bg); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.nav-icon { width: 19px; height: 19px; flex-shrink: 0; }
.nav-divider { height: 1px; background: var(--border); margin: 10px 4px; }
.nav-logout { margin: 0; }
.nav-logout button { color: var(--danger); }

.main { flex: 1; min-width: 0; padding: 24px 32px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.topbar h1 { font-size: 24px; margin: 0; }
.topbar-eyebrow { font-size: 12px; color: var(--muted); font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }
.user-chip:hover { text-decoration: none; border-color: var(--primary); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; color: var(--muted); }

/* ---------- Komponen ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { font-size: 18px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mb-0 { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.stats-note { margin: -8px 0 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--primary); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-light { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-light:hover { background: var(--bg); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; margin: 0; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #bfe5cb; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #f6c6c6; }
.alert-info { background: var(--primary-soft); color: var(--primary-dark); border-color: #bfe3ec; }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: #f3dcb4; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge-owner { background: #ede9fe; color: #6d28d9; }
.badge-staff { background: var(--primary-soft); color: var(--primary-dark); }
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-inactive { background: #f1f5f9; color: var(--muted); }

/* ---------- Form ---------- */
.form { max-width: 560px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-group .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.form-group .field-error { font-size: 12.5px; color: var(--danger); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 148, 176, .15); }
.has-error input, .has-error select { border-color: var(--danger); }
.checkbox { display: flex; gap: 8px; align-items: center; font-weight: 500 !important; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 32px 10px !important; }

.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.temp-password { font-family: ui-monospace, Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: .05em; background: var(--surface); padding: 6px 12px; border-radius: 8px; border: 1px dashed var(--primary); display: inline-block; margin: 6px 0; user-select: all; }

/* ---------- Login / setup ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #e3f4f8 0%, #f4f7fa 55%); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 18px; padding: 32px 28px; box-shadow: 0 10px 40px rgba(14, 148, 176, .12); border: 1px solid var(--border); }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand img { height: 40px; }
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.auth-card .lead { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.auth-foot { text-align: center; margin: 16px 0 0; font-size: 14px; }
.forgot-block { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; font-size: 14px; }
.forgot-block h2 { font-size: 15px; margin: 0 0 6px; }
.forgot-block p { margin: 0; color: var(--text); }
.forgot-block ol { margin: 0; padding-left: 20px; }
.forgot-block li { margin-bottom: 4px; }
.forgot-block code { font-size: 12.5px; background: var(--bg); padding: 1px 5px; border-radius: 5px; }

/* ---------- Responsif ---------- */
@media (max-width: 900px) {
  .app-body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 20; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; }
  .sidebar-head { padding: 0; }
  .menu-toggle { display: block; }
  .nav { display: none; padding-top: 12px; }
  .nav.open { display: flex; }
  .main { padding: 20px 16px 40px; }
  .topbar h1 { font-size: 20px; }
  .user-meta { display: none; }
  .user-chip { padding: 4px; }

  .table-cards thead { display: none; }
  .table-cards tr { display: block; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; padding: 6px 4px; }
  .table-cards td { display: flex; justify-content: space-between; gap: 12px; border-bottom: 0; padding: 6px 10px; text-align: right; }
  .table-cards td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; }
  .table-cards td.empty { display: block; text-align: center; }
  .table-cards td.empty::before { content: none; }
}

/* ---------- Tahap 2: invoice ---------- */
.grid-2, .grid-3 { display: grid; gap: 0 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
input[type=date], input[type=month], input[type=search] {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
textarea { resize: vertical; }
.text-danger { color: var(--danger) !important; }

/* Aksi per baris di daftar invoice: [Unduh ▾] [Lihat] [Ubah] dalam satu baris */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }
.row-actions .dl-icon { flex: none; display: block; }
.btn-square { width: 32px; height: 32px; padding: 0; }
.btn-square[data-action="view"] { color: var(--primary); }
.btn-square[data-action="edit"] { color: var(--text); }
.dl-trigger { gap: 5px; height: 32px; padding: 0 8px 0 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.dl-trigger .dl-icon-chevron { color: var(--muted); transition: transform .15s; }
.dl-trigger[aria-expanded="true"] { background: var(--bg); }
.dl-trigger[aria-expanded="true"] .dl-icon-chevron { transform: rotate(180deg); }
.dl-trigger .spinner { width: 16px; height: 16px; }
.dl-trigger.is-loading { justify-content: center; }
.dl-menu {
  position: fixed; z-index: 60; min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
}
.dl-menu[hidden] { display: none; }
.dl-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; font-weight: 700;
  color: var(--text); text-align: left; text-decoration: none; cursor: pointer;
}
.dl-item small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.dl-item:hover, .dl-item:focus-visible { background: var(--bg); outline: none; }
.dl-item-pdf .dl-icon { color: #c2410c; }
.dl-item-png .dl-icon { color: #6d28d9; }
.export-hint { margin: 0 0 8px; }
.text-warning { color: var(--warning) !important; }
.num { text-align: right !important; white-space: nowrap; }
.stat-money { font-size: 22px; }
.badge-unpaid { background: var(--warning-soft); color: var(--warning); }
.badge-void { background: var(--danger-soft); color: var(--danger); }
.row-void td { opacity: .55; }
.row-void td:first-child { text-decoration: line-through; }
.error-list { margin: 6px 0 0; padding-left: 20px; }

.item-row { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; background: #fbfdfe; transition: border-color .15s, box-shadow .15s; }
.item-row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.item-no { font-weight: 700; color: var(--primary-dark); white-space: nowrap; }
.item-body { padding-top: 10px; }
.item-body-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding-bottom: 6px; }
.item-msg { color: var(--danger); font-size: 13px; }
.item-msg:empty { display: none; }

/* Ringkasan satu baris (tombol) di kepala item */
.item-summary {
  flex: 1; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 2px 16px; padding: 6px 8px; margin: -6px 0 -6px -8px;
  background: none; border: 0; border-radius: 8px; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.item-summary:hover { background: var(--bg); }
.item-summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.sum-main { min-width: 0; display: flex; flex-direction: column; }
.sum-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-title.is-placeholder { color: var(--muted); font-weight: 500; font-style: italic; }
.sum-desc { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-desc:empty { display: none; }
.sum-figures { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.sum-total { font-weight: 700; white-space: nowrap; }
.sum-calc { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sum-calc s { margin-right: 2px; opacity: .8; }

/* Tanpa JS (.js-items tidak ada): semua item terbuka, tombol Ubah/Selesai tidak perlu */
.item-edit-btn, .item-done-btn { display: none; }
.js-items .item-done-btn { display: inline-flex; }
.js-items .item-row[data-open="0"] .item-body { display: none; }
.js-items .item-row[data-open="0"] .item-edit-btn { display: inline-flex; }
.js-items .item-row[data-open="1"] { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(14, 148, 176, .10); }
.js-items .item-row[data-open="1"] .sum-figures,
.js-items .item-row[data-open="1"] .sum-desc { display: none; }
.js-items .item-row.is-incomplete { border-color: #f3c9a0; background: var(--warning-soft); }
.js-items .item-row.is-incomplete .sum-title::after { content: '  · belum lengkap'; color: var(--warning); font-weight: 600; font-style: normal; font-size: 12.5px; }
.item-grid { display: grid; grid-template-columns: 1fr 90px 160px 160px 150px; gap: 0 12px; }
.item-title, .item-desc { grid-column: 1 / -1; }
.item-total-value { padding: 10px 0; font-weight: 700; }
.item-grid > .item-qty { grid-column: 2; }
.item-grid > .item-price { grid-column: 3; }
.item-grid > .item-orig { grid-column: 4; }
.item-grid > .item-total { grid-column: 5; text-align: right; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.totals { margin: 18px 0 0 auto; max-width: 340px; }
.totals > div { display: flex; justify-content: space-between; padding: 6px 4px; }
.totals-grand { background: var(--primary); color: #fff; border-radius: 10px; padding: 10px 14px !important; font-size: 17px; }

.card-details summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.card-details summary::-webkit-details-marker { display: none; }
.card-details summary h2 { font-size: 18px; margin: 0; }
.card-details summary h2::before { content: '▸ '; color: var(--muted); }
.card-details[open] summary h2::before { content: '▾ '; }
.card-details[open] summary { margin-bottom: 16px; }

.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 10px; z-index: 5; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select, .filters input[type=month] { width: auto; }
.filters-new { margin-left: auto; }
.pagination-info { align-self: center; padding: 0 6px; }

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .item-grid { grid-template-columns: 1fr 1fr; }
  .item-grid > .item-qty, .item-grid > .item-price, .item-grid > .item-orig, .item-grid > .item-total { grid-column: auto; text-align: left; }
  /* Ringkasan item di HP: nama di baris pertama, qty × harga dan total di baris kedua */
  .item-row-head { flex-wrap: wrap; }
  .item-summary { flex-basis: 100%; grid-template-columns: auto minmax(0, 1fr); }
  .sum-figures { grid-column: 2; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: 10px; }
  .js-items .item-row[data-open="1"] .item-summary { flex-basis: auto; flex: 1; }
  .item-actions { margin-left: auto; }
  .filters-new { margin-left: 0; }
}

.welcome { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.welcome h2 { margin-bottom: 4px; }

/* ---------- Tahap 3: export & verifikasi ---------- */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: var(--bg); flex-wrap: wrap; }
.segmented a, .segmented span { padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.segmented a:hover { text-decoration: none; color: var(--text); }
.segmented a.active { background: var(--surface); color: var(--primary-dark); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.segmented .disabled { opacity: .45; cursor: not-allowed; }
.export-card .alert { margin-bottom: 14px; }
.export-card p { margin: 0 0 14px; }

.verify-badge { padding: 12px 14px; border-radius: 10px; font-weight: 700; text-align: center; margin-bottom: 18px; }
.verify-ok { background: var(--success-soft); color: var(--success); }
.verify-void { background: var(--danger-soft); color: var(--danger); }
.verify-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.verify-table th, .verify-table td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.verify-table th { width: 42%; color: var(--muted); font-weight: 600; }
.verify-note { margin: 16px 0 0; }

.sig-preview { display: inline-block; padding: 10px 16px; border: 1px dashed var(--border); border-radius: 10px; background: #fff; margin-bottom: 12px; }
.sig-preview img { height: 90px; width: auto; display: block; }
input[type=file] { font: inherit; }

/* ---------- Loading ---------- */
.spinner {
  display: inline-block; width: 16px; height: 16px; flex-shrink: 0;
  border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; vertical-align: -3px;
}
.spinner-lg { width: 38px; height: 38px; border-width: 4px; color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.btn.is-loading { cursor: progress; opacity: .85; }
.btn:disabled.is-loading { opacity: .85; }

.loading-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 16px;
  background: rgba(244, 247, 250, .72);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s;
  cursor: progress;
}
.loading-overlay.show { opacity: 1; visibility: visible; }
.loading-box {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 26px 34px; box-shadow: 0 10px 40px rgba(14, 148, 176, .15);
  font-weight: 600; text-align: center; max-width: 320px;
}

/* Bagi pengguna yang mematikan animasi: ganti putaran dengan kedip pelan */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: pulse 1.6s ease-in-out infinite; border-right-color: currentColor; }
  .loading-overlay { transition: none; }
  @keyframes pulse { 50% { opacity: .35; } }
}

/* Isian yang hanya ditampilkan (tidak bisa diubah) */
.input-readonly { background: var(--bg) !important; color: var(--muted) !important; cursor: default; }
.input-readonly:focus { box-shadow: none !important; border-color: var(--border) !important; }

.nowrap { white-space: nowrap; }
.audit-detail { max-width: 360px; overflow-wrap: anywhere; }

/* ---------- Dialog konfirmasi ---------- */
.app-dialog {
  width: min(420px, calc(100vw - 32px)); padding: 26px 24px 20px; border: 0; border-radius: 18px;
  background: var(--surface); color: var(--text); text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}
.app-dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
.app-dialog[open] { animation: dialog-in .18s ease-out; }
.app-dialog[open]::backdrop { animation: fade-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.app-dialog-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px; font-weight: 800;
  background: var(--primary-soft); color: var(--primary-dark);
}
.app-dialog[data-tone="warning"] .app-dialog-icon { background: var(--warning-soft); color: var(--warning); }
.app-dialog[data-tone="danger"] .app-dialog-icon { background: var(--danger-soft); color: var(--danger); }
.app-dialog-title { font-size: 19px; margin: 0 0 8px; }
.app-dialog-message { margin: 0 0 22px; color: var(--muted); font-size: 14.5px; line-height: 1.55; white-space: pre-line; }
.app-dialog-actions { display: flex; gap: 10px; }
.app-dialog-actions .btn { flex: 1; }
@media (prefers-reduced-motion: reduce) {
  .app-dialog[open], .app-dialog[open]::backdrop { animation: none; }
}

/* ---------- Syarat password (dicentang saat mengetik) ---------- */
.pw-rules { list-style: none; margin: -4px 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 8px; transition: color .15s; }
.pw-rule-icon { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cbd5e1; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; line-height: 1; }
.pw-rules li.is-ok { color: var(--success); }
.pw-rules li.is-ok .pw-rule-icon { background: var(--success); border-color: var(--success); color: #fff; }
.pw-rules li.is-ok .pw-rule-icon::before { content: '✓'; }
.pw-rules li.is-bad { color: var(--danger); }
.pw-rules li.is-bad .pw-rule-icon { border-color: var(--danger); color: var(--danger); }
.pw-rules li.is-bad .pw-rule-icon::before { content: '×'; font-size: 13px; }

.req { color: var(--danger); font-weight: 700; }
textarea.input-readonly { resize: none; }
