/* ============================================================
   Billing CI3 — Main Stylesheet
   ============================================================ */

:root {
  --sidebar-width: 240px;
  --primary: #1a3a5c;
  --primary-light: #2d6a9f;
  --sidebar-bg: #1a3a5c;
  --sidebar-text: rgba(255,255,255,.85);
  --sidebar-active: rgba(255,255,255,.15);
  --topbar-height: 56px;
}

/* ---- Layout ---- */
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f4f6fb;
  font-size: 14px;
  overflow-x: hidden;
}

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1000;
  overflow-y: auto;
  transition: width .25s ease, transform .25s ease;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.sidebar-brand i {
  font-size: 20px;
  color: #5bc8ff;
}

.sidebar-menu {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background .15s, color .15s;
  font-size: 13.5px;
}

.sidebar-menu li a i {
  width: 18px;
  text-align: center;
  font-size: 13px;
}

.sidebar-menu li:hover > a,
.sidebar-menu li.active > a {
  background: var(--sidebar-active);
  color: #fff;
  border-right: 3px solid #5bc8ff;
}

.sidebar-menu li.nav-header {
  padding: 14px 20px 4px;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  font-weight: 600;
}

/* ---- Main Content ---- */
#content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}

.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e3e8ef;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

#sidebarToggle {
  color: #555;
  padding: 4px 8px;
}

/* ---- Collapsed sidebar ---- */
body.sidebar-collapsed .sidebar {
  width: 60px;
}
body.sidebar-collapsed .sidebar-brand span,
body.sidebar-collapsed .sidebar-menu li a span,
body.sidebar-collapsed .sidebar-menu li.nav-header {
  display: none;
}
body.sidebar-collapsed #content {
  margin-left: 60px;
}
body.sidebar-collapsed .sidebar-menu li a {
  justify-content: center;
  padding: 12px;
}

/* ---- Stat Cards ---- */
.stat-card {
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,.1);
  transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { font-size: 28px; opacity: .9; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; opacity: .85; margin-top: 2px; }

.stat-blue   { background: linear-gradient(135deg, #2193b0, #6dd5ed); }
.stat-green  { background: linear-gradient(135deg, #11998e, #38ef7d); }
.stat-orange { background: linear-gradient(135deg, #f46b45, #eea849); }
.stat-red    { background: linear-gradient(135deg, #cb2d3e, #ef473a); }
.stat-purple { background: linear-gradient(135deg, #834d9b, #d04ed6); }
.stat-teal   { background: linear-gradient(135deg, #11998e, #38ef7d); }
.stat-indigo { background: linear-gradient(135deg, #4776e6, #8e54e9); }

/* ---- Cards ---- */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: 12px 16px;
  border-radius: 10px 10px 0 0 !important;
}

/* ---- Tables ---- */
.table-sm th, .table-sm td { padding: .45rem .75rem; }
.table thead th { font-size: 12px; letter-spacing: .4px; text-transform: uppercase; color: #555; }

/* ---- Badges ---- */
.badge { font-size: 11px; padding: .3em .65em; }

/* ---- Buttons ---- */
.btn-xs { padding: 2px 7px; font-size: 11px; line-height: 1.5; border-radius: 4px; }

/* ---- Alerts ---- */
.alert { border-radius: 8px; }

/* ---- Scrollbar ---- */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

/* ---- Responsive ---- */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  #content {
    margin-left: 0 !important;
  }
}
