/* ============================================================
   SchoolScore — UI v2
   Theme: #4A4466 / #6EADBC / #9FCBAD / #F1F7D4
   Font: Google Sans + Sarabun
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  --deep:        #4A4466;
  --deep-hover:  #3C3755;
  --deep-light:  rgba(74,68,102,.08);
  --teal:        #6EADBC;
  --teal-light:  rgba(110,173,188,.15);
  --mint:        #9FCBAD;
  --mint-light:  rgba(159,203,173,.18);
  --cream:       #F1F7D4;
  --cream-soft:  #F7FBE8;

  --bg:          #F4F6F0;
  --surface:     #FFFFFF;
  --text:        #2C2945;
  --text-soft:   #7A7899;
  --border:      #E4E2DA;
  --border-soft: #EDEBD5;

  --danger:      #E05C5C;
  --warn:        #E09A44;
  --success:     #5CB87A;

  --sidebar-w:   256px;
  --radius:      16px;
  --radius-sm:   10px;
  --radius-xs:   6px;
  --sh-xs:       0 1px 3px rgba(44,41,69,.06);
  --sh-sm:       0 2px 8px rgba(44,41,69,.08);
  --sh-md:       0 6px 20px rgba(44,41,69,.10);
  --sh-lg:       0 16px 48px rgba(44,41,69,.14);

  --font:        'Google Sans','Sarabun',sans-serif;
  --font-th:     'Sarabun','Google Sans',sans-serif;

  --ease:        cubic-bezier(.4,0,.2,1);
}

/* ─── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-th);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ─── Typography ─────────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font); font-weight: 700; color: var(--deep); line-height: 1.3; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }

/* ─── Layout ─────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--deep);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 50;
  box-shadow: 4px 0 24px rgba(44,41,69,.18);
}

/* brand */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.brand-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--mint) 0%, var(--teal) 100%);
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(110,173,188,.4);
}
.brand-mark svg { width: 20px; height: 20px; color: var(--deep); }
.brand-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: .2px;
}
.brand-sub { font-size: .7rem; color: rgba(255,255,255,.45); margin-top: 1px; }

/* nav scroll area */
.nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav-section {
  font-family: var(--font);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: rgba(159,203,173,.7);
  padding: 18px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: 1px;
  transition: all .18s var(--ease);
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.95);
}
.nav-item.active {
  background: rgba(110,173,188,.2);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--teal);
  border-radius: 0 3px 3px 0;
}
.nav-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: rgba(255,255,255,.06);
  transition: background .18s;
}
.nav-item:hover .nav-ico { background: rgba(255,255,255,.1); }
.nav-item.active .nav-ico { background: rgba(110,173,188,.3); }
.nav-ico svg { width: 16px; height: 16px; }

/* user foot */
.sidebar-foot {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05);
  margin-bottom: 8px;
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--mint), var(--teal));
  color: var(--deep);
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: .95rem;
  flex-shrink: 0;
}
.user-name { font-size: .85rem; font-weight: 600; color: #fff; line-height: 1.2; }
.user-role { font-size: .7rem; color: rgba(255,255,255,.45); margin-top: 1px; }
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.6);
  font-size: .82rem;
  font-weight: 500;
  transition: all .18s;
  border: 1px solid rgba(255,255,255,.07);
}
.logout-btn:hover { background: rgba(224,92,92,.15); color: #ff9090; border-color: rgba(224,92,92,.2); }
.logout-btn svg { width: 14px; height: 14px; }

/* ─── MAIN ───────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 28px 36px 40px;
}

/* ─── PAGE HEADER ─────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-title { font-size: 1.6rem; color: var(--deep); }
.page-sub { color: var(--text-soft); font-size: .88rem; margin-top: 3px; }

/* ─── FLASH ──────────────────────────────────────── */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: .9rem; font-weight: 500;
  border-left: 3px solid var(--teal);
  background: var(--teal-light);
  color: var(--deep);
  animation: slideDown .25s var(--ease);
}
.flash-success { background: var(--mint-light); border-color: var(--success); color: #2E6640; }
.flash-error   { background: rgba(224,92,92,.1); border-color: var(--danger); color: #8C2020; }
.flash-warn    { background: rgba(224,154,68,.1); border-color: var(--warn);  color: #7A4B10; }
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

/* ─── STAT CARDS ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--sh-xs);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--sh-sm); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.c1 { background: rgba(110,173,188,.15); color: var(--teal); }
.stat-icon.c2 { background: rgba(159,203,173,.2);  color: #4a8f5f; }
.stat-icon.c3 { background: rgba(74,68,102,.1);    color: var(--deep); }
.stat-icon.c4 { background: rgba(224,154,68,.12);  color: var(--warn); }
.stat-label { font-size: .8rem; color: var(--text-soft); font-weight: 500; }
.stat-value { font-family: var(--font); font-size: 1.9rem; font-weight: 700; color: var(--deep); line-height: 1; margin-top: 2px; }

/* ─── CARD ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--cream-soft);
}
.card-title { font-size: 1rem; font-weight: 600; color: var(--deep); }
.card-body  { padding: 20px; }

/* ─── BUTTONS ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: var(--deep);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all .18s var(--ease);
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:hover { background: var(--deep-hover); transform: translateY(-1px); box-shadow: var(--sh-sm); color: #fff; }
.btn:active { transform: none; box-shadow: none; }

.btn-teal  { background: var(--teal); }
.btn-teal:hover  { background: #5a9aaa; }
.btn-mint  { background: var(--mint); color: var(--deep); }
.btn-mint:hover  { background: #8bbf9a; color: var(--deep); }
.btn-ghost { background: transparent; color: var(--deep); border-color: var(--border); }
.btn-ghost:hover { background: var(--cream); color: var(--deep); border-color: var(--teal); }
.btn-danger{ background: var(--danger); }
.btn-danger:hover{ background: #c44; color: #fff; }
.btn-sm  { padding: 5px 12px; font-size: .8rem; border-radius: var(--radius-xs); gap: 5px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg  { padding: 11px 24px; font-size: .95rem; }
.btn-icon { padding: 7px; border-radius: var(--radius-xs); }

/* ─── FORM ───────────────────────────────────────── */
.form-row { display: grid; gap: 14px; margin-bottom: 14px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select, .field textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  transition: all .18s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(110,173,188,.18);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 80px; }

/* ─── TABLE ──────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border-soft); font-size: .88rem; }
th {
  background: var(--cream-soft);
  color: var(--text-soft);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  font-family: var(--font);
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fafaf5; }
td.actions { white-space: nowrap; display: flex; gap: 5px; align-items: center; }

/* ─── BADGES ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: .2px;
}
.badge-deep   { background: rgba(74,68,102,.1);   color: var(--deep); }
.badge-teal   { background: rgba(110,173,188,.18); color: #3a7d8c; }
.badge-mint   { background: rgba(159,203,173,.25); color: #3d7551; }
.badge-warn   { background: rgba(224,154,68,.2);   color: #8a5010; }
.badge-danger { background: rgba(224,92,92,.15);   color: var(--danger); }

/* ─── STATUS PILL ────────────────────────────────── */
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.status-pill::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.7; flex-shrink:0; }
.status-not_submitted { background: rgba(224,92,92,.12);  color: var(--danger); }
.status-submitted     { background: rgba(110,173,188,.15); color: #2e7d8c; }
.status-graded        { background: rgba(92,184,122,.15);  color: #2e7a4a; }
.status-late          { background: rgba(224,154,68,.15);  color: #8a5010; }

/* ─── MODAL ──────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(44,41,69,.5);
  display: none; align-items: center; justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 20px;
}
.modal-backdrop.show { display: flex; animation: fadeIn .2s var(--ease); }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%; max-width: 520px;
  box-shadow: var(--sh-lg);
  animation: scaleUp .22s var(--ease);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal h3 { color: var(--deep); font-size: 1.15rem; }
.modal-close {
  width: 30px; height: 30px;
  border: none; background: var(--deep-light);
  border-radius: 8px; cursor: pointer;
  display: grid; place-items: center;
  color: var(--text-soft);
  transition: all .15s;
}
.modal-close:hover { background: rgba(224,92,92,.12); color: var(--danger); }
.modal-close svg { width: 14px; height: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-soft); }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleUp { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }

/* ─── EMPTY STATE ────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--text-soft);
}
.empty-state-icon {
  width: 64px; height: 64px;
  background: var(--cream);
  border-radius: 20px;
  display: grid; place-items: center;
  margin: 0 auto 16px;
  color: var(--text-soft);
}
.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 1rem; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: .85rem; }

/* ─── SCHEDULE TOOLS ─────────────────────────────── */
.schedule-tools {
  background: var(--surface);
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  margin-bottom: 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--sh-xs);
}
.schedule-tools .field { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.schedule-tools .field label { white-space: nowrap; margin: 0; }

/* ─── SCHEDULE GRID ──────────────────────────────── */
.schedule-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: start;
}
.subject-palette {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  padding: 14px;
  position: sticky;
  top: 20px;
  box-shadow: var(--sh-xs);
}
.palette-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-soft); margin-bottom: 10px; font-family: var(--font); }
.subject-chip {
  padding: 8px 11px;
  background: var(--cream-soft);
  border: 1.5px solid var(--border-soft);
  border-radius: 9px;
  margin-bottom: 6px;
  cursor: grab;
  transition: all .15s;
  font-size: .82rem;
}
.subject-chip:hover { background: var(--mint-light); border-color: var(--mint); transform: translateX(3px); }
.subject-chip:active { cursor: grabbing; }
.subject-chip.dragging { opacity: .4; }
.subject-chip-code { font-weight: 700; font-size: .72rem; color: var(--deep); }
.subject-chip-name { font-size: .8rem; color: var(--text-soft); }

.schedule-grid {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  display: grid;
  grid-template-columns: 72px repeat(7, 1fr);
  box-shadow: var(--sh-xs);
}
.sg-cell { border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); min-height: 76px; position: relative; }
.sg-cell:last-child { border-right: none; }
.sg-header { background: var(--deep); color: rgba(255,255,255,.9); padding: 10px 6px; text-align: center; font-weight: 700; font-size: .73rem; min-height: auto; font-family: var(--font); letter-spacing: .3px; }
.sg-header small { display: block; font-weight: 400; opacity: .6; margin-top: 3px; font-size: .68rem; }
.sg-header.lunch-col { background: var(--mint); color: var(--deep); }
.sg-day { background: var(--cream-soft); padding: 10px; text-align: center; font-weight: 700; font-family: var(--font); font-size: .8rem; color: var(--deep); display: flex; align-items: center; justify-content: center; }
.sg-slot { padding: 6px; transition: background .12s; }
.sg-slot.drop-target { background: rgba(159,203,173,.25); }
.sg-slot.lunch { background: repeating-linear-gradient(45deg,var(--cream),var(--cream) 8px,var(--cream-soft) 8px,var(--cream-soft) 16px); cursor: default; }
.sg-lunch-label { text-align: center; color: var(--text-soft); font-size: .7rem; padding-top: 22px; }
.scheduled-item {
  background: linear-gradient(135deg, var(--teal), #5a9aaa);
  color: #fff;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: .78rem;
  cursor: grab;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(110,173,188,.3);
}
.scheduled-item-code { font-weight: 700; font-size: .7rem; opacity: .85; }
.scheduled-item-name { font-weight: 500; line-height: 1.3; }
.scheduled-item .remove-btn {
  position: absolute; top: 3px; right: 3px;
  background: rgba(255,255,255,.22); color: #fff;
  border: none; width: 17px; height: 17px;
  border-radius: 50%; cursor: pointer; font-size: 11px;
  line-height: 17px; padding: 0; display: grid; place-items: center;
}
.scheduled-item .remove-btn:hover { background: rgba(224,92,92,.5); }

/* ─── ASSIGNMENT CARDS ───────────────────────────── */
.assignment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 18px; }
.assignment-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  padding: 20px;
  transition: all .2s var(--ease);
  border-top: 3px solid var(--teal);
  box-shadow: var(--sh-xs);
}
.assignment-card:hover { box-shadow: var(--sh-md); transform: translateY(-3px); }
.assignment-card .subject-tag { font-size: .72rem; color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; font-family: var(--font); }
.assignment-card h3 { font-size: 1rem; margin-bottom: 6px; }
.assignment-card .desc { color: var(--text-soft); font-size: .85rem; margin-bottom: 14px; line-height: 1.5; }
.assignment-card .meta { display: flex; gap: 8px; font-size: .8rem; color: var(--text-soft); align-items: center; flex-wrap: wrap; }
.assignment-card .meta b { color: var(--deep); }

/* ─── LOGIN ──────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 10% 15%, rgba(159,203,173,.45) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(110,173,188,.4) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(241,247,212,.6) 0%, transparent 70%),
    var(--cream);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--sh-lg);
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  border: 1px solid rgba(255,255,255,.6);
}
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand-mark {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, var(--deep) 0%, #6B6489 100%);
  border-radius: 20px;
  display: grid; place-items: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(74,68,102,.3);
}
.login-brand-mark svg { width: 32px; height: 32px; color: var(--mint); }
.login-title { font-family: var(--font); font-size: 1.4rem; color: var(--deep); font-weight: 700; }
.login-sub { color: var(--text-soft); font-size: .85rem; margin-top: 4px; }
.login-hint {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--cream-soft);
  border-radius: var(--radius-xs);
  font-size: .8rem;
  color: var(--text-soft);
  border: 1px solid var(--border-soft);
}
.login-hint strong { color: var(--deep); }

/* ─── GRADING TABLE ──────────────────────────────── */
.grading-table input[type=number] { width: 90px; padding: 5px 8px; }
.grading-table select { min-width: 130px; }

/* ─── SCORE DISPLAY ──────────────────────────────── */
.score-box {
  text-align: center;
  padding: 14px;
  background: var(--mint-light);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(159,203,173,.3);
}
.score-box .score-num {
  font-family: var(--font); font-size: 2rem;
  font-weight: 700; color: var(--deep); line-height: 1;
}
.score-box .score-label { font-size: .75rem; color: var(--text-soft); margin-top: 3px; }

/* ─── UTILITY ────────────────────────────────────── */
.flex         { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.flex-wrap    { flex-wrap: wrap; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 14px; }
.mt-3 { margin-top: 22px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 14px; }
.mb-3 { margin-bottom: 22px; }
.text-muted   { color: var(--text-soft); }
.text-center  { text-align: center; }
.text-sm      { font-size: .82rem; }
.w-full       { width: 100%; }
.separator    { height: 1px; background: var(--border-soft); margin: 16px 0; }

/* ─── SWEETALERT2 CUSTOM ─────────────────────────── */
.swal2-popup { font-family: var(--font-th) !important; border-radius: var(--radius) !important; }
.swal2-title { font-family: var(--font) !important; color: var(--deep) !important; font-size: 1.15rem !important; }
.swal2-html-container { color: var(--text-soft) !important; font-size: .9rem !important; }
.swal2-confirm { background: var(--deep) !important; border-radius: var(--radius-xs) !important; font-family: var(--font) !important; font-weight: 600 !important; }
.swal2-cancel  { background: transparent !important; color: var(--text-soft) !important; border: 1.5px solid var(--border) !important; border-radius: var(--radius-xs) !important; font-family: var(--font) !important; }
.swal2-cancel:hover { background: var(--cream) !important; }
.swal2-icon { border-color: transparent !important; }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 900px) {
  .schedule-layout { grid-template-columns: 1fr; }
  .schedule-grid { grid-template-columns: 60px repeat(7,1fr); font-size: .7rem; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
