/* ─── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  --bg:          #0d0d0d;
  --bg2:         #141414;
  --bg3:         #1c1c1c;
  --bg4:         #252525;
  --border:      #2e2e2e;
  --text:        #f0f0f0;
  --text-muted:  #888;
  --blue:        #3b82f6;
  --blue-dark:   #2563eb;
  --green:       #22c55e;
  --green-dark:  #16a34a;
  --purple:      #a855f7;
  --purple-dark: #9333ea;
  --red:         #ef4444;
  --yellow:      #f59e0b;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --transition:  .2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ─── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ─── Typography ────────────────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; }

/* ─── PUBLIC NAVBAR ─────────────────────────────────────────────────────── */
.pub-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 68px;
  background: rgba(13,13,13,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.pub-nav .brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 800;
  color: var(--text);
}

.pub-nav .brand-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 900; color: #fff;
}

.pub-nav .nav-links {
  display: flex; align-items: center; gap: 6px;
  list-style: none;
}

.pub-nav .nav-links a {
  padding: 7px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: .9rem;
  transition: var(--transition);
}

.pub-nav .nav-links a:hover { color: var(--text); background: var(--bg3); }

.pub-nav .btn-nav {
  padding: 9px 22px; border-radius: 50px;
  background: var(--blue); color: #fff;
  font-weight: 600; font-size: .9rem;
  transition: var(--transition);
}

.pub-nav .btn-nav:hover { background: var(--blue-dark); transform: translateY(-1px); }

/* ─── HERO ──────────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - 68px);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 20px;
}

.hero-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 24px;
  padding: 60px;
  max-width: 1000px; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: center;
  box-shadow: 0 8px 48px rgba(59,130,246,.12);
}

.hero-text h1 {
  font-size: 3rem; line-height: 1.1;
  color: #e2e8f0;
}

.hero-text h1 span { color: var(--blue); }

.hero-text p {
  margin: 20px 0 36px;
  color: var(--text-muted); font-size: 1.1rem; line-height: 1.7;
}

.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-image {
  display: flex; align-items: center; justify-content: center;
}

.hero-image img {
  max-height: 260px; border-radius: 16px;
  filter: drop-shadow(0 8px 32px rgba(59,130,246,.2));
}

/* ─── BUTTONS ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px; border-radius: 50px;
  font-weight: 600; font-size: .9rem; cursor: pointer;
  border: none; transition: var(--transition);
}

.btn-blue   { background: var(--blue);   color: #fff; }
.btn-green  { background: var(--green);  color: #fff; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-muted);
}

.btn-blue:hover   { background: var(--blue-dark);   transform: translateY(-2px); box-shadow: 0 4px 16px rgba(59,130,246,.4); }
.btn-green:hover  { background: var(--green-dark);  transform: translateY(-2px); box-shadow: 0 4px 16px rgba(34,197,94,.4); }
.btn-purple:hover { background: var(--purple-dark); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(168,85,247,.4); }
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

.btn-sm { padding: 7px 16px; font-size: .82rem; border-radius: 8px; }
.btn-xs { padding: 4px 10px; font-size: .78rem; border-radius: 6px; }
.btn-red    { background: var(--red);    color: #fff; }
.btn-yellow { background: var(--yellow); color: #000; }
.btn-gray   { background: var(--bg4);   color: var(--text); }
.btn-red:hover    { background: #dc2626; transform: translateY(-1px); }
.btn-yellow:hover { background: #d97706; transform: translateY(-1px); }
.btn-gray:hover   { background: #333; transform: translateY(-1px); }

/* ─── FEATURES SECTION ──────────────────────────────────────────────────── */
.section { padding: 80px 20px; max-width: 1100px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { font-size: 2.2rem; }
.section-title p  { color: var(--text-muted); margin-top: 10px; font-size: 1rem; }

.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: var(--transition);
}

.feature-card:hover { transform: translateY(-4px); border-color: var(--blue); }

.feature-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 16px;
}

.feature-icon.blue   { background: rgba(59,130,246,.15); color: var(--blue); }
.feature-icon.green  { background: rgba(34,197,94,.15);  color: var(--green); }
.feature-icon.purple { background: rgba(168,85,247,.15); color: var(--purple); }
.feature-icon.yellow { background: rgba(245,158,11,.15); color: var(--yellow); }

.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p  { color: var(--text-muted); font-size: .9rem; line-height: 1.6; }

/* ─── ROLES SECTION ─────────────────────────────────────────────────────── */
.roles-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}

.role-card {
  border-radius: var(--radius); padding: 32px 24px; text-align: center;
  border: 1px solid var(--border);
}

.role-card.manager { background: linear-gradient(135deg, rgba(59,130,246,.1), rgba(59,130,246,.05)); border-color: rgba(59,130,246,.3); }
.role-card.teacher { background: linear-gradient(135deg, rgba(34,197,94,.1),  rgba(34,197,94,.05));  border-color: rgba(34,197,94,.3); }
.role-card.student { background: linear-gradient(135deg, rgba(168,85,247,.1), rgba(168,85,247,.05)); border-color: rgba(168,85,247,.3); }

.role-card .role-icon { font-size: 2.5rem; margin-bottom: 16px; }
.role-card h3 { font-size: 1.2rem; margin-bottom: 12px; }
.role-card ul { list-style: none; text-align: left; }
.role-card ul li { color: var(--text-muted); font-size: .88rem; padding: 4px 0; }
.role-card ul li::before { content: "✓ "; color: var(--green); }

/* ─── FAQ ───────────────────────────────────────────────────────────────── */
.faq-list { max-width: 750px; margin: 0 auto; }

.faq-item {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 10px;
  overflow: hidden;
}

.faq-question {
  padding: 18px 24px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; user-select: none;
  transition: var(--transition);
}

.faq-question:hover { background: var(--bg4); }
.faq-question .icon { transition: transform .3s; font-size: .8rem; color: var(--text-muted); }
.faq-question.open .icon { transform: rotate(180deg); }

.faq-answer { padding: 0 24px; max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s; }
.faq-answer.open { max-height: 200px; padding: 0 24px 18px; }
.faq-answer p { color: var(--text-muted); line-height: 1.7; }

/* ─── CONTACT ───────────────────────────────────────────────────────────── */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  align-items: start;
}

.contact-info p { color: var(--text-muted); margin-bottom: 24px; line-height: 1.7; }
.contact-info .info-item {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); margin-bottom: 14px; font-size: .9rem;
}
.contact-info .info-item span:first-child { font-size: 1.1rem; }

/* ─── FOOTER ────────────────────────────────────────────────────────────── */
.pub-footer {
  border-top: 1px solid var(--border);
  padding: 30px 40px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-muted); font-size: .85rem;
}

/* ─── AUTH PAGES ────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at center top, #0d1a2e 0%, #0d0d0d 60%);
}

.auth-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; padding: 48px 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-card h1 { font-size: 1.8rem; text-align: center; margin-bottom: 6px; }
.auth-card .subtitle {
  text-align: center; color: var(--text-muted);
  font-size: .9rem; margin-bottom: 32px;
}

.select-btns { display: flex; flex-direction: column; gap: 14px; }

.select-btn {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 24px; border-radius: var(--radius); border: none;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); color: #fff; text-decoration: none;
}

.select-btn:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.select-btn.blue   { background: var(--blue); }
.select-btn.green  { background: var(--green); }
.select-btn.purple { background: var(--purple); }
.select-btn .icon  { font-size: 1.4rem; width: 32px; text-align: center; }

/* ─── FORM ELEMENTS ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: .87rem; font-weight: 500; margin-bottom: 7px; color: #ccc; }

.form-control {
  width: 100%; padding: 12px 16px;
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: .95rem; transition: var(--transition);
  outline: none;
}

.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }

.input-wrap { position: relative; }
.input-wrap .form-control { padding-right: 44px; }
.input-wrap .toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1rem; padding: 4px;
  transition: color .2s;
}
.input-wrap .toggle-pass:hover { color: var(--text); }

.forgot-link { display: block; text-align: right; font-size: .83rem; color: var(--text-muted); margin-bottom: 24px; }

.btn-submit {
  width: 100%; padding: 14px; border-radius: 50px;
  font-size: 1rem; font-weight: 700; border: none; cursor: pointer;
  transition: var(--transition);
}

.btn-submit.blue   { background: var(--blue);   color: #fff; }
.btn-submit.green  { background: var(--green);  color: #fff; }
.btn-submit.purple { background: var(--purple); color: #fff; }

.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.3); filter: brightness(1.1); }

.back-link {
  text-align: center; display: block; margin-top: 20px;
  color: var(--text-muted); font-size: .87rem;
  transition: color .2s;
}
.back-link:hover { color: var(--text); }

/* ─── ALERTS / FLASH ────────────────────────────────────────────────────── */
.alert {
  padding: 12px 18px; border-radius: var(--radius-sm);
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
  font-size: .9rem;
}

.alert-success { background: rgba(34,197,94,.15);  border: 1px solid rgba(34,197,94,.3);  color: #86efac; }
.alert-danger  { background: rgba(239,68,68,.15);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,.15); border: 1px solid rgba(245,158,11,.3); color: #fcd34d; }
.alert-info    { background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }
.alert .close-btn { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1rem; opacity: .7; }
.alert .close-btn:hover { opacity: 1; }

/* ─── DASHBOARD LAYOUT ──────────────────────────────────────────────────── */
.dash-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}

.sidebar-brand .brand-logo {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1rem; color: #fff;
}

.sidebar-brand .brand-text { font-weight: 700; font-size: 1rem; }
.sidebar-brand .brand-sub  { font-size: .75rem; color: var(--text-muted); }

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-user .user-name  { font-weight: 600; font-size: .92rem; }
.sidebar-user .user-role  { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.sidebar-user .user-school { font-size: .76rem; color: var(--text-muted); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section-label {
  padding: 10px 20px 4px;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  color: var(--text-muted); text-transform: uppercase;
}

.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; border-radius: 0;
  color: var(--text-muted); font-size: .9rem;
  transition: var(--transition); position: relative;
}

.sidebar-nav a:hover { background: var(--bg3); color: var(--text); }
.sidebar-nav a.active { background: var(--bg4); color: var(--text); font-weight: 600; }
.sidebar-nav a .icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-nav a.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: 0 2px 2px 0;
}

/* Active indicator colors */
.sidebar-blue  a.active::before   { background: var(--blue); }
.sidebar-green a.active::before   { background: var(--green); }
.sidebar-purple a.active::before  { background: var(--purple); }

.sidebar-nav a.active.blue   { color: var(--blue); }
.sidebar-nav a.active.green  { color: var(--green); }
.sidebar-nav a.active.purple { color: var(--purple); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: .87rem;
  transition: color .2s;
}

.sidebar-footer a:hover { color: var(--red); }

/* ─── MAIN CONTENT ──────────────────────────────────────────────────────── */
.main-content { flex: 1; min-width: 0; }

.topbar {
  height: 60px; padding: 0 28px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}

.topbar-title { font-size: 1rem; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.page-body { padding: 28px; }

/* ─── CARDS ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 22px; }

/* ─── STAT CARDS ────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}

.stat-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 6px;
}

.stat-card .stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; }
.stat-card .stat-sub   { font-size: .78rem; color: var(--text-muted); }
.stat-card.blue   .stat-value { color: var(--blue); }
.stat-card.green  .stat-value { color: var(--green); }
.stat-card.purple .stat-value { color: var(--purple); }
.stat-card.yellow .stat-value { color: var(--yellow); }
.stat-card.red    .stat-value { color: var(--red); }

/* ─── TABLES ────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }

thead th {
  padding: 12px 16px; text-align: left;
  background: var(--bg4); color: var(--text-muted);
  font-weight: 600; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg4); }
tbody td { padding: 13px 16px; vertical-align: middle; }

/* ─── BADGES ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 50px;
  font-size: .75rem; font-weight: 600;
}

.badge-blue   { background: rgba(59,130,246,.2);  color: var(--blue); }
.badge-green  { background: rgba(34,197,94,.2);   color: var(--green); }
.badge-purple { background: rgba(168,85,247,.2);  color: var(--purple); }
.badge-red    { background: rgba(239,68,68,.2);   color: var(--red); }
.badge-yellow { background: rgba(245,158,11,.2);  color: var(--yellow); }
.badge-gray   { background: var(--bg4);           color: var(--text-muted); }

/* ─── MODALS ─────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .25s;
}

.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 18px; padding: 32px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow); transform: translateY(20px); transition: transform .25s;
}

.modal-backdrop.open .modal { transform: translateY(0); }

.modal-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ─── ATTENDANCE CALENDAR ───────────────────────────────────────────────── */
.calendar-wrap { overflow-x: auto; }

.calendar-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}

.calendar-nav h3 { font-size: 1.3rem; font-weight: 700; }

.cal-table { width: 100%; border-collapse: separate; border-spacing: 4px; }
.cal-table th {
  padding: 10px; text-align: center;
  color: var(--text-muted); font-size: .8rem; font-weight: 600;
}

.cal-table td { vertical-align: top; }

.cal-day {
  min-height: 80px; padding: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: default; transition: var(--transition);
}

.cal-day.has-att {
  background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.3);
  cursor: pointer;
}

.cal-day.has-att:hover { background: rgba(59,130,246,.15); transform: translateY(-2px); }
.cal-day.today { border-color: var(--blue); }
.cal-day.empty { background: transparent; border-color: transparent; }

.cal-day-num {
  font-size: .85rem; font-weight: 600; margin-bottom: 4px;
}

.cal-day.today .cal-day-num {
  background: var(--blue); color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.cal-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--blue);
  margin-top: 4px;
}

/* ─── ASSIGNMENT CARD ───────────────────────────────────────────────────── */
.hw-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: var(--transition);
}

.hw-card:hover { border-color: var(--bg4); box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.hw-card.overdue { border-color: rgba(239,68,68,.3); }
.hw-card.submitted { border-color: rgba(34,197,94,.2); }

.hw-card-title { font-size: 1rem; font-weight: 600; }
.hw-card-meta  { font-size: .82rem; color: var(--text-muted); display: flex; gap: 16px; flex-wrap: wrap; }
.hw-card-desc  { font-size: .88rem; color: var(--text-muted); line-height: 1.6; }
.hw-card-footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── ANNOUNCEMENT CARD ─────────────────────────────────────────────────── */
.ann-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: var(--transition);
}

.ann-card:hover { border-color: rgba(59,130,246,.3); }
.ann-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.ann-card-meta  { font-size: .8rem; color: var(--text-muted); margin-bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap; }
.ann-card-body  { font-size: .9rem; color: var(--text-muted); line-height: 1.7; }

/* ─── ATTENDANCE STATUS ─────────────────────────────────────────────────── */
.att-present { color: var(--green); }
.att-absent  { color: var(--red); }
.att-late    { color: var(--yellow); }

/* ─── EMPTY STATE ───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: .4; }
.empty-state p { font-size: .95rem; }

/* ─── GRID UTILITIES ────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap { display: flex; gap: 10px; flex-wrap: wrap; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .85rem; }
.w-full { width: 100%; }

/* ─── CLASS CHIP (used in many places) ──────────────────────────────────── */
.class-chip {
  padding: 6px 14px;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: .85rem;
  user-select: none;
  transition: var(--transition);
}
.class-chip:hover { border-color: var(--text-muted); }
.class-chip.selected {
  background: rgba(59,130,246,.2);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}

/* ─── SPINNER (form submit loading) ─────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
  margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

button[disabled] { opacity: .65; cursor: not-allowed; }

/* ─── FILE INPUT ────────────────────────────────────────────────────────── */
.file-input-wrap {
  background: var(--bg4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: var(--transition);
}
.file-input-wrap:hover { border-color: var(--blue); }
.file-input-wrap input[type=file] {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: .87rem;
  cursor: pointer;
}

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

@media (max-width: 768px) {
  .pub-nav { padding: 0 16px; }
  .pub-nav .nav-links { display: none; }
  .hero-card { grid-template-columns: 1fr; gap: 32px; padding: 36px 24px; }
  .hero-text h1 { font-size: 2rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  /* Dashboard mobile: sidebar becomes top bar */
  .dash-layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 60;
    flex-direction: row; flex-wrap: wrap;
    border-right: none; border-bottom: 1px solid var(--border);
    overflow-y: visible;
  }
  .sidebar-brand {
    padding: 10px 14px; border-bottom: none;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
  }
  .sidebar-brand .brand-text { font-size: .92rem; }
  .sidebar-brand .brand-sub { font-size: .7rem; }
  .sidebar-brand .brand-logo { width: 30px; height: 30px; font-size: .9rem; }
  .sidebar-user { display: none; }
  .sidebar-nav {
    flex: 1; display: flex; flex-direction: row; flex-wrap: nowrap;
    padding: 6px 8px; gap: 2px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-nav .nav-section-label { display: none; }
  .sidebar-nav a {
    padding: 7px 11px; border-radius: 8px; font-size: .78rem;
    white-space: nowrap;
  }
  .sidebar-nav a.active::before { display: none; }
  .sidebar-footer {
    padding: 6px 12px; border-top: none;
    border-left: 1px solid var(--border);
    display: flex; align-items: center;
    flex-shrink: 0;
  }
  .sidebar-footer a { font-size: .78rem; }
  .sidebar-footer a span:first-child { font-size: 1rem; }

  .topbar { padding: 0 14px; height: 50px; }
  .topbar-title { font-size: .92rem; }
  .page-body { padding: 14px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .stat-card .stat-label { font-size: .72rem; }

  /* Tables: horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }
  thead th { padding: 10px 12px; font-size: .72rem; }
  tbody td { padding: 10px 12px; }

  /* Modal: bottom sheet style */
  .modal {
    max-width: 100% !important; margin: 0;
    border-radius: 16px 16px 0 0;
    padding: 24px 18px;
    max-height: 92vh; overflow-y: auto;
  }
  .modal-backdrop {
    align-items: flex-end; padding: 0;
  }
  .modal-footer { flex-wrap: wrap; }

  /* Forms: collapse grid-2 inside modal */
  .modal .grid-2 { grid-template-columns: 1fr; }

  /* Card padding tighter */
  .card-header { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 16px; }

  /* Calendar tighter */
  .cal-day { min-height: 56px; padding: 4px; }
  .cal-day-num { font-size: .78rem; }
  .cal-table th { font-size: .7rem; padding: 6px 4px; }

  /* HW card stack */
  .hw-card > div:first-child { flex-direction: column; gap: 10px; }
  .hw-card > div:first-child > div:last-child { margin-left: 0 !important; }
  .hw-card-meta { gap: 8px; font-size: .78rem; }

  /* Attendance filter form: stack */
  .card-body form > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .auth-card { padding: 28px 18px; max-width: 100%; }
  .select-btn { padding: 14px 18px; }
  .hero-text h1 { font-size: 1.7rem; }
  .hero-btns { flex-direction: column; }
  .hero-btns .btn { justify-content: center; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .flex-between { flex-direction: column; gap: 10px; align-items: flex-start; }
  .flex-between .btn, .flex-between button { align-self: flex-start; }

  .pub-footer { flex-direction: column; gap: 6px; text-align: center; }

  .grid-2 { grid-template-columns: 1fr; }
  .topbar-right .text-muted { display: none; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal { padding: 20px 14px; }
  .btn { padding: 9px 18px; font-size: .85rem; }
  .btn-sm { padding: 6px 12px; font-size: .78rem; }
}
