:root {
  --red: #e2232c;
  --red-dark: #b71c23;
  --bg: #121417;
  --bg-panel: #1b1f24;
  --bg-panel-2: #22262c;
  --text: #e9ecef;
  --text-muted: #9aa0a6;
  --border: #2c3137;
  --success: #2ecc71;
  --warning: #f1c40f;
  --danger: #e74c3c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  flex-shrink: 0;
}
.brand { font-weight: 700; font-size: 20px; padding: 0 20px 20px; color: var(--text); }
.brand span { color: var(--red); }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a {
  padding: 10px 20px;
  color: var(--text-muted);
  border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active {
  background: var(--bg-panel-2);
  color: var(--text);
  border-left-color: var(--red);
  text-decoration: none;
}

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}
.user-box { display: flex; gap: 12px; align-items: center; color: var(--text-muted); }
.btn-link { background: none; border: none; color: var(--red); cursor: pointer; font: inherit; }

.content { padding: 24px; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.alert-success { background: rgba(46,204,113,.15); border: 1px solid var(--success); color: var(--success); }
.alert-error { background: rgba(231,76,60,.15); border: 1px solid var(--danger); color: var(--danger); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.stat-label { font-size: 12px; color: var(--text-muted); letter-spacing: .05em; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; }

.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.panel h2 { margin-top: 0; font-size: 16px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.data-table th { color: var(--text-muted); font-weight: 600; }

.detail-table { border-collapse: collapse; }
.detail-table th { text-align: left; color: var(--text-muted); padding: 8px 16px 8px 0; vertical-align: top; }
.detail-table td { padding: 8px 0; }

.badge { padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-online, .badge-active { background: rgba(46,204,113,.15); color: var(--success); }
.badge-offline, .badge-suspended { background: rgba(231,76,60,.15); color: var(--danger); }
.badge-unknown, .badge-expired, .badge-unpaid { background: rgba(241,196,15,.15); color: var(--warning); }
.badge-unused { background: rgba(154,160,166,.2); color: var(--text-muted); }
.badge-used, .badge-paid { background: rgba(46,204,113,.15); color: var(--success); }
.badge-terminated { background: rgba(231,76,60,.15); color: var(--danger); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; max-width: 760px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
  background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; color: var(--text); font: inherit;
}

.btn-primary, .btn-secondary {
  display: inline-block; padding: 9px 16px; border-radius: 6px; border: none;
  font-weight: 600; cursor: pointer; font-size: 14px;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); text-decoration: none; }
.btn-secondary { background: var(--bg-panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-primary, .btn-secondary, .btn-danger { text-decoration: none; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a3291b; text-decoration: none; }

.code-block {
  background: #0c0e10; border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; overflow-x: auto; font-family: Consolas, monospace; font-size: 13px;
}

.login-body, .error-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-card, .error-card {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 40px; width: 340px; text-align: center;
}
.login-card h1 { margin-bottom: 4px; }
.login-card h1 span { color: var(--red); }
.login-card .subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 13px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.login-card label { font-size: 13px; color: var(--text-muted); }
.login-card input {
  background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px; color: var(--text); font: inherit;
}
.login-card button {
  margin-top: 10px; padding: 10px; border-radius: 6px; border: none;
  background: var(--red); color: #fff; font-weight: 700; cursor: pointer;
}
.error-card h1 { font-size: 48px; color: var(--red); margin: 0; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select {
  background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; color: var(--text); font: inherit;
}
.muted { color: var(--text-muted); font-size: 13px; }
.pagination { margin-top: 12px; color: var(--text-muted); font-size: 13px; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f5f7; --bg-panel: #ffffff; --bg-panel-2: #f0f1f3;
    --text: #1b1f24; --text-muted: #6b7280; --border: #e2e4e8;
  }
}

/* ---- Global search (§14) ---- */
.search-box { position: relative; width: 420px; max-width: 60vw; }
.search-box input {
  width: 100%; background: var(--bg-panel-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 9px 12px; color: var(--text); font-size: 14px;
}
.search-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px;
  max-height: 360px; overflow-y: auto; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.search-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg-panel-2); }
.search-type { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--danger); }
.search-title { display: block; font-size: 14px; font-weight: 600; }
.search-sub { display: block; font-size: 12px; color: var(--text-muted); }
.search-empty { padding: 14px; color: var(--text-muted); font-size: 13px; }

/* ---- Notification center (§16) ---- */
.notif-wrap { position: relative; }
.notif-bell-btn { position: relative; font-size: 18px; background: none; border: none; cursor: pointer; color: var(--text); }
.notif-badge {
  position: absolute; top: -6px; right: -10px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 6px; line-height: 1.4;
}
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: 340px; max-height: 420px;
  overflow-y: auto; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 8px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.notif-head {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px;
}
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(231,76,60,.06); cursor: pointer; }
.notif-title { font-weight: 600; margin-bottom: 2px; }
.notif-msg { color: var(--text-muted); margin-bottom: 4px; }
.notif-time { color: var(--text-muted); font-size: 11px; }
.notif-empty { padding: 16px; color: var(--text-muted); font-size: 13px; text-align: center; }

/* ---- Role & Permission matrix (§17) ---- */
.permission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 12px 0; }
.permission-module { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.permission-module h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .05em; color: var(--text-muted); }
.checkbox-label { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; margin-bottom: 6px; cursor: pointer; }
.checkbox-label input { margin-top: 3px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.actions { white-space: nowrap; }
.actions a, .actions .btn-link { margin-right: 8px; }
code { background: var(--bg-panel-2); padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ---- Voucher & User management (2026-11-16) ---- */
.dropdown { position: relative; display: inline-block; }
.btn-menu {
  background: #1e9e55; color: #fff; border: none; border-radius: 6px; padding: 10px 16px;
  font-weight: 700; font-size: 14px; letter-spacing: .02em; cursor: pointer;
}
.btn-menu:hover { background: #18854a; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; min-width: 250px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35); padding: 6px 0;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu form { margin: 0; }
.dropdown-menu a, .dropdown-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 16px; background: none; border: none;
  color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-panel-2); text-decoration: none; }
.dropdown-menu a::before, .dropdown-menu button::before { content: "\2022"; color: var(--text-muted); margin-right: 10px; }
.dropdown-menu .danger { color: var(--danger); }
.dropdown-title { padding: 10px 16px 4px; font-size: 12px; font-weight: 700; color: var(--danger); border-top: 1px solid var(--border); margin-top: 6px; }

.balance-chip { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 14px; }
.stat-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.stat-strip a {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px;
  color: var(--text-muted); font-size: 13px; text-decoration: none;
}
.stat-strip a b { color: var(--text); margin-left: 4px; }
.stat-strip a.on { border-color: var(--red); color: var(--text); }
.filter-note { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { background: var(--bg-panel-2); border-radius: 12px; padding: 2px 10px; color: var(--text); }

.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.table-toolbar select, .table-toolbar input, label.search input {
  background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; color: var(--text); font: inherit;
}
label.search { font-size: 14px; color: var(--text-muted); }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table .cb { width: 34px; text-align: center; }
.data-table tr.selected td { background: rgba(226,35,44,.08); }
.data-table td.small, .small { font-size: 12px; }
.data-table td.empty { text-align: center; color: var(--text-muted); padding: 24px; }
.vcode { font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.dot-online { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); vertical-align: middle; }
.badge-disabled { background: rgba(154,160,166,.2); color: var(--text-muted); }
.pos { color: var(--success); }
.neg { color: var(--danger); }

.pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.pager .pages a { display: inline-block; padding: 5px 10px; border: 1px solid var(--border); border-radius: 5px; margin-left: 4px; color: var(--text); text-decoration: none; }
.pager .pages a.on { background: var(--red); border-color: var(--red); color: #fff; }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal[hidden] { display: none; }
body.modal-open { overflow: hidden; }
.modal-box { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; width: 100%; max-width: 560px; padding: 0 22px 22px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.modal-box.wide { max-width: 980px; }
.modal-box.small { max-width: 420px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); margin: 0 -22px 16px; padding: 14px 22px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 26px; cursor: pointer; line-height: 1; }
.modal .form-grid { max-width: none; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.wide { max-width: 860px; }
.radio-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.radio, .check-inline { display: inline-flex !important; flex-direction: row !important; gap: 6px !important; align-items: center; color: var(--text) !important; }
.field-label { font-size: 13px; color: var(--text-muted); }
.hint { font-size: 11px; color: var(--text-muted); text-transform: none; }
.hint.warn { color: var(--warning); }
.tiny-link { font-size: 12px; font-weight: 700; }
.cost-preview { font-size: 13px; color: var(--text-muted); min-height: 18px; }
label.stack { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
label.stack select, label.stack input, .inline-form input, .inline-form select, .full-input {
  background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; color: var(--text); font: inherit;
}
.full-input { width: 100%; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.btn-success { display: inline-block; padding: 10px 18px; border-radius: 6px; border: none; background: #1e9e55; color: #fff; font-weight: 700; cursor: pointer; font-size: 14px; }
.btn-success:hover { background: #18854a; }
.btn-ghost { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 3px 9px; font-size: 12px; color: var(--text); white-space: nowrap; }
.btn-wa { background: #25d366; color: #fff; border-radius: 14px; padding: 4px 12px; font-size: 12px; white-space: nowrap; }
.icon-btn { display: inline-block; border: none; border-radius: 4px; padding: 5px 9px; background: var(--bg-panel-2); color: var(--text); cursor: pointer; font-size: 13px; text-decoration: none; }
.icon-btn.edit { background: #1aa3d9; color: #fff; }
.icon-btn.delete { background: #f39c12; color: #fff; }
.actions-row { display: flex; gap: 0; }
.actions-row .btn-secondary, .actions-row .btn-success { border-radius: 0; flex: 0 0 auto; }
.help-list { margin: 0 0 16px; padding-left: 18px; font-size: 14px; line-height: 1.9; }
.pill { background: #2d7fc1; color: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12px; }
.pill.green { background: #1e9e55; }
.domain-box { margin-top: 16px; font-size: 13px; }
.domain-box summary { cursor: pointer; color: #2d7fc1; font-weight: 700; }
.req { color: #1e9e55; margin-right: 4px; }
#username-status.good { color: var(--success); font-style: italic; }
#username-status.bad { color: var(--danger); font-style: italic; }
.user-link { color: var(--text-muted); }
.form-grid textarea { resize: vertical; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; padding: 10px 0; }
  .sidebar nav { flex-direction: row; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .form-grid, .form-grid.three, .panel-row { grid-template-columns: 1fr; }
  .search-box { width: auto; max-width: 50vw; }
  .content { padding: 14px; }
}

/* ---- Update 2026-11-17: detail pelanggan, perpanjang, laporan penjualan ---- */
[hidden] { display: none !important; }
.no-margin { margin: 0 0 4px; }
.small { font-size: 12px; }
.small-table td, .small-table th { font-size: 12px; padding: 6px 8px; }
.row-actions { white-space: nowrap; }
.row-actions .btn-ghost { margin-right: 4px; cursor: pointer; }
.danger-zone { margin-top: 18px; }
.account-grid { display: grid; grid-template-columns: minmax(300px, 5fr) 8fr; gap: 20px; align-items: start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px 0 16px; }
.tab { background: none; border: 1px solid transparent; border-bottom: none; color: #3d9be0; padding: 10px 16px; cursor: pointer; font: inherit; border-radius: 6px 6px 0 0; margin-bottom: -1px; }
.tab.on { color: var(--text); background: var(--bg-panel-2); border-color: var(--border); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.info-grid .full { grid-column: 1 / -1; }
.info-field span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.info-field div { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 9px 12px; min-height: 38px; word-break: break-word; }
.info-actions { margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.note-line { font-style: italic; font-weight: 600; color: var(--text-muted); margin: 0 0 14px; font-size: 13px; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { border-radius: 4px; padding: 16px; color: #fff; min-height: 88px; }
.kpi-value { font-size: 20px; font-weight: 700; word-break: break-all; }
.kpi-label { margin-top: 8px; font-size: 13px; opacity: .95; }
.kpi-cyan { background: #00b4e6; }
.kpi-red { background: #dd4b39; }
.kpi-green { background: #00a65a; }
.kpi-orange { background: #f39c12; }
.kpi-grey { background: #5d6670; }
.kpi-blue { background: #3c8dbc; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.btn-row form { display: inline; }
.btn-blue, .btn-green, .btn-red { border: none; color: #fff; font-weight: 700; padding: 6px 12px; border-radius: 3px; cursor: pointer; font-size: 14px; }
.btn-blue { background: #3c8dbc; }
.btn-green { background: #00a65a; }
.btn-red { background: #dd4b39; }
.icon-btn.print { background: #00a65a; color: #fff; }
.renew-target { display: flex; gap: 30px; background: var(--bg-panel-2); padding: 10px 14px; border-radius: 6px; }
.renew-total { font-size: 15px; }

.report-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 16px; }
.report-head h1 { margin: 0 0 6px; }
.report-head h2 { margin: 0; font-size: 20px; }
.report-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.sum-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.sum-card { display: flex; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.sum-card .ic { width: 78px; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #fff; flex-shrink: 0; }
.sum-card .tx { padding: 12px 14px; }
.sum-card .tx span { display: block; font-size: 13px; color: var(--text-muted); text-transform: uppercase; }
.sum-card .tx b { display: block; font-size: 22px; margin-top: 6px; font-family: Consolas, monospace; letter-spacing: .03em; }
.status-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.status-strip .chip-stat { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 18px; padding: 5px 14px; font-size: 13px; }
.status-strip .chip-stat b { margin-left: 4px; }
.report-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-actions .icon-btn { font-size: 18px; padding: 8px 12px; }
.icon-btn.excel { background: #1aa3d9; color: #fff; }
.icon-btn.printer { background: #00a65a; color: #fff; }
.data-table tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.num { text-align: right !important; white-space: nowrap; }
.list-toggle { margin: 14px 0; }
.form-grid .span2 { grid-column: span 2; }

@media (max-width: 1100px) {
  .account-grid { grid-template-columns: 1fr; }
  .sum-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .kpi-row, .sum-cards, .info-grid { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .no-print, .report-actions, .modal { display: none !important; }
  body, .main, .panel, .sum-card, .info-field div { background: #fff !important; color: #000 !important; }
  .data-table th, .data-table td { color: #000 !important; border-color: #999 !important; }
  .content { padding: 0 !important; }
}
.form-grid > * { min-width: 0; }
.form-grid .form-grid { gap: 12px 14px; }
.form-grid select, .form-grid input:not([type=checkbox]):not([type=radio]) { width: 100%; }
.kpi-value { font-size: 18px; word-break: normal; overflow-wrap: anywhere; }

/* ---- Template Voucher ---- */
.search-inline { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.search-inline input { width: 240px; }
.status-pill { border: none; border-radius: 16px; padding: 4px 14px; font-weight: 700; font-size: 13px; color: #fff; cursor: pointer; }
.status-pill.on { background: #00a65a; }
.status-pill.off { background: #dd4b39; }
.tpl-table .row-actions .icon-btn { margin-right: 2px; }
.logo-preview { display: flex; gap: 16px; align-items: center; background: #fff; border-radius: 6px; padding: 10px; color: #333; }
.logo-preview img { max-width: 140px; max-height: 70px; object-fit: contain; }
.logo-preview .muted { color: #555; }
.tpl-form .CodeMirror { border: 1px solid var(--border); border-radius: 6px; font-size: 14px; margin: 8px 0; }
.tpl-form textarea.code-fallback { width: 100%; min-height: 480px; background: #272822; color: #f8f8f2; font-family: Consolas, "Courier New", monospace; font-size: 14px; border-radius: 6px; padding: 10px; margin: 8px 0; }
.copy-row { cursor: pointer; }
.copy-row.copied td { background: rgba(46,204,113,.2); }
.tpl-form .actions-row { gap: 8px; align-items: center; }

/* ---- Isolir & WhatsApp ---- */
.badge-isolir { background: rgba(230,126,34,.18); color: #e67e22; }
.btn-orange { border: none; color: #fff; font-weight: 700; padding: 6px 12px; border-radius: 3px; cursor: pointer; font-size: 14px; background: #e67e22; }
.btn-wa-send { border: none; color: #fff; font-weight: 700; padding: 6px 12px; border-radius: 0 3px 3px 0; cursor: pointer; font-size: 14px; background: #25d366; }
.wa-send { display: inline-flex !important; align-items: stretch; }
.wa-send select { border-radius: 3px 0 0 3px; padding: 4px 8px; width: auto; }
.isolir-note { background: rgba(230,126,34,.12); border-left: 4px solid #e67e22; padding: 10px 14px; border-radius: 4px; font-size: 13px; }
.wa-preview { white-space: pre-wrap; background: #e7ffdb; color: #111; border-radius: 8px; padding: 12px 14px; font-size: 13px; max-height: 360px; overflow: auto; font-family: inherit; }
.var-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 16px; font-size: 13px; margin-bottom: 14px; }
.var-list button { font-size: 11px; padding: 2px 8px; margin-right: 6px; cursor: pointer; border: 1px solid var(--border); background: var(--bg-panel-2); color: var(--text); border-radius: 3px; }
.tpl-tabs .tab.t-register.on { background: #fff; color: #333; }
.tab-colored { color: #fff !important; border-radius: 4px 4px 0 0; }
.tab-colored.c-reminder { background: #00c0ef; }
.tab-colored.c-payment { background: #00a65a; }
.tab-colored.c-isolir { background: #e67e22; }
.tab-colored.c-register { background: #605ca8; }
.tab-colored.on { box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.wa-status-SENT { color: #00a65a; font-weight: 700; }
.wa-status-FAILED { color: #dd4b39; font-weight: 700; }
.wa-status-PENDING, .wa-status-SENDING { color: #f39c12; font-weight: 700; }
.wa-status-CANCELLED { color: var(--text-muted); }
.code-block { background: #1e1e1e; color: #e6e6e6; padding: 14px; border-radius: 6px; font-family: Consolas, monospace; font-size: 13px; white-space: pre; overflow-x: auto; }
.days-check { display: flex; gap: 14px; flex-wrap: wrap; }
.inline-pair { display: flex; gap: 8px; align-items: center; }
.inline-pair input { width: 90px !important; }
.custom-box { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.custom-box legend { padding: 0 6px; font-weight: 700; }
.inline-test { margin: 10px 0 20px; display: flex; gap: 10px; align-items: center; }
details.panel summary { cursor: pointer; }
.tpl-area { display: block; width: 100%; min-height: 340px; font-family: inherit; font-size: 14px; line-height: 1.5; padding: 10px 12px; background: var(--bg-panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; margin-top: 6px; }
label.field-label { display: block; }
.code-block { white-space: pre-wrap; word-break: break-all; }

/* ---- Pembayaran online ---- */
.gw-box { margin-bottom: 16px; }
.gw-box legend { padding: 0 8px; font-size: 16px; }
.portal-link { font-size: 12px; margin-top: 10px; word-break: break-all; }

/* ---- NAS / Router & VPN ---- */
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.header-actions form.inline, form.inline { display: inline; margin: 0; }
.info-box ul { margin: 6px 0 0; padding-left: 20px; color: var(--text-muted); font-size: 13px; }
.table-tools { display: flex; gap: 8px; margin: 0 0 12px; justify-content: flex-end; }
.table-tools input { background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 6px; min-width: 240px; }
.table-wrap { overflow-x: auto; }
.nas-table td { vertical-align: middle; }
.nas-table .small, .small { font-size: 11px; }
.btn-api { background: #1aa3e8; color: #fff; border: 0; border-radius: 4px; width: 36px; height: 30px; cursor: pointer; font-size: 15px; }
.btn-api.busy { opacity: .5; cursor: wait; }
.btn-mini { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 30px; padding: 0 6px; border-radius: 4px; border: 0; color: #fff; cursor: pointer; font-size: 13px; text-decoration: none !important; }
.btn-mini-blue { background: #1aa3e8; }
.btn-mini-orange { background: #f39c12; }
.nas-table .actions { white-space: nowrap; }
.nas-table .actions > * { margin-right: 2px; }
.badge-vpn { background: rgba(26,163,232,.16); color: #4db8f0; }
.online-link { color: var(--text); white-space: nowrap; }
.nas-toast { position: fixed; right: 20px; bottom: 20px; max-width: 460px; padding: 12px 16px; border-radius: 8px; z-index: 200; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.nas-toast.ok { background: #1e4d33; color: #c9f5da; border: 1px solid var(--success); }
.nas-toast.err { background: #4d1e1e; color: #f5c9c9; border: 1px solid var(--danger); }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.mode-card { display: flex !important; flex-direction: row !important; gap: 10px !important; align-items: flex-start; border: 1px solid var(--border); border-radius: 8px; padding: 12px; cursor: pointer; color: var(--text) !important; background: var(--bg-panel-2); }
.mode-card:has(input:checked) { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.mode-card.disabled { opacity: .55; cursor: not-allowed; }
.mode-card small { color: var(--text-muted); font-size: 12px; }
.input-row { display: flex; gap: 6px; }
.input-row input { flex: 1; }
details.advanced { border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px; }
details.advanced summary { cursor: pointer; color: var(--text-muted); font-size: 13px; }
details.advanced[open] summary { margin-bottom: 12px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 20px; }
.kv-grid > div { display: flex; flex-direction: column; gap: 3px; }
.kv-grid span { font-size: 12px; color: var(--text-muted); }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; font-size: 12px; font-weight: 600; letter-spacing: .3px; color: var(--text-muted); text-decoration: underline; }
.btn-copy { background: #27ae60; color: #fff; border: 0; border-radius: 4px; padding: 7px 14px; cursor: pointer; font-weight: 600; text-decoration: none; }
.btn-copy:hover { background: #229954; }
pre.code-block.script { white-space: pre-wrap; word-break: break-all; font-size: 12.5px; line-height: 1.55; }
pre.code-block.script.one-line { white-space: pre-wrap; }
.oneline-toggle { margin: 4px 0 14px; }
ol.steps { margin: 6px 0 0; padding-left: 20px; line-height: 1.9; font-size: 13px; }
.vpn-diagram .flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.vpn-diagram .node { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-weight: 600; font-size: 14px; }
.vpn-diagram .node small { display: block; font-weight: 400; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.vpn-diagram .arrow { color: var(--red); font-weight: 700; font-size: 13px; }
.vpn-status { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-reserve { display: flex; gap: 6px; align-items: center; }
.inline-reserve input { background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); padding: 4px 8px; border-radius: 4px; width: 140px; }
@media (max-width: 760px) {
  .mode-pick { grid-template-columns: 1fr; }
  .table-tools { justify-content: stretch; }
  .table-tools input { min-width: 0; flex: 1; }
}
.alert-warn { background: rgba(241,196,15,.12); border: 1px solid var(--warning); color: #f5d76e; font-size: 13px; }

/* ---- Dashboard ---- */
.dash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-head h1 { margin: 0; }
.dash-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dcard { border-radius: 8px; overflow: hidden; color: #fff; display: flex; flex-direction: column; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.dcard-body { position: relative; padding: 16px 18px 14px; flex: 1; min-height: 116px; }
.dcard-value { font-size: 26px; font-weight: 700; letter-spacing: -.3px; position: relative; z-index: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcard-label { font-size: 14px; margin-top: 4px; opacity: .95; position: relative; z-index: 1; }
.dcard-sub { font-size: 12px; margin-top: 6px; opacity: .85; position: relative; z-index: 1; }
.dcard-icon { position: absolute; right: 12px; top: 12px; width: 70px; height: 70px; opacity: .22; }
.dcard-icon svg { width: 100%; height: 100%; }
.dcard-foot { display: block; width: 100%; text-align: center; padding: 8px; background: rgba(0,0,0,.14); color: #fff; border: 0; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none !important; }
.dcard-foot:hover { background: rgba(0,0,0,.24); }
.c-green { background: #16a05d; } .c-teal { background: #0f9aa8; } .c-orange { background: #e67e22; } .c-yellow { background: #d4a013; }
.c-blue { background: #1f7fd1; } .c-purple { background: #7b4fc9; } .c-red { background: #d9363e; } .c-dark { background: #2f3640; }
.dash-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 26px; }
.tile-group h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none !important; transition: border-color .15s; }
.tile:hover { border-color: var(--red); }
.tile-ic { width: 26px; height: 26px; color: var(--text-muted); }
.tile-ic svg { width: 100%; height: 100%; }
.tile-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.tile-num { font-size: 20px; font-weight: 700; }
.dash-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.dash-panels .panel { min-width: 0; margin: 0; }
.dash-panels h2 { font-size: 16px; margin: 0 0 10px; }
.data-table.compact th, .data-table.compact td { padding: 7px 8px; font-size: 12.5px; }
.dot-online { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); margin-left: 4px; }
@media (max-width: 1200px) { .dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-panels { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .dash-cards, .dash-tiles { grid-template-columns: 1fr; } .dcard-value { font-size: 22px; } }

/* ---- Laporan pendapatan ---- */
a.tab { text-decoration: none !important; display: inline-block; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.filter-bar input, .filter-bar select { background: var(--bg-panel-2); border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 6px; min-width: 150px; }
.btn-mini-green { background: #27ae60; }
.income-report .report-title { margin: 0 0 6px; font-size: 22px; letter-spacing: .3px; }
.income-report .report-meta { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.income-report .report-actions { display: flex; gap: 6px; margin-bottom: 14px; }
.sum-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sum-card { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-panel-2); }
.sum-card > div { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.sum-card small { color: var(--text-muted); font-size: 12px; letter-spacing: .3px; }
.sum-card b { font-size: 21px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.sum-ic { width: 64px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; flex-shrink: 0; }
.s-green { background: #16a05d; } .s-orange { background: #e67e22; } .s-grey { background: #5d6670; } .s-blue { background: #1f7fd1; }
.owner-breakdown { margin-bottom: 14px; }
.owner-breakdown summary { cursor: pointer; color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
@media (max-width: 900px) { .sum-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print {
  .income-report { border: 0; }
  .sum-card { border-color: #999; background: #fff; }
}
.dash-panels .data-table td, .dash-panels .data-table th { white-space: nowrap; }
.dash-panels .data-table td:first-child { white-space: normal; }
@media (max-width: 1500px) and (min-width: 1201px) { .dash-panels { grid-template-columns: 1fr 1fr; } .dash-panels .panel:first-child { grid-column: 1 / -1; } }
.income-report .data-table td { white-space: nowrap; }
.nas-table .badge, .nowrap { white-space: nowrap; }
.unit-input { display: flex; gap: 6px; }
.unit-input input { flex: 1; min-width: 0; }
.unit-input select { width: auto; min-width: 92px; flex: 0 0 auto; }

/* Kuota router NAS (SaaS) */
.quota-box { padding: 12px 16px; }
.quota-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.quota-bar { height: 8px; border-radius: 4px; background: var(--bg-panel-2, rgba(255,255,255,.08)); overflow: hidden; margin-bottom: 6px; }
.quota-bar span { display: block; height: 100%; background: var(--success, #2ecc71); transition: width .3s; }
.quota-warn .quota-bar span { background: var(--warning, #f1c40f); }
.quota-full { border-color: var(--danger, #e74c3c); }
.quota-full .quota-bar span { background: var(--danger, #e74c3c); }
.update-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.plan-pick label { border: 1px solid var(--border); border-radius: 6px; padding: 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.plan-pick label.disabled { opacity: .45; cursor: not-allowed; }
.plan-pick input:checked + span { font-weight: 600; color: var(--text); }
.changelog { white-space: pre-line; }
button[disabled] { opacity: .55; cursor: not-allowed; }
.tabs { flex-wrap: wrap; }
a.tab { text-decoration: none; white-space: nowrap; }
a.btn-mini-blue, a.btn-mini-green, a.btn-mini-orange { color: #fff; text-decoration: none; display: inline-block; }
