/* ============================================================
   NusaNet Billing Pro — tema glassmorphism indigo/violet
   ============================================================ */
:root {
  --indigo: #4F46E5;
  --violet: #8B5CF6;
  --sky: #38BDF8;
  --pink: #F472B6;
  --grad: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);
  --grad-soft: linear-gradient(135deg, rgba(79,70,229,.12), rgba(139,92,246,.12));
  --bg: #F3F0FF;
  --ink: #1F1B3A;
  --muted: #635F82;
  --line: rgba(99, 95, 130, .14);
  --card: rgba(255, 255, 255, .62);
  --card-strong: rgba(255, 255, 255, .82);
  --input: rgba(255, 255, 255, .78);
  --sidebar: linear-gradient(180deg, #241C56 0%, #1B1546 60%, #14102F 100%);
  --sidebar-ink: #D9D5F5;
  --shadow: 0 12px 34px rgba(79, 70, 229, .10);
  --shadow-lg: 0 22px 60px rgba(31, 27, 58, .16);
  --radius: 18px;
  --ok: #059669;
  --warn: #D97706;
  --danger: #DC2626;
  --info: #0284C7;
}
[data-theme="dark"] {
  --bg: #0C0920;
  --ink: #ECE9FB;
  --muted: #A6A1C6;
  --line: rgba(255, 255, 255, .09);
  --card: rgba(30, 25, 62, .60);
  --card-strong: rgba(34, 29, 70, .86);
  --input: rgba(255, 255, 255, .05);
  --sidebar: linear-gradient(180deg, #191340 0%, #130F33 60%, #0D0A24 100%);
  --shadow: 0 14px 40px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before, body::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none;
  border-radius: 50%; filter: blur(90px); opacity: .55;
}
body::before {
  width: 620px; height: 620px; top: -240px; left: -140px;
  background: radial-gradient(circle, rgba(139,92,246,.55), transparent 65%);
}
body::after {
  width: 560px; height: 560px; bottom: -220px; right: -120px;
  background: radial-gradient(circle, rgba(56,189,248,.38), transparent 65%);
}
[data-theme="dark"] body::before { opacity: .38; }
[data-theme="dark"] body::after { opacity: .28; }

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0 0 10px; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-family: "SFMono-Regular", ui-monospace, Menlo, monospace; font-size: 12.5px; }
.ic { flex: 0 0 auto; vertical-align: middle; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------- Layout ---------------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; position: relative; z-index: 1; }
/* Lapisan gelap menu mobile: harus tetap tersembunyi di desktop.
   Sebelumnya aturan ini hanya ada di media query sehingga div .scrim
   menempati kolom grid konten dan mendorong seluruh isi aplikasi ke bawah. */
.scrim { display: none; }

.sidebar {
  grid-column: 1;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  padding: 18px 14px 26px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 8px 20px rgba(79,70,229,.45); letter-spacing: -.5px;
}
.brand-txt b { display: block; color: #fff; font-size: 14.5px; letter-spacing: -.2px; }
.brand-txt span { font-size: 11px; color: #A8A2D8; letter-spacing: .06em; text-transform: uppercase; }
.nav-group { margin-top: 12px; padding: 0 8px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #8B84C4; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px;
  color: var(--sidebar-ink); font-size: 13.2px; font-weight: 500; text-decoration: none;
  transition: background .16s, color .16s, transform .16s; margin: 1px 0;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav a.active {
  background: var(--grad); color: #fff; font-weight: 600;
  box-shadow: 0 8px 22px rgba(79,70,229,.42);
}
.nav a.active .ic { color: #fff; }
.nav .count { margin-left: auto; background: rgba(255,255,255,.18); color: #fff; font-size: 10.5px; padding: 1px 7px; border-radius: 20px; font-weight: 700; }
.sidebar .foot { margin-top: auto; padding: 14px 10px 0; font-size: 11px; color: #8B84C4; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .foot b { color: #C9C4EE; }

.main { min-width: 0; display: flex; flex-direction: column; grid-column: 2; }
@media (max-width: 1024px) { .main { grid-column: 1 / -1; } }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.hamburger { display: none; background: none; border: 0; color: var(--ink); padding: 6px; border-radius: 10px; cursor: pointer; }
.topbar .crumb { font-size: 12.5px; color: var(--muted); }
.topbar .crumb b { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.tenant-pick { display: flex; align-items: center; gap: 8px; }
.tenant-pick select {
  background: var(--card-strong); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 7px 10px; font-size: 12.5px; max-width: 230px;
}
.icon-btn {
  width: 37px; height: 37px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); display: inline-grid; place-items: center;
  cursor: pointer; position: relative; transition: .16s;
}
.icon-btn:hover { background: var(--card-strong); transform: translateY(-1px); }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #EF4444; border: 2px solid var(--bg); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 8px 5px 5px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.avatar { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--grad); flex: 0 0 auto; }
.avatar.lg { width: 46px; height: 46px; border-radius: 14px; font-size: 15px; }
.user-chip .u-name { font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.user-chip .u-role { font-size: 10.5px; color: var(--muted); }
.dropdown { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--card-strong); backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: 60;
}
.menu-pop.open { display: block; }
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 9px; border: 0; background: none; color: var(--ink);
  font: inherit; font-size: 12.8px; cursor: pointer; text-decoration: none;
}
.menu-pop a:hover, .menu-pop button:hover { background: rgba(79,70,229,.08); text-decoration: none; }
.menu-pop .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-head { padding: 8px 10px 4px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.notif-item { display: block; padding: 9px 10px; border-radius: 10px; color: var(--ink); }
.notif-item:hover { background: rgba(79,70,229,.07); text-decoration: none; }
.notif-item b { display: block; font-size: 12.5px; font-weight: 600; }
.notif-item span { font-size: 11.5px; color: var(--muted); }

.content { padding: 24px 26px 44px; max-width: 1560px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 22px; letter-spacing: -.5px; }
.page-head .sub { color: var(--muted); font-size: 12.8px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------------- Teks berjalan (marquee) ---------------- */
.marquee {
  display: flex; align-items: center; gap: 10px; overflow: hidden;
  margin-bottom: 18px; padding: 8px 12px; border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid rgba(79, 70, 229, .18);
  box-shadow: 0 6px 18px rgba(79, 70, 229, .07);
  cursor: pointer; user-select: none;
}
.marquee-badge {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.6px; font-weight: 800; letter-spacing: .08em;
  color: #fff; background: var(--grad); border-radius: 20px; padding: 3px 9px;
}
.marquee-view { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.marquee-track { display: inline-flex; white-space: nowrap; will-change: transform; animation: marqueeScroll 90s linear infinite; }
.marquee-text { padding-right: 64px; font-size: 12.6px; font-weight: 500; color: var(--ink); letter-spacing: .01em; }
.marquee:hover .marquee-track, .marquee.paused .marquee-track { animation-play-state: paused; }
@keyframes marqueeScroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .marquee-view { overflow-x: auto; }
}
@media (max-width: 640px) {
  .marquee { padding: 7px 10px; margin-bottom: 14px; }
  .marquee-text { font-size: 11.8px; padding-right: 48px; }
  .marquee-badge { font-size: 9px; padding: 2px 7px; }
}

/* ---------------- Cards ---------------- */
.card {
  min-width: 0;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.65);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
[data-theme="dark"] .card { border-color: var(--line); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 11.8px; color: var(--muted); }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* stat cards */
.stat { position: relative; overflow: hidden; padding: 18px 19px; background: var(--card); border: 1px solid rgba(255,255,255,.65); border-radius: 16px; backdrop-filter: blur(20px) saturate(180%); box-shadow: var(--shadow); }
[data-theme="dark"] .stat { border-color: var(--line); }
.stat .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); color: var(--indigo); margin-bottom: 13px; }
.stat .ico.g { background: linear-gradient(135deg, rgba(5,150,105,.14), rgba(56,189,248,.12)); color: #059669; }
.stat .ico.r { background: linear-gradient(135deg, rgba(220,38,38,.12), rgba(244,114,182,.12)); color: #DC2626; }
.stat .ico.w { background: linear-gradient(135deg, rgba(217,119,6,.14), rgba(244,114,182,.1)); color: #D97706; }
.stat .lb { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .vl { font-size: 23px; font-weight: 700; letter-spacing: -.6px; margin: 2px 0 4px; }
.stat .ex { font-size: 11.5px; color: var(--muted); }
.stat .trend { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.trend.up { color: #047857; background: rgba(5,150,105,.12); }
.trend.down { color: #B91C1C; background: rgba(220,38,38,.1); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); gap: 18px; margin-bottom: 22px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.9px; }
.tbl th {
  text-align: left; font-size: 10.6px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 11px 14px; white-space: nowrap;
  background: rgba(99,95,130,.045); border-bottom: 1px solid var(--line);
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: rgba(79,70,229,.045); }
.tbl td.actions, .tbl th.actions { text-align: right; white-space: nowrap; }
.tbl .title { font-weight: 600; }
.tbl .sub { font-size: 11.4px; color: var(--muted); }
.tbl.compact td, .tbl.compact th { padding: 9px 11px; }
.row-actions { display: inline-flex; gap: 4px; }
.act { width: 29px; height: 29px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.act:hover { color: var(--indigo); border-color: rgba(79,70,229,.4); background: rgba(79,70,229,.07); text-decoration: none; }
.act.danger:hover { color: var(--danger); border-color: rgba(220,38,38,.4); background: rgba(220,38,38,.07); }
.pager { display: flex; align-items: center; gap: 5px; padding: 13px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager-meta { font-size: 11.5px; color: var(--muted); margin-right: auto; }
.pg { min-width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; color: var(--ink); }
.pg:hover { background: rgba(79,70,229,.08); text-decoration: none; }
.pg.active { background: var(--grad); color: #fff; border-color: transparent; font-weight: 600; }
.pg.disabled { opacity: .4; }

.perm-group td {
  background: rgba(79,70,229,.07); font-size: 10.6px; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase; color: var(--indigo); padding: 7px 12px;
}
.tbl input[type=checkbox] { cursor: pointer; }

/* ---------------- Badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2.5px 9px; border-radius: 20px; font-size: 10.8px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; background: rgba(99,95,130,.1); color: var(--muted); }
.b-aktif, .b-active, .b-paid, .b-lunas, .b-verified, .b-success, .b-selesai, .b-resolved, .b-done, .b-dibayar, .b-dilaporkan, .b-online, .b-menang, .b-tersedia, .b-available, .b-approved { background: rgba(5,150,105,.13); color: #047857; }
[data-theme="dark"] .b-aktif, [data-theme="dark"] .b-active, [data-theme="dark"] .b-paid, [data-theme="dark"] .b-lunas, [data-theme="dark"] .b-verified, [data-theme="dark"] .b-success, [data-theme="dark"] .b-resolved, [data-theme="dark"] .b-done, [data-theme="dark"] .b-online { color: #34D399; }
.b-unpaid, .b-pending, .b-queued, .b-menunggu, .b-waiting, .b-scheduled, .b-terjadwal, .b-draft, .b-follow_up, .b-survei, .b-medium, .b-sedang, .b-proses, .b-dihitung { background: rgba(217,119,6,.13); color: #B45309; }
[data-theme="dark"] .b-unpaid, [data-theme="dark"] .b-pending, [data-theme="dark"] .b-queued, [data-theme="dark"] .b-waiting { color: #FBBF24; }
.b-overdue, .b-menunggak, .b-suspend, .b-failed, .b-gagal, .b-rejected, .b-ditolak, .b-high, .b-urgent, .b-offline, .b-kalah, .b-void { background: rgba(220,38,38,.11); color: #B91C1C; }
[data-theme="dark"] .b-overdue, [data-theme="dark"] .b-menunggak, [data-theme="dark"] .b-failed, [data-theme="dark"] .b-rejected, [data-theme="dark"] .b-offline { color: #F87171; }
.b-open, .b-assigned, .b-in_progress, .b-sent, .b-info, .b-baru, .b-aktif2 { background: rgba(79,70,229,.12); color: #4338CA; }
[data-theme="dark"] .b-open, [data-theme="dark"] .b-assigned, [data-theme="dark"] .b-sent { color: #A5B4FC; }
.b-closed, .b-terminasi, .b-inactive, .b-cancelled, .b-refunded, .b-unknown, .b-belum, .b-nonaktif { background: rgba(99,95,130,.13); color: #4B5563; }
[data-theme="dark"] .b-closed, [data-theme="dark"] .b-inactive, [data-theme="dark"] .b-unknown { color: #C7C3DE; }
.b-calon, .b-calon, .b-low, .b-rendah, .b-read, .b-used { background: rgba(56,189,248,.15); color: #0369A1; }
.b-urgent { background: rgba(220,38,38,.16); }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 15px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 11px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 9.5px 12px; border-radius: 10px; border: 1px solid rgba(99,95,130,.22);
  background: var(--input); color: var(--ink); font: inherit; font-size: 13px;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { border-color: rgba(255,255,255,.12); }
input:focus, select:focus, textarea:focus { border-color: var(--indigo); box-shadow: 0 0 0 3.5px rgba(79,70,229,.15); }
input:disabled, select:disabled, textarea:disabled { opacity: .62; cursor: not-allowed; }
textarea { min-height: 88px; resize: vertical; }
input[type=file] { font-size: 12.5px; padding: 8px; background: var(--input); border: 1px dashed rgba(99,95,130,.3); border-radius: 10px; width: 100%; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--indigo); vertical-align: -2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.8px; padding-top: 6px; }
.form-actions { display: flex; gap: 10px; padding-top: 18px; flex-wrap: wrap; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.filter-bar .field { min-width: 140px; flex: 0 1 auto; }
.filter-bar .grow { flex: 1 1 220px; }
.filter-bar input, .filter-bar select { padding: 8px 10px; font-size: 12.5px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 12.9px; font-weight: 600; cursor: pointer;
  background: rgba(99,95,130,.08); color: var(--ink); transition: .16s; white-space: nowrap;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(79,70,229,.28); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(79,70,229,.38); color: #fff; }
.btn-outline { background: transparent; border-color: rgba(99,95,130,.28); color: var(--ink); }
.btn-outline:hover { border-color: var(--indigo); color: var(--indigo); background: rgba(79,70,229,.06); }
.btn-danger { background: rgba(220,38,38,.1); color: #B91C1C; }
.btn-danger:hover { background: #DC2626; color: #fff; }
.btn-success { background: rgba(5,150,105,.12); color: #047857; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn-lg { padding: 12px 20px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.plain-fieldset[disabled] { opacity: .92; }
.plain-fieldset[disabled] input, .plain-fieldset[disabled] select, .plain-fieldset[disabled] textarea { background: rgba(99,95,130,.05); }
.row-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.row-btns form { display: inline-flex; }
.row-btns .btn { padding: 5px 8px; font-size: 11.5px; border-radius: 8px; }

/* ---------------- Hero satu baris (panduan mikrotik) ---------------- */
.oneline-hero {
  border: 1.5px solid rgba(79,70,229,.35); border-radius: 16px; padding: 18px 20px;
  background: linear-gradient(135deg, rgba(79,70,229,.07), rgba(139,92,246,.05));
  box-shadow: 0 12px 30px rgba(79,70,229,.10);
}
.oneline-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.oneline-head b { font-size: 15px; letter-spacing: -.2px; }
.oneline-hero .script-pre { border-radius: 11px; }
.oneline-steps { margin: 14px 0 8px; padding-left: 18px; font-size: 12.4px; line-height: 1.85; color: var(--muted); }
.oneline-steps b { color: var(--ink); }

/* ---------------- Pilihan tindakan layanan (radio kartu) ---------------- */
.svc-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.svc-opt {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card-strong);
  cursor: pointer; transition: .16s;
}
.svc-opt input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.svc-opt .svc-ico {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--grad-soft); color: var(--indigo);
}
.svc-opt .svc-txt { display: flex; flex-direction: column; min-width: 0; }
.svc-opt b { font-size: 12.6px; }
.svc-opt small { font-size: 10.6px; color: var(--muted); line-height: 1.35; }
.svc-opt:hover { border-color: rgba(79,70,229,.4); }
.svc-opt:has(input:checked) { border-color: var(--indigo); box-shadow: 0 8px 20px rgba(79,70,229,.16); background: rgba(79,70,229,.06); }
.svc-opt:has(input:checked) .svc-ico { background: var(--grad); color: #fff; }
.svc-opt:has(input:disabled) { opacity: .55; cursor: not-allowed; }

/* ---------------- Panel aksi cepat ---------------- */
.action-panel { margin-top: 16px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(99,95,130,.035); }
.action-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 9px; }
.action-grid form { display: contents; }
.action-btn {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--card-strong);
  color: var(--ink); font: inherit; font-size: 12.4px; font-weight: 600; cursor: pointer;
  text-align: left; text-decoration: none; transition: .16s; line-height: 1.25;
}
.action-btn span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.action-btn small { font-size: 10.4px; font-weight: 500; color: var(--muted); }
.action-btn:hover { transform: translateY(-1px); border-color: rgba(79,70,229,.45); box-shadow: var(--shadow); text-decoration: none; }
.action-btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(79,70,229,.28); }
.action-btn.primary small { color: rgba(255,255,255,.82); }
.action-btn.danger { color: #B91C1C; border-color: rgba(220,38,38,.3); background: rgba(220,38,38,.06); }
.action-btn.danger small { color: #B91C1C; opacity: .8; }
.action-btn.danger-outline { color: #B91C1C; }
.action-btn.dark { color: #4B5563; background: rgba(99,95,130,.1); }
.action-btn.ok { color: #047857; border-color: rgba(5,150,105,.3); background: rgba(5,150,105,.07); }
.action-btn.ok small { color: #047857; opacity: .8; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tabs a { padding: 12px 13px; font-size: 12.8px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--indigo); border-bottom-color: var(--indigo); }

/* ---------------- Flash / alerts ---------------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 13px;
  background: var(--card-strong); backdrop-filter: blur(20px); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); font-size: 12.8px; animation: slideIn .28s ease;
}
.toast b { display: block; font-size: 12.4px; }
.toast.success { border-left: 3px solid #059669; }
.toast.error { border-left: 3px solid #DC2626; }
.toast.info { border-left: 3px solid #4F46E5; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.alert { padding: 13px 16px; border-radius: 12px; font-size: 12.8px; margin-bottom: 18px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert.info { background: rgba(79,70,229,.07); border-color: rgba(79,70,229,.2); color: #3730A3; }
.alert.warn { background: rgba(217,119,6,.08); border-color: rgba(217,119,6,.25); color: #92400E; }
.alert.error { background: rgba(220,38,38,.07); border-color: rgba(220,38,38,.22); color: #991B1B; }
.alert.success { background: rgba(5,150,105,.07); border-color: rgba(5,150,105,.22); color: #065F46; }
[data-theme="dark"] .alert.info { color: #C7D2FE; }
[data-theme="dark"] .alert.warn { color: #FDE68A; }
[data-theme="dark"] .alert.error { color: #FCA5A5; }
[data-theme="dark"] .alert.success { color: #6EE7B7; }

/* ---------------- Empty state ---------------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--grad-soft); color: var(--indigo); }
.empty b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.empty p { font-size: 12.5px; margin: 0; }

/* ---------------- Charts ---------------- */
.chart { width: 100%; max-width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: inherit; }
.legend { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding: 14px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.bar { width: 100%; max-width: 46px; background: var(--grad); border-radius: 8px 8px 4px 4px; min-height: 3px; transition: .3s; }
.bar-col:hover .bar { filter: brightness(1.1); }
.bar-val { font-size: 10px; color: var(--muted); font-weight: 600; }
.bar-lb { font-size: 10.5px; color: var(--muted); }
.progress { height: 7px; border-radius: 10px; background: rgba(99,95,130,.14); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 10px; background: var(--grad); }
.progress.ok > i { background: linear-gradient(90deg,#10B981,#34D399); }
.progress.warn > i { background: linear-gradient(90deg,#F59E0B,#FBBF24); }
.progress.danger > i { background: linear-gradient(90deg,#EF4444,#F87171); }

/* ---------------- List / detail ---------------- */
.kv { display: grid; grid-template-columns: 155px minmax(0, 1fr); gap: 9px 14px; font-size: 12.9px; }
.kv dt { color: var(--muted); font-size: 12.3px; }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.avatar-line { display: flex; align-items: center; gap: 11px; }
.avatar-line .nm { font-weight: 600; font-size: 13px; }
.avatar-line .sb { font-size: 11.5px; color: var(--muted); }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-tabs a { padding: 5px 11px; border-radius: 20px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.pill-tabs a.active { background: var(--grad); color: #fff; border-color: transparent; text-decoration: none; }
.pill-tabs a:hover { text-decoration: none; color: var(--ink); }
.pill-tabs a.active:hover { color: #fff; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--indigo); box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
.timeline b { font-size: 12.8px; }
.timeline span { font-size: 11.5px; color: var(--muted); }

.url-box { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
  border: 1px dashed rgba(79,70,229,.35); background: rgba(79,70,229,.05);
  font-size: 11.6px; word-break: break-all; }
.url-box .mono { flex: 1; min-width: 0; }
.method-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; margin-bottom: 12px; }
.method-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--card-strong); }
.method-card.recommended { border-color: rgba(5,150,105,.45); box-shadow: 0 8px 22px rgba(5,150,105,.12); }
.method-card.recommended .conn-badge { background: linear-gradient(135deg,#059669,#10B981); color: #fff; }
.method-card h4 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; margin: 6px 0; }
.method-card p { color: var(--muted); margin-bottom: 8px; }
.wizard { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.wiz-step { display: flex; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); backdrop-filter: blur(18px) saturate(180%); box-shadow: var(--shadow); }
.wiz-num { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 12px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 16px; box-shadow: 0 8px 20px rgba(79,70,229,.3); }
.wiz-body { min-width: 0; flex: 1; }
.wiz-body > h4 { font-size: 14.5px; margin-bottom: 4px; }
.wiz-body > p { margin-bottom: 10px; }
.more-box { margin-top: 12px; border: 1px dashed rgba(99,95,130,.3); border-radius: 12px; padding: 10px 14px; }
.more-box > summary { cursor: pointer; font-size: 12.4px; font-weight: 600; color: var(--indigo); }
.more-box[open] > summary { margin-bottom: 6px; }
@media (max-width: 640px) {
  .wiz-step { padding: 14px; gap: 10px; }
  .wiz-num { width: 30px; height: 30px; font-size: 14px; border-radius: 10px; }
  .script-pre { font-size: 10.6px; }
}
.test-panel { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 13px 16px; margin-top: 16px;
  border: 1px solid rgba(5,150,105,.3); border-radius: 13px; background: rgba(5,150,105,.05); }
.test-panel .spacer { flex: 1; }
.cred-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px;
  padding: 14px 16px; margin-top: 16px; border: 1px solid rgba(79,70,229,.28); border-radius: 13px; background: rgba(79,70,229,.05); }
.cred-val { font-size: 12.6px; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.cred-val .act { width: 22px; height: 22px; }
.cred-note { grid-column: 1 / -1; }
.mt-conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.conn-card { border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; background: var(--card-strong); position: relative; }
.conn-card.active { border-color: rgba(79,70,229,.55); box-shadow: 0 8px 22px rgba(79,70,229,.14); }
.conn-card h4 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; margin: 6px 0 6px; }
.conn-card p { margin: 0 0 8px; color: var(--muted); line-height: 1.55; }
.conn-card ul { margin: 0; padding-left: 16px; color: var(--muted); line-height: 1.7; }
.conn-badge { display: inline-block; font-size: 9.6px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--indigo); background: rgba(79,70,229,.1); border-radius: 20px; padding: 2px 8px; }
.conn-card.active .conn-badge { background: var(--grad); color: #fff; }

.script-block { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 16px; background: var(--card-strong); }
.script-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.script-head b { font-size: 12.8px; }
.script-head .hstack { margin-left: auto; }
.script-pre {
  margin: 0; padding: 14px 16px; font-family: "SFMono-Regular", ui-monospace, Menlo, monospace;
  font-size: 11.4px; line-height: 1.65; white-space: pre; overflow-x: auto;
  background: #10122B; color: #D8D5F5; max-height: 420px; overflow-y: auto;
}
[data-theme="light"] .script-pre { background: #16183A; color: #DCD9F7; }

/* ---------------- Panel foto satu slide ---------------- */
.photo-panel { padding: 18px 20px 20px; }
.photo-filters-wrap {
  display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; padding: 2px 0 12px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.photo-filters-wrap::-webkit-scrollbar { height: 5px; }
.photo-filters-wrap::-webkit-scrollbar-thumb { background: rgba(99,95,130,.25); border-radius: 4px; }
.chip-filter {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--input);
  color: var(--muted); font: inherit; font-size: 11.6px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip-filter b { font-size: 10.2px; font-weight: 700; background: rgba(99,95,130,.14); border-radius: 10px; padding: 0 5px; }
.chip-filter:hover { color: var(--ink); border-color: rgba(79,70,229,.4); }
.chip-filter.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 5px 14px rgba(79,70,229,.26); }
.chip-filter.active b { background: rgba(255,255,255,.28); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.photo-card {
  margin: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden;
  background: var(--card-strong); display: flex; flex-direction: column; position: relative;
}
.photo-thumb { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; display: block; cursor: zoom-in; background: rgba(99,95,130,.08); }
.photo-thumb.placeholder { display: grid; place-items: center; color: var(--muted); cursor: default; }
.photo-card figcaption { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.photo-tag {
  display: inline-block; font-size: 9.4px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--indigo); background: rgba(79,70,229,.1); border-radius: 20px; padding: 1px 7px;
  width: fit-content; margin-bottom: 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.photo-cap { font-size: 11.8px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.photo-meta { font-size: 10.2px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-del { position: absolute; top: 6px; right: 6px; }
.photo-del .act { width: 26px; height: 26px; background: rgba(255,255,255,.94); border-color: rgba(220,38,38,.35); color: #B91C1C; backdrop-filter: blur(6px); }
.photo-del .act:hover { background: #DC2626; color: #fff; }

.photo-upload-box { margin-top: 20px; padding: 18px; border: 1.5px dashed rgba(79,70,229,.35); border-radius: 14px; background: rgba(79,70,229,.035); }
.upload-box-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; margin-bottom: 14px; color: var(--indigo); }
.upload-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.source-btn {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card-strong);
  color: var(--ink); cursor: pointer; transition: .16s; overflow: hidden;
}
.source-btn:hover { border-color: rgba(79,70,229,.5); transform: translateY(-1px); box-shadow: var(--shadow); }
.source-btn .ic { color: var(--indigo); flex: 0 0 auto; }
.source-btn span { display: flex; flex-direction: column; min-width: 0; }
.source-btn b { font-size: 12.6px; }
.source-btn small { font-size: 10.6px; color: var(--muted); }
.source-btn input.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-chosen {
  margin-top: 10px; padding: 8px 11px; border-radius: 9px; font-size: 11.6px; color: var(--muted);
  background: rgba(99,95,130,.06); border: 1px dashed var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-chosen.has { color: #047857; background: rgba(5,150,105,.08); border-color: rgba(5,150,105,.28); border-style: solid; }
.upload-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* ---------------- Slide panel (2 slide halaman edit) ---------------- */
.slide-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.slide-switch .btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(79,70,229,.28); }
.slide-switch .spacer { flex: 1; }
.slide-panel { display: none; }
.slide-panel.active { display: block; animation: fadeSlide .28s ease; }
@keyframes fadeSlide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* ---------------- MikroTik action panel ---------------- */
.mt-panel { border: 1px solid rgba(79,70,229,.22); border-radius: 14px; padding: 16px; background: rgba(79,70,229,.04); }
.mt-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mt-status .dot { width: 9px; height: 9px; border-radius: 50%; background: #94A3B8; }
.mt-status .dot.ok { background: #10B981; box-shadow: 0 0 0 3px rgba(16,185,129,.16); }
.mt-status .dot.bad { background: #EF4444; box-shadow: 0 0 0 3px rgba(239,68,68,.16); }
.mt-status .dot.warn { background: #F59E0B; }
.mt-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr)); gap: 9px; }
.mt-actions form { display: contents; }
.mt-btn { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card-strong); color: var(--ink); font: inherit; font-size: 12.3px; font-weight: 600; cursor: pointer; text-align: left; line-height: 1.25; }
.mt-btn span { display: flex; flex-direction: column; }
.mt-btn small { font-size: 10.3px; font-weight: 500; color: var(--muted); }
.mt-btn:hover { border-color: rgba(79,70,229,.5); transform: translateY(-1px); }
.mt-btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.mt-btn.primary small { color: rgba(255,255,255,.8); }
.mt-btn.danger { color: #B91C1C; border-color: rgba(220,38,38,.3); background: rgba(220,38,38,.06); }
.mt-btn.ok { color: #047857; border-color: rgba(5,150,105,.3); background: rgba(5,150,105,.07); }

/* ---------------- Slider dokumentasi foto ---------------- */
.slider-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.slider-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--input); color: var(--muted); font: inherit; font-size: 11.8px; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.slider-chip:hover { color: var(--ink); border-color: rgba(79,70,229,.4); }
.slider-chip.has { color: var(--ink); }
.slider-chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(79,70,229,.28); }
.slider-chip .chip-count { background: rgba(99,95,130,.16); color: inherit; border-radius: 10px; padding: 0 6px; font-size: 10.5px; font-weight: 700; }
.slider-chip.active .chip-count { background: rgba(255,255,255,.28); }

.slider { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: rgba(99,95,130,.03); }
.slider-track { display: flex; transition: transform .38s cubic-bezier(.4,.1,.2,1); will-change: transform; }
.slide { flex: 0 0 100%; min-width: 100%; padding: 16px; box-sizing: border-box; }
.slide-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.slide-head .spacer { flex: 1; }
.slide-step { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.slide-head h4 { font-size: 14.5px; margin-top: 2px; }
.slide-empty { display: grid; place-items: center; gap: 4px; text-align: center; padding: 26px 14px; color: var(--muted); background: var(--input); border-radius: 12px; border: 1px dashed rgba(99,95,130,.3); }
.slide-empty b { color: var(--ink); font-size: 13px; }
.slide-empty span { font-size: 11.8px; }
.slide-upload { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.slide-upload .field { flex: 1 1 180px; min-width: 0; }
.source-btn.compact { flex: 0 0 auto; padding: 9px 12px; gap: 8px; min-height: 46px; }
.source-btn.compact b { font-size: 12px; }
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--card-strong);
  color: var(--ink); font-size: 19px; line-height: 1; display: grid; place-items: center;
  cursor: pointer; box-shadow: var(--shadow); z-index: 3; backdrop-filter: blur(10px);
}
.slider-arrow:hover { background: var(--grad); color: #fff; border-color: transparent; }
.slider-arrow.prev { left: 8px; }
.slider-arrow.next { right: 8px; }
.slider-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.dot-btn { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: rgba(99,95,130,.28); cursor: pointer; transition: .2s; }
.dot-btn.active { width: 22px; border-radius: 6px; background: var(--grad); }

.brand-logo { width: 40px; height: 40px; border-radius: 13px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; background: var(--input); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery img { display: block; width: 100%; height: 118px; object-fit: cover; cursor: zoom-in; }
.gallery figcaption { padding: 7px 9px; font-size: 11px; color: var(--muted); }
.doc-row { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--input); font-size: 12.4px; }

/* ---------------- Chat ---------------- */
.chat-wrap { display: grid; grid-template-columns: 300px minmax(0,1fr); min-height: 560px; }
.chat-list { border-right: 1px solid var(--line); max-height: 620px; overflow-y: auto; }
.chat-item { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.chat-item:hover { background: rgba(79,70,229,.05); text-decoration: none; }
.chat-item.active { background: rgba(79,70,229,.09); box-shadow: inset 3px 0 0 var(--indigo); }
.chat-item b { font-size: 12.8px; display: block; }
.chat-item span { font-size: 11.3px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-panel { display: flex; flex-direction: column; max-height: 620px; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: rgba(99,95,130,.03); }
.bubble { max-width: 74%; padding: 9px 12px; border-radius: 13px; font-size: 12.9px; background: var(--card-strong); border: 1px solid var(--line); }
.bubble .meta { font-size: 10.5px; color: var(--muted); margin-top: 4px; display: block; }
.bubble.me { align-self: flex-end; background: var(--grad); color: #fff; border-color: transparent; }
.bubble.me .meta { color: rgba(255,255,255,.75); }
.chat-input { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 9px; align-items: flex-end; }
.chat-input textarea { min-height: 44px; max-height: 120px; }
@media (max-width: 800px) { .chat-wrap { grid-template-columns: 1fr; } .chat-list { max-height: 240px; } }

/* ---------------- Modal ---------------- */
dialog.modal {
  border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(620px, calc(100vw - 30px));
  background: var(--card-strong); backdrop-filter: blur(26px) saturate(180%); color: var(--ink);
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto;
}
dialog.modal::backdrop { background: rgba(18,14,45,.55); backdrop-filter: blur(4px); }
dialog.modal .modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
dialog.modal .modal-head h3 { font-size: 15px; }
dialog.modal .modal-body { padding: 20px; }
dialog.modal .modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }
dialog.modal .close { margin-left: auto; background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }

/* ---------------- Login ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; position: relative; z-index: 1; }
.auth-aside { background: var(--sidebar); color: #fff; padding: 46px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.5), transparent 65%); top: -120px; right: -120px; filter: blur(30px); }
.auth-aside h2 { font-size: 29px; letter-spacing: -.8px; line-height: 1.2; max-width: 420px; }
.auth-aside p { color: #C6C0E8; font-size: 13.5px; max-width: 400px; margin-top: 14px; }
.auth-feats { display: grid; gap: 13px; margin-top: 30px; }
.auth-feat { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: #DCD8F4; }
.auth-feat .ic { color: #A78BFA; margin-top: 2px; }
.auth-main { display: grid; place-items: center; padding: 30px; }
.auth-card { width: 100%; max-width: 405px; }
.auth-card h1 { font-size: 25px; letter-spacing: -.6px; margin-bottom: 5px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 25px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; }
.demo-box { margin-top: 22px; padding: 13px 15px; border-radius: 12px; border: 1px dashed rgba(99,95,130,.3); font-size: 11.8px; color: var(--muted); background: rgba(255,255,255,.35); }
[data-theme="dark"] .demo-box { background: rgba(255,255,255,.03); }
.demo-box b { color: var(--ink); font-size: 12px; display: block; margin-bottom: 5px; }
.demo-box code { background: rgba(79,70,229,.1); color: var(--indigo); padding: 1px 5px; border-radius: 5px; font-size: 11px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ---------------- Map ---------------- */
#map { height: 540px; border-radius: var(--radius); z-index: 1; }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 13px 18px; border-top: 1px solid var(--line); font-size: 11.8px; color: var(--muted); }
.map-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.leaflet-popup-content { font: 12.5px Inter, system-ui, sans-serif; }

/* ---------------- Portal ---------------- */
.portal-hero { background: var(--grad); color: #fff; border-radius: var(--radius); padding: 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; box-shadow: 0 18px 44px rgba(79,70,229,.3); margin-bottom: 22px; }
.portal-hero h2 { font-size: 19px; letter-spacing: -.3px; }
.portal-hero .sub { font-size: 12.5px; color: rgba(255,255,255,.82); margin-top: 3px; }
.portal-hero .avatar { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); }
.portal-hero .right { margin-left: auto; text-align: right; }
.hero-big { font-size: 22px; font-weight: 700; }

/* invoice doc */
.doc { background: #fff; color: #1F1B3A; border-radius: 14px; padding: 30px; border: 1px solid rgba(99,95,130,.16); }
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #4F46E5; padding-bottom: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.doc h2 { font-size: 21px; color: #4F46E5; }
.doc table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.doc table th { text-align: left; background: #F5F3FF; padding: 9px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.doc table td { padding: 9px 10px; border-bottom: 1px solid #EEF0F6; }
.doc .totals { margin-left: auto; width: min(320px, 100%); margin-top: 14px; font-size: 12.8px; }
.doc .totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.doc .totals .grand { border-top: 2px solid #1F1B3A; margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 15px; color: #4F46E5; }
.doc .note { font-size: 11.5px; color: #635F82; margin-top: 18px; padding-top: 14px; border-top: 1px dashed #D9D5F0; }

.voucher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.voucher-card { border: 1.5px dashed rgba(79,70,229,.4); border-radius: 13px; padding: 13px; background: rgba(255,255,255,.7); text-align: center; }
[data-theme="dark"] .voucher-card { background: rgba(255,255,255,.04); }
.voucher-card .vcode { font-family: ui-monospace, monospace; font-size: 18px; font-weight: 700; letter-spacing: 1.5px; color: var(--indigo); }
.voucher-card .vmeta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.voucher-card canvas, .voucher-card img.qr { margin: 8px auto 4px; display: block; }

/* misc */
.stat-inline { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-inline div { font-size: 12px; color: var(--muted); }
.stat-inline b { display: block; font-size: 17px; color: var(--ink); }
.hstack { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.vstack { display: grid; gap: 9px; }
.dotline { display: flex; align-items: center; gap: 7px; font-size: 12.3px; }
.dotline .dot { width: 8px; height: 8px; border-radius: 50%; background: #94A3B8; }
.dotline .dot.ok { background: #10B981; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.dotline .dot.bad { background: #EF4444; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.dotline .dot.warn { background: #F59E0B; }
.copy-btn { cursor: pointer; }
.qr-holder { background: #fff; padding: 8px; border-radius: 10px; width: fit-content; }
.tiny { font-size: 11px; }
.mt { margin-top: 14px; }
.mb0 { margin-bottom: 0; }
.w-100 { width: 100%; }
.text-ok { color: #059669; }
.text-danger { color: #DC2626; }
.text-warn { color: #D97706; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { flex-wrap: wrap; }
  .topbar .crumb { display: none; }
  .tenant-pick select { max-width: 165px; }
  .card-head { gap: 8px; }
  .sidebar { position: fixed; left: 0; top: 0; width: 268px; z-index: 100; transform: translateX(-105%); transition: transform .25s ease; height: 100vh; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .hamburger { display: inline-grid; }
  .scrim { position: fixed; inset: 0; background: rgba(15,12,35,.5); z-index: 90; }
  .scrim.show { display: block; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 10px 16px; }
  .user-chip .u-name, .user-chip .u-role { display: none; }
}
@media (max-width: 640px) {
  .photo-panel { padding: 14px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .photo-upload-box { padding: 14px; }
  .upload-sources { grid-template-columns: 1fr; }
  .slide { padding: 12px; }
  .slider-arrow { width: 30px; height: 30px; font-size: 16px; }
  .slide-upload { gap: 8px; }
  .page-head h1 { font-size: 19px; }
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 13px; }
  .stat { padding: 14px; }
  .stat .vl { font-size: 19px; }
  .kv { grid-template-columns: 120px minmax(0,1fr); }
  .doc { padding: 18px; }
  .tabs { padding: 0 8px; }
  .filter-bar { padding: 12px 14px; }
}

@media print {
  .sidebar, .topbar, .toasts, .page-head .actions, .no-print, .tabs { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  body::before, body::after { display: none; }
  .card { box-shadow: none; border: 1px solid #ddd; background: #fff; backdrop-filter: none; }
  .doc { border: 0; padding: 0; }
}
