/* ============================================================
   ISP Billing System — Global Stylesheet
   ============================================================ */

:root {
  --primary:       #00d4aa;
  --primary-dark:  #00b894;
  --primary-light: #e0faf5;
  --secondary:     #2d3748;
  --accent:        #6c63ff;
  --danger:        #e53e3e;
  --warning:       #dd6b20;
  --success:       #38a169;
  --info:          #3182ce;
  --bg:            #f0f4f8;
  --sidebar-bg:    #ffffff;
  --sidebar-text:  #2d3748;
  --sidebar-hover: #f0f4f8;
  --card-bg:       #ffffff;
  --border:        #e2e8f0;
  --text:          #2d3748;
  --text-muted:    #718096;
  --shadow:        0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --radius:        8px;
  --radius-lg:     12px;
  --transition:    .2s ease;
  --sidebar-w:     260px;
  --header-h:      64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--secondary); }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p  { color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #1a202c; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53030; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-info      { background: var(--info); color: #fff; }
.btn-outline   { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-outline-primary { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: .45rem; border-radius: var(--radius); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg);
}
.card-header h3, .card-header h4 { margin: 0; }
.card-body { padding: 1.25rem; }
.card-footer {
  padding: .75rem 1.25rem; border-top: 1px solid var(--border);
  background: #fafbfc;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 1.25rem; box-shadow: var(--shadow); border: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 1rem;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.green  { background: #e6fffa; color: var(--primary-dark); }
.stat-icon.blue   { background: #ebf8ff; color: var(--info); }
.stat-icon.orange { background: #fffaf0; color: var(--warning); }
.stat-icon.red    { background: #fff5f5; color: var(--danger); }
.stat-icon.purple { background: #f0ebff; color: var(--accent); }
.stat-info { flex: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--secondary); line-height: 1.2; }
.stat-change { font-size: .78rem; margin-top: .2rem; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; color: var(--secondary); }
.form-control {
  width: 100%; padding: .55rem .85rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .875rem; color: var(--text);
  background: #fff; transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,212,170,.15); }
.form-control::placeholder { color: #b0bec5; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; gap: 1rem; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: .25rem; }
.input-group { position: relative; display: flex; }
.input-group .form-control { flex: 1; }
.input-group-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.input-group .form-control.has-icon { padding-left: 2.5rem; }
.input-group-append {
  display: flex; align-items: center; padding: 0 .75rem;
  background: var(--bg); border: 1px solid var(--border);
  border-left: none; border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer; color: var(--text-muted);
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; font-size: .875rem;
}
.table th {
  background: #f7fafc; color: var(--text-muted); font-weight: 600;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  padding: .65rem 1rem; border-bottom: 2px solid var(--border);
  text-align: left; white-space: nowrap;
}
.table td {
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--text);
}
.table tbody tr:hover { background: #f7fafc; }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 20px;
  font-size: .72rem; font-weight: 600; letter-spacing: .03em;
}
.badge-success  { background: #e6fffa; color: #00695c; }
.badge-danger   { background: #fff5f5; color: #c53030; }
.badge-warning  { background: #fffaf0; color: #c05621; }
.badge-info     { background: #ebf8ff; color: #2b6cb0; }
.badge-secondary{ background: #edf2f7; color: #4a5568; }
.badge-primary  { background: var(--primary-light); color: var(--primary-dark); }
.badge-purple   { background: #f0ebff; color: #553c9a; }
.badge::before  { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

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

.sidebar {
  width: var(--sidebar-w); background: #ffffff; color: var(--sidebar-text);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 500; transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.1rem 1.5rem; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center;
}
.sidebar-brand .brand-logo {
  width: 36px; height: 36px; border-radius: var(--radius);
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem; color: #fff; font-weight: 700;
}
.sidebar-brand .brand-name { font-size: 1rem; font-weight: 700; color: #1a202c; }
.sidebar-brand .brand-sub  { font-size: .7rem; color: var(--sidebar-text); }

.sidebar-section { padding: 1rem 0; }
.sidebar-section-title {
  padding: .4rem 1.5rem; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: #4a5568;
}
.sidebar-nav { list-style: none; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.5rem; color: var(--sidebar-text);
  font-size: .875rem; font-weight: 500; transition: all var(--transition);
  text-decoration: none; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: #f0f4f8; color: #1a202c;
  border-left-color: var(--primary);
}
.sidebar-nav a .nav-icon { width: 18px; text-align: center; }
.sidebar-nav a .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: .65rem; padding: .1rem .4rem; border-radius: 10px;
}

.sidebar-footer {
  margin-top: auto; padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
}
.sidebar-user { display: flex; align-items: center; gap: .75rem; }
.sidebar-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem; flex-shrink: 0;
}
.sidebar-user .user-info .user-name { font-size: .875rem; font-weight: 600; color: #2d3748; }
.sidebar-user .user-info .user-role { font-size: .72rem; color: var(--sidebar-text); }

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w); flex: 1; display: flex;
  flex-direction: column; min-height: 100vh;
}

.topbar {
  height: var(--header-h); background: var(--card-bg);
  border-bottom: 1px solid var(--border); padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 400; box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-title { font-size: 1.1rem; font-weight: 600; color: var(--secondary); }
.topbar-breadcrumb { font-size: .8rem; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar-btn {
  width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); transition: all var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--bg); color: var(--text); }
.topbar-btn .notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid #fff;
}
.topbar-user {
  display: flex; align-items: center; gap: .5rem; cursor: pointer;
  padding: .3rem .6rem; border-radius: var(--radius);
  transition: background var(--transition);
}
.topbar-user:hover { background: var(--bg); }
.topbar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
}
.topbar-user .user-name { font-size: .875rem; font-weight: 500; }

.page-content { padding: 1.5rem; flex: 1; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.page-header h2 { margin: 0; }

/* ── Grid Layouts ─────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  transform: scale(.95); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }
.modal-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.modal-close {
  width: 30px; height: 30px; border-radius: var(--radius);
  border: none; background: var(--bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--text-muted); transition: all var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: .75rem;
}

/* ── Alerts / Toasts ─────────────────────────────────────── */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius);
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .875rem; margin-bottom: 1rem;
}
.alert-success { background: #e6fffa; border: 1px solid #b2f5ea; color: #00695c; }
.alert-danger   { background: #fff5f5; border: 1px solid #fed7d7; color: #c53030; }
.alert-warning  { background: #fffaf0; border: 1px solid #feebc8; color: #c05621; }
.alert-info     { background: #ebf8ff; border: 1px solid #bee3f8; color: #2b6cb0; }

.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--secondary); color: #fff; padding: .75rem 1.25rem;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: .875rem; display: flex; align-items: center; gap: .75rem;
  min-width: 260px; animation: slideIn .3s ease;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); gap: 0; margin-bottom: 1.25rem; }
.tab-btn {
  padding: .65rem 1.25rem; font-size: .875rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: .3rem;
  justify-content: flex-end; padding-top: 1rem;
}
.page-btn {
  width: 32px; height: 32px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .8rem; color: var(--text-muted);
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ── Search & Filter Bar ─────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.search-box {
  position: relative; flex: 1; min-width: 200px;
}
.search-box input {
  width: 100%; padding: .5rem .85rem .5rem 2.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .875rem; outline: none; transition: border-color var(--transition);
}
.search-box input:focus { border-color: var(--primary); }
.search-box .search-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: .9rem;
}

/* ── Dropdown ────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + .5rem); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  min-width: 180px; z-index: 200; overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: all var(--transition);
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1rem; font-size: .875rem; color: var(--text);
  cursor: pointer; transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { border-top: 1px solid var(--border); margin: .25rem 0; }

/* ── Progress Bars ───────────────────────────────────────── */
.progress { background: var(--bg); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 20px; background: var(--primary);
  transition: width .5s ease;
}
.progress-bar.danger  { background: var(--danger); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.success { background: var(--success); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h4 { color: var(--text-muted); font-weight: 500; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

/* ── Utilities ───────────────────────────────────────────── */
.text-primary  { color: var(--primary-dark) !important; }
.text-success  { color: var(--success) !important; }
.text-danger   { color: var(--danger) !important; }
.text-warning  { color: var(--warning) !important; }
.text-info     { color: var(--info) !important; }
.text-muted    { color: var(--text-muted) !important; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-bold     { font-weight: 600; }
.text-sm       { font-size: .8rem; }
.text-xs       { font-size: .72rem; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-0  { padding: 0 !important; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.flex-1 { flex: 1; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 50%; }
.shadow { box-shadow: var(--shadow); }
.border { border: 1px solid var(--border); }
.bg-white { background: #fff; }
.cursor-pointer { cursor: pointer; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Sidebar toggle — mobile slides, desktop collapses ──── */

/* Desktop default: sidebar visible */
.sidebar {
  transform: translateX(0);
  transition: transform .25s ease;
}

/* Mobile: sidebar hidden off-screen */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .filter-bar { flex-direction: column; }
  .search-box { width: 100%; }
}

/* Desktop: hamburger collapses sidebar */
@media (min-width: 769px) {
  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-collapsed .main-content {
    margin-left: 0 !important;
  }
}

/* Mobile overlay */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 250;
  cursor: pointer;
}
#sidebar-overlay.active {
  display: block;
}

/* ── Additional utilities ────────────────────────────────── */
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 768px) {
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
.text-info    { color: var(--info) !important; }
.badge-purple { background: #f0ebff; color: #553c9a; }
.badge-purple::before { background: #553c9a; }

/* ── Sidebar light mode ──────────────────────────────────── */
.sidebar { background: #ffffff; border-right: 1px solid #e2e8f0; }
.sidebar-section-title { color: #718096 !important; }
.sidebar-nav a { color: #4a5568 !important; }
.sidebar-nav a:hover { background: #f0f4f8 !important; color: #1a202c !important; }
.sidebar-nav a.active {
  background: #e0faf5 !important;
  color: #00b894 !important;
  font-weight: 600;
  border-left-color: #00d4aa;
}
.brand-name { color: #1a202c !important; }
.brand-sub  { color: #718096 !important; }
.sidebar-user .user-name { color: #2d3748 !important; }
.sidebar-user .user-role { color: #718096 !important; }
.signout-btn {
  width: 100%; padding: .45rem; margin-top: .5rem;
  background: #f0f4f8; border: 1px solid #e2e8f0;
  border-radius: var(--radius); color: #4a5568;
  font-size: .8rem; cursor: pointer;
}
.signout-btn:hover { background: #e2e8f0; }


   ISP Billing System — Global Stylesheet
   ============================================================ */

:root {
  --primary:       #00d4aa;
  --primary-dark:  #00b894;
  --primary-light: #e0faf5;
  --secondary:     #2d3748;
  --accent:        #6c63ff;
  --danger:        #e53e3e;
  --warning:       #dd6b20;
  --success:       #38a169;
  --info:          #3182ce;
  --bg:            #f0f4f8;
  --sidebar-bg:    #ffffff;
  --sidebar-text:  #2d3748;
  --sidebar-hover: #f0f4f8;
  --card-bg:       #ffffff;
  --border:        #e2e8f0;
  --text:          #2d3748;
  --text-muted:    #718096;
  --shadow:        0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --radius:        8px;
  --radius-lg:     12px;
  --transition:    .2s ease;
  --sidebar-w:     260px;
  --header-h:      64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--secondary); }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p  { color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #1a202c; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53030; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-info      { background: var(--info); color: #fff; }
.btn-outline   { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-outline-primary { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: .45rem; border-radius: var(--radius); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg);
}
.card-header h3, .card-header h4 { margin: 0; }
.card-body { padding: 1.25rem; }
.card-footer {
  padding: .75rem 1.25rem; border-top: 1px solid var(--border);
  background: #fafbfc;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 1.25rem; box-shadow: var(--shadow); border: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 1rem;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.green  { background: #e6fffa; color: var(--primary-dark); }
.stat-icon.blue   { background: #ebf8ff; color: var(--info); }
.stat-icon.orange { background: #fffaf0; color: var(--warning); }
.stat-icon.red    { background: #fff5f5; color: var(--danger); }
.stat-icon.purple { background: #f0ebff; color: var(--accent); }
.stat-info { flex: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--secondary); line-height: 1.2; }
.stat-change { font-size: .78rem; margin-top: .2rem; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; color: var(--secondary); }
.form-control {
  width: 100%; padding: .55rem .85rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .875rem; color: var(--text);
  background: #fff; transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,212,170,.15); }
.form-control::placeholder { color: #b0bec5; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; gap: 1rem; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: .25rem; }
.input-group { position: relative; display: flex; }
.input-group .form-control { flex: 1; }
.input-group-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.input-group .form-control.has-icon { padding-left: 2.5rem; }
.input-group-append {
  display: flex; align-items: center; padding: 0 .75rem;
  background: var(--bg); border: 1px solid var(--border);
  border-left: none; border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer; color: var(--text-muted);
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; font-size: .875rem;
}
.table th {
  background: #f7fafc; color: var(--text-muted); font-weight: 600;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  padding: .65rem 1rem; border-bottom: 2px solid var(--border);
  text-align: left; white-space: nowrap;
}
.table td {
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--text);
}
.table tbody tr:hover { background: #f7fafc; }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 20px;
  font-size: .72rem; font-weight: 600; letter-spacing: .03em;
}
.badge-success  { background: #e6fffa; color: #00695c; }
.badge-danger   { background: #fff5f5; color: #c53030; }
.badge-warning  { background: #fffaf0; color: #c05621; }
.badge-info     { background: #ebf8ff; color: #2b6cb0; }
.badge-secondary{ background: #edf2f7; color: #4a5568; }
.badge-primary  { background: var(--primary-light); color: var(--primary-dark); }
.badge-purple   { background: #f0ebff; color: #553c9a; }
.badge::before  { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

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

.sidebar {
  width: var(--sidebar-w); background: #ffffff; color: var(--sidebar-text);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 500; transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.1rem 1.5rem; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center;
}
.sidebar-brand .brand-logo {
  width: 36px; height: 36px; border-radius: var(--radius);
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem; color: #fff; font-weight: 700;
}
.sidebar-brand .brand-name { font-size: 1rem; font-weight: 700; color: #1a202c; }
.sidebar-brand .brand-sub  { font-size: .7rem; color: var(--sidebar-text); }

.sidebar-section { padding: 1rem 0; }
.sidebar-section-title {
  padding: .4rem 1.5rem; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: #4a5568;
}
.sidebar-nav { list-style: none; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.5rem; color: var(--sidebar-text);
  font-size: .875rem; font-weight: 500; transition: all var(--transition);
  text-decoration: none; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: #f0f4f8; color: #1a202c;
  border-left-color: var(--primary);
}
.sidebar-nav a .nav-icon { width: 18px; text-align: center; }
.sidebar-nav a .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: .65rem; padding: .1rem .4rem; border-radius: 10px;
}

.sidebar-footer {
  margin-top: auto; padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
}
.sidebar-user { display: flex; align-items: center; gap: .75rem; }
.sidebar-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem; flex-shrink: 0;
}
.sidebar-user .user-info .user-name { font-size: .875rem; font-weight: 600; color: #2d3748; }
.sidebar-user .user-info .user-role { font-size: .72rem; color: var(--sidebar-text); }

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w); flex: 1; display: flex;
  flex-direction: column; min-height: 100vh;
}

.topbar {
  height: var(--header-h); background: var(--card-bg);
  border-bottom: 1px solid var(--border); padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 400; box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-title { font-size: 1.1rem; font-weight: 600; color: var(--secondary); }
.topbar-breadcrumb { font-size: .8rem; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar-btn {
  width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); transition: all var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--bg); color: var(--text); }
.topbar-btn .notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid #fff;
}
.topbar-user {
  display: flex; align-items: center; gap: .5rem; cursor: pointer;
  padding: .3rem .6rem; border-radius: var(--radius);
  transition: background var(--transition);
}
.topbar-user:hover { background: var(--bg); }
.topbar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
}
.topbar-user .user-name { font-size: .875rem; font-weight: 500; }

.page-content { padding: 1.5rem; flex: 1; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.page-header h2 { margin: 0; }

/* ── Grid Layouts ─────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  transform: scale(.95); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }
.modal-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.modal-close {
  width: 30px; height: 30px; border-radius: var(--radius);
  border: none; background: var(--bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--text-muted); transition: all var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: .75rem;
}

/* ── Alerts / Toasts ─────────────────────────────────────── */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius);
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .875rem; margin-bottom: 1rem;
}
.alert-success { background: #e6fffa; border: 1px solid #b2f5ea; color: #00695c; }
.alert-danger   { background: #fff5f5; border: 1px solid #fed7d7; color: #c53030; }
.alert-warning  { background: #fffaf0; border: 1px solid #feebc8; color: #c05621; }
.alert-info     { background: #ebf8ff; border: 1px solid #bee3f8; color: #2b6cb0; }

.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--secondary); color: #fff; padding: .75rem 1.25rem;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: .875rem; display: flex; align-items: center; gap: .75rem;
  min-width: 260px; animation: slideIn .3s ease;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); gap: 0; margin-bottom: 1.25rem; }
.tab-btn {
  padding: .65rem 1.25rem; font-size: .875rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: .3rem;
  justify-content: flex-end; padding-top: 1rem;
}
.page-btn {
  width: 32px; height: 32px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .8rem; color: var(--text-muted);
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ── Search & Filter Bar ─────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.search-box {
  position: relative; flex: 1; min-width: 200px;
}
.search-box input {
  width: 100%; padding: .5rem .85rem .5rem 2.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .875rem; outline: none; transition: border-color var(--transition);
}
.search-box input:focus { border-color: var(--primary); }
.search-box .search-icon {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: .9rem;
}

/* ── Dropdown ────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + .5rem); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  min-width: 180px; z-index: 200; overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: all var(--transition);
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1rem; font-size: .875rem; color: var(--text);
  cursor: pointer; transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { border-top: 1px solid var(--border); margin: .25rem 0; }

/* ── Progress Bars ───────────────────────────────────────── */
.progress { background: var(--bg); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 20px; background: var(--primary);
  transition: width .5s ease;
}
.progress-bar.danger  { background: var(--danger); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.success { background: var(--success); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h4 { color: var(--text-muted); font-weight: 500; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

/* ── Utilities ───────────────────────────────────────────── */
.text-primary  { color: var(--primary-dark) !important; }
.text-success  { color: var(--success) !important; }
.text-danger   { color: var(--danger) !important; }
.text-warning  { color: var(--warning) !important; }
.text-info     { color: var(--info) !important; }
.text-muted    { color: var(--text-muted) !important; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-bold     { font-weight: 600; }
.text-sm       { font-size: .8rem; }
.text-xs       { font-size: .72rem; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-0  { padding: 0 !important; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.flex-1 { flex: 1; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 50%; }
.shadow { box-shadow: var(--shadow); }
.border { border: 1px solid var(--border); }
.bg-white { background: #fff; }
.cursor-pointer { cursor: pointer; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Sidebar toggle — mobile slides, desktop collapses ──── */

/* Desktop default: sidebar visible */
.sidebar {
  transform: translateX(0);
  transition: transform .25s ease;
}

/* Mobile: sidebar hidden off-screen */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .filter-bar { flex-direction: column; }
  .search-box { width: 100%; }
}

/* Desktop: hamburger collapses sidebar */
@media (min-width: 769px) {
  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-collapsed .main-content {
    margin-left: 0 !important;
  }
}

/* Mobile overlay */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 250;
  cursor: pointer;
}
#sidebar-overlay.active {
  display: block;
}

/* ── Additional utilities ────────────────────────────────── */
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 768px) {
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
.text-info    { color: var(--info) !important; }
.badge-purple { background: #f0ebff; color: #553c9a; }
.badge-purple::before { background: #553c9a; }

/* ── Sidebar light mode ──────────────────────────────────── */
.sidebar { background: #ffffff; border-right: 1px solid #e2e8f0; }
.sidebar-section-title { color: #718096 !important; }
.sidebar-nav a { color: #4a5568 !important; }
.sidebar-nav a:hover { background: #f0f4f8 !important; color: #1a202c !important; }
.sidebar-nav a.active {
  background: #e0faf5 !important;
  color: #00b894 !important;
  font-weight: 600;
  border-left-color: #00d4aa;
}
.brand-name { color: #1a202c !important; }
.brand-sub  { color: #718096 !important; }
.sidebar-user .user-name { color: #2d3748 !important; }
.sidebar-user .user-role { color: #718096 !important; }
.signout-btn {
  width: 100%; padding: .45rem; margin-top: .5rem;
  background: #f0f4f8; border: 1px solid #e2e8f0;
  border-radius: var(--radius); color: #4a5568;
  font-size: .8rem; cursor: pointer;
}
.signout-btn:hover { background: #e2e8f0; }

/* ═══════════════════════════════════════════
   COLLAPSIBLE NAV GROUPS
═══════════════════════════════════════════ */
.sidebar-nav-wrap {
  flex: 1;
  overflow-y: auto;
  padding: .5rem 0;
}

/* Direct link (Dashboard) */
a.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
  cursor: pointer;
}
a.nav-item:hover,
a.nav-item.active {
  background: var(--primary-light, #ebf8ff);
  color: var(--primary);
  border-left-color: var(--primary);
}

/* Group header (clickable) */
.nav-group-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
  user-select: none;
}
.nav-group-header:hover {
  background: var(--bg);
  color: var(--primary);
}
.nav-group-header.open {
  color: var(--primary);
}

/* Arrow rotates when open */
.nav-arrow {
  margin-left: auto;
  font-size: 1rem;
  display: inline-block;
  transition: transform .2s;
  color: var(--text-muted);
}
.nav-group-header.open .nav-arrow {
  transform: rotate(90deg);
  color: var(--primary);
}

/* Submenu body — hidden by default */
.nav-group-body {
  display: none;
  background: var(--bg, #f8fafc);
  border-left: 3px solid var(--primary, #38b2ac);
  margin-left: 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius);
}
.nav-group-body.open {
  display: block;
}

/* Sub items */
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem 1rem;
  font-size: .82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
  border-left: 2px solid transparent;
}
.nav-sub-item:hover,
.nav-sub-item.active {
  background: var(--primary-light, #ebf8ff);
  color: var(--primary);
  border-left-color: var(--primary);
}
.nav-sub-item .nav-icon {
  font-size: .85rem;
}

/* Badge inside nav */
.nav-badge {
  margin-left: auto;
  background: var(--danger, #e53e3e);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
}
.nav-badge:empty, .nav-badge[data-val="0"] {
  display: none;
}



/* ═══════════════════════════════════════════════════════════
   SIDEBAR NAV — CLEAN, NO CARD SUBMENUS
═══════════════════════════════════════════════════════════ */

.sidebar-nav-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .5rem 0 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-nav-wrap::-webkit-scrollbar { width: 3px; }
.sidebar-nav-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Direct link (Overview) ── */
a.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: color .15s;
  position: relative;
  border: none;
  background: none;
}
a.nav-item .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
a.nav-item:hover { color: var(--text); }
a.nav-item.active {
  color: var(--primary);
  font-weight: 600;
}
a.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; height: 70%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

/* ── Group header ── */
.nav-group { }

.nav-group-header {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s;
  user-select: none;
  position: relative;
  background: none;
  border: none;
}
.nav-group-header .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.nav-group-header:hover { color: var(--text); }
.nav-group-header.open {
  color: var(--primary);
}
.nav-group-header.open::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; height: 70%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

/* ── Arrow ── */
.nav-arrow {
  margin-left: auto;
  font-size: .85rem;
  transition: transform .22s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}
.nav-group-header.open .nav-arrow {
  transform: rotate(90deg);
  color: var(--primary);
}

/* ── Submenu body — NO background, NO card ── */
.nav-group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
  background: none;
  border: none;
  margin: 0;
  padding: 0;
}
.nav-group-body.open {
  max-height: 600px;
}

/* ── Sub items — plain rows with indent ── */
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .48rem 1.25rem .48rem 2.9rem;
  font-size: .835rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
  background: none;
  border: none;
  position: relative;
}
.nav-sub-item .nav-icon {
  font-size: .85rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: .75;
}
.nav-sub-item:hover {
  color: var(--text);
}
.nav-sub-item.active {
  color: var(--primary);
  font-weight: 600;
}
.nav-sub-item.active::before {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

/* ── Badge ── */
.nav-badge {
  margin-left: auto;
  background: var(--danger, #e53e3e);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}
.nav-badge:empty { display: none; }

/* ── MOBILE SIDEBAR Z-INDEX FIX ── */
@media (max-width: 768px) {
  .sidebar {
    z-index: 500 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
  }
  .sidebar-overlay {
    z-index: 499 !important;
    position: fixed !important;
    top: 0; left: 0;
    width: 100%; height: 100%;
  }
}

/* ── Overlay default hidden ── */
#sidebar-overlay {
  display: none;
  pointer-events: none;
}
#sidebar-overlay.active {
  display: block !important;
  pointer-events: all !important;
}


/* ── MOBILE DASHBOARD — Keep 2-column grid like desktop ── */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr !important; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr !important; }
  .grid-4 { grid-template-columns: 1fr 1fr !important; }
  .kpi-row { grid-template-columns: 1fr 1fr !important; }
  .stat-card { padding: .65rem !important; }
  .stat-icon { width: 36px !important; height: 36px !important; font-size: 1rem !important; }
  .stat-value { font-size: 1.2rem !important; }
  .stat-label { font-size: .68rem !important; }
  .page-header { flex-direction: row !important; align-items: center !important; }
  .card { border-radius: 10px !important; }
}

/* ════════════════════════════════════════════
   DARK MODE
════════════════════════════════════════════ */
body.dark {
  --bg:         #0f172a;
  --bg2:        #1e293b;
  --border:     #334155;
  --text:       #f1f5f9;
  --text-muted: #94a3b8;
  --primary:    #14b8a6;
  --primary-light: #0f2027;
  background:   #0f172a;
  color:        #f1f5f9;
}

/* Topbar */
body.dark .topbar        { background:#1e293b; border-bottom:1px solid #334155; }
body.dark .topbar-title  { color:#f1f5f9; }
body.dark .topbar-breadcrumb { color:#94a3b8; }
body.dark .topbar-btn    { color:#94a3b8; background:transparent; }
body.dark .topbar-btn:hover { background:#334155; color:#f1f5f9; }
body.dark .topbar-user   { color:#f1f5f9; }
body.dark .avatar        { background:#14b8a6; }
body.dark .dropdown-menu { background:#1e293b; border:1px solid #334155; }
body.dark .dropdown-item { color:#cbd5e1; }
body.dark .dropdown-item:hover { background:#334155; color:#f1f5f9; }
body.dark .dropdown-divider { border-color:#334155; }

/* Sidebar */
body.dark .sidebar        { background:#1e293b; border-right:1px solid #334155; }
body.dark .sidebar-brand  { border-bottom:1px solid #334155; }
body.dark .brand-name     { color:#f1f5f9 !important; }
body.dark .brand-sub      { color:#64748b !important; }
body.dark .nav-item       { color:#94a3b8; }
body.dark .nav-item:hover { color:#f1f5f9; }
body.dark .nav-item.active{ color:#14b8a6; }
body.dark .nav-group-header       { color:#94a3b8; }
body.dark .nav-group-header:hover { color:#f1f5f9; }
body.dark .nav-group-header.open  { color:#14b8a6; }
body.dark .nav-sub-item           { color:#64748b; }
body.dark .nav-sub-item:hover     { color:#f1f5f9; }
body.dark .nav-sub-item.active    { color:#14b8a6; }
body.dark .sidebar-footer { border-top:1px solid #334155; }
body.dark .sidebar-user .user-name { color:#f1f5f9 !important; }
body.dark .sidebar-user .user-role { color:#64748b !important; }

/* Page background */
body.dark .page-content   { background:#0f172a; }
body.dark .main-content   { background:#0f172a; }

/* Cards */
body.dark .income-card,
body.dark .kpi-card,
body.dark .sess-card,
body.dark .bw-card,
body.dark .mk-card,
body.dark .net-card,
body.dark .dash-card,
body.dark .health-card,
body.dark .intg-card,
body.dark .mk-router-card,
body.dark .shortcut-btn,
body.dark .card           { background:#1e293b !important; border-color:#334155 !important; }

body.dark .mk-router-card { background:#1e293b !important; }

/* Text colors */
body.dark .dash-greeting h2,
body.dark .income-value,
body.dark .kpi-value,
body.dark .sess-count,
body.dark .net-value,
body.dark .health-val,
body.dark .intg-val,
body.dark .mk-router-name,
body.dark .bw-title,
body.dark .dash-card-title,
body.dark .mk-title        { color:#f1f5f9 !important; }

body.dark .dash-greeting p,
body.dark .income-label,
body.dark .income-sub,
body.dark .kpi-label,
body.dark .kpi-sub,
body.dark .sess-sub,
body.dark .sess-type,
body.dark .net-label,
body.dark .net-sub,
body.dark .health-lbl,
body.dark .intg-lbl,
body.dark .intg-sub,
body.dark .mk-router-ip,
body.dark .mk-router-model,
body.dark .mk-stat-label,
body.dark .mk-footer-item,
body.dark .sc-label,
body.dark .shortcuts-label,
body.dark .sec-div,
body.dark .bw-legend-item,
body.dark .bw-updated,
body.dark .mk-last-updated { color:#64748b !important; }

/* Bars/tracks */
body.dark .mk-stat-bar-wrap,
body.dark .health-bar,
body.dark .plan-bar-track  { background:#334155 !important; }

/* Inputs/selects */
body.dark .bw-select,
body.dark .mk-select       { background:#0f172a; border-color:#334155; color:#f1f5f9; }

/* Tables */
body.dark .table thead th  { background:#1e293b; color:#64748b; border-color:#334155; }
body.dark .table tbody td  { border-color:#334155; color:#cbd5e1; }
body.dark .table tbody tr:hover td { background:#334155 !important; }
body.dark .table-wrapper   { background:#1e293b; }

/* Live clock & refresh */
body.dark .live-clock,
body.dark .refresh-bar     { background:#1e293b; border-color:#334155; color:#94a3b8; }
body.dark .live-clock      { color:#f1f5f9; }

/* Section dividers */
body.dark .sec-div::after,
body.dark .shortcuts-label::after { background:#334155 !important; }

/* Shortcut buttons */
body.dark .sc-icon         { background:#0f172a; }
body.dark .shortcut-btn:hover { background:#334155 !important; border-color:#14b8a6 !important; }
body.dark .shortcut-btn:hover .sc-icon { background:#0d2d2d; }

/* MikroTik summary */
body.dark .mk-summary      { background:#0f172a; border-color:#334155; }
body.dark .mk-summary-lbl  { color:#64748b; }
body.dark .mk-summary-val  { color:#f1f5f9; }
body.dark .mk-refresh-btn  { background:#334155; border-color:#475569; color:#94a3b8; }
body.dark .mk-router-grid  { background:#1e293b; }

/* Card headers */
body.dark .bw-header,
body.dark .mk-header,
body.dark .dash-card-header { border-color:#334155 !important; }

/* Badges */
body.dark .badge           { background:#334155; color:#94a3b8; }

/* Agent & plan bars */
body.dark .agent-row       { border-color:#334155; }
body.dark .agent-name      { color:#f1f5f9; }
body.dark .plan-bar-name   { color:#cbd5e1; }
body.dark .plan-bar-cnt    { color:#64748b; }

/* Expiry rows */
body.dark .expiry-row      { border-color:#334155; }
body.dark .expiry-name     { color:#f1f5f9; }
body.dark .expiry-plan     { color:#64748b; }

/* Activity log */
body.dark .act-item        { border-color:#334155; }
body.dark .act-text        { color:#cbd5e1; }
body.dark .act-text strong { color:#f1f5f9; }

/* Dark mode toggle button */
.dark-toggle {
  display:flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:10px;
  border:1px solid #e2e8f0; background:#fff; cursor:pointer;
  transition:all .2s; flex-shrink:0; color:#475569;
}
.dark-toggle:hover { border-color:#14b8a6; background:#f0fdfa; color:#14b8a6; }
body.dark .dark-toggle { background:#1e293b; border-color:#334155; color:#f59e0b; }
body.dark .dark-toggle:hover { background:#334155; border-color:#f59e0b; }

/* ── Dark mode on <html> element (flash prevention) ── */
html.dark {
  background: #0f172a;
  color: #f1f5f9;
}
html.dark body {
  background: #0f172a;
  color: #f1f5f9;
}

/* ════════════════════════════════════════════
   MOBILE SIDEBAR — definitive rules
════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Sidebar hidden off-screen by default on mobile */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 260px !important;
    z-index: 500 !important;
    transform: translateX(-100%) !important;
    transition: transform .25s ease !important;
    overflow-y: auto !important;
    background: #fff !important;
    border-right: 1px solid #e2e8f0 !important;
  }
  /* Sidebar visible when .open is added by JS */
  .sidebar.open {
    transform: translateX(0) !important;
  }
  /* Main content takes full width */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  /* Overlay */
  #sidebar-overlay {
    display: none;
    position: fixed !important;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45) !important;
    z-index: 499 !important;
    cursor: pointer;
  }
  #sidebar-overlay.active {
    display: block !important;
  }
}

/* Dark mode sidebar on mobile */
@media (max-width: 900px) {
  body.dark .sidebar {
    background: #1e293b !important;
    border-right-color: #334155 !important;
  }
}

/* === SIDEBAR MASTER RESPONSIVE === */
.sidebar {
  position: fixed !important;
  top: 0; left: 0;
  height: 100vh;
  width: 260px;
  z-index: 500;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform .25s ease;
}
.main-content {
  margin-left: 260px;
  transition: margin-left .25s ease;
}
@media (min-width: 901px) {
  body.sidebar-collapsed .sidebar { transform: translateX(-260px); }
  body.sidebar-collapsed .main-content { margin-left: 0; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-260px) !important; }
  .sidebar.open { transform: translateX(0) !important; }
  .main-content { margin-left: 0 !important; }
}
#sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 499; pointer-events: none; }


/* ════════════════════════════════════════════════════
   MOBILE SIDEBAR PUSH (same behaviour as desktop)
════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Layout: row so sidebar + content sit side by side */
  .app-layout {
    display: flex !important;
    flex-direction: row !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
  }

  /* Sidebar: part of the flow, starts at width 0 */
  .sidebar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    height: auto !important;
    min-height: 100vh !important;
    width: 0 !important;
    min-width: 0 !important;
    transform: none !important;
    transition: width 0.28s ease, min-width 0.28s ease !important;
    overflow: hidden !important;
    z-index: auto !important;
    flex-shrink: 0 !important;
  }

  /* When open: expand to 260px — pushes content right */
  .sidebar.open {
    width: 260px !important;
    min-width: 260px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  /* Main content fills remaining space */
  .main-content {
    flex: 1 !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    overflow-x: hidden !important;
    transition: none !important;
  }

  /* Hide overlay — not needed for push layout */
  #sidebar-overlay {
    display: none !important;
  }
}


/* ═══════════════════════════════════════════════════════════════
   WORLD-CLASS ISP BILLING SYSTEM — COMPLETE STYLE OVERHAUL
   Responsive, polished, professional — beats Splynx.
═══════════════════════════════════════════════════════════════ */

/* ── Import premium font ── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary:        #00c896;
  --primary-dark:   #00a87d;
  --primary-light:  #e6faf4;
  --primary-glow:   rgba(0,200,150,.15);
  --accent:         #6366f1;
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --success:        #10b981;
  --info:           #3b82f6;
  --bg:             #f0f4f8;
  --bg2:            #e8edf3;
  --card-bg:        #ffffff;
  --border:         #e2e8f0;
  --border-light:   #f1f5f9;
  --text:           #0f172a;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 12px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-md:      0 8px 24px rgba(0,0,0,.09), 0 4px 8px rgba(0,0,0,.05);
  --shadow-lg:      0 20px 40px rgba(0,0,0,.1),  0 8px 16px rgba(0,0,0,.06);
  --radius-sm:      8px;
  --radius:         12px;
  --radius-lg:      16px;
  --radius-xl:      20px;
  --sidebar-w:      260px;
  --header-h:       60px;
  --transition:     .18s ease;
  --font:           'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}

/* ── Base reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font) !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── App layout ── */
.app-layout {
  display: flex !important;
  min-height: 100vh !important;
}

/* ═══════════════════════════════════════════════════
   TOPBAR — clean, sticky, perfect height
═══════════════════════════════════════════════════ */
.topbar {
  height: var(--header-h) !important;
  background: rgba(255,255,255,.95) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 0 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 400 !important;
  box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(0,0,0,.04) !important;
  flex-shrink: 0 !important;
}
.topbar-left {
  display: flex !important;
  align-items: center !important;
  gap: .75rem !important;
}
.topbar-right {
  display: flex !important;
  align-items: center !important;
  gap: .5rem !important;
}
.topbar-title {
  font-size: .95rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  letter-spacing: -.01em !important;
}
.topbar-breadcrumb {
  font-size: .72rem !important;
  color: var(--text-muted) !important;
  margin-top: 1px !important;
}
.topbar-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  color: var(--text-muted) !important;
  flex-shrink: 0 !important;
  transition: all var(--transition) !important;
}
.topbar-btn:hover { background: var(--bg) !important; color: var(--text) !important; }
.dark-toggle-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  color: var(--text-muted) !important;
  transition: all var(--transition) !important;
}
.dark-toggle-btn:hover {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  color: var(--primary) !important;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR — refined, modern
═══════════════════════════════════════════════════ */
.sidebar {
  background: #fff !important;
  border-right: 1px solid var(--border) !important;
  display: flex !important;
  flex-direction: column !important;
}
.sidebar-brand {
  padding: 1.1rem 1.25rem !important;
  border-bottom: 1px solid var(--border-light) !important;
  display: flex !important;
  align-items: center !important;
  gap: .65rem !important;
}
.brand-logo {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 12px var(--primary-glow) !important;
}
.brand-name {
  font-size: .9rem !important;
  font-weight: 800 !important;
  color: var(--text) !important;
  letter-spacing: -.02em !important;
}
.brand-sub {
  font-size: .65rem !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
}

/* Nav items */
a.nav-item {
  display: flex !important;
  align-items: center !important;
  gap: .65rem !important;
  padding: .55rem 1.25rem !important;
  color: var(--text-muted) !important;
  text-decoration: none !important;
  font-size: .84rem !important;
  font-weight: 500 !important;
  transition: all var(--transition) !important;
  position: relative !important;
  border-radius: 0 !important;
}
a.nav-item:hover { color: var(--text) !important; background: var(--bg) !important; }
a.nav-item.active {
  color: var(--primary) !important;
  font-weight: 700 !important;
  background: var(--primary-light) !important;
}
a.nav-item.active::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important; top: 20% !important; height: 60% !important;
  width: 3px !important;
  background: var(--primary) !important;
  border-radius: 0 3px 3px 0 !important;
}
.nav-group-header {
  display: flex !important;
  align-items: center !important;
  gap: .65rem !important;
  padding: .55rem 1.25rem !important;
  font-size: .84rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
  transition: all var(--transition) !important;
  user-select: none !important;
  position: relative !important;
}
.nav-group-header:hover { color: var(--text) !important; background: var(--bg) !important; }
.nav-group-header.open { color: var(--primary) !important; background: var(--primary-light) !important; }
.nav-group-header.open::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important; top: 20% !important; height: 60% !important;
  width: 3px !important;
  background: var(--primary) !important;
  border-radius: 0 3px 3px 0 !important;
}
.nav-arrow { margin-left: auto !important; transition: transform .22s ease !important; color: var(--text-light) !important; font-size: .8rem !important; }
.nav-group-header.open .nav-arrow { transform: rotate(90deg) !important; color: var(--primary) !important; }

.nav-group-body { max-height: 0 !important; overflow: hidden !important; transition: max-height .28s ease !important; }
.nav-group-body.open { max-height: 600px !important; }

.nav-sub-item {
  display: flex !important;
  align-items: center !important;
  gap: .55rem !important;
  padding: .45rem 1.25rem .45rem 2.75rem !important;
  font-size: .8rem !important;
  font-weight: 400 !important;
  color: var(--text-muted) !important;
  text-decoration: none !important;
  transition: all var(--transition) !important;
  position: relative !important;
}
.nav-sub-item:hover { color: var(--text) !important; }
.nav-sub-item.active {
  color: var(--primary) !important;
  font-weight: 600 !important;
}
.nav-sub-item.active::before {
  content: '' !important;
  position: absolute !important;
  left: 1.5rem !important; top: 50% !important; transform: translateY(-50%) !important;
  width: 5px !important; height: 5px !important;
  border-radius: 50% !important;
  background: var(--primary) !important;
}

/* ═══════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════ */
.main-content {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  min-width: 0 !important;
  background: var(--bg) !important;
}
.page-content {
  padding: 1.25rem !important;
  flex: 1 !important;
}

/* ═══════════════════════════════════════════════════
   CARDS — elevated, premium
═══════════════════════════════════════════════════ */
.card, .dash-card, .bw-card, .mk-card, .net-card,
.health-card, .intg-card, .kpi-card, .income-card,
.sess-card, .shortcut-btn, .stat-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: box-shadow var(--transition), transform var(--transition) !important;
}
.card:hover, .dash-card:hover, .kpi-card:hover,
.income-card:hover, .net-card:hover { 
  box-shadow: var(--shadow) !important; 
}
.card-header, .dash-card-header, .bw-header, .mk-header {
  padding: .85rem 1.1rem !important;
  border-bottom: 1px solid var(--border-light) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: .5rem !important;
}
.card-body { padding: 1.1rem !important; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE GRID SYSTEM
   Mobile-first. Adapts cleanly at every breakpoint.
═══════════════════════════════════════════════════ */

/* Base: single column on mobile */
.grid { display: grid !important; gap: .85rem !important; }
.grid-2 { grid-template-columns: 1fr !important; }
.grid-3 { grid-template-columns: 1fr !important; }
.grid-4 { grid-template-columns: 1fr 1fr !important; }
.grid-5 { grid-template-columns: 1fr 1fr !important; }

/* Tablet 600px+ */
@media (min-width: 600px) {
  .grid-2 { grid-template-columns: 1fr 1fr !important; }
  .grid-3 { grid-template-columns: 1fr 1fr !important; }
  .grid-4 { grid-template-columns: 1fr 1fr !important; }
}

/* Desktop 1024px+ */
@media (min-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr 1fr !important; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr !important; }
  .grid-4 { grid-template-columns: repeat(4, 1fr) !important; }
  .grid-5 { grid-template-columns: repeat(5, 1fr) !important; }
}

/* ── Dashboard specific responsive grids ── */

/* Income row: always 2 cols */
.income-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: .75rem !important;
  margin-bottom: .85rem !important;
}

/* KPI row: 2 cols mobile, 2 cols tablet, 2 cols (it has 2 cards) */
.kpi-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: .75rem !important;
  margin-bottom: .85rem !important;
}

/* Sessions: 3 cols always (small cards) */
.sessions-row {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: .75rem !important;
  margin-bottom: .85rem !important;
}

/* Shortcuts: 5 cols always (icon buttons) */
.shortcuts-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: .5rem !important;
}
@media (max-width: 380px) {
  .shortcuts-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* Analytics section: 1 col mobile, 2 col tablet, 3 col desktop */
.analytics-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: .85rem !important;
  margin-bottom: .85rem !important;
}
@media (min-width: 700px) {
  .analytics-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (min-width: 1100px) {
  .analytics-grid { grid-template-columns: 1fr 1fr 1fr !important; }
}

/* Network row: 2 col mobile, 4 col desktop */
.net-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: .75rem !important;
  margin-bottom: .85rem !important;
}
@media (min-width: 1024px) {
  .net-row { grid-template-columns: repeat(4, 1fr) !important; }
}

/* Health row: 2 col mobile, 4 col desktop */
.health-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: .75rem !important;
  margin-bottom: .85rem !important;
}
@media (min-width: 1024px) {
  .health-row { grid-template-columns: repeat(4, 1fr) !important; }
}

/* Integration row: 2 col mobile, 4 col desktop */
.intg-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: .75rem !important;
  margin-bottom: .85rem !important;
}
@media (min-width: 1024px) {
  .intg-row { grid-template-columns: repeat(4, 1fr) !important; }
}

/* MikroTik router grid */
.mk-router-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: .75rem !important;
  padding: .85rem !important;
}
@media (min-width: 700px) {
  .mk-router-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (min-width: 1200px) {
  .mk-router-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ═══════════════════════════════════════════════════
   SIDEBAR DESKTOP/MOBILE LAYOUT
═══════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: var(--sidebar-w) !important;
    height: 100vh !important;
    transform: translateX(0) !important;
    transition: transform .25s ease !important;
    z-index: 500 !important;
    overflow-y: auto !important;
  }
  body:not(.sidebar-collapsed) .main-content { margin-left: var(--sidebar-w) !important; }
  body.sidebar-collapsed .sidebar { transform: translateX(-260px) !important; }
  body.sidebar-collapsed .main-content { margin-left: 0 !important; }
  .main-content { transition: margin-left .25s ease !important; }
}
@media (max-width: 768px) {
  .app-layout { display: flex !important; flex-direction: row !important; overflow-x: hidden !important; }
  .sidebar {
    position: relative !important;
    width: 0 !important; min-width: 0 !important;
    height: auto !important; min-height: 100vh !important;
    transform: none !important;
    transition: width .28s ease, min-width .28s ease !important;
    overflow: hidden !important;
    z-index: auto !important;
    flex-shrink: 0 !important;
  }
  .sidebar.open {
    width: 260px !important; min-width: 260px !important;
    overflow-y: auto !important;
  }
  .main-content { flex: 1 !important; margin-left: 0 !important; min-width: 0 !important; }
  #sidebar-overlay { display: none !important; }
}

/* ═══════════════════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════════════════ */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font) !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  letter-spacing: -.02em !important;
}
.dash-card-title, .bw-title, .mk-title {
  font-size: .85rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  display: flex !important;
  align-items: center !important;
  gap: .4rem !important;
}

/* ═══════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: .35rem !important;
  padding: .45rem 1rem !important;
  border-radius: var(--radius-sm) !important;
  font-size: .82rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  border: 1px solid transparent !important;
  transition: all var(--transition) !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  font-family: var(--font) !important;
}
.btn:hover { transform: translateY(-1px) !important; box-shadow: var(--shadow-sm) !important; }
.btn-primary { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }
.btn-primary:hover { background: var(--primary-dark) !important; }
.btn-sm { padding: .3rem .7rem !important; font-size: .76rem !important; }
.btn-outline { background: transparent !important; border-color: var(--border) !important; color: var(--text) !important; }
.btn-outline:hover { background: var(--bg) !important; }
.btn-success { background: var(--success) !important; color: #fff !important; }
.btn-warning { background: var(--warning) !important; color: #fff !important; }
.btn-danger  { background: var(--danger)  !important; color: #fff !important; }

/* ═══════════════════════════════════════════════════
   TABLES — clean, readable
═══════════════════════════════════════════════════ */
.table { width: 100% !important; border-collapse: collapse !important; font-size: .83rem !important; }
.table th {
  background: var(--bg) !important;
  color: var(--text-muted) !important;
  font-size: .7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  padding: .6rem .9rem !important;
  border-bottom: 2px solid var(--border) !important;
  white-space: nowrap !important;
}
.table td {
  padding: .7rem .9rem !important;
  border-bottom: 1px solid var(--border-light) !important;
  color: var(--text) !important;
  vertical-align: middle !important;
}
.table tbody tr:hover td { background: var(--bg) !important; }
.table tbody tr:last-child td { border-bottom: none !important; }
.table-wrapper { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }

/* ═══════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════ */
.badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: .25rem !important;
  padding: .18rem .55rem !important;
  border-radius: 999px !important;
  font-size: .7rem !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
}
.badge::before { content: '' !important; width: 5px !important; height: 5px !important; border-radius: 50% !important; background: currentColor !important; }
.badge-success  { background: #dcfce7 !important; color: #15803d !important; }
.badge-danger   { background: #fee2e2 !important; color: #dc2626 !important; }
.badge-warning  { background: #fef3c7 !important; color: #d97706 !important; }
.badge-info     { background: #dbeafe !important; color: #2563eb !important; }
.badge-secondary{ background: #f1f5f9 !important; color: #475569 !important; }
.badge-primary  { background: var(--primary-light) !important; color: var(--primary-dark) !important; }

/* ═══════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════ */
.form-control {
  width: 100% !important;
  padding: .55rem .85rem !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  font-size: .85rem !important;
  font-family: var(--font) !important;
  color: var(--text) !important;
  background: #fff !important;
  transition: border-color var(--transition), box-shadow var(--transition) !important;
  outline: none !important;
}
.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}
.form-label {
  display: block !important;
  font-size: .8rem !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  margin-bottom: .35rem !important;
}
.form-row.cols-2 { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: .85rem !important; }
@media (max-width: 600px) {
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr !important; }
}

/* ═══════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed !important; inset: 0 !important;
  background: rgba(15,23,42,.5) !important;
  backdrop-filter: blur(4px) !important;
  z-index: 1000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .2s ease !important;
}
.modal-overlay.active { opacity: 1 !important; pointer-events: all !important; }
.modal {
  background: #fff !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-lg) !important;
  width: 100% !important;
  max-width: 560px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  transform: scale(.96) translateY(8px) !important;
  transition: transform .22s ease !important;
}
.modal-overlay.active .modal { transform: scale(1) translateY(0) !important; }
.modal-lg  { max-width: 760px !important; }
.modal-xl  { max-width: 960px !important; }
.modal-header {
  padding: 1.1rem 1.4rem !important;
  border-bottom: 1px solid var(--border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
.modal-header h3 { font-size: 1rem !important; }
.modal-body { padding: 1.4rem !important; }
.modal-footer {
  padding: .9rem 1.4rem !important;
  border-top: 1px solid var(--border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: .6rem !important;
}
.modal-close {
  width: 30px !important; height: 30px !important;
  border-radius: var(--radius-sm) !important;
  border: none !important;
  background: var(--bg) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--text-muted) !important;
  font-size: 1.1rem !important;
  transition: all var(--transition) !important;
}
.modal-close:hover { background: var(--border) !important; }

/* ═══════════════════════════════════════════════════
   STAT / KPI CARDS
═══════════════════════════════════════════════════ */
.income-card {
  padding: 1rem 1.1rem !important;
  border-radius: var(--radius-lg) !important;
  position: relative !important;
  overflow: hidden !important;
}
.income-value { font-size: 1.4rem !important; font-weight: 800 !important; letter-spacing: -.02em !important; }
.kpi-value    { font-size: 1.5rem !important; font-weight: 800 !important; letter-spacing: -.02em !important; }
.kpi-label    { font-size: .68rem !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: .07em !important; }
.sess-count   { font-size: 1.6rem !important; font-weight: 800 !important; }

/* ═══════════════════════════════════════════════════
   SHORTCUT BUTTONS
═══════════════════════════════════════════════════ */
.shortcut-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .3rem !important;
  padding: .65rem .3rem !important;
  border-radius: var(--radius) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  color: var(--text) !important;
  transition: all var(--transition) !important;
}
.shortcut-btn:hover {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px var(--primary-glow) !important;
}
.sc-label { font-size: .67rem !important; font-weight: 600 !important; color: var(--text-muted) !important; text-align: center !important; line-height: 1.3 !important; }
.sc-icon { width: 36px !important; height: 36px !important; border-radius: 10px !important; background: var(--bg) !important; display: flex !important; align-items: center !important; justify-content: center !important; transition: background var(--transition) !important; }
.shortcut-btn:hover .sc-icon { background: #fff !important; }

/* ═══════════════════════════════════════════════════
   TOASTS
═══════════════════════════════════════════════════ */
.toast-container { position: fixed !important; bottom: 1.25rem !important; right: 1.25rem !important; z-index: 9999 !important; display: flex !important; flex-direction: column !important; gap: .4rem !important; }
.toast {
  background: #1e293b !important;
  color: #fff !important;
  padding: .7rem 1.1rem !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-md) !important;
  font-size: .82rem !important;
  display: flex !important;
  align-items: center !important;
  gap: .6rem !important;
  min-width: 240px !important;
  max-width: 320px !important;
  animation: toastIn .3s ease !important;
}
.toast.success { background: var(--success) !important; }
.toast.error   { background: var(--danger)  !important; }
.toast.warning { background: var(--warning) !important; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ═══════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════ */
.page-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 1.25rem !important;
  flex-wrap: wrap !important;
  gap: .75rem !important;
}
.page-header h2 { font-size: 1.3rem !important; font-weight: 800 !important; margin: 0 !important; }

/* ═══════════════════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════════════════ */
.filter-toolbar {
  display: flex !important;
  gap: .6rem !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  padding: .75rem 1rem !important;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  margin-bottom: 1rem !important;
}
@media (max-width: 600px) {
  .filter-toolbar { flex-direction: column !important; align-items: stretch !important; }
  .filter-toolbar select, .filter-toolbar input { width: 100% !important; }
}

/* ═══════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════ */
.pager { display: flex !important; align-items: center !important; gap: .3rem !important; }
.pager button {
  min-width: 32px !important; height: 32px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  font-size: .8rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all var(--transition) !important;
  padding: 0 .4rem !important;
  font-family: var(--font) !important;
}
.pager button:hover:not(:disabled), .pager button.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

/* ═══════════════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════════════ */
body.dark {
  --bg:           #0f172a !important;
  --bg2:          #1e293b !important;
  --card-bg:      #1e293b !important;
  --border:       #334155 !important;
  --border-light: #293548 !important;
  --text:         #f1f5f9 !important;
  --text-muted:   #94a3b8 !important;
  --text-light:   #64748b !important;
  background: #0f172a !important;
}
body.dark .topbar    { background: rgba(30,41,59,.95) !important; border-bottom-color: #334155 !important; }
body.dark .sidebar   { background: #1e293b !important; border-right-color: #334155 !important; }
body.dark .card, body.dark .dash-card, body.dark .bw-card, body.dark .mk-card,
body.dark .income-card, body.dark .kpi-card, body.dark .net-card, body.dark .health-card,
body.dark .intg-card, body.dark .sess-card, body.dark .shortcut-btn, body.dark .stat-card,
body.dark .mk-router-card, body.dark #reg-chart-section, body.dark #router-selector-wrap > div {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.dark .table th  { background: #0f172a !important; color: #64748b !important; border-color: #334155 !important; }
body.dark .table td  { border-color: #293548 !important; color: #cbd5e1 !important; }
body.dark .table tbody tr:hover td { background: #293548 !important; }
body.dark .topbar-btn, body.dark .dark-toggle-btn { background: transparent !important; border-color: #334155 !important; color: #94a3b8 !important; }
body.dark .form-control { background: #0f172a !important; border-color: #334155 !important; color: #f1f5f9 !important; }
body.dark .btn-outline { border-color: #334155 !important; color: #94a3b8 !important; }
body.dark .btn-outline:hover { background: #334155 !important; color: #f1f5f9 !important; }
body.dark .modal { background: #1e293b !important; }
body.dark .modal-header, body.dark .modal-footer { border-color: #334155 !important; }
body.dark a.nav-item:hover, body.dark .nav-group-header:hover { background: #0f172a !important; }
body.dark a.nav-item.active, body.dark .nav-group-header.open { background: rgba(0,200,150,.1) !important; }
body.dark .sc-icon { background: #0f172a !important; }
body.dark .pager button { background: #1e293b !important; border-color: #334155 !important; color: #94a3b8 !important; }
body.dark .filter-toolbar { background: #1e293b !important; border-color: #334155 !important; }
body.dark #router-selector { background: #0f172a !important; border-color: #334155 !important; color: #f1f5f9 !important; }

/* ═══════════════════════════════════════════════════
   SCROLLBAR — refined
═══════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }
body.dark ::-webkit-scrollbar-thumb { background: #334155; }

/* ═══════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content > * {
  animation: fadeInUp .3s ease both;
}
.page-content > *:nth-child(2) { animation-delay: .04s; }
.page-content > *:nth-child(3) { animation-delay: .08s; }
.page-content > *:nth-child(4) { animation-delay: .12s; }
.page-content > *:nth-child(5) { animation-delay: .16s; }

/* ═══════════════════════════════════════════════════
   MOBILE POLISH
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .page-content { padding: .9rem !important; }
  .income-value { font-size: 1.2rem !important; }
  .kpi-value    { font-size: 1.3rem !important; }
  .sess-count   { font-size: 1.4rem !important; }
  .dash-header  { flex-direction: column !important; align-items: flex-start !important; gap: .6rem !important; }
  .dash-meta    { flex-wrap: wrap !important; gap: .4rem !important; }
  .income-row, .kpi-row { gap: .6rem !important; }
  .sessions-row { gap: .5rem !important; }
  .page-header  { flex-direction: row !important; align-items: center !important; }
  .modal        { border-radius: var(--radius-lg) !important; margin: 0 !important; }
  .modal-overlay { align-items: flex-end !important; padding: 0 !important; }
  .modal { max-height: 92vh !important; border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important; }
}

/* ═══════════════════════════════════════════════════
   ANALYTICS GRID FIX
   Replace inline grid-2/grid-3 in analytics section
═══════════════════════════════════════════════════ */
.analytics-section .grid-2,
.analytics-section .grid-3 {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: .85rem !important;
}
@media (min-width: 700px) {
  .analytics-section .grid-2 { grid-template-columns: 1fr 1fr !important; }
  .analytics-section .grid-3 { grid-template-columns: 1fr 1fr !important; }
}
@media (min-width: 1100px) {
  .analytics-section .grid-2 { grid-template-columns: 1fr 1fr !important; }
  .analytics-section .grid-3 { grid-template-columns: 1fr 1fr 1fr !important; }
}


/* ── Modal active/open alias fix ── */
.modal-overlay.active { opacity: 1 !important; pointer-events: all !important; }
.modal-overlay.active .modal { transform: scale(1) !important; }
.modal-overlay.open   { opacity: 1 !important; pointer-events: all !important; }
.modal-overlay.open .modal   { transform: scale(1) !important; }
