/* ============================================================
   Camp Management System – style.css  v2.0
   ============================================================ */

:root {
  --cms-primary:    #1a3c5e;
  --cms-primary-2:  #2e7db5;
  --cms-accent:     #e67e22;
  --cms-sidebar-w:  240px;
  --cms-sidebar-bg: #0f2840;
  --cms-body-bg:    #f0f4f8;
  --cms-radius:     10px;
}

/* ── Base ─────────────────────────────────────────────────── */
html, body { height:100%; }
body {
  background: var(--cms-body-bg);
  font-size: .9rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#wrapper { min-height: calc(100vh - 56px); position: relative; flex: 1 0 auto; }

/* ── Navbar ───────────────────────────────────────────────── */
.cms-navbar {
  background: var(--cms-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 1050;
}
.bg-accent { background: var(--cms-accent) !important; }

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--cms-sidebar-w);
  min-height: calc(100vh - 56px);
  background: var(--cms-sidebar-bg);
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .28s ease;
  z-index: 1040;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar-brand {
  text-align: center;
  padding: 16px 0 12px;
  color: #fff;
  font-size: 1.6rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-nav { list-style: none; padding: 8px 0 30px; margin: 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; color: #a8c0d6;
  text-decoration: none; font-size: .84rem;
  border-left: 3px solid transparent;
  transition: all .2s; white-space: nowrap;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.07);
  border-left-color: var(--cms-accent);
}
.sidebar-nav a i { width: 18px; text-align: center; font-size: .95rem; }
.sidebar-header {
  padding: 14px 18px 4px;
  font-size: .68rem; text-transform: uppercase;
  letter-spacing: .08em; color: #5a7a95;
}
.cs-mini-stat { font-size: 10px; color: rgba(255,255,255,.6); margin-top: 4px; }
.cs-occ-bar   { width: 100%; background: rgba(255,255,255,.15); border-radius: 3px; height: 5px; margin-top: 4px; }
.cs-occ-bar > div { height: 5px; border-radius: 3px; transition: width .4s; }

/* ── Mobile sidebar overlay ──────────────────────────────── */
#sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 1039;
}
#sidebar-overlay.show { display: block; }

/* ── Page content ─────────────────────────────────────────── */
#page-content { flex: 1; padding: 24px; overflow-x: hidden; min-width: 0; }

/* ── Cards ────────────────────────────────────────────────── */
.card        { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-radius: var(--cms-radius); }
.card-header { background: #fff; border-bottom: 1px solid #e9ecef; font-weight: 600; }

/* ── KPI Cards ────────────────────────────────────────────── */
.kpi-card {
  background: #fff; border-radius: 12px; padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  display: flex; align-items: center; gap: 14px;
  transition: .15s; text-decoration: none; color: inherit;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: #fff; flex-shrink: 0;
}
.kpi-icon.blue   { background: linear-gradient(135deg,#1a3c5e,#2e7db5); }
.kpi-icon.orange { background: linear-gradient(135deg,#e67e22,#f39c12); }
.kpi-icon.green  { background: linear-gradient(135deg,#27ae60,#2ecc71); }
.kpi-icon.red    { background: linear-gradient(135deg,#c0392b,#e74c3c); }
.kpi-icon.teal   { background: linear-gradient(135deg,#16a085,#1abc9c); }
.kpi-icon.purple { background: linear-gradient(135deg,#8e44ad,#9b59b6); }
.kpi-icon.gold   { background: linear-gradient(135deg,#b8860b,#ffd700); }
.kpi-icon.navy   { background: linear-gradient(135deg,#1a1f5e,#2d3561); }
.kpi-icon.brown  { background: linear-gradient(135deg,#6d4c41,#8d6e63); }
.kpi-val   { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.kpi-label { font-size: .75rem; color: #6c757d; margin-top: 3px; }

/* ── Tables ───────────────────────────────────────────────── */
.table { font-size: .85rem; }
.table th { background: #f8f9fa; font-weight: 600; white-space: nowrap; }
.table-hover tbody tr:hover { background: #f0f7ff; }

/* ── Page heading ─────────────────────────────────────────── */
.page-title { font-size: 1.2rem; font-weight: 700; color: var(--cms-primary); }
.breadcrumb { font-size: .8rem; margin-bottom: 0; }
.section-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 14px; color: var(--cms-primary); font-weight: 600;
}
.section-divider::after { content: ''; flex: 1; height: 1px; background: #dee2e6; }

/* ── Forms ────────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: .84rem; }

/* ── Badges ───────────────────────────────────────────────── */
.badge { font-size: .72rem; }

/* ── Tabs ─────────────────────────────────────────────────── */
.nav-tabs .nav-link {
  color: var(--cms-primary);
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 500;
}
.nav-tabs .nav-link.active {
  border-bottom-color: var(--cms-accent);
  background: transparent;
  color: var(--cms-primary);
}

/* ── Login ────────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--cms-primary) 0%, var(--cms-primary-2) 100%);
}
.login-card { width: 400px; max-width: 95vw; border-radius: 16px; }
.login-logo { font-size: 2.5rem; color: var(--cms-primary); }

/* ── Misc helpers ─────────────────────────────────────────── */
.occ-bar { height: 8px; border-radius: 4px; background: #dee2e6; overflow: hidden; }
.occ-bar-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.btn-xs { padding: 2px 6px; font-size: 11px; }
.cms-footer { background: #fff; border-top: 1px solid #e9ecef; flex-shrink: 0; }

/* ── Tree-style infrastructure layout ─────────────────────── */
.block-card    { border: none; box-shadow: 0 2px 8px rgba(0,0,0,.1); border-radius: var(--cms-radius); margin-bottom: 16px; }
.floor-section { background: #f8f9fa; border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.room-card     { border: 1px solid #e9ecef; border-radius: 8px; background: #fff; }
.room-card .card-header { border-radius: 7px 7px 0 0; padding: 6px 10px; font-size: .82rem; }

/* ── Cost calculator ──────────────────────────────────────── */
.cost-row    { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.cost-label  { flex: 1; font-size: .85rem; }
.cost-amount { font-weight: 600; color: var(--cms-primary); min-width: 110px; text-align: right; }
.formula-box {
  background: #f8f9fa; border-left: 4px solid var(--cms-accent);
  padding: 12px 16px; border-radius: 6px; margin-bottom: 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem;
}

/* ══ RESPONSIVE ═════════════════════════════════════════════ */
@media (max-width: 991px) {
  #sidebar {
    position: fixed; top: 56px; left: 0;
    height: calc(100vh - 56px);
    transform: translateX(-100%); z-index: 1040;
  }
  #sidebar.sidebar-open { transform: translateX(0); }
  #page-content { padding: 16px; }
  .kpi-val   { font-size: 1.3rem; }
  .page-title{ font-size: 1rem; }
}
@media (max-width: 576px) {
  #page-content { padding: 10px; }
  .kpi-card  { padding: 10px 12px; gap: 10px; }
  .kpi-icon  { width: 38px; height: 38px; font-size: 1rem; }
}

/* Print friendly */
@media print {
  #sidebar, .cms-navbar, .cms-footer, .btn, .no-print { display: none !important; }
  #page-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
