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

:root {
  /* ── CMPC Brand Colors ── */
  --green: #7AB531;
  --green-dark: #3B6B1F;
  --green-light: #8DC63F;
  --green-xlight: #EEF7DF;
  --cmpc-gray: #58595B;
  --cmpc-gray-light: #9A9B9E;

  /* ── Surfaces ── */
  --bg: #F2F3F2;
  --surface: #FFFFFF;
  --border: #E2E5E2;

  /* ── Text ── */
  --text: #2B2B2B;
  --text-mid: #58595B;
  --text-muted: #9A9B9E;

  /* ── Semantic ── */
  --danger: #C0392B;
  --danger-light: #FDECEA;
  --warning: #D4871A;
  --warning-light: #FEF3E2;
  --info: #1976D2;
  --info-light: #E3F0FD;
  --success: #7AB531;

  /* ── Layout ── */
  --sidebar-w: 220px;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.07);
  --shadow-md: 0 2px 10px rgba(0,0,0,.11);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; font-family: inherit; font-size: 14px; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ── LAYOUT ──────────────────────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0,0,0,.06);
}

.sidebar-brand {
  padding: 20px 16px 18px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
}
.brand-logo { height: 36px; width: auto; display: block; }
.brand-icon { display: none; }
.brand-name { display: none; }

.sidebar-nav { padding: 10px 0; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-mid); transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--green-xlight); color: var(--green-dark); }
.nav-item.active {
  background: var(--green-xlight); color: var(--green-dark);
  border-left-color: var(--green); font-weight: 600;
}
.nav-icon { font-size: 15px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted);
}

.main-content { flex: 1; overflow-y: auto; }

/* ── PAGE ────────────────────────────────────────────────────────────────────── */
.page { padding: 28px 32px; max-width: 1200px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-header h1 { font-size: 21px; font-weight: 700; color: var(--text); }
.page-header .subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green); font-size: 13px; font-weight: 500;
  margin-bottom: 12px; padding: 4px 0; cursor: pointer;
}
.back-btn:hover { text-decoration: underline; }

/* ── SECTION ─────────────────────────────────────────────────────────────────── */
.section { margin-bottom: 28px; }
.section-title {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--cmpc-gray); margin-bottom: 12px;
}

/* ── GRID ────────────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }

/* ── TYPOGRAPHY ──────────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-mid { color: var(--text-mid); }
.text-green { color: var(--green); }
.text-red { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-bold { font-weight: 700; }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }

/* ── TABS ────────────────────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-mid); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s; cursor: pointer;
}
.tab-btn:hover { color: var(--green); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }

/* ── PROGRESS ────────────────────────────────────────────────────────────────── */
.progress-bar { width: 80px; height: 6px; background: var(--border); border-radius: 3px; display: inline-block; vertical-align: middle; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--green); transition: width .3s; }
.progress-fill.fill-red { background: var(--danger); }
.progress-fill.fill-yellow { background: var(--warning); }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-5 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
