:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #15213b;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; touch-action: manipulation; }
html, body { overscroll-behavior: none; }
body { margin: 0; background: #f5f7fb; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
  border-radius: 12px;
  border: 1px solid #d5dcef;
  padding: 0.8rem 0.95rem;
  background: white;
}
button {
  cursor: pointer;
  background: #3f6df6;
  color: white;
  border: none;
  font-weight: 700;
}
textarea { width: 100%; }
label { display: grid; gap: 0.35rem; }

.app-shell { display: flex; min-height: 100vh; }
.side-menu {
  position: fixed; inset: 0 auto 0 0; width: 280px; background: #162445; color: white;
  transform: translateX(-100%); transition: transform 0.22s ease; z-index: 20; padding: 1rem;
}
.side-menu.open { transform: translateX(0); }
.side-menu nav { display: grid; gap: 0.45rem; margin-top: 1rem; }
.side-menu nav a { padding: 0.9rem; border-radius: 12px; color: rgba(255,255,255,0.9); }
.side-menu nav a.active, .side-menu nav a:hover { background: rgba(255,255,255,0.12); }
.side-menu__header { display: flex; justify-content: space-between; align-items: center; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 10; }
.main-wrap { flex: 1; width: 100%; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 1rem; align-items: center;
  background: rgba(245,247,251,0.95); backdrop-filter: blur(8px); padding: 0.75rem 1rem; border-bottom: 1px solid #e2e8f6;
}
.topbar__center { flex: 1; min-width: 0; }
.topbar h1 { font-size: 1.1rem; margin: 0; }
.topbar p { margin: 0.2rem 0 0; color: #52607d; font-size: 0.9rem; }
.menu-button, .ghost-button, .home-button { padding: 0.75rem 0.9rem; min-width: 48px; }
.ghost-button { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: white; }
.home-button { display: inline-flex; align-items: center; justify-content: center; background: #3f6df6; color: white; border-radius: 12px; font-weight: 700; font-size: 1.2rem; }
.page-container { padding: 1rem; max-width: 1100px; margin: 0 auto; }

.card, .action-card, .metric-card, .nested-card {
  background: white; border-radius: 20px; padding: 1rem; box-shadow: 0 8px 24px rgba(26, 43, 87, 0.08);
}
.hero-card { display: grid; gap: 1rem; }
.hero-card--compact { padding: 0.75rem 0.9rem; }
.action-card { display: grid; place-items: center; min-height: 100px; font-size: 1.05rem; font-weight: 800; }
.metric-card strong { display: block; margin-top: 0.25rem; font-size: 1.05rem; }
.metric-card--compact { padding: 0.65rem 0.8rem; border-radius: 16px; }
.metric-card--compact span { font-size: 0.8rem; }
.metric-card span, .muted, small { color: #64728f; }
.section-title { display: flex; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-title h3, .section-title p { margin: 0; }
.stack-lg { display: grid; gap: 1.2rem; }
.stack-md { display: grid; gap: 1rem; }
.stack-sm { display: grid; gap: 0.75rem; }
.stack-xs { display: grid; gap: 0.35rem; }
.grid-2, .grid-3, .form-grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.compact-top-grid { gap: 0.7rem; }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.compact-grid { align-items: center; }
.list-row, .attendance-row {
  display: flex; gap: 1rem; justify-content: space-between; align-items: center; padding: 0.9rem 1rem;
  border: 1px solid #edf1fa; border-radius: 16px;
}
.list-row-actions { align-items: flex-start; }
.student-card-row small { display: block; margin-top: 0.25rem; }
.status-group, .button-row, .icon-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.button-row-between { justify-content: space-between; width: 100%; }
.right-meta-actions { justify-content: flex-end; }
.chip {
  background: #eef3ff; color: #2142a0; border: none; padding: 0.65rem 0.85rem; border-radius: 999px; font-weight: 700;
}
.chip.active { background: #3f6df6; color: white; }
.badge {
  padding: 0.45rem 0.7rem; border-radius: 999px; font-size: 0.85rem; font-weight: 800; text-transform: capitalize;
}
.badge.acquired { background: #dff7e8; color: #0f7a39; }
.badge.in_progress { background: #fff2d6; color: #b06b00; }
.badge.not_acquired { background: #ffe2e2; color: #b42318; }
.bar-track { height: 12px; background: #e9edf8; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: #3f6df6; border-radius: 999px; }
.bar-label { display: flex; justify-content: space-between; gap: 1rem; }
.danger-button { background: #f2f4f7; color: #344054; }
.secondary-button { background: #eef2f7; color: #22314f; }
.wrap-gap { margin-top: 0.75rem; }
.icon-button {
  width: 36px; height: 36px; min-width: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 0.95rem;
}
.light-icon-button { background: #f6f7fb; color: #344054; border: 1px solid #e4e7ec; }
.inline-link-button { display: inline-flex; align-items: center; justify-content: center; padding: 0.8rem 0.95rem; border-radius: 12px; background: #3f6df6; color: white; font-weight: 700; }

.area-theme-1 { background: #fff1e6; }
.area-theme-1.item-theme { background: #fff6ef; }
.area-theme-1.subitem-theme { background: #fffaf5; }
.area-theme-1.content-theme { background: #fffdf9; }
.area-theme-2 { background: #edf9ef; }
.area-theme-2.item-theme { background: #f4fbf5; }
.area-theme-2.subitem-theme { background: #fbfefb; }
.area-theme-2.content-theme { background: #fefffe; }
.area-theme-3 { background: #ebf5ff; }
.area-theme-3.item-theme { background: #f3f9ff; }
.area-theme-3.subitem-theme { background: #f9fcff; }
.area-theme-3.content-theme { background: #fcfeff; }

@media (max-width: 720px) {
  .page-container { padding: 0.85rem; }
  .attendance-row, .list-row { flex-direction: column; align-items: flex-start; }
  .status-group { width: 100%; }
  .status-group .chip { flex: 1; min-width: 110px; }
  .topbar { gap: 0.6rem; }
  .home-button { padding-inline: 0.8rem; }
  .button-row-between { align-items: flex-start; }
}


.min-w-0 { min-width: 0; }
.wrap-text-card, .wrap-text-card * { word-break: break-word; overflow-wrap: anywhere; }
.inner-card { padding: 0.8rem; border: 1px solid #edf1fa; box-shadow: none; }
.sticky-toolbar { position: sticky; top: 72px; z-index: 4; }
textarea, input, select, .list-row, .attendance-row, .nested-card, .card, .metric-card, .action-card { min-width: 0; }
.bar-fill { width: 0; }
@media (max-width: 720px) {
  .list-row, .attendance-row { align-items: flex-start; }
  .sticky-toolbar { top: 68px; }
}
