/* ============================================
   Cantonese Tutoring LMS — Common Stylesheet
   Admin / Teacher 전용 · 한국어 단일 UI
   ============================================ */

:root {
  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 60px;

  /* Colors */
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --sub: #6b7280;
  --line: #e5e7eb;
  --line-soft: #f0f1f3;

  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #2f6bff;
  --sidebar-hover: #334155;

  --primary: #2f6bff;
  --primary-dark: #1e54e6;
  --primary-soft: #eef3ff;

  --green: #0e9f6e;
  --green-soft: #e6f7f1;
  --amber: #c27803;
  --amber-soft: #fdf3e0;
  --red: #d93025;
  --red-soft: #fdecea;
  --purple: #7c3aed;
  --purple-soft: #f1eafd;
  --indigo: #4f46e5;       /* '단회' 출석 버튼 (회수 미차감) */
  --indigo-soft: #eef2ff;
  --indigo-dark: #3f37c0;
  --teal: #0d9488;         /* '무료체험' 체험 수업 */
  --teal-soft: #ccfbf1;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  /* Shadow */
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.14);
}

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

body {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f6821f 0%, #d93025 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
  padding: 40px 36px;
  text-align: center;
}
.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #f6821f, #d93025);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
}
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .subtitle { color: var(--sub); font-size: 13px; margin-bottom: 28px; }
.login-field { text-align: left; margin-bottom: 16px; }
.login-field label { display: block; font-size: 12px; font-weight: 600; color: var(--sub); margin-bottom: 6px; }
.login-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .15s;
}
.login-field input:focus { border-color: var(--primary); }
.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  transition: background .15s;
  margin-top: 8px;
}
.login-btn:hover { background: var(--primary-dark); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-error {
  background: var(--red-soft);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.login-hint {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--sub);
  line-height: 1.8;
}
.login-hint code {
  background: var(--line-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* ============================================
   APP LAYOUT (sidebar + main)
   ============================================ */
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #f6821f, #d93025);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; flex-shrink: 0;
}
.sidebar-logo .logo-text { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.3; }
.sidebar-logo .logo-text span { display: block; font-size: 11px; font-weight: 400; color: var(--sidebar-text); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav .nav-section {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #64748b;
  padding: 16px 22px 6px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  font-size: 13.5px;
  color: var(--sidebar-text);
  transition: all .15s;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav a.active {
  background: rgba(47,107,255,.12);
  color: #fff;
  border-left-color: var(--sidebar-active);
  font-weight: 600;
}
.sidebar-nav a .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-user {
  padding: 14px 22px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-info .name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user .user-info .role { font-size: 11px; color: var(--sidebar-text); }
.sidebar-user .logout-btn {
  background: none; color: var(--sidebar-text); font-size: 16px;
  padding: 4px; transition: color .15s;
}
.sidebar-user .logout-btn:hover { color: #fff; }

/* Main */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
}
.topbar .page-title { font-size: 17px; font-weight: 700; }
.topbar .page-sub { font-size: 12px; color: var(--sub); margin-top: 1px; }
.topbar .topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar .today-date { font-size: 13px; color: var(--sub); }
.content { padding: 24px 28px; flex: 1; }

/* ============================================
   COMPONENTS
   ============================================ */

/* Tabs (학생 관리: 활성/삭제된 학생) */
.tab-bar {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 4px;
  gap: 2px;
  margin-bottom: 18px;
}
.tab-item {
  padding: 8px 18px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-family: inherit;
}
.tab-item:hover { color: var(--text); background: var(--line-soft); }
.tab-item.active {
  background: var(--primary);
  color: #fff;
}
.tab-item .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  background: var(--line-soft);
  color: var(--sub);
}
.tab-item.active .tab-count { background: rgba(255,255,255,.22); color: #fff; }

/* History list (삭제된 학생 카드 내 이력 행) */
.history-row { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.history-row:last-child { border-bottom: none; }
.history-row .h-date { color: var(--text); font-weight: 600; min-width: 110px; }
.history-row .h-time { color: var(--sub); min-width: 60px; }
.history-row .h-note { color: var(--sub); flex: 1; font-size: 12px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-header .header-actions { display: flex; gap: 8px; }
.card-body { padding: 20px; }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card .stat-label { font-size: 12px; color: var(--sub); font-weight: 600; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; line-height: 1.2; }
.stat-card .stat-icon { position: absolute; top: 16px; right: 16px; font-size: 22px; opacity: .2; }
.stat-card.accent { border-left: 4px solid var(--primary); }
.stat-card.green { border-left: 4px solid var(--green); }
.stat-card.amber { border-left: 4px solid var(--amber); }
.stat-card.red { border-left: 4px solid var(--red); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #0b805c; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b52620; }
.btn-warning { background: var(--amber); color: #fff; }
.btn-warning:hover { background: #a56802; }
.btn-ghost { background: var(--line-soft); color: var(--text); }
.btn-ghost:hover { background: var(--line); }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
/* '단회' 출석 버튼 — 출석(녹색)과 명확히 구분되는 인디고 계열 */
.btn-single { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.btn-single:hover { background: var(--indigo-dark); border-color: var(--indigo-dark); }
.btn-single:focus { outline: 2px solid var(--indigo-soft); outline-offset: 1px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: var(--r-sm); background: var(--line-soft); color: var(--sub); font-size: 14px; }
.btn-icon:hover { background: var(--line); color: var(--text); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--line-soft);
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--sub);
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #f9fafb; }
.data-table .col-actions { text-align: right; white-space: nowrap; }
.data-table .col-actions .btn { margin-left: 4px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-scheduled { background: var(--primary-soft); color: var(--primary); }
.badge-completed { background: var(--green-soft); color: var(--green); }
.badge-cancelled { background: var(--red-soft); color: var(--red); }
.badge-noshow    { background: var(--amber-soft); color: var(--amber); }
.badge-makeup    { background: var(--purple-soft); color: var(--purple); }
.badge-trial    { background: var(--teal-soft); color: var(--teal); }
.badge-pending_approval { background: var(--indigo-soft); color: var(--indigo); }
.badge-active    { background: var(--green-soft); color: var(--green); }
.badge-expired   { background: var(--red-soft); color: var(--red); }
.badge-done      { background: var(--line-soft); color: var(--sub); }
.badge-disabled  { background: var(--red-soft); color: var(--red); }
.badge-admin     { background: var(--primary-soft); color: var(--primary); }
.badge-teacher   { background: var(--green-soft); color: var(--green); }
.badge-archived  { background: #f3f4f6; color: #6b7280; }     /* 삭제(보관)된 학생용 회색 배지 */
.badge-archived::before { content: '🗑 '; font-size: 10px; opacity: .8; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--sub); margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .15s;
  background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: 11px; color: var(--sub); margin-top: 4px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal.modal-lg { max-width: 640px; }
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-header .close-btn { background: none; font-size: 22px; color: var(--sub); padding: 0; line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: toastIn .2s ease;
  max-width: 360px;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.warn { background: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Progress bar (수강권 잔여) */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--line-soft);
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}
.progress-bar .fill { height: 100%; border-radius: 4px; transition: width .3s; }
.progress-bar .fill.green { background: var(--green); }
.progress-bar .fill.amber { background: var(--amber); }
.progress-bar .fill.red { background: var(--red); }
.progress-text { font-size: 12px; font-weight: 600; white-space: nowrap; }

/* Calendar */
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.calendar-toolbar .nav-buttons { display: flex; align-items: center; gap: 8px; }
.calendar-toolbar .week-label { font-size: 15px; font-weight: 700; min-width: 200px; text-align: center; }
.calendar-toolbar .filters { display: flex; gap: 8px; flex-wrap: wrap; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.cal-day-head {
  background: var(--line-soft);
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--sub);
}
.cal-day-head.today { color: var(--primary); }
.cal-day {
  background: #fff;
  min-height: 96px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-day.other-month { background: #f9fafb; }
.cal-day.other-month .cal-event { opacity: .55; }
.cal-day.today { background: var(--primary-soft); }
.cal-day .day-num { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-day.other-month .day-num { color: var(--sub); opacity: .5; }
.cal-event {
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity .15s;
  line-height: 1.3;
  overflow: hidden;
}
.cal-event:hover { opacity: .85; }
.cal-event .evt-top { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event .evt-time { font-weight: 700; flex-shrink: 0; }
.cal-event .evt-student { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cal-event .evt-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(47,107,255,.12);
  color: var(--primary);
  flex-shrink: 0;
  margin-left: 2px;
  letter-spacing: -0.2px;
}
.cal-event .evt-status {
  margin-top: 2px;
  padding-left: 12px;
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  display: inline-block;
}
.cal-event.status-scheduled { background: var(--primary-soft); color: var(--primary); }
.cal-event.status-completed { background: var(--green-soft); color: var(--green); }
.cal-event.status-cancelled { background: var(--red-soft); color: var(--red); }
.cal-event.status-noshow { background: var(--amber-soft); color: var(--amber); }
.cal-event.status-makeup { background: var(--purple-soft); color: var(--purple); }
.cal-event.status-trial { background: var(--teal-soft); color: var(--teal); }
.cal-event.status-pending_approval { background: var(--indigo-soft); color: var(--indigo); }
.cal-event .evt-status.s-completed { color: var(--green); }
.cal-event .evt-status.s-single { color: var(--indigo); font-weight: 600; }
.cal-event .evt-status.s-cancelled { color: var(--red); text-decoration: line-through; }
.cal-event .evt-status.s-noshow { color: var(--amber); }
.cal-event .evt-status.s-makeup { color: var(--purple); }
.cal-event .evt-status.s-trial { color: var(--teal); }
.cal-event .evt-status.s-pending_approval { color: var(--indigo); }

/* Teacher color dots */
.teacher-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* Today lesson card */
.lesson-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .15s;
}
.lesson-card:hover { box-shadow: var(--shadow-md); }
.lesson-card .lesson-time {
  text-align: center;
  flex-shrink: 0;
  min-width: 70px;
}
.lesson-card .lesson-time .time { font-size: 18px; font-weight: 800; }
.lesson-card .lesson-time .dur { font-size: 11px; color: var(--sub); }
.lesson-card .lesson-info { flex: 1; }
.lesson-card .lesson-info .student-name { font-size: 15px; font-weight: 700; }
.lesson-card .lesson-info .lesson-meta { font-size: 12px; color: var(--sub); margin-top: 2px; }
.lesson-card .lesson-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lesson-card.completed { opacity: .7; }
.lesson-card.completed .student-name { text-decoration: line-through; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--sub);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .3; }
.empty-state .empty-text { font-size: 14px; }

/* Section title */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 24px 0 12px;
}

/* Flex utilities */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sub { color: var(--sub); }
.text-sm { font-size: 12px; }
.text-bold { font-weight: 700; }
.text-right { text-align: right; }
.hide { display: none !important; }

/* ============================================
   MOBILE HEADER & SIDEBAR OVERLAY
   ============================================ */
.mobile-header {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
}
.mobile-header .menu-toggle {
  width: 36px; height: 36px;
  background: none; border: none; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text);
  padding: 0;
}
.mobile-header .menu-toggle:active { background: var(--line-soft); }
.mobile-header .mobile-title { font-size: 16px; font-weight: 700; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* Responsive */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; z-index: 101; box-shadow: 4px 0 20px rgba(0,0,0,.3); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .stats-row { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .calendar-grid { grid-template-columns: repeat(7, 1fr); }
  .cal-day { min-height: 56px; padding: 3px; }
  .cal-event { font-size: 9px; padding: 2px 3px; }
  .calendar-toolbar .week-label { min-width: 90px; font-size: 14px; }
  .calendar-toolbar .week-label { min-width: 90px; font-size: 14px; }
}
