/* ============================================================
   Billing ISP — Dark NOC Theme
   ============================================================ */
:root {
  --bg: #070b14;
  --bg-2: #0b1220;
  --surface: rgba(17, 25, 40, 0.72);
  --surface-solid: #111a2b;
  --surface-2: #16203a;
  --border: rgba(120, 160, 220, 0.14);
  --border-strong: rgba(120, 160, 220, 0.28);
  --text: #e6eefb;
  --text-dim: #9bacc7;
  --muted: #6f7f9b;
  --accent: #22d3ee;
  --accent-2: #3b82f6;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 45px -20px rgba(0, 0, 0, 0.85);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -5%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(800px 480px at 90% 0%, rgba(59, 130, 246, 0.16), transparent 62%),
    radial-gradient(700px 500px at 60% 110%, rgba(139, 92, 246, 0.12), transparent 60%),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }

/* ---------------- Layout ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 258px;
  flex: 0 0 258px;
  background: linear-gradient(180deg, #0b1220 0%, #0a1020 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.brand-box { display: flex; gap: 12px; align-items: center; padding: 6px 8px 18px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #04121b;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -8px rgba(34, 211, 238, 0.65);
}
.brand-name { font-weight: 700; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.09em; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-sep {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--muted); padding: 16px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-weight: 500; font-size: 13.6px;
  border: 1px solid transparent; transition: all .15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), rgba(59, 130, 246, 0.05));
  border-color: rgba(34, 211, 238, 0.28);
  color: #fff; font-weight: 600;
}
.nav-ico { width: 20px; text-align: center; font-size: 15px; }

.sidebar-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.user-chip { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.03); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, #1f2b45, #2b3a5c); color: var(--accent); }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  background: rgba(9, 14, 25, 0.72); backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 30;
}
.page-title { font-size: 17px; font-weight: 650; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.clock { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 6px 10px; cursor: pointer; display: none; }
.content { padding: 24px 22px 56px; display: flex; flex-direction: column; gap: 22px; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(160%);
  overflow: hidden;
}
.card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-title { font-size: 15px; }
.card-sub { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

/* ---------------- KPI ---------------- */
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.kpi-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 29px; font-weight: 700; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.kpi-ok { border-left-color: var(--ok); }
.kpi-warn { border-left-color: var(--warn); }
.kpi-danger { border-left-color: var(--danger); }
.kpi-accent2 { border-left-color: var(--accent-2); }
.kpi-violet { border-left-color: #8b5cf6; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; font-size: 13.2px; font-weight: 600;
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.05);
  color: var(--text); cursor: pointer; transition: all .15s ease; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #04121b; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ok { background: rgba(52, 211, 153, 0.16); border-color: rgba(52, 211, 153, 0.4); color: #7ff0c4; }
.btn-danger { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.4); color: #ffb3b3; }
.btn-warn { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.4); color: #ffdf9a; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 12.2px; border-radius: 8px; }
.btn-xs { padding: 4px 8px; font-size: 11.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.w-full { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------- Forms ---------------- */
.input, select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  background: rgba(8, 13, 24, 0.75); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 13.4px;
}
.input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(34, 211, 238, 0.55); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12); }
.input-sm { padding: 7px 10px; font-size: 12.6px; }
textarea { min-height: 88px; resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12.2px; color: var(--text-dim); margin-bottom: 5px; font-weight: 500; }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.hint { font-size: 11.8px; color: var(--muted); margin-top: 4px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.checkline input { width: auto; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.2px; }
table.tbl th {
  text-align: left; padding: 11px 14px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--muted); background: rgba(9, 14, 25, 0.6);
  border-bottom: 1px solid var(--border); white-space: nowrap; font-weight: 700;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid rgba(120, 160, 220, 0.08); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: rgba(34, 211, 238, 0.045); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .nowrap { white-space: nowrap; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }

/* ---------------- Badges ---------------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.4px; font-weight: 650; border: 1px solid transparent; white-space: nowrap; }
.badge-ok { background: rgba(52, 211, 153, 0.15); color: #74e8bd; border-color: rgba(52, 211, 153, 0.32); }
.badge-warn { background: rgba(251, 191, 36, 0.15); color: #ffd88a; border-color: rgba(251, 191, 36, 0.32); }
.badge-danger { background: rgba(248, 113, 113, 0.15); color: #ffabab; border-color: rgba(248, 113, 113, 0.32); }
.badge-muted { background: rgba(160, 174, 192, 0.12); color: #b6c2d4; border-color: rgba(160, 174, 192, 0.25); }
.badge-info { background: rgba(59, 130, 246, 0.16); color: #9dc4ff; border-color: rgba(59, 130, 246, 0.32); }

/* ---------------- Alerts ---------------- */
.alert { padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13.4px; border: 1px solid var(--border); }
.alert-ok { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.35); color: #a6f0d2; }
.alert-error { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.35); color: #ffbdbd; }
.alert-warn { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.35); color: #ffe0a3; }
.alert-info { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.35); color: #b8d3ff; }

/* ---------------- Misc ---------------- */
.muted { color: var(--muted); }
.dim { color: var(--text-dim); }
.small { font-size: 12.2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flex-wrap { flex-wrap: wrap; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.text-right { text-align: right; } .text-center { text-align: center; }
.hr { height: 1px; background: var(--border); margin: 16px 0; border: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); font-size: 12px; }

.pager { display: flex; gap: 6px; padding: 14px 18px; flex-wrap: wrap; }
.pager-item { padding: 5px 11px; border-radius: 8px; border: 1px solid var(--border); font-size: 12.5px; color: var(--text-dim); }
.pager-item.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04121b; border-color: transparent; font-weight: 700; }
.pager-gap { padding: 5px 4px; color: var(--muted); }

.detail-list { display: grid; gap: 10px; }
.detail-row { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 9px; border-bottom: 1px dashed rgba(120, 160, 220, 0.13); font-size: 13.3px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--muted); }
.detail-row .v { font-weight: 600; text-align: right; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.bar-pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar { width: 42%; border-radius: 5px 5px 0 0; min-height: 2px; }
.bar-in { background: linear-gradient(180deg, #34d399, #0f9e70); }
.bar-out { background: linear-gradient(180deg, #f87171, #b63f3f); }
.bar-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.legend { display: flex; gap: 16px; font-size: 12.2px; color: var(--text-dim); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.mono-box { background: rgba(6, 10, 18, 0.85); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, Menlo, monospace; font-size: 12.3px; white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 30px 28px; box-shadow: var(--shadow); backdrop-filter: blur(20px) saturate(170%);
}
.login-logo { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #04121b; background: linear-gradient(135deg, var(--accent), var(--accent-2)); margin: 0 auto 16px; }
.login-title { text-align: center; font-size: 21px; }
.login-sub { text-align: center; color: var(--muted); font-size: 12.8px; margin: 6px 0 22px; }
.role-tabs { display: flex; gap: 6px; background: rgba(6, 10, 18, 0.6); border: 1px solid var(--border); border-radius: 11px; padding: 4px; margin-bottom: 18px; }
.role-tabs button { flex: 1; background: transparent; border: none; color: var(--text-dim); padding: 8px 6px; border-radius: 8px; font-size: 12.4px; font-weight: 600; cursor: pointer; font-family: var(--font); }
.role-tabs button.active { background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(59, 130, 246, 0.14)); color: #fff; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }

.stat-inline { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-inline .item { min-width: 120px; }
.stat-inline .item .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat-inline .item .val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { display: flex; gap: 12px; }
.timeline-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 10px; }

.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* Tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tabs a { padding: 11px 13px; font-size: 13px; color: var(--text-dim); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: #fff; border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: #fff; }

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .icon-btn { display: inline-block; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.7); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .clock { display: none; }
  .content { padding: 18px 14px 48px; }
}
