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

:root {
  --bg:       #060c08;
  --surface:  #0c1610;
  --card:     #111f16;
  --border:   #1a2e20;
  --border2:  #243d2a;
  --text:     #e8f5ee;
  --muted:    #5a8a6a;
  --muted2:   #2e5038;
  --sidebar-w: 220px;
  --header-h:  52px;
}

html, body { height: 100%; overflow: hidden; font-family: 'Segoe UI', system-ui, sans-serif; }
body { background: var(--bg); color: var(--text); }

/* ─────────────────────────────────────
   APP SHELL
───────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; height: 100vh; }

/* ─────────────────────────────────────
   TOP HEADER
───────────────────────────────────── */
.app-header {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
  z-index: 200;
}
.header-left  { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }

/* Hamburger (mobile only) */
.hamburger {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 4px; flex-shrink: 0;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px; transition: .25s;
}

.back-btn {
  display: flex; align-items: center; gap: 5px;
  color: var(--muted); text-decoration: none; font-size: 12px;
  padding: 5px 11px; border-radius: 7px; border: 1px solid var(--border2);
  transition: .2s; white-space: nowrap; flex-shrink: 0;
}
.back-btn:hover { color: var(--text); border-color: var(--muted); }

.app-logo {
  font-size: 16px; font-weight: 800;
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap;
}

.user-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--card); padding: 5px 14px;
  border-radius: 20px; border: 1px solid var(--border);
  font-size: 12px; white-space: nowrap;
}

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ─────────────────────────────────────
   BODY ROW  (sidebar + page)
───────────────────────────────────── */
.body-row { display: flex; flex: 1; overflow: hidden; }

/* ─────────────────────────────────────
   SIDEBAR
───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto; overflow-x: hidden;
  transition: transform .28s ease;
  z-index: 150;
}

/* Sidebar header */
.sidebar-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted2);
  padding: 18px 16px 6px;
}

/* Nav items */
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  border: none; background: transparent; width: 100%;
  text-align: left; transition: .18s;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active {
  color: var(--accent, #22c55e);
  background: rgba(34,197,94,.08);
  border-left-color: var(--accent, #22c55e);
  font-weight: 700;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-divider {
  height: 1px; background: var(--border);
  margin: 8px 14px;
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted2);
  display: flex; align-items: center; gap: 6px;
}

/* Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 140;
}

/* ─────────────────────────────────────
   PAGE AREA
───────────────────────────────────── */
.page-area { flex: 1; overflow-y: auto; overflow-x: hidden; }
.page { display: none; padding: 20px 22px; }
.page.active { display: block; }

/* ─────────────────────────────────────
   STATUS BAR
───────────────────────────────────── */
.statusbar {
  height: 26px; display: flex; align-items: center; gap: 18px;
  padding: 0 18px; font-size: 10px; color: var(--muted2);
  border-top: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
  overflow-x: auto; white-space: nowrap;
}
.statusbar::-webkit-scrollbar { display: none; }
.statusbar b { color: var(--muted); font-weight: 600; }

/* ─────────────────────────────────────
   PAGE HEADER
───────────────────────────────────── */
.page-title { font-size: 19px; font-weight: 800; margin-bottom: 3px; }
.page-sub   { font-size: 12px; color: var(--muted); margin-bottom: 16px; }

/* ─────────────────────────────────────
   KPI CARDS
───────────────────────────────────── */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 11px; margin-bottom: 16px; }
.kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 13px 15px; }
.kpi-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 5px; }
.kpi-value { font-size: 21px; font-weight: 800; line-height: 1; }
.kpi-sub   { font-size: 10px; margin-top: 4px; }

/* colour helpers */
.c-green  { color: #22c55e; }
.c-red    { color: #f87171; }
.c-amber  { color: #f59e0b; }
.c-blue   { color: #3b82f6; }
.c-purple { color: #a855f7; }
.c-pink   { color: #f472b6; }
.c-cyan   { color: #06b6d4; }
.c-text   { color: var(--text); }
.c-muted  { color: var(--muted); }

/* ─────────────────────────────────────
   FILTER BAR
───────────────────────────────────── */
.filter-bar {
  display: flex; gap: 9px; margin-bottom: 13px;
  align-items: center; flex-wrap: wrap;
}
.search-input {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 8px; padding: 8px 12px;
  color: var(--text); font-size: 12px; min-width: 200px; flex: 1;
}
.search-input:focus { outline: none; border-color: var(--accent, #22c55e); }
.sel {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 8px; padding: 8px 11px;
  color: var(--text); font-size: 12px;
}
.spacer { flex: 1; }
.btn { padding: 8px 16px; border-radius: 8px; border: none; font-size: 12px; font-weight: 700; cursor: pointer; transition: .18s; }
.btn-outline { background: transparent; border: 1px solid var(--border2); color: var(--muted); }
.btn-outline:hover { border-color: var(--text); color: var(--text); }
.btn-accent { color: #040e07; }

/* ─────────────────────────────────────
   TABLE CARD
───────────────────────────────────── */
.table-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.table-hdr  { padding: 11px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.table-hdr h3 { font-size: 13px; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 8px 13px; font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: .7px; text-align: left; background: rgba(0,0,0,.25); }
tbody tr { border-top: 1px solid var(--border); transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.03); }
tbody td { padding: 9px 13px; font-size: 12px; vertical-align: middle; }

/* ─────────────────────────────────────
   BADGES
───────────────────────────────────── */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; }
.b-green  { background: #041a0a; color: #22c55e; }
.b-red    { background: #1a0404; color: #f87171; }
.b-amber  { background: #1a0f00; color: #f59e0b; }
.b-blue   { background: #03091a; color: #3b82f6; }
.b-purple { background: #0e0318; color: #a855f7; }
.b-pink   { background: #1a0310; color: #f472b6; }
.b-cyan   { background: #01101a; color: #06b6d4; }
.b-gray   { background: var(--surface); color: var(--muted); }

/* ─────────────────────────────────────
   ACTION BUTTON
───────────────────────────────────── */
.act-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); padding: 4px 9px; border-radius: 5px;
  font-size: 10px; cursor: pointer; transition: .12s; margin-right: 3px;
}
.act-btn:hover { color: var(--text); border-color: var(--muted); }

/* ─────────────────────────────────────
   KANBAN
───────────────────────────────────── */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.kanban::-webkit-scrollbar { height: 4px; }
.kanban::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.k-col { min-width: 230px; flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.k-head { padding: 10px 13px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.k-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.k-cnt { font-size: 11px; font-weight: 700; width: 21px; height: 21px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.k-body { padding: 8px; min-height: 200px; }
.k-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; transition: .15s; }
.k-card:hover { transform: translateY(-1px); }
.k-card .k-title2 { font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.k-card .k-sub   { font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.k-card .k-foot  { font-size: 10px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.prog { background: var(--border); border-radius: 3px; height: 4px; margin-top: 6px; }
.prog-fill { height: 100%; border-radius: 3px; }

/* ─────────────────────────────────────
   MINI CHART BARS
───────────────────────────────────── */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 110px; }
.bar-wrap { display: flex; flex-direction: column; align-items: center; flex: 1; }
.bar-val  { font-size: 9px; color: var(--muted); margin-bottom: 3px; }
.bar      { width: 100%; border-radius: 3px 3px 0 0; }
.bar-lbl  { font-size: 9px; color: var(--muted); margin-top: 4px; }

/* ─────────────────────────────────────
   TWO-COLUMN LAYOUT
───────────────────────────────────── */
.two-col { display: flex; gap: 14px; margin-bottom: 14px; }
.two-col > * { flex: 1; min-width: 0; }
.col-wide  { flex: 2 !important; }
.col-narrow { flex: 1 !important; }

/* ─────────────────────────────────────
   SCROLLBAR
───────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ─────────────────────────────────────
   MOBILE  ≤ 768px
───────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    z-index: 150;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .user-pill .user-label { display: none; }

  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .two-col { flex-direction: column; }
  .kanban  { flex-direction: column; }
  .k-col   { min-width: unset; }
}
