/* cPanel License Manager — dark navy/charcoal, aksen biru-teal */
:root {
  --bg: #0b1220;
  --bg-2: #0f172a;
  --panel: #111c31;
  --panel-2: #16233b;
  --border: #1e2d47;
  --text: #dbe6f5;
  --muted: #8ea3c0;
  --accent: #38bdf8;
  --accent-2: #2dd4bf;
  --danger: #f87171;
  --warn: #fbbf24;
  --success: #34d399;
  --sidebar-w: 244px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% -10%, #14243d 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  min-height: 100vh;
}

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

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0d1728 0%, #0a1120 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: width .18s ease, transform .18s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden;
}
.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121f; font-weight: 800; font-size: .82rem;
}
.sidebar-nav { padding: .7rem .55rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .58rem .7rem; border-radius: 9px;
  color: var(--muted); font-weight: 500; white-space: nowrap;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: #16233b; color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(56,189,248,.16), rgba(45,212,191,.07));
  color: #eaf6ff;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-ico { display: inline-flex; flex: 0 0 18px; }
.sidebar-footer { padding: .8rem .7rem; border-top: 1px solid var(--border); display: grid; gap: .55rem; }
.user-chip { display: flex; align-items: center; gap: .55rem; overflow: hidden; }
.avatar {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  background: #1c2d49; color: var(--accent);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; overflow: hidden; }
.user-meta strong { font-size: .82rem; }
.user-meta small { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; }

/* Collapsed sidebar (desktop) */
body.sidebar-collapsed .sidebar { width: 68px; }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .user-meta,
body.sidebar-collapsed .sidebar-footer form { display: none; }
body.sidebar-collapsed .main-wrap { margin-left: 68px; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: .6rem .5rem; }

.main-wrap { margin-left: var(--sidebar-w); transition: margin .18s ease; }
body.no-sidebar .main-wrap { margin-left: 0; }

.topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: .8rem;
  padding: .65rem 1.25rem;
  background: rgba(11,18,32,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 600; font-size: .98rem; }
.topbar-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.content { padding: 1.25rem; max-width: 1600px; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, #0f1a2e 100%);
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--text);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: .9rem; color: #cfe0f5;
}
.stat-card { padding: 1rem 1.05rem; }
.stat-label { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .6px; }
.stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1.25; }
.stat-sub { color: var(--muted); font-size: .75rem; }
.stat-card.accent { border-color: #1d4d63; }
.stat-card.tone-success .stat-value { color: var(--success); }
.stat-card.tone-danger .stat-value { color: var(--danger); }
.stat-card.tone-warn .stat-value { color: var(--warn); }
.stat-card.tone-muted .stat-value { color: var(--muted); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; background: var(--bg-2); }
table.tbl thead th {
  background: #101c31; color: var(--muted); font-weight: 600;
  font-size: .72rem; letter-spacing: .5px; text-transform: uppercase;
  padding: .6rem .7rem; border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0;
}
table.tbl thead th a { color: inherit; }
table.tbl thead th a:hover { color: var(--accent); }
table.tbl tbody td { padding: .55rem .7rem; border-bottom: 1px solid #16233b; vertical-align: middle; }
table.tbl tbody tr:hover { background: #132038; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.ip-link { font-family: ui-monospace, monospace; font-weight: 600; color: #7dd3fc; }
.cell-muted { color: var(--muted); }

/* ---------- Badges ---------- */
.badge-status {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .5rem; border-radius: 999px;
  font-size: .71rem; font-weight: 600; letter-spacing: .2px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bs-success { color: #6ee7b7; background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.35); }
.bs-danger  { color: #fca5a5; background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.35); }
.bs-warning { color: #fcd34d; background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.35); }
.bs-secondary { color: #a9bcd6; background: rgba(148,163,184,.12); border-color: rgba(148,163,184,.3); }
.bs-muted   { color: var(--muted); background: rgba(148,163,184,.08); border-color: #24344f; }
.tag {
  display: inline-block; padding: .1rem .42rem; margin: .08rem .15rem .08rem 0;
  border-radius: 5px; background: #1b2b45; color: #9fc2e8; font-size: .68rem;
}
.err-chip { color: #fca5a5; font-size: .72rem; }

/* ---------- Forms ---------- */
.form-control, .form-select, .form-check-input {
  background-color: #0d1728; border-color: #24344f; color: var(--text);
}
.form-control:focus, .form-select:focus {
  background-color: #0d1728; color: var(--text);
  border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(56,189,248,.15);
}
.form-control::placeholder { color: #5b708c; }
.form-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: .3rem; }
.btn-primary { background: linear-gradient(135deg, #2596c9, #1f7fa8); border-color: #2a8fc0; color: #f0fbff; }
.btn-primary:hover { background: linear-gradient(135deg, #2ba6dd, #2389b6); border-color: #38bdf8; }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; color: #04121f; font-weight: 600; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { background: #16233b; color: var(--text); border-color: #2a3f61; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card {
  width: 100%; max-width: 396px; padding: 2rem 1.7rem;
  background: linear-gradient(180deg, #111c31, #0c1526);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.login-brand { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.4rem; }
.login-brand .brand-mark { width: 38px; height: 38px; flex-basis: 38px; font-size: .95rem; }
.login-title { font-size: 1.12rem; font-weight: 650; }
.login-sub { color: var(--muted); font-size: .8rem; }

/* ---------- Misc ---------- */
.section-title { font-size: .95rem; font-weight: 650; margin-bottom: .75rem; }
.hint { color: var(--muted); font-size: .78rem; }
.empty-state { padding: 2.6rem 1rem; text-align: center; color: var(--muted); }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 210px; }
.pagination .page-link { background: var(--bg-2); border-color: var(--border); color: var(--muted); }
.pagination .page-item.active .page-link { background: #1d4d63; border-color: #2a6b87; color: #e8f8ff; }
.kv { display: grid; grid-template-columns: minmax(120px, 168px) 1fr; gap: .4rem .9rem; font-size: .85rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; word-break: break-word; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a {
  padding: .5rem .85rem; color: var(--muted); font-size: .85rem; font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.active { color: #eaf6ff; border-bottom-color: var(--accent); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.15rem; border-left: 1px solid var(--border); margin-left: .3rem; }
.timeline li::before {
  content: ""; position: absolute; left: -4.5px; top: .32rem;
  width: 8px; height: 8px; border-radius: 50%; background: #2a3f61;
}
.timeline li.ok::before { background: var(--success); }
.timeline li.bad::before { background: var(--danger); }
.timeline li.warn::before { background: var(--warn); }
.notice {
  border-left: 3px solid var(--accent); background: rgba(56,189,248,.07);
  padding: .7rem .9rem; border-radius: 8px; font-size: .82rem; color: #bcd6ec;
}
.notice.warn { border-left-color: var(--warn); background: rgba(251,191,36,.07); color: #f0dcae; }
.notice.danger { border-left-color: var(--danger); background: rgba(248,113,113,.07); color: #f3c5c5; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .main-wrap { margin-left: 0 !important; }
  body.sidebar-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1030;
  }
  .content { padding: 1rem .75rem; }
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .user-meta,
  body.sidebar-collapsed .sidebar-footer form { display: initial; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; }
}
