/* =========================================================
   ISP Billing System - Core Stylesheet
   Clean, professional "masterclass" look:
   deep navy sidebar, soft neutral canvas, teal accent.
   ========================================================= */

:root {
  --navy-900: #0f1b2d;
  --navy-800: #16233a;
  --navy-700: #1d3050;
  --accent: #14b8a6;
  --accent-dark: #0d9488;
  --danger: #e11d48;
  --warning: #f59e0b;
  --success: #16a34a;
  --canvas: #f4f6f9;
  --card-border: #e7eaf0;
  --text-muted: #6b7280;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--canvas);
  color: #1f2937;
  font-size: 14.5px;
}

a { text-decoration: none; }

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

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #cbd5e1;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 1030;
  transition: transform .25s ease;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.25rem 1.25rem 1rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand .logo-dot {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #08201c;
}

.sidebar .nav-section-title {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  padding: 1.1rem 1.25rem .35rem;
}

.sidebar .nav-link {
  color: #cbd5e1;
  padding: .6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .89rem;
  border-left: 3px solid transparent;
}
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar .nav-link.active {
  background: rgba(20,184,166,.12);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}

.main-area { margin-left: 250px; flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  padding: .7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar .page-title { font-weight: 700; font-size: 1.05rem; color: #111827; }
.topbar .page-subtitle { color: var(--text-muted); font-size: .8rem; }

.content-wrap { padding: 1.5rem; flex: 1; }

.sidebar-toggle-btn { display: none; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .sidebar-toggle-btn { display: inline-flex; }
}

/* ---------- Cards / widgets ---------- */
.card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.card-header { background: transparent; border-bottom: 1px solid var(--card-border); font-weight: 600; }

.stat-card {
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: #fff;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .9rem;
}
.stat-card .icon-badge {
  width: 46px; height: 46px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.4rem; font-weight: 800; color: #111827; line-height: 1.2; }
.stat-card .stat-label { color: var(--text-muted); font-size: .78rem; }

.bg-soft-teal   { background: rgba(20,184,166,.12); color: var(--accent-dark); }
.bg-soft-blue   { background: rgba(59,130,246,.12); color: #1d4ed8; }
.bg-soft-amber  { background: rgba(245,158,11,.14); color: #b45309; }
.bg-soft-rose   { background: rgba(225,29,72,.12); color: var(--danger); }
.bg-soft-green  { background: rgba(22,163,74,.12); color: var(--success); }

/* ---------- Tables ---------- */
.table thead th {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom-width: 1px;
  white-space: nowrap;
}
.table td { vertical-align: middle; font-size: .87rem; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ---------- Badges / status pills ---------- */
.badge-status { font-weight: 600; font-size: .72rem; padding: .35em .65em; border-radius: 999px; }
.badge-active    { background: rgba(22,163,74,.12); color: var(--success); }
.badge-suspended { background: rgba(225,29,72,.12); color: var(--danger); }
.badge-inactive  { background: rgba(107,114,128,.15); color: #4b5563; }
.badge-unpaid    { background: rgba(225,29,72,.12); color: var(--danger); }
.badge-partial   { background: rgba(245,158,11,.14); color: #b45309; }
.badge-paid      { background: rgba(22,163,74,.12); color: var(--success); }
.badge-online    { background: rgba(22,163,74,.12); color: var(--success); }
.badge-offline   { background: rgba(107,114,128,.15); color: #4b5563; }
.badge-unknown   { background: rgba(245,158,11,.14); color: #b45309; }
.status-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px; }
.status-dot.online  { background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.status-dot.offline { background: #9ca3af; }
.status-dot.unknown { background: var(--warning); }
.row-online,
.row-online > td { background-color: #dcfce7 !important; }
.row-online:hover,
.row-online:hover > td { background-color: #bbf7d0 !important; }

/* ---------- Buttons ---------- */
.btn-accent { background: var(--accent); border-color: var(--accent); color: #05201b; font-weight: 600; }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-outline-accent { border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.btn-outline-accent:hover { background: var(--accent); color: #05201b; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .82rem; color: #374151; }
.form-control, .form-select {
  border-radius: 8px;
  border-color: #d7dce3;
  font-size: .88rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}
.required-star { color: var(--danger); }

/* ---------- Login page ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #16233a, #0f1b2d 60%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 2.2rem 2rem;
  box-shadow: 0 20px 45px rgba(0,0,0,.25);
}
.login-card .logo-dot {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3rem; color: #05201b;
  margin: 0 auto 1rem;
}

/* ---------- Misc ---------- */
.text-muted-soft { color: var(--text-muted); }
.divider-label { text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; color: var(--text-muted); }
.avatar-circle {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy-700); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
}
code.template-var { background: #eef2f7; color: #0f1b2d; padding: 1px 6px; border-radius: 6px; }
