/* ==========================================================================
   Billing Selakambang — Modern SaaS Design System (Aligned with app-monitoring)
   Clean White Layout, Blue Brand (#2563eb), Slate-50 (#f8fafc), Modern Status Pills
   ========================================================================== */

:root {
  /* Brand colors */
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #eff6ff;
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --accent: #f59e0b;

  /* Status semantic colors */
  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --ok-border: #bbf7d0;
  
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --warn-border: #fde68a;
  
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  
  --info: #2563eb;
  --info-soft: #eff6ff;
  --info-border: #bfdbfe;

  /* Neutral palette (Tailwind Slate-style) */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --border-2: #f1f5f9;

  /* Navigation (Clean White Sidebar) */
  --nav-bg: #ffffff;
  --nav-hover: #f8fafc;
  --nav-active: #eff6ff;
  --nav-text: #64748b;
  --nav-text-active: #2563eb;
  --nav-border: #e2e8f0;

  /* Typography */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* Elevation & Metrics */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
  --shadow-2: 0 4px 14px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --sidebar-w: 260px;
  --topbar-h: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  font-size: 14px;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.bare {
  background: #f8fafc;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-strong);
  text-decoration: none;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  color: #0f172a;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  border: 1px solid var(--border);
}

em {
  font-style: normal;
  color: var(--text-3);
}

/* Custom modern scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---- App Shell (Sidebar & Main Content) -------------------------------- */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--nav-bg);
  color: var(--nav-text);
  border-right: 1px solid var(--nav-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.brand-mark.lg {
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  border-radius: 14px;
}

.brand-text {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.2;
}

.brand-text small {
  display: block;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.6rem;
}

.nav-group {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0.9rem 0.85rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  color: var(--nav-text);
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--nav-hover);
  color: var(--text);
  text-decoration: none;
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
  border-right: 3px solid var(--brand);
}

.nav-item.is-soon {
  color: #cbd5e1;
  font-size: 0.75rem;
  cursor: default;
  padding: 0.35rem 0.85rem;
}

.nav-item.is-soon:hover {
  background: none;
}

.nav-ico {
  width: 1.2em;
  text-align: center;
  opacity: 0.85;
  font-size: 1rem;
}

.sidebar-foot {
  padding: 0.85rem 1.25rem;
  font-size: 0.72rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.sidebar-backdrop {
  display: none;
}

/* ---- Topbar ----------------------------------------------------------- */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-spacer {
  flex: 1;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-2);
  padding: 0.3rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9999px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.only-mobile {
  display: none;
}

.usermenu {
  position: relative;
}

.usermenu > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.usermenu > summary::-webkit-details-marker {
  display: none;
}

.usermenu > summary:hover {
  background: var(--surface-2);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-100);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.82rem;
}

.usermenu-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.usermenu-meta strong {
  font-size: 0.82rem;
  color: var(--text);
}

.usermenu-meta small {
  font-size: 0.68rem;
  color: var(--text-3);
  font-weight: 500;
}

.usermenu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  min-width: 160px;
  padding: 0.4rem;
  z-index: 50;
  animation: fadeIn 0.15s ease-out;
}

.usermenu-pop a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
}

.usermenu-pop a:hover {
  background: var(--surface-2);
  color: var(--brand);
  text-decoration: none;
}

/* ---- Content Area -------------------------------------------------------- */
.content {
  padding: 1.75rem 2rem;
  max-width: 1440px;
  width: 100%;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
}

.page-sub {
  font-size: 0.82rem;
  color: var(--text-2);
  margin-top: 0.2rem;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ---- Cards (Modern Card System) ----------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-site {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: all 0.15s ease-in-out;
}

.card-site:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-2);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.card-body {
  padding: 1.25rem;
}

.settings-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.settings-cols .card {
  margin: 0;
}

/* ---- Stat Cards (KPI Dashboard Grid) ----------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.stat-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-2);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #f0fdf4; color: #16a34a; }
.stat-icon.amber { background: #fffbeb; color: #d97706; }
.stat-icon.red { background: #fef2f2; color: #dc2626; }

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
  margin: 0.2rem 0;
  letter-spacing: -0.02em;
}

.stat-hint {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 500;
}

/* ---- Tables (Clean Table System) --------------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  /* JANGAN sticky dengan top: var(--topbar-h): tabel ada di dalam wadah overflow-x:auto, jadi
     offset itu dihitung dari wadah -> header melayang menutupi baris pertama (B35) */
}

.table tbody td {
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
  color: var(--text);
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover td {
  background: #f8fafc;
}

.rail td:first-child { box-shadow: inset 3px 0 0 var(--text-3); }
.rail-ok td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.rail-danger td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

.row-edit-panel td {
  padding: 0 1.15rem;
}

.row-edit-panel .disclosure {
  border: 0;
  box-shadow: none;
  margin: 0;
}

.empty {
  text-align: center;
  color: var(--text-3);
  padding: 2.5rem 1rem;
  font-size: 0.85rem;
}

.ta-r { text-align: right; }
.ta-c { text-align: center; }

.mono {
  font-family: var(--mono);
  font-size: 0.84rem;
}

.kv {
  width: 100%;
  font-size: 0.84rem;
  border-collapse: collapse;
}

.kv th {
  text-align: left;
  color: var(--text-2);
  font-weight: 500;
  padding: 0.5rem 0.85rem 0.5rem 0;
  vertical-align: top;
  white-space: nowrap;
  width: 1%;
}

.kv td {
  padding: 0.5rem 0;
  color: var(--text);
}

/* ---- Status Pills & Badges --------------------------------------------- */
.pill-blue {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pill-green {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background-color: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pill-red {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pill-amber {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pill-slate {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background-color: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-border); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); }
.badge-info { background: var(--info-soft); color: var(--info); border: 1px solid var(--info-border); }

/* ---- Form Controls ----------------------------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.form.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-2);
}

.field > span {
  font-weight: 600;
  color: #334155;
}

.input, .field input, .field select, .field textarea, .toolbar .input {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  width: 100%;
  transition: all 0.15s ease;
}

.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.field textarea {
  resize: vertical;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--text);
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  border-radius: 4px;
}

.field-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  grid-column: 1 / -1;
  padding-top: 0.5rem;
}

.hint {
  font-size: 0.72rem;
  color: var(--text-3);
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.btn:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #ffffff;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.btn-danger:hover {
  background: #fee2e2;
  color: #991b1b;
}

.btn-primary.btn-danger, .btn.btn-danger:not(.btn-ghost) {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-primary.btn-danger:hover, .btn.btn-danger:not(.btn-ghost):hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-block {
  width: 100%;
}

/* ---- Chips & Filter Bars ----------------------------------------------- */
.chip-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s ease;
}

.chip-filter:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.chip-filter.active {
  background-color: var(--brand-soft);
  border-color: var(--brand-500);
  color: var(--brand-600);
  font-weight: 600;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.filter-bar .input, .filter-bar select {
  width: auto;
  min-width: 140px;
  flex: 0 1 220px;
}

/* ---- Disclosure & Toolbar ---------------------------------------------- */
.disclosure > summary {
  cursor: pointer;
  list-style: none;
}

.disclosure > summary::-webkit-details-marker {
  display: none;
}

.disclosure.card > summary {
  padding: 1rem 1.25rem;
}

.disclosure.card[open] > summary {
  border-bottom: 1px solid var(--border-2);
}

.tiny-summary {
  font-size: 0.8rem;
  color: var(--brand);
  font-weight: 600;
  padding: 0.55rem 0;
}

.toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  max-width: 520px;
}

.toolbar .input {
  flex: 1;
}

/* ---- Flash Messages ---------------------------------------------------- */
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.flash {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  border: 1px solid;
}

.flash-info { background: var(--info-soft); border-color: var(--info-border); color: #1e3a8a; }
.flash-success { background: var(--ok-soft); border-color: var(--ok-border); color: #14532d; }
.flash-danger { background: var(--danger-soft); border-color: var(--danger-border); color: #7f1d1d; }
.flash-warn { background: var(--warn-soft); border-color: var(--warn-border); color: #78350f; }

.flash-x {
  border: 0;
  background: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
}

.flash-x:hover {
  opacity: 1;
}

/* ---- Auth Screens ------------------------------------------------------ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: var(--bg);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 2.25rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-brand {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

.auth-card h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.auth-sub {
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 1.5rem;
}

.auth-card .form {
  text-align: left;
}

.auth-foot {
  color: var(--text-3);
  font-size: 0.72rem;
  margin-top: 1rem;
}

/* ---- Error Screens ----------------------------------------------------- */
.err-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text);
  text-align: center;
  padding: 1.5rem;
}

.err-code {
  font-size: 4rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
}

/* ---- Grid & Layout Helpers --------------------------------------------- */
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.hidden-form { display: none; }
.tiny-link { font-size: 0.75rem; color: var(--brand); }

.dash-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.row-2 .card, .row-2 .filter-bar {
  margin: 0;
}

@media (max-width: 900px) {
  .dash-cols, .row-2 {
    grid-template-columns: 1fr;
  }
}

.table.compact td, .table.compact th {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.table.compact thead th {
  position: static;
}

.total-row td, .table tfoot td {
  font-weight: 700;
  background: var(--surface-2);
  border-top: 2px solid var(--border);
}

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tab {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text);
  text-decoration: none;
}

.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* ---- Pagination -------------------------------------------------------- */
.pager {
  display: flex;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.pager a, .pager-cur, .pager-gap {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  border: 1px solid var(--border);
  font-weight: 500;
}

.pager a {
  color: var(--text-2);
  background: var(--surface);
}

.pager a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.pager-cur {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 700;
}

.pager-gap {
  border-color: transparent;
  color: var(--text-3);
}

/* ---- WhatsApp Inbox Chat UI -------------------------------------------- */
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
  min-width: 18px;
  text-align: center;
}

.chat-wrap {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
  height: calc(100vh - var(--topbar-h) - 8rem);
  min-height: 480px;
}

.chat-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.chat-search {
  display: flex;
  gap: 0.4rem;
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

/* judul kolom yang bisa diklik untuk sortir */
.th-urut {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.th-urut:hover,
.th-urut.aktif {
  color: var(--brand);
}
.th-urut .th-panah {
  font-size: 0.65rem;
  opacity: 0.45;
}
.th-urut.aktif .th-panah {
  opacity: 1;
}

/* tabel lebar bisa digeser di HP tanpa membuat halaman ikut melebar */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chat-filter {
  display: flex;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  flex-shrink: 0;
}
.chat-filter .chip {
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  text-decoration: none;
}
.chat-filter .chip.active {
  background: #dcfce7;
  color: #166534;
}
.chat-filter .chip-count {
  display: inline-block;
  margin-left: 0.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 0.6875rem;
}

.thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.thread-list .empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-3);
  font-size: 0.85rem;
}

.thread {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-2);
  color: var(--text);
  transition: background 0.15s;
}

.thread:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.thread.active {
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
}

.thread-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.thread-sub {
  font-size: 0.76rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.thread-time {
  font-size: 0.68rem;
  color: var(--text-3);
}

.chat-main {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.chat-main > div:first-child {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f8fafc;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  gap: 0.5rem;
  font-size: 0.88rem;
}

.bubble {
  max-width: 75%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.84rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  line-height: 1.45;
}

.bubble.in {
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  background: #ffffff;
}

.bubble.out {
  align-self: flex-end;
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
  border-bottom-right-radius: 3px;
}

.bubble-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble-meta {
  font-size: 0.66rem;
  color: var(--text-3);
  margin-top: 0.25rem;
}

.txt-danger {
  color: var(--danger);
  font-weight: 600;
}

.chat-compose {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  align-items: flex-end;
}

.chat-compose textarea {
  flex: 1;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.chat-note {
  padding: 0 1.25rem 0.75rem;
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-3);
}

.chat-back { display: none; }
.bubble-img { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin-bottom: .3rem;
  background: #e2e8f0; }
.bubble-img.stiker { max-height: 140px; background: transparent; }
.bubble-audio { width: 240px; max-width: 100%; height: 36px; display: block; }
.bubble-file { font-weight: 600; }

/* HP: daftar percakapan ATAU chat, bukan bertumpuk atas-bawah */
@media (max-width: 900px) {
  .chat-wrap {
    grid-template-columns: 1fr;
    gap: 0;
    height: calc(100vh - var(--topbar-h) - 2.5rem);
    height: calc(100dvh - var(--topbar-h) - 2.5rem);
    min-height: 0;
  }
  .chat-wrap.ada-thread .chat-list { display: none; }
  .chat-wrap:not(.ada-thread) .chat-main { display: none; }
  .content:has(.chat-wrap.ada-thread) > .page-head { display: none; }
  .chat-list, .chat-main { height: 100%; max-height: none; }
  .chat-log { max-height: none; padding: .85rem; }
  .chat-head { padding: .6rem .75rem !important; gap: .4rem; }
  .chat-head .btn { padding: .35rem .55rem; font-size: .72rem; }
  .bubble { max-width: 88%; }
  .chat-back { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2.25rem;
    width: 2.25rem; height: 2.25rem; border-radius: 999px; font-size: 1.3rem; color: var(--text);
    text-decoration: none; }
  .chat-back:hover { background: var(--surface-2); text-decoration: none; }
  .chat-note { display: none; }
  .chat-compose { padding: .6rem .75rem; }
  .chat-compose textarea { resize: none; }
}

hr.soft {
  border: 0;
  border-top: 1px solid var(--border-2);
  margin: 1.25rem 0;
}

.wa-status {
  font-size: 0.85rem;
}

.wa-status p {
  margin: 0.4rem 0;
}

.wa-qr {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  margin: 0.5rem 0;
  image-rendering: pixelated;
}

.thumbs {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.thumbs img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

input[type="file"] {
  font-size: 0.8rem;
  padding: 0.4rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  width: 100%;
}

.htmx-request.filter-bar, .htmx-request #list-card {
  opacity: 0.6;
  transition: opacity 0.15s;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form .input {
  width: auto;
  flex: 0 1 180px;
}

.input.sm {
  width: auto;
  flex: 0 0 130px;
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
}

.pay-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.bulk-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: -0.5rem;
  margin-bottom: 1.25rem;
}

/* Mini Bar Chart */
.bars {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  height: 130px;
  padding-top: 0.5rem;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
}

.bar-stack {
  flex: 1;
  display: flex;
  gap: 3px;
  align-items: flex-end;
  width: 100%;
  justify-content: center;
}

.bar {
  width: 14px;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}

.bar-in { background: var(--brand); }
.bar-out { background: var(--danger); }
.bar-label { font-size: 0.68rem; color: var(--text-3); font-family: var(--mono); }

.legend {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
  margin-left: 0.6rem;
}

.legend .dot:first-child {
  margin-left: 0;
}

.dot-in { background: var(--brand); }
.dot-out { background: var(--danger); }

/* ---- Invoice Cetak (Print Styles) -------------------------------------- */
.inv-a4 {
  max-width: 720px;
  margin: 1.5rem auto;
  background: #fff;
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #111;
  box-shadow: var(--shadow-2);
}

.inv-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 1rem;
}

.inv-head h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.inv-meta {
  text-align: right;
  font-family: var(--mono);
}

.inv-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.inv-to {
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
}

.inv-table th, .inv-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.inv-table thead th {
  background: var(--surface-2);
  text-align: left;
  font-weight: 700;
}

.inv-table tfoot td {
  border-top: 2px solid #0f172a;
  border-bottom: none;
  font-size: 1rem;
  font-weight: 700;
}

.inv-status {
  margin: 1rem 0;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.inv-status.is-paid {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}

.inv-foot {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-2);
}

.inv-thermal {
  width: 280px;
  margin: 1rem auto;
  background: #fff;
  color: #000;
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
}

.inv-thermal .c { text-align: center; }
.inv-thermal .bold { font-weight: 700; }
.inv-thermal .sm { font-size: 11px; }
.inv-thermal .hr { border-top: 1px dashed #000; margin: 6px 0; }
.inv-thermal .kv { display: flex; justify-content: space-between; gap: 8px; }
.no-print { display: block; margin: 1rem auto 0; }

@media print {
  .no-print { display: none; }
  body, body.bare { background: #fff; }
  .inv-a4, .inv-thermal { border: none; margin: 0; box-shadow: none; }
}

/* ---- Responsive (Mobile Sidebar Offcanvas) ----------------------------- */
@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
  }
  .sidebar.open {
    transform: none;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.15);
  }
  .main {
    margin-left: 0;
  }
  .only-mobile {
    display: inline-flex;
  }
  .sidebar-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 35;
  }
  .content {
    padding: 1.25rem 1rem;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   UTILITIES — kelas gaya Tailwind yang dipakai di template.
   Tanpa blok ini SVG tanpa width/height jatuh ke ukuran default (raksasa),
   dan utilitas spacing/warna tidak berefek sama sekali.
   ========================================================================== */

/* ---- Ikon (PENTING) ---------------------------------------------------- */
.icon      { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
.icon-sm   { width: 1rem;    height: 1rem; }
.icon-lg   { width: 1.5rem;  height: 1.5rem; }
.icon-xl   { width: 2rem;    height: 2rem; }

/* Jaring pengaman: svg inline tanpa ukuran eksplisit tidak boleh meledak. */
.card svg:not([width]):not([height]),
.card-title svg:not([width]):not([height]),
.btn svg:not([width]):not([height]) { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.btn svg { margin-right: .35rem; }
.card-title svg { color: var(--brand); }

/* ---- Layout ------------------------------------------------------------ */
.flex            { display: flex; }
.inline-flex     { display: inline-flex; }
.block           { display: block; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-wrap       { flex-wrap: wrap; }
.flex-1          { flex: 1 1 0%; min-width: 0; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }

/* ---- Spacing ----------------------------------------------------------- */
.mt-1 { margin-top: .25rem; }  .mt-2 { margin-top: .5rem; }  .mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }   .mb-6 { margin-bottom: 1.5rem; }
.ml-1 { margin-left: .25rem; }   .ml-2 { margin-left: .5rem; }
.p-4  { padding: 1rem; }         .p-6  { padding: 1.5rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

/* ---- Teks -------------------------------------------------------------- */
.text-xs  { font-size: .72rem; }
.text-sm  { font-size: .82rem; }
.text-lg  { font-size: 1.05rem; }
.text-center { text-align: center; }
.uppercase   { text-transform: uppercase; }
.tracking-wider { letter-spacing: .05em; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-mono     { font-family: var(--mono); }

.text-blue-600    { color: #2563eb; }
.text-indigo-600  { color: #4f46e5; }
.text-sky-500     { color: #0ea5e9; }
.text-green-600   { color: #16a34a; }
.text-emerald-600 { color: #059669; }
.text-rose-600    { color: #e11d48; }
.text-amber-600   { color: #d97706; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }

.hover\:underline:hover      { text-decoration: underline; }
.hover\:text-blue-600:hover  { color: #2563eb; }

/* ---- Komponen kecil yang belum punya kelas dasar ------------------------ */
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem; border-radius: 9999px;
  font-size: .72rem; font-weight: 600; line-height: 1.5;
  border: 1px solid transparent; white-space: nowrap;
}
.btn-secondary {
  background: var(--surface); color: var(--text-2); border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }

.search-wrap { position: relative; display: flex; align-items: center; flex: 1; }
.search-wrap .input { padding-left: 2.1rem; }
.search-icon {
  position: absolute; left: .65rem; width: 1rem; height: 1rem;
  color: var(--text-3); pointer-events: none;
}

/* ---- Angka statistik: pakai sans + tabular, bukan mono ------------------ */
/* JetBrains Mono tidak di-bundle -> fallback Consolas bikin "0" bergaris   */
/* dan spasi lebar di HP. Sans + tabular-nums tetap rapi lurus.             */
.stat-value { font-family: var(--sans); font-variant-numeric: tabular-nums; }

/* ---- Responsif tambahan ------------------------------------------------ */
@media (max-width: 640px) {
  .content { padding: 1rem .85rem; }
  .page-title { font-size: 1.15rem; }
  .stat-value { font-size: 1.45rem; }
  .card-body { padding: .95rem; }
  .settings-cols { grid-template-columns: 1fr; }
  .filter-bar .input, .filter-bar select { flex: 1 1 100%; min-width: 0; }
  .table { font-size: .8rem; }
  .table thead th, .table tbody td { padding: .5rem .6rem; }
  .field-actions { flex-wrap: wrap; }
}

/* ---- Modal (ganti <details> yang mendorong konten ke bawah) -------------- */
dialog.modal {
  /* Reset global `* { margin: 0 }` mematikan `margin:auto` bawaan <dialog>,
     yang justru tugasnya menengahkan modal. Kembalikan di sini. */
  margin: auto;
  border: 0; padding: 0; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: 0 24px 48px -12px rgba(15, 23, 42, .25);
  width: min(720px, 94vw); max-height: 88vh; overflow: hidden;
}
/* JANGAN set display di selector dasar — itu menimpa `display:none` bawaan
   <dialog> yang tertutup, sehingga isinya bocor ke halaman. */
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
dialog.modal[open] { animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-2); flex: 0 0 auto;
}
.modal-head h2 { font-size: .98rem; font-weight: 700; }
.modal-body { padding: 1.25rem; overflow-y: auto; flex: 1 1 auto; }
.modal-x {
  border: 0; background: transparent; font-size: 1.4rem; line-height: 1;
  color: var(--text-3); cursor: pointer; padding: .1rem .35rem; border-radius: 6px;
}
.modal-x:hover { background: var(--surface-2); color: var(--text); }

/* ---- Pemilih provider pengiriman ---------------------------------------- */
.provider-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 700px) { .provider-pick { grid-template-columns: 1fr; } }
.provider-opt {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem .95rem;
  background: var(--surface);
}
.provider-opt.is-on { border-color: var(--brand); background: var(--brand-soft); }
.provider-info { display: flex; flex-direction: column; min-width: 0; }
.provider-info strong { font-size: .9rem; }
.provider-info small { font-size: .74rem; color: var(--text-3); }
.provider-opt button[disabled] { opacity: .45; cursor: not-allowed; }

/* ---- Rekening & QRIS ---------------------------------------------------- */
.inv-brand { display: flex; align-items: center; gap: .75rem; }
.inv-logo { max-width: 88px; max-height: 60px; object-fit: contain; }
.inv-logo-sm { max-width: 120px; max-height: 48px; object-fit: contain; }
.logo-preview { max-width: 150px; max-height: 90px; object-fit: contain;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px; background: #fff; margin-top: .5rem; }
/* logo di sidebar menggantikan ikon default; dibatasi agar tidak merusak baris */
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand-mark.has-logo { background: #fff; padding: 3px; }
.qris-preview { max-width: 190px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px; background: #fff; margin-top: .5rem; }
.rek-list { list-style: none; padding: 0; margin: .5rem 0 0; display: flex;
  flex-direction: column; gap: .35rem; }
.rek-list li { font-size: .83rem; padding: .45rem .6rem; background: var(--surface-2);
  border-radius: var(--radius-sm); }
.rek-list .bank { font-weight: 700; }
.rek-list .no { font-family: var(--mono); }
.link-salin { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; }
.link-salin-baris { display: flex; gap: .4rem; }
.link-salin-baris .input { flex: 1; min-width: 0; font-size: .75rem; }
.rek-list .rek-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.rek-list .rek-info { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.rek-list .rek-info .no { font-size: .95rem; font-weight: 600; letter-spacing: .02em; }
.rek-list .rek-salin { flex-shrink: 0; min-width: 4.5rem; }
.rek-list .rek-salin.tersalin { background: #dcfce7; border-color: #86efac; color: #166534; }

.inv-pay { margin-top: 1.2rem; padding: .9rem 1rem; border: 1px dashed var(--border);
  border-radius: 8px; font-size: .85rem; }
.inv-pay-row { display: flex; gap: 1.2rem; align-items: flex-start;
  justify-content: space-between; margin-top: .4rem; }

/* --- timeline tiket ------------------------------------------------------ */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--border); }
.tl-item { position: relative; padding: 0 0 1.1rem .75rem; }
.tl-item::before { content: ""; position: absolute; box-sizing: border-box; top: .25rem;
  left: calc(-1.25rem - 1px - .375rem); width: .75rem; height: .75rem; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand, #2563eb); }
.tl-item.tl-status::before { background: var(--brand, #2563eb); }
.tl-meta { font-size: .75rem; color: var(--text-2, #64748b); }
.tl-body { margin-top: .2rem; white-space: pre-wrap; word-break: break-word; }

/* --- daftar pilih di modal (jadwal isolir, task massal) ------------------ */
.pick-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius-sm); }
.pick-list .table { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.opsi-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2, #f8fafc); }
.opsi-bar .input { width: auto; display: inline-block; }

/* --- portal pelanggan ---------------------------------------------------- */
.portal { min-height: 100vh; display: flex; flex-direction: column; }
.portal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; padding: .75rem 1.25rem; background: var(--surface, #fff);
  border-bottom: 1px solid var(--border); }
.portal-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700;
  color: var(--text); text-decoration: none; }
.portal-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.portal-nav a { padding: .4rem .75rem; border-radius: var(--radius-sm); color: var(--text-2);
  text-decoration: none; font-size: .875rem; font-weight: 600; }
.portal-nav a.active, .portal-nav a:hover { background: var(--surface-2, #f1f5f9); color: var(--text); }
.portal-main { width: 100%; max-width: 960px; margin: 0 auto; padding: 1.25rem; display: flex;
  flex-direction: column; gap: 1rem; flex: 1; box-sizing: border-box; }
.portal-foot { text-align: center; font-size: .75rem; color: var(--text-3, #94a3b8); padding: 1rem; }
.portal-total { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.portal-akun { display: flex; flex-direction: column; gap: .45rem; }
.kredensial { font-family: var(--font-mono, ui-monospace, monospace); font-size: 1.3rem; font-weight: 700;
  letter-spacing: .04em; padding: .35rem .7rem; background: var(--surface-2, #f1f5f9);
  border-radius: var(--radius-sm); display: inline-block; user-select: all; }
