/* ================================================================
   EDUSN V6 — Styles
   Aesthetic: Refined editorial dark-mode sidebar + warm off-white content
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg:        #f2ede6;
  --surface:   #faf7f2;
  --panel:     #ffffff;
  --ink:       #1a1612;
  --ink2:      #4a4440;
  --muted:     #8c857d;
  --line:      #e0d9d0;
  --red:       #c0392b;
  --red-soft:  #fde8e6;
  --amber:     #d97706;
  --amber-soft:#fef3c7;
  --green:     #0f766e;
  --green-soft:#d1fae5;
  --blue:      #1d4ed8;
  --blue-soft: #dbeafe;
  --sidebar-bg:#161210;
  --sidebar-text:#e8e0d8;
  --sidebar-muted:#7a706a;
  --sidebar-hover:#2e2420;
  --sidebar-active:#c0392b;
  --shadow-sm: 0 2px 8px rgba(30,20,10,.07);
  --shadow:    0 6px 28px rgba(30,20,10,.10);
  --shadow-lg: 0 20px 60px rgba(30,20,10,.15);
  --radius:    14px;
  --radius-lg: 20px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --sidebar-width: 260px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 14px;
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

/* ── LAYOUT ──────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.app.locked { display: none; }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,.04);
}

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--red);
  display: grid; place-items: center;
  font-weight: 900; font-size: 20px; color: #fff;
  flex-shrink: 0;
  font-family: var(--font-display);
}
.brand-name h1 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand-name p  { font-size: 10px; font-weight: 600; text-transform: uppercase;
                  letter-spacing: .1em; color: var(--sidebar-muted); margin-top: 2px; }

/* User pill in sidebar */
.sidebar-user {
  margin: 14px 14px 6px;
  background: rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid rgba(255,255,255,.07);
}
.sidebar-user .avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--red); color: #fff;
  display: grid; place-items: center;
  font-weight: 900; font-size: 14px; flex-shrink: 0;
}
.sidebar-user .uname { font-size: 13px; font-weight: 600; }
.sidebar-user .urole {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--sidebar-muted);
}

.nav-group {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--sidebar-muted);
  padding: 18px 20px 6px;
}
.nav {
  width: calc(100% - 28px); margin: 0 14px 2px;
  border: 0; border-radius: 10px;
  padding: 10px 14px;
  text-align: left; background: transparent;
  color: #a09890; font-family: var(--font-body);
  font-weight: 600; font-size: 13.5px;
  cursor: pointer; display: flex; align-items: center; gap: 9px;
  transition: background .15s, color .15s;
}
.nav svg { opacity: .6; flex-shrink: 0; }
.nav:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }
.nav.active { background: var(--red); color: #fff; }
.nav.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; background: var(--red);
  color: #fff; border-radius: 99px;
  padding: 2px 7px; font-size: 11px; font-weight: 800;
}
.nav.active .nav-badge { background: rgba(255,255,255,.25); }

.sidebar-footer {
  margin-top: auto; padding: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.db-status {
  background: rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 11px; color: var(--sidebar-muted);
  display: flex; align-items: center; gap: 6px;
}
.db-dot {
  width: 8px; height: 8px; border-radius: 99px;
  background: var(--muted); flex-shrink: 0;
  transition: background .3s;
}
.db-dot.online { background: #22c55e; box-shadow: 0 0 6px #22c55e; }

/* ── MAIN ────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  padding: 30px 36px;
}

/* ── TOPBAR ──────────────────────────────────────────────────── */
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 18px; margin-bottom: 22px;
}
.eyebrow {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--red); display: block; margin-bottom: 4px;
}
.topbar h2 {
  font-family: var(--font-display);
  font-size: 30px; line-height: 1.2;
  color: var(--ink); margin-bottom: 3px;
}
.topbar p { color: var(--muted); font-size: 13.5px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; flex-shrink: 0; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  border: 0; border-radius: 10px; padding: 9px 16px;
  font-family: var(--font-body); font-weight: 700; font-size: 13.5px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: filter .15s, transform .1s; white-space: nowrap;
}
.btn:hover  { filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.btn.primary   { background: var(--red);   color: #fff; }
.btn.secondary { background: var(--panel); border: 1px solid var(--line); color: var(--ink2); }
.btn.dark      { background: var(--ink);   color: #fff; }
.btn.danger    { background: #7f1d1d;       color: #fff; }
.btn.success   { background: var(--green);  color: #fff; }
.btn.amber     { background: var(--amber);  color: #fff; }
.btn.ghost     { background: transparent;   color: var(--muted); border: 1px solid var(--line); }
.btn.full      { width: 100%; justify-content: center; }
.btn.sm        { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn.icon-btn  { padding: 8px; }

/* ── FILTERS ─────────────────────────────────────────────────── */
.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 12px 14px;
  margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.filters input, .filters select { flex: 1; min-width: 130px; max-width: 220px; }

input, select, textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 9px;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}
textarea { resize: vertical; min-height: 80px; }

/* ── PANELS / CARDS ──────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.panel-head {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 14px; margin-bottom: 16px;
}
.panel h3 {
  font-family: var(--font-display);
  font-size: 20px; color: var(--ink); margin-bottom: 4px;
}
.panel p.sub { color: var(--muted); font-size: 13px; }

/* ── KPI GRID ────────────────────────────────────────────────── */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 18px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  position: relative; overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--red); opacity: .35;
}
.kpi.green::before { background: var(--green); opacity: .6; }
.kpi.amber::before { background: var(--amber); opacity: .6; }
.kpi.blue::before  { background: var(--blue);  opacity: .6; }
.kpi b    { display: block; font-size: 36px; font-family: var(--font-display); line-height: 1; }
.kpi span { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 4px; display: block; }
.kpi .kpi-icon {
  position: absolute; right: 18px; top: 18px; opacity: .08;
  font-size: 32px;
}

/* ── VIEWS ───────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── TABLE ───────────────────────────────────────────────────── */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; min-width: 1000px; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; text-align: left; }
th {
  background: var(--surface); color: var(--muted);
  text-transform: uppercase; font-size: 11px; letter-spacing: .06em;
  font-weight: 800; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #faf6f0; }

/* ── PILLS / BADGES ──────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 99px; padding: 3px 9px;
  font-size: 11px; font-weight: 800; white-space: nowrap;
}
.pill.red    { background: var(--red-soft);   color: #991b1b; }
.pill.green  { background: var(--green-soft);  color: #065f46; }
.pill.amber  { background: var(--amber-soft);  color: #92400e; }
.pill.blue   { background: var(--blue-soft);   color: #1e40af; }
.pill.grey   { background: #f1ece5;            color: #6b6560; }
.badge {
  display: inline-block; border-radius: 99px;
  background: #f0ebe3; border: 1px solid var(--line);
  padding: 3px 10px; font-size: 12px; font-weight: 700; margin: 2px;
}

/* ── TABLE ACTION BUTTONS ────────────────────────────────────── */
.action-btns { display: flex; gap: 5px; }
.tbl-btn {
  border: 0; border-radius: 8px; padding: 5px 10px;
  font-weight: 800; font-size: 12px; cursor: pointer;
  transition: filter .15s;
}
.tbl-btn:hover { filter: brightness(.92); }
.tbl-btn.edit   { background: var(--amber-soft); color: #92400e; }
.tbl-btn.delete { background: var(--red-soft);   color: #991b1b; }
.tbl-btn.sub    { background: var(--blue-soft);  color: #1e40af; }
.tbl-btn.teams  { background: #ede9fe; color: #4c1d95; }

/* ── GRID LAYOUTS ────────────────────────────────────────────── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }

/* ── FORM ────────────────────────────────────────────────────── */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
label.field {
  display: grid; gap: 5px;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}

/* ── MATRIX ──────────────────────────────────────────────────── */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px,1fr));
  gap: 14px;
}
.matrix-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 16px; overflow: hidden;
}
.matrix-card h4 {
  font-family: var(--font-display); font-size: 16px;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.matrix-session { font-size: 10px; font-weight: 900; text-transform: uppercase;
                   letter-spacing: .1em; color: var(--muted); margin: 10px 0 5px; }
.matrix-item {
  border-left: 3px solid var(--red);
  padding: 7px 10px; border-radius: 0 8px 8px 0;
  background: var(--surface); margin-bottom: 5px; font-size: 13px;
}
.matrix-item.pm { border-left-color: var(--blue); }
.matrix-item b  { display: block; font-size: 12.5px; }
.matrix-item span { color: var(--muted); font-size: 11.5px; }

/* ── LIST ITEMS ──────────────────────────────────────────────── */
.list-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 7px; font-size: 13.5px;
}
.list-row:last-child { margin-bottom: 0; }

/* ── CARDS ───────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 12px; }
.mini {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.mini h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.mini .count { font-family: var(--font-display); font-size: 28px; color: var(--red); }

/* ── LEAVE / SUB STATUS ─────────────────────────────────────── */
.leave-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  margin-bottom: 10px; display: flex; gap: 14px; align-items: flex-start;
}
.leave-avatar {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 10px; background: var(--red-soft);
  color: var(--red); display: grid; place-items: center;
  font-weight: 900; font-size: 15px;
}
.leave-body { flex: 1; }
.leave-body strong { font-size: 14.5px; display: block; }
.leave-body .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.leave-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── NOTICE ──────────────────────────────────────────────────── */
.notice {
  border: 1px solid #f6d365; background: var(--amber-soft);
  color: #8a4b00; border-radius: var(--radius);
  padding: 13px 15px; margin-top: 14px; line-height: 1.5; font-size: 13.5px;
}
.notice.error   { border-color: #fca5a5; background: var(--red-soft);   color: #991b1b; }
.notice.success { border-color: #6ee7b7; background: var(--green-soft); color: #065f46; }
.notice.info    { border-color: #93c5fd; background: var(--blue-soft);  color: #1e40af; }
.hidden { display: none !important; }

/* ── FEATURE TAGS ────────────────────────────────────────────── */
.feature-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.feature-list span {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 99px; padding: 7px 13px;
  font-weight: 700; font-size: 12.5px; color: var(--ink2);
}

/* ── FORMAT GRID (import) ────────────────────────────────────── */
.format-grid {
  display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; margin: 12px 0;
}
.format-grid span {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; text-align: center; padding: 9px;
  font-weight: 800; font-size: 12px;
}
.import-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* ── TABS ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.tab {
  padding: 10px 18px; font-weight: 700; font-size: 13.5px;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; color: var(--muted); background: transparent; border-top: 0; border-left: 0; border-right: 0;
  font-family: var(--font-body);
  transition: color .15s, border-color .15s;
}
.tab.active { color: var(--red); border-bottom-color: var(--red); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── ROLE CHIPS ──────────────────────────────────────────────── */
.role-superadmin { background: #fde8e6; color: #991b1b; }
.role-subadmin   { background: #dbeafe; color: #1e40af; }
.role-teacher    { background: #d1fae5; color: #065f46; }

/* ── DIVIDER ─────────────────────────────────────────────────── */
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ── LOGIN SCREEN ────────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 30% 60%, #2a1209 0%, #0e0b08 100%);
  display: grid; place-items: center; z-index: 9999; padding: 20px;
}
.login-screen.hidden { display: none; }
.login-card {
  width: 100%; max-width: 420px;
  background: var(--panel); border-radius: 22px;
  box-shadow: 0 40px 100px rgba(0,0,0,.5);
  padding: 36px 32px; text-align: center;
  border: 1px solid rgba(255,255,255,.05);
}
.login-logo {
  width: 60px; height: 60px; border-radius: 16px;
  background: var(--red); display: grid; place-items: center;
  font-family: var(--font-display); font-size: 32px; color: #fff;
  margin: 0 auto 18px;
}
.login-card h1 { font-family: var(--font-display); font-size: 26px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 24px; }
.login-card form { text-align: left; }
.error-msg { color: #991b1b; font-weight: 700; font-size: 13px; margin-top: 10px; text-align: center; }
.login-hint {
  margin-top: 16px; background: var(--surface);
  border-radius: 10px; padding: 11px 14px;
  font-size: 12.5px; color: var(--muted);
}

/* ── MY TIMETABLE (teacher view) ─────────────────────────────── */
.my-tt-header {
  background: linear-gradient(135deg, var(--red) 0%, #8b1c13 100%);
  border-radius: var(--radius-lg); padding: 22px 24px; color: #fff;
  margin-bottom: 18px;
}
.my-tt-header h2 { font-family: var(--font-display); font-size: 24px; margin-bottom: 4px; }
.my-tt-header p  { opacity: .75; font-size: 13.5px; }
.tt-day-block { margin-bottom: 18px; }
.tt-day-label {
  font-size: 11px; font-weight: 900; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted);
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.tt-day-label::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.tt-class-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 8px; display: flex; gap: 16px; align-items: center;
}
.tt-time {
  text-align: center; min-width: 72px;
  background: var(--surface); border-radius: 8px; padding: 8px;
  flex-shrink: 0;
}
.tt-time .session { font-size: 10px; font-weight: 900; text-transform: uppercase; color: var(--muted); }
.tt-time .clock   { font-family: var(--font-display); font-size: 15px; }
.tt-info { flex: 1; }
.tt-info strong { display: block; font-size: 15px; }
.tt-info .meta   { color: var(--muted); font-size: 12.5px; }
.tt-teams-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #5b5bd6; color: #fff;
  border: 0; border-radius: 9px; padding: 8px 13px;
  font-weight: 700; font-size: 12.5px; cursor: pointer;
  text-decoration: none; flex-shrink: 0;
  transition: filter .15s;
}
.tt-teams-btn:hover { filter: brightness(1.12); }

/* ── SETTINGS FORM ───────────────────────────────────────────── */
.form-panel { max-width: 860px; }
.settings-section { margin-bottom: 28px; }
.settings-section h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 14px; }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
}
.empty .emoji { font-size: 36px; display: block; margin-bottom: 10px; }
.empty p { font-size: 14px; }

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  z-index: 1000; display: grid; place-items: center; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--panel); border-radius: var(--radius-lg);
  padding: 28px 30px; width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); animation: modal-in .2s ease;
  max-height: 90vh; overflow-y: auto;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}
.modal h3 { font-family: var(--font-display); font-size: 21px; margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ── REALTIME PULSE ──────────────────────────────────────────── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.realtime-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--green-soft); color: var(--green);
  border-radius: 99px; padding: 3px 10px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.realtime-badge .dot {
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--green); animation: pulse 2s infinite;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2,1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 860px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-260px); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); width: 260px; }
  .main { margin-left: 0; width: 100%; padding: 18px; }
  .topbar { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .format-grid { grid-template-columns: repeat(3,1fr); }
  .kpis { grid-template-columns: repeat(2,1fr); }
  .filters { flex-direction: column; }
  .filters input, .filters select { max-width: 100%; }
  .hamburger { display: flex !important; }
}
.hamburger {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 200;
  background: var(--sidebar-bg); border: 0; border-radius: 10px;
  padding: 9px 11px; cursor: pointer; flex-direction: column; gap: 5px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }

@media print {
  .sidebar, .top-actions, .filters, .action-btns, .tabs, .hamburger { display: none !important; }
  .main { margin: 0; width: 100%; padding: 0; }
  .panel { box-shadow: none; border: 0; }
}

/* ── TEACHER PROFILE GRID ────────────────────────────────────── */
.teacher-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.tp-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow .18s, transform .15s;
  position: relative;
  overflow: hidden;
}
.tp-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.tp-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--red);
}
.tp-card.part-time::before  { background: var(--amber); }
.tp-card.contract::before   { background: var(--blue); }
.tp-card.inactive::before   { background: var(--muted); }

.tp-card-head {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px;
}
.tp-avatar {
  width: 50px; height: 50px; border-radius: 14px;
  background: linear-gradient(135deg, var(--red), #8b1c13);
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 20px;
  flex-shrink: 0; font-weight: 700;
}
.tp-avatar.blue   { background: linear-gradient(135deg, #1d4ed8, #1e3a8a); }
.tp-avatar.green  { background: linear-gradient(135deg, #0f766e, #065f46); }
.tp-avatar.amber  { background: linear-gradient(135deg, #d97706, #92400e); }

.tp-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.tp-role { font-size: 12px; color: var(--muted); font-weight: 600; }

.tp-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px; margin-bottom: 14px;
}
.tp-stat {
  background: var(--surface); border-radius: 9px;
  padding: 8px 10px; text-align: center;
}
.tp-stat b { display: block; font-size: 18px; font-family: var(--font-display); color: var(--red); }
.tp-stat span { font-size: 10px; font-weight: 700; text-transform: uppercase;
                 letter-spacing: .06em; color: var(--muted); }

.tp-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-meta-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.tp-rating { display: flex; gap: 2px; margin-top: 10px; }
.tp-star { font-size: 14px; }

.tp-card-actions {
  display: flex; gap: 6px; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--line);
}

/* ── MODAL TABS ──────────────────────────────────────────────── */
.modal-tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--line);
  margin: 0 -2px 2px;
}
.modal-tab {
  padding: 9px 16px; font-weight: 700; font-size: 13px;
  cursor: pointer; border: 0; background: transparent;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  color: var(--muted); font-family: var(--font-body);
  transition: color .15s, border-color .15s;
}
.modal-tab.active { color: var(--red); border-bottom-color: var(--red); }
.modal-tab-panel { display: none; }
.modal-tab-panel.active { display: block; }

/* ── TEACHER DETAIL VIEW ────────────────────────────────────── */
.tv-header {
  display: flex; gap: 18px; align-items: flex-start;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.tv-avatar {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, var(--red), #8b1c13);
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 26px;
  flex-shrink: 0;
}
.tv-name { font-family: var(--font-display); font-size: 24px; margin-bottom: 4px; }
.tv-sub  { color: var(--muted); font-size: 13px; }

.tv-section { margin-bottom: 20px; }
.tv-section-title {
  font-size: 10px; font-weight: 900; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.tv-section-title::after { content:''; flex:1; height:1px; background:var(--line); }

.tv-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.tv-field { background: var(--surface); border-radius: 9px; padding: 10px 12px; }
.tv-field label { font-size: 10px; font-weight: 800; text-transform: uppercase;
                   letter-spacing: .06em; color: var(--muted); display: block; margin-bottom: 3px; }
.tv-field span  { font-size: 13.5px; color: var(--ink); }
.tv-field.full  { grid-column: 1 / -1; }
.tv-remarks { background: var(--surface); border-radius: 9px; padding: 12px 14px;
               font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }
.tv-rating-row { display: flex; align-items: center; gap: 10px; }
.tv-stars { font-size: 18px; }
.tv-rating-label { font-size: 13px; color: var(--muted); font-weight: 600; }

.tp-no-profile {
  text-align: center; padding: 60px 20px; color: var(--muted);
  grid-column: 1 / -1;
}
.tp-no-profile .emoji { font-size: 42px; display: block; margin-bottom: 12px; }

@media (max-width: 860px) {
  .teacher-profile-grid { grid-template-columns: 1fr; }
  .tv-grid { grid-template-columns: 1fr; }
  .tp-stats { grid-template-columns: repeat(3,1fr); }
}

/* ── DATE SELECTS (replaces type="date") ─────────────────────── */
.date-selects {
  display: grid;
  grid-template-columns: 80px 1fr 90px;
  gap: 6px;
}
.date-part { width: 100%; }

/* ── ACTIVITY TABLE INLINE INPUTS ───────────────────────────────*/
.act-input {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 7px;
  padding: 6px 8px;
  font-family: var(--font-body);
  font-size: 13px;
  width: 100%;
}
.act-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(192,57,43,.1);
}
.act-del {
  border: 0; background: var(--red-soft); color: var(--red);
  border-radius: 7px; padding: 5px 9px;
  cursor: pointer; font-weight: 900; font-size: 13px;
}
.act-del:hover { background: var(--red); color: #fff; }

/* ── DEPT BADGE ─────────────────────────────────────────────────*/
.dept-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--blue-soft); color: var(--blue);
  border-radius: 99px; padding: 3px 10px;
  font-size: 11px; font-weight: 800;
}

/* ── CLASS CARDS GRID ────────────────────────────────────────── */
.class-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.class-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: box-shadow .18s, transform .15s, border-color .18s;
  position: relative; overflow: hidden;
}
.class-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--blue);
}
.class-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--blue);
}
.class-card-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.class-icon {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), #1e3a8a);
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
}
.class-name { font-size: 16px; font-weight: 700; }
.class-sub  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.class-sessions {
  display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px;
}
.class-card-footer {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--blue);
  display: flex; align-items: center; gap: 4px;
}

/* ══════════════════════════════════════════════════════════════
   SCHEDULE VIEW — Calendar, Working Hours, By Class
══════════════════════════════════════════════════════════════ */
.sched-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);padding:12px 16px;margin-bottom:14px;box-shadow:var(--shadow-sm)}
.sched-view-toggle{display:flex;border:1px solid var(--line);border-radius:9px;overflow:hidden}
.sched-vbtn{padding:6px 14px;font-size:12.5px;font-weight:700;border:0;background:transparent;color:var(--muted);cursor:pointer;font-family:var(--font-body);transition:background .14s,color .14s}
.sched-vbtn.active{background:var(--red);color:#fff}
.sched-date-nav{display:flex;align-items:center;gap:6px;flex-shrink:0}
.sched-date-label{font-size:13px;font-weight:700;min-width:155px;text-align:center;color:var(--ink)}
.sched-filters-row{display:flex;gap:7px;flex-wrap:wrap;flex:1;justify-content:flex-end}
.sched-filters-row select{width:auto;min-width:120px;flex:1;max-width:160px}

.sched-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:14px}
.sched-stat-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;box-shadow:var(--shadow-sm)}
.sched-stat-label{font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin-bottom:4px}
.sched-stat-val{font-size:22px;font-weight:700;font-family:var(--font-display);color:var(--ink);line-height:1}
.sched-stat-val.warn{color:var(--red)}
.sched-stat-sub{font-size:10.5px;color:var(--muted);margin-top:2px}

.sched-tabs{display:flex;border-bottom:2px solid var(--line);margin-bottom:16px}
.sched-tab{padding:8px 16px;font-weight:700;font-size:13px;cursor:pointer;border:0;background:transparent;border-bottom:2px solid transparent;margin-bottom:-2px;color:var(--muted);font-family:var(--font-body);transition:color .15s,border-color .15s}
.sched-tab.active{color:var(--red);border-bottom-color:var(--red)}
.sched-tab-panel{display:none}
.sched-tab-panel.active{display:block}

/* Weekly */
.sched-weekly-wrap{overflow-x:auto}
.sched-weekly{display:grid;grid-template-columns:54px repeat(5,1fr);min-width:640px;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--panel)}
.sched-w-corner{background:var(--surface);border-right:1px solid var(--line);border-bottom:1px solid var(--line);height:46px}
.sched-w-dayhead{padding:7px 8px;text-align:center;background:var(--surface);border-right:1px solid var(--line);border-bottom:1px solid var(--line);font-size:11.5px;font-weight:700;color:var(--muted)}
.sched-w-dayhead.today{color:var(--red)}
.sched-w-daynum{font-size:18px;font-weight:700;font-family:var(--font-display);display:block;line-height:1.1}
.sched-w-timecol{background:var(--surface);border-right:1px solid var(--line)}
.sched-w-timeslot{height:54px;display:flex;align-items:flex-start;justify-content:flex-end;padding:4px 7px 0 0;font-size:9.5px;color:var(--muted);border-bottom:1px solid var(--line)}
.sched-w-daycol{position:relative;border-right:1px solid var(--line);height:540px}
.sched-w-daycol:last-child{border-right:0}
.sched-w-gridline{position:absolute;left:0;right:0;height:54px;border-bottom:1px solid var(--line);pointer-events:none}
.sched-event{position:absolute;left:2px;right:2px;border-radius:6px;padding:4px 6px;font-size:10.5px;cursor:pointer;overflow:hidden;transition:opacity .12s,transform .12s;z-index:2}
.sched-event:hover{opacity:.85;transform:scale(1.015);z-index:5}
.sched-event.conflict{outline:2px solid var(--red);outline-offset:-1px}
.sched-event-title{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sched-event-sub{font-size:9px;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:1px}
.sched-event-warn{font-size:9px;margin-top:2px}

/* Daily */
.sched-daily-wrap{overflow-x:auto}
.sched-daily{display:grid;grid-template-columns:54px 1fr;min-width:420px;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--panel)}
.sched-daily-hdr{padding:10px 14px;background:var(--surface);border-bottom:1px solid var(--line);grid-column:1/-1}
.sched-daily-hdr h4{font-family:var(--font-display);font-size:17px;margin-bottom:2px}
.sched-daily-hdr p{font-size:12px;color:var(--muted)}
.sched-d-timecol{background:var(--surface);border-right:1px solid var(--line)}
.sched-d-timeslot{height:60px;display:flex;align-items:flex-start;justify-content:flex-end;padding:5px 8px 0 0;font-size:9.5px;color:var(--muted);border-bottom:1px solid var(--line)}
.sched-d-slotarea{position:relative;min-height:600px}
.sched-d-gridline{position:absolute;left:0;right:0;height:60px;border-bottom:1px solid var(--line);pointer-events:none}
.sched-daily-event{position:absolute;left:4px;right:4px;border-radius:7px;padding:6px 10px;cursor:pointer;overflow:hidden;transition:opacity .12s}
.sched-daily-event:hover{opacity:.85}
.sched-daily-event.conflict{outline:2px solid var(--red);outline-offset:-1px}
.sched-daily-event-title{font-size:13px;font-weight:700}
.sched-daily-event-meta{font-size:11px;opacity:.75;margin-top:2px}

/* Teachers table */
.sched-teacher-table{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.sched-tr-row{display:grid;grid-template-columns:200px 1fr 70px 70px 80px;align-items:center;padding:9px 16px;gap:12px;border-bottom:1px solid var(--line);transition:background .12s}
.sched-tr-row:last-child{border-bottom:0}
.sched-tr-row:hover{background:var(--surface)}
.sched-tr-hd{background:var(--surface);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}
.sched-t-avatar{width:28px;height:28px;border-radius:50%;display:inline-grid;place-items:center;font-size:11px;font-weight:800;flex-shrink:0}
.sched-day-dot{width:18px;height:18px;border-radius:4px;font-size:9px;display:inline-grid;place-items:center;border:1px solid transparent;font-weight:700}

/* Working Hours */
.sched-hrs-panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);padding:18px 20px}
.sched-hrs-row{display:grid;grid-template-columns:160px 1fr 54px;align-items:center;gap:12px;margin-bottom:10px}
.sched-hrs-fullbar{height:8px;border-radius:4px;background:var(--surface);border:1px solid var(--line);overflow:hidden}
.sched-hrs-fill{height:100%;border-radius:4px;transition:width .45s}
.sched-day-breakdown{margin-top:18px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px}
.sched-day-cols{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:10px}
.sched-day-col{text-align:center}
.sched-day-bar-wrap{height:60px;background:var(--panel);border:1px solid var(--line);border-radius:7px;display:flex;align-items:flex-end;overflow:hidden}
.sched-day-bar{width:100%;transition:height .4s}

/* By Class */
.sched-class-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}
.sched-class-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;cursor:pointer;transition:box-shadow .15s,transform .14s,border-color .15s}
.sched-class-card:hover{box-shadow:var(--shadow);transform:translateY(-2px);border-color:var(--blue)}

/* Event Drawer */
.sched-drawer-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);backdrop-filter:blur(2px);z-index:500;display:grid;place-items:center;padding:20px}
.sched-drawer-overlay.hidden{display:none}
.sched-drawer{background:var(--panel);border-radius:var(--radius-lg);width:100%;max-width:380px;max-height:88vh;overflow-y:auto;box-shadow:var(--shadow-lg);animation:modal-in .2s ease;border:1px solid var(--line)}
.sched-drawer-hdr{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}
.sched-drawer-hdr h4{font-family:var(--font-display);font-size:17px;margin:0}
.sched-drawer-body{padding:16px}
.sched-drawer-row{display:flex;align-items:flex-start;gap:10px;margin-bottom:12px}
.sched-drawer-icon{width:32px;height:32px;border-radius:8px;background:var(--surface);display:grid;place-items:center;font-size:15px;flex-shrink:0}
.sched-drawer-lbl{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}
.sched-drawer-val{font-size:13.5px;font-weight:700;color:var(--ink);margin-top:1px}
.sched-conflict-banner{background:var(--red-soft);border:1px solid #fca5a5;border-radius:9px;padding:9px 11px;margin-bottom:12px;font-size:12px;color:#991b1b;font-weight:700;display:flex;gap:7px;align-items:center}
.sched-load-bar{background:var(--surface);border-radius:9px;padding:10px 12px;margin-top:4px}
.sched-load-bar-track{height:7px;border-radius:4px;background:var(--line);overflow:hidden;margin-top:6px}
.sched-load-bar-fill{height:100%;border-radius:4px}
.sched-drawer-actions{display:flex;gap:6px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}
.sched-drawer-actions .btn{flex:1;justify-content:center}
.sched-reassign-panel select{margin-bottom:8px}

@media(max-width:1100px){.sched-stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:860px){
  .sched-toolbar{flex-direction:column;align-items:stretch}
  .sched-filters-row{justify-content:flex-start}
  .sched-stats{grid-template-columns:repeat(2,1fr)}
  .sched-tr-row{grid-template-columns:1fr 1fr 60px}
}
