:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #eef0f3;
  --teal: #14b8a6;
  --teal-dark: #0d9488;
  --teal-soft: #e6f7f5;
  --sidebar-w: 268px;
  --header-h: 56px;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 15px;
}
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #2dd4bf, #0ea5e9);
  color: #fff; display: grid; place-items: center; font-size: 13px;
}
.userchip {
  display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e0f2fe; color: #0369a1; display: grid; place-items: center; font-weight: 700;
}

.layout { display: flex; min-height: calc(100vh - var(--header-h)); }
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 14px 12px 28px;
  overflow-y: auto;
}
.nav-label {
  font-size: 11px; color: #9ca3af; font-weight: 700; letter-spacing: .08em;
  padding: 10px 12px 6px; text-transform: uppercase;
}
.nav-item, .nav-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; color: #374151;
  font-size: 13.5px; font-weight: 600; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
}
.nav-item:hover, .nav-toggle:hover { background: #f3f4f6; }
.nav-item.active {
  background: var(--teal-soft); color: var(--teal-dark);
}
.nav-item .dot, .nav-toggle .dot {
  width: 18px; color: #9ca3af; display: grid; place-items: center;
}
.nav-item.active .dot { color: var(--teal); }
.nav-group .children { padding: 2px 0 8px 12px; }
.nav-group .children.collapsed { display: none; }
.nav-toggle .chev { margin-left: auto; font-size: 11px; color: #9ca3af; }

.content { flex: 1; padding: 26px 32px 48px; max-width: 1180px; }
.page-title { font-size: 28px; font-weight: 800; margin: 0 0 18px; letter-spacing: -0.03em; }

.card {
  background: var(--card); border: 1px solid #eef1f4; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px;
}
.card + .card { margin-top: 16px; }

.welcome-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.kicker { color: #64748b; font-size: 12px; font-weight: 700; letter-spacing: .04em; margin-bottom: 8px; }
.welcome-head h2 { margin: 0 0 10px; font-size: 22px; }
.badge {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px;
  background: #e8f4ff; color: #2563eb; font-size: 12px; font-weight: 700;
}
.year-pill {
  background: #14b8a6; color: #fff; border: 0; border-radius: 10px;
  padding: 8px 14px; font-size: 12px; font-weight: 700; white-space: nowrap;
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.stat {
  border: 1px solid #eef1f4; border-radius: 14px; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.stat .lbl { font-size: 11px; color: #94a3b8; font-weight: 700; letter-spacing: .04em; }
.stat .val { font-size: 28px; font-weight: 800; margin-top: 4px; }
.iconbox {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px;
}
.iconbox.amber { background: #fff7ed; }
.iconbox.green { background: #ecfdf5; }
.iconbox.violet { background: #f5f3ff; }
.iconbox.blue { background: #eff6ff; }

.progress-row { margin: 16px 0 6px; }
.progress-row:first-of-type { margin-top: 8px; }
.progress-meta { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.bar { height: 8px; background: #eef2f6; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; }
.bar.orange > span { background: #f59e0b; }
.bar.blue > span { background: #3b82f6; }
.bar.green > span { background: #22c55e; }
.sub { color: #94a3b8; font-size: 12px; margin-top: 6px; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search {
  border: 1px solid #e5e7eb; border-radius: 10px; padding: 9px 12px; min-width: 240px; background: #fff;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px;
  padding: 9px 14px; font-weight: 700; cursor: pointer; font-size: 13px;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost { background: #f3f4f6; color: #374151; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11px; letter-spacing: .04em; color: #94a3b8;
  padding: 10px 8px; border-bottom: 1px solid var(--line);
}
table.data td { padding: 11px 8px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
table.data tr:hover td { background: #fafbfc; }
.actions { display: flex; gap: 6px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=password], select, textarea {
  width: 100%; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
.form-actions { margin-top: 16px; display: flex; gap: 8px; }

.flash { padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.flash.success { background: #ecfdf5; color: #047857; }
.flash.error { background: #fef2f2; color: #b91c1c; }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(circle at top, #e6fffb, #f4f6f8 45%);
}
.login-card { width: 480px; max-width: calc(100vw - 32px); padding: 32px; }
.login-card h1 { margin: 8px 0 4px; }
.login-card p { color: var(--muted); margin: 0 0 22px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }

@media (max-width: 980px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .sidebar { display: none; }
  .content { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
}
