/* ============================================================
   WLJ Cloud — Email Services Prototype (shared stylesheet)
   Acuan: acbc-cloud/src/css/input.css + dashboard.ejs + pricing-database.ejs
   Palet WAJIB (tidak boleh ada hex lain di file ini):
   #14213b #1963e3 #1450c4 #203250 #30405b #12b886
   #c38d2d #a8452f #f8fafc #ffffff #e2e8f0 #475569
   ============================================================ */
:root {
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #e2e8f0;
  --border: #e2e8f0;
  --text: #14213b;
  --text-muted: #475569;
  --text-subtle: #475569;
  --ring: #1963e3;
  --brand: #1963e3;
  --brand-hover: #1450c4;
  --success: #12b886;
  --warning: #c38d2d;
  --danger: #a8452f;
  --sidebar-bg: #14213b;
  --sidebar-bg-2: #203250;
  --sidebar-border: #30405b;
  --sidebar-text: #ffffff;
  --sidebar-muted: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 3px 0 rgb(20 33 59 / 0.08), 0 1px 2px -1px rgb(20 33 59 / 0.06);
  --shadow-lg: 0 12px 24px -6px rgb(20 33 59 / 0.16);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
[data-theme="dark"] {
  --surface: #14213b;
  --surface-2: #203250;
  --surface-3: #30405b;
  --border: #30405b;
  --text: #ffffff;
  --text-muted: #e2e8f0;
  --text-subtle: #e2e8f0;
  --ring: #1963e3;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--text); font-weight: 650; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
::selection { background: #1963e3; color: #ffffff; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-muted); opacity: 0.85; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 200; background: #1963e3; color: #ffffff; padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; transition: top 150ms ease; }
.skip-link:focus { top: 12px; color: #ffffff; }

/* ---------- App shell: sidebar 256px + main ---------- */
.app-shell { display: flex; min-height: 100vh; }
.wlj-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: 256px;
  background: #14213b; color: #ffffff;
  border-right: 1px solid #30405b;
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform 200ms ease;
}
.wlj-sidebar.is-open { transform: translateX(0); }
@media (min-width: 1024px) {
  .wlj-sidebar { transform: none; }
}
.sidebar-brand { display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 20px; border-bottom: 1px solid #30405b; flex-shrink: 0; }
.sidebar-brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #1963e3; color: #ffffff; }
.sidebar-brand-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.sidebar-close { margin-left: auto; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: #e2e8f0; font-size: 18px; cursor: pointer; }
.sidebar-close:hover { background: #203250; color: #ffffff; }
@media (min-width: 1024px) { .sidebar-close { display: none; } }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-group { margin: 20px 12px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #e2e8f0; opacity: 0.75; }
.side-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px;
  padding: 8px 12px; border-radius: 8px;
  color: #e2e8f0; text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background 150ms ease, color 150ms ease;
}
.side-link:hover { background: #203250; color: #ffffff; }
.side-link svg { flex-shrink: 0; }
.side-link-active { background: #1963e3; color: #ffffff; }
.side-link-active:hover { background: #1450c4; color: #ffffff; }
.sidebar-details summary { list-style: none; cursor: pointer; }
.sidebar-details summary::-webkit-details-marker { display: none; }
.sidebar-details summary .caret { margin-left: auto; transition: transform 150ms ease; }
.sidebar-details[open] summary .caret { transform: rotate(90deg); }
.sidebar-sub { margin: 4px 0 4px 22px; padding-left: 12px; border-left: 1px solid #30405b; display: flex; flex-direction: column; gap: 2px; }
.sidebar-sub .side-link { min-height: 40px; font-size: 13.5px; }
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgb(20 33 59 / 0.5); }
@media (min-width: 1024px) { .backdrop { display: none !important; } }
.wlj-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (min-width: 1024px) { .wlj-main { margin-left: 256px; } }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
@media (min-width: 640px) { .topbar { padding: 0 24px; } }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: var(--text-muted); cursor: pointer; transition: background 150ms ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
@media (min-width: 1024px) { .menu-btn { display: none; } }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9999px; background: #1963e3; color: #ffffff; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; }

/* ---------- Page ---------- */
.wlj-page { min-width: 0; flex: 1; padding: 16px; }
@media (min-width: 640px) { .wlj-page { padding: 24px; } }
@media (min-width: 1024px) { .wlj-page { padding: 32px; } }
.wlj-page-heading { margin-bottom: 24px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.wlj-page-heading h2 { font-size: 24px; }
@media (min-width: 640px) { .wlj-page-heading h2 { font-size: 28px; } }
.wlj-page-heading p { margin-top: 4px; font-size: 14px; color: var(--text-muted); }
.wlj-page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.wlj-card-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .wlj-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .wlj-card-grid { grid-template-columns: repeat(3, 1fr); } }
.wlj-table-card { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }

/* ---------- Buttons (satu ukuran dasar, 44px min) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 8px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500; line-height: 1.25;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; flex-shrink: 0;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #1963e3; color: #ffffff; }
.btn-primary:hover { background: #1450c4; color: #ffffff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #a8452f; color: #ffffff; }
.btn-danger:hover { filter: brightness(0.94); color: #ffffff; }
.btn-sm { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.label { display: block; font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: var(--font-sans); font-size: 14px; transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input::placeholder { color: var(--text-muted); opacity: 0.7; }
.input:focus { outline: none; border-color: #1963e3; box-shadow: 0 0 0 3px rgb(25 99 227 / 0.2); }
select.input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px;
}
[data-theme="dark"] select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
textarea.input { min-height: 120px; resize: vertical; }
.hint { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.field-error { margin-top: 6px; font-size: 12px; color: #a8452f; font-weight: 500; }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }
.check-row { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.check-row:hover { background: var(--surface-2); }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: #1963e3; flex-shrink: 0; }
.check-row strong { display: block; font-size: 14px; }
.check-row span.desc { display: block; font-size: 12px; color: var(--text-muted); }
.search-wrap { position: relative; min-width: 200px; flex: 1; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.search-wrap .input { padding-left: 38px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }

/* ---------- Badges + dots (status = warna + teks + dot) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 2px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500; line-height: 20px;
  background: var(--surface-3); color: var(--text);
}
.badge-neutral { background: rgb(71 85 105 / 0.14); color: var(--text); }
.badge-brand { background: rgb(25 99 227 / 0.12); color: var(--text); }
.badge-success { background: rgb(18 184 134 / 0.14); color: var(--text); }
.badge-warning { background: rgb(195 141 45 / 0.16); color: var(--text); }
.badge-danger { background: rgb(168 69 47 / 0.12); color: var(--text); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 9999px; flex-shrink: 0; }
.dot-brand { background: #1963e3; }
.dot-success { background: #12b886; }
.dot-warning { background: #c38d2d; }
.dot-danger { background: #a8452f; }
.dot-muted { background: #475569; }
[data-theme="dark"] .dot-muted { background: #e2e8f0; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
.table-base { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.table-base thead th {
  padding: 12px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table-base tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.table-base tbody tr:last-child td { border-bottom: 0; }
.table-base tbody tr:hover { background: var(--surface-2); }
.table-base .num { font-family: var(--font-mono); font-size: 13px; }
.cell-main { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--text-muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  padding: 10px 16px; font-family: inherit; font-size: 14px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; transition: color 150ms ease, border-color 150ms ease;
}
.tab:hover { color: var(--text); }
.tab-active { border-bottom-color: #1963e3; color: #1963e3; }
.tab-active:hover { color: #1450c4; }
[data-theme="dark"] .tab-active { color: #ffffff; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; padding: 16px; border-radius: 8px; border: 1px solid; font-size: 14px; }
.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert-info { border-color: rgb(25 99 227 / 0.35); background: rgb(25 99 227 / 0.08); color: var(--text); }
.alert-success { border-color: rgb(18 184 134 / 0.4); background: rgb(18 184 134 / 0.08); color: var(--text); }
.alert-warning { border-color: rgb(195 141 45 / 0.45); background: rgb(195 141 45 / 0.1); color: var(--text); }
.alert-danger { border-color: rgb(168 69 47 / 0.4); background: rgb(168 69 47 / 0.08); color: var(--text); }

/* ---------- Quota bars (hijau -> kuning -> merah) ---------- */
.quota { margin-top: 8px; }
.quota-track { height: 8px; border-radius: 9999px; background: var(--surface-3); overflow: hidden; }
.quota-fill { height: 100%; border-radius: 9999px; background: #12b886; transition: width 300ms ease; }
.quota-fill.is-warn { background: #c38d2d; }
.quota-fill.is-danger { background: #a8452f; }
.quota-label { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-muted); }

/* ---------- Code / DNS values ---------- */
.code-block {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; overflow-x: auto; white-space: pre; color: var(--text);
}
.dns-value { font-family: var(--font-mono); font-size: 13px; word-break: break-all; color: var(--text); }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-family: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.copy-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgb(20 33 59 / 0.55); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-overlay.is-open { display: flex; }
.modal { display: flex; flex-direction: column; max-height: 90vh; max-height: 90dvh; width: 100%; max-width: 560px; margin: auto; flex-shrink: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.modal-lg { max-width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px; }
.modal form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-header, .modal-footer { flex-shrink: 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px dashed #1963e3; border-radius: 8px; background: rgb(25 99 227 / 0.06); font-family: var(--font-mono); font-size: 13px; word-break: break-all; }

/* ---------- States: empty / loading / error ---------- */
.empty-state { padding: 40px 20px; text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 12px; background: var(--surface-2); color: var(--text-muted); }
.empty-state h3 { font-size: 15px; margin-bottom: 4px; }
.empty-state p { font-size: 13px; color: var(--text-muted); }
.empty-state .btn { margin-top: 16px; }
.skeleton { border-radius: 8px; background: var(--surface-3); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 9999px; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; padding: 12px 16px; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; color: var(--text-muted); }

/* ---------- Wizard steps ---------- */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; overflow-x: auto; padding-bottom: 4px; }
.step { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.step-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9999px; background: var(--surface-3); color: var(--text-muted); font-size: 13px; font-weight: 600; }
.step-label { font-size: 13px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.step.is-active .step-num { background: #1963e3; color: #ffffff; }
.step.is-active .step-label { color: var(--text); font-weight: 600; }
.step.is-done .step-num { background: #12b886; color: #ffffff; }
.step-line { width: 32px; height: 2px; background: var(--border); border-radius: 2px; flex-shrink: 0; }
.step.is-done + .step-line { background: #12b886; }

/* ---------- Marketing nav + pricing (publik) ---------- */
.mkt-nav { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); }
.mkt-nav-inner { max-width: 1280px; margin: 0 auto; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; }
@media (min-width: 640px) { .mkt-nav-inner { padding: 0 32px; } }
.mkt-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; }
.mkt-links { display: none; align-items: center; gap: 4px; }
@media (min-width: 768px) { .mkt-links { display: flex; } }
.mkt-link { padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-muted); text-decoration: none; }
.mkt-link:hover { background: var(--surface-2); color: var(--text); }
.mkt-actions { display: flex; align-items: center; gap: 8px; }
.mkt-container { max-width: 1280px; margin: 0 auto; padding: 48px 16px; }
@media (min-width: 640px) { .mkt-container { padding: 48px 32px; } }
.mkt-hero { text-align: center; max-width: 680px; margin: 0 auto; }
.mkt-hero h1 { font-size: 30px; line-height: 1.15; margin: 12px 0 32px; }
@media (min-width: 640px) { .mkt-hero h1 { font-size: 40px; } }
.mkt-hero p.lead { color: var(--text-muted); font-size: 15px; }
.mkt-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.pricing-grid { display: grid; gap: 16px; margin-top: 40px; }
@media (min-width: 640px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.pricing-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--shadow-sm); }
.pricing-card.is-featured { border-color: #1963e3; box-shadow: 0 0 0 1px #1963e3, var(--shadow-sm); }
.pricing-flag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); }
.pricing-price { display: flex; align-items: baseline; gap: 4px; margin-top: 16px; }
.pricing-price .amount { font-family: var(--font-mono); font-size: 30px; font-weight: 600; }
.pricing-features { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.pricing-features li { display: flex; gap: 8px; align-items: flex-start; }
.pricing-features svg { flex-shrink: 0; margin-top: 3px; color: #12b886; }
.pricing-card .btn { margin-top: 24px; }
.compare-section { margin-top: 64px; }
.compare-section h2 { font-size: 22px; text-align: center; margin-bottom: 32px; }

/* ---------- Metrics ---------- */
.metrics { display: grid; gap: 16px; }
@media (min-width: 640px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .metrics { grid-template-columns: repeat(4, 1fr); } }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-label { font-size: 14px; color: var(--text-muted); }
.metric-value { margin-top: 12px; font-family: var(--font-mono); font-size: 28px; font-weight: 600; word-break: break-word; }
.metric-sub { margin-top: 4px; font-size: 12px; color: var(--text-muted); }

/* ---------- Webmail ---------- */
.mail-layout { display: grid; gap: 16px; }
@media (min-width: 1024px) { .mail-layout { grid-template-columns: 220px minmax(0, 340px) minmax(0, 1fr); align-items: start; } }
.mail-pane { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.mail-pane-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mail-folder { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; transition: background 150ms ease, color 150ms ease; }
.mail-folder:hover { background: var(--surface-2); color: var(--text); }
.mail-folder.is-active { background: rgb(25 99 227 / 0.1); color: var(--text); }
.mail-folder .count { margin-left: auto; font-size: 12px; font-family: var(--font-mono); }
.mail-list { border-top: 1px solid var(--border); }
.mail-item { display: block; width: 100%; text-align: left; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font-family: inherit; font-size: 14px; line-height: 1.45; cursor: pointer; transition: background 150ms ease; }
.mail-item:hover { background: var(--surface-2); }
.mail-item:focus-visible { outline-offset: -2px; }
.mail-item.is-selected { background: rgb(25 99 227 / 0.08); }
.mail-item.is-unread .mail-subject::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 9999px; background: #1963e3; vertical-align: 1px; }
.mail-item.is-unread .mail-from { font-weight: 700; }
.mail-item.is-unread .mail-subject { font-weight: 700; }
.mail-item.is-unread .mail-time { color: var(--text); font-weight: 600; }
.mail-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mail-from { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-time { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.mail-subject { display: block; margin-top: 2px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-snippet { display: block; margin-top: 2px; font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item .star-btn { width: 40px; height: 40px; }
.mail-item .mail-check { width: 20px; height: 20px; }
[data-theme="dark"] .star-btn { color: #e2e8f0; }
.mail-read-body { padding: 20px; }
.mail-read-body h3 { font-size: 18px; margin-bottom: 4px; }
.wlj-scroll { scrollbar-width: thin; scrollbar-color: #30405b transparent; }
.wlj-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.wlj-scroll::-webkit-scrollbar-track { background: transparent; }
.wlj-scroll::-webkit-scrollbar-thumb { background: #30405b; border-radius: 9999px; }
.wlj-scroll::-webkit-scrollbar-thumb:hover { background: #475569; }
.wlj-scroll::-webkit-scrollbar-thumb:active { background: #1963e3; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 640px) {
  .btn, .input, .tab { min-height: 44px; }
  .table-base thead th, .table-base tbody td { padding-left: 12px; padding-right: 12px; }
}

/* ============================================================
   Webmail standalone shell — BUKAN panel dashboard.
   Tidak ada sidebar di sini. Topbar ramping + konten mail.
   ============================================================ */
.wm-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface-2); }
.wm-topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.wm-topbar-inner { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 16px; min-height: 60px; }
.wm-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap; }
.wm-brand:hover { color: var(--text); }
.wm-search { flex: 1; max-width: 560px; margin: 0 auto; }
.wm-search .input { border-radius: 9999px; background: var(--surface-2); }
.wm-search .input:focus { background: var(--surface); }
.wm-account { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.wm-account .mono { color: var(--text); }
.wm-main { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 16px; }
@media (min-width: 640px) { .wm-main { padding: 24px; } }
.wm-foot { max-width: 1400px; margin: 0 auto; width: 100%; padding: 16px; font-size: 12px; color: var(--text-muted); }
@media (min-width: 1024px) { .wm-search.is-mobile { display: none; } }
@media (max-width: 1023px) {
  .wm-main .toolbar { position: sticky; top: 60px; z-index: 20; margin: 0 0 12px; padding: 12px 0; background: var(--surface-2); border-bottom: 1px solid var(--border); }
  .wm-folders .mail-pane-head { padding: 8px 12px; }
  .wm-folders .folder-list { flex-direction: row; gap: 8px; overflow-x: auto; padding: 12px; }
  .wm-folders .mail-folder { white-space: nowrap; flex-shrink: 0; min-height: 40px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 9999px; background: var(--surface); }
  .wm-folders .mail-folder.is-active { border-color: #1963e3; background: rgb(25 99 227 / 0.1); color: var(--text); }
  .wm-folders .mail-folder .count { margin-left: 4px; }
  .wm-search { display: none; }
  .wm-search.is-mobile { display: block; margin: 0 0 12px; max-width: none; }
}
@media (max-width: 640px) {
  .wm-main .toolbar .btn-primary { flex: 1 1 100%; }
  .wm-main .toolbar .btn:not(.btn-primary) { flex: 1 1 calc(50% - 4px); }
  .mail-item { padding: 14px 16px; }
}

/* ============================================================
   Auth webmail — kartu login mailbox (bukan akun dashboard).
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--surface-2); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 32px 28px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 24px; font-weight: 600; font-size: 16px; }
.auth-card h1 { font-size: 22px; text-align: center; }
.auth-sub { margin-top: 8px; margin-bottom: 24px; font-size: 14px; color: var(--text-muted); text-align: center; }
.auth-card .form-grid { margin-bottom: 16px; }
.auth-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); text-align: center; }

/* ============================================================
   Webmail app — shell aplikasi surat layar penuh.
   .wm-side = sidebar folder MILIK webmail (bukan sidebar panel
   dashboard; isinya hanya folder email, kuota, dan akun mailbox).
   ============================================================ */
.wm-app { display: flex; min-height: 100dvh; background: var(--surface-2); }
.wm-backdrop { position: fixed; inset: 0; z-index: 55; background: rgb(20 33 59 / 0.5); border: 0; padding: 0; cursor: pointer; }
@media (min-width: 1024px) { .wm-backdrop { display: none !important; } }

/* Sidebar folder */
.wm-side { position: fixed; inset: 0 auto 0 0; z-index: 60; width: 264px; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); transform: translateX(-100%); transition: transform 200ms ease; }
.wm-side.is-open { transform: translateX(0); }
@media (min-width: 1024px) { .wm-side { position: sticky; top: 0; height: 100dvh; transform: none; flex-shrink: 0; } }
.wm-side-brand { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 0 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; flex-shrink: 0; }
.wm-side-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #1963e3; color: #ffffff; flex-shrink: 0; }
.wm-side-close { margin-left: auto; }
@media (min-width: 1024px) { .wm-side-close { display: none; } }
.wm-side-compose { padding: 16px 16px 8px; flex-shrink: 0; }
.wm-side-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.wm-group { margin: 20px 12px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.wm-side-foot { border-top: 1px solid var(--border); padding: 16px; flex-shrink: 0; }
.wm-quota-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-muted); }
.wm-quota-hint { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.wm-quota-hint a { color: var(--brand-600, #1963e3); text-decoration: underline; }

/* Kolom utama */
.wm-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100dvh; }
.wm-main-col .wm-topbar { position: static; }
.wm-menu-btn { display: inline-grid; }
@media (min-width: 1024px) { .wm-menu-btn { display: none; } }
.wm-app .wm-topbar .wm-brand { display: none; }
@media (max-width: 1023px) { .wm-app .wm-topbar .wm-brand { display: flex; } }
.wm-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
@media (min-width: 640px) { .wm-scroll { padding: 24px; } }

/* Kepala daftar pesan (sticky) */
.wm-list-head { position: sticky; top: -16px; z-index: 10; margin: -16px -16px 0; padding: 16px 16px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
@media (min-width: 640px) { .wm-list-head { top: -24px; margin: -24px -24px 0; padding: 16px 24px 12px; } }
.wm-list-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wm-list-title h1 { font-size: 20px; letter-spacing: -0.01em; }
.wm-select-all { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.wm-select-all h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-page { display: flex; align-items: center; gap: 4px; }
.wm-list-meta { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.wm-list-meta .sep { width: 1px; height: 24px; margin: 0 8px; background: var(--border); }
.wm-bulk { display: flex; align-items: center; gap: 4px; }
.wm-page-label { white-space: nowrap; margin: 0 4px; }
.chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 2px; }
.chip { flex-shrink: 0; min-height: 40px; padding: 8px 14px; border-radius: 9999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background 150ms ease, color 150ms ease, border-color 150ms ease; }
.chip:hover { color: var(--text); }
.chip.is-active { background: var(--text); color: var(--surface); border-color: var(--text); }
.wm-list-pane { margin-top: 8px; background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }

/* Baris pesan full-width: ceklis | bintang | pengirim | subjek+cuplikan | waktu */
.mail-item-row { display: flex; align-items: center; gap: 12px; }
.mail-item-main { flex: 1; min-width: 0; }
@media (min-width: 1024px) {
  .mail-item { padding: 10px 12px; }
  .mail-item-row .mail-from { flex: 0 0 200px; }
  .mail-item-main { display: flex; align-items: baseline; gap: 8px; }
  .mail-subject { flex: 0 1 auto; min-width: 0; margin-top: 0; }
  .mail-snippet { flex: 1 1 auto; min-width: 0; margin-top: 0; }
}
@media (max-width: 1023px) {
  .mail-item-row { flex-wrap: wrap; gap: 4px 12px; }
  .mail-item-row .mail-check { order: 1; }
  .mail-item-row .star-btn { order: 2; }
  .mail-item-row .mail-from { order: 3; flex: 1 1 auto; }
  .mail-item-row .mail-time { order: 4; margin-left: auto; }
  .mail-item-main { order: 5; flex: 1 1 100%; }
}

/* Tampilan baca */
.read-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.read-bar .sep { width: 1px; height: 24px; margin: 0 8px; background: var(--border); }
.read-subject { font-size: 20px; line-height: 1.3; margin-bottom: 16px; max-width: 900px; }
@media (min-width: 640px) { .read-subject { font-size: 24px; } }
.read-head { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; }
.read-head-top { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.read-head-meta { flex: 1; min-width: 200px; font-size: 14px; }
.read-head-meta .mono { font-size: 13px; color: var(--text-muted); }
.read-head-side { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.read-to { margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.read-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 13px; color: var(--text-muted); }
.read-banner .spacer { flex: 1 1 auto; }
.read-body-card { margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px 20px; }
@media (min-width: 640px) { .read-body-card { padding: 32px; } }
.read-body-inner { width: 100%; font-size: 15px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.read-body-inner p { margin-bottom: 16px; }
.read-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Tombol tulis mengambang (mobile saja) */
.wm-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 9999px; background: #1963e3; color: #ffffff; cursor: pointer; box-shadow: var(--shadow-lg); }
.wm-fab:hover { background: #1450c4; }
@media (min-width: 1024px) { .wm-fab { display: none; } }
@media (max-width: 1023px) { #view-list { padding-bottom: 72px; } }
@media (max-width: 640px) {
  .wm-list-title { flex-wrap: wrap; row-gap: 4px; }
  .wm-page { margin-left: auto; }
  .wm-list-meta { display: contents; }
  .wm-list-meta .sep { display: none; }
  .wm-bulk { order: 3; flex: 1 1 100%; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
}
@media (max-width: 380px) {
  .wm-page-label { display: none; }
}
@media (max-width: 640px) {
  .input { font-size: 16px; } /* cegah auto-zoom iOS saat input disentuh */
}
/* Email HTML dirender dalam iframe terisolasi (skrip mati, gaya tidak bocor) */
.read-html-wrap { width: 100%; }
.read-html-frame { display: block; width: 100%; min-height: 420px; border: 0; border-radius: 8px; background: #ffffff; }
/* Modal menjadi lembar penuh di HP: header + tombol aksi selalu terlihat, isi yang scroll */
@media (max-width: 640px) {
  .modal-overlay { padding: 0; }
  .modal-overlay .modal { max-width: none; max-height: none; height: 100%; height: 100dvh; border: 0; border-radius: 0; }
}
