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

/* ===== Theme Variables ===== */
:root {
  --bg: #09090f;
  --bg2: #0f0f18;
  --surface: #13131e;
  --surface2: #1a1a28;
  --surface3: #212133;
  --border: #27273a;
  --border2: #32324a;
  --accent: #0891b2;
  --accent-h: #06b6d4;
  --accent-soft: rgba(8,145,178,0.12);
  --accent-softer: rgba(8,145,178,0.06);
  --text: #f0f0f8;
  --text2: #9090b0;
  --text3: #55556a;
  --done: #22c55e;
  --done-soft: rgba(34,197,94,0.1);
  --failed: #f43f5e;
  --failed-soft: rgba(244,63,94,0.1);
  --inprog: #f59e0b;
  --inprog-soft: rgba(245,158,11,0.1);
  --blue: #3b82f6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 5px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --transition: 0.18s ease;
}

[data-theme="light"] {
  --bg: #f0f9ff;
  --bg2: #e0f2fe;
  --surface: #ffffff;
  --surface2: #f0f9ff;
  --surface3: #e0f2fe;
  --border: #bae6fd;
  --border2: #7dd3fc;
  --accent: #0891b2;
  --accent-h: #0e7490;
  --accent-soft: rgba(8,145,178,0.09);
  --accent-softer: rgba(8,145,178,0.04);
  --text: #0c1a2e;
  --text2: #1e4a6e;
  --text3: #64748b;
  --done: #16a34a;
  --done-soft: rgba(22,163,74,0.09);
  --failed: #e11d48;
  --failed-soft: rgba(225,29,72,0.09);
  --inprog: #d97706;
  --inprog-soft: rgba(217,119,6,0.09);
  --shadow: 0 4px 20px rgba(8,145,178,0.08);
  --shadow-sm: 0 2px 8px rgba(8,145,178,0.06);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  transition: background var(--transition), color var(--transition);
  font-size: 14px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ===== Layout ===== */
#app { display: flex; height: 100vh; }

/* ===== Sidebar ===== */
#sidebar {
  width: 210px; min-width: 210px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
  transition: background var(--transition), border-color var(--transition);
}

#sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  display: flex; align-items: center; gap: 8px;
}
.logo-icon {
  width: 28px; height: 28px; background: var(--accent);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.logo-text { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.logo-sub { font-size: 10.5px; color: var(--text3); margin-top: 1px; padding-left: 36px; }

#sidebar-user {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.user-info .name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-info .role { font-size: 10.5px; color: var(--text3); }

#sidebar nav { flex: 1; padding: 8px 8px; }
.nav-section {
  padding: 10px 8px 4px;
  font-size: 10px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.8px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text2); font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-h); }
.nav-item .icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }

#sidebar-footer {
  padding: 10px 10px 14px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.btn-logout {
  width: 100%; padding: 7px; background: none;
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text3); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.btn-logout:hover { background: var(--failed-soft); color: var(--failed); border-color: var(--failed); }

/* Theme toggle */
.theme-toggle {
  width: 100%; padding: 7px 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2);
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all var(--transition); font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.theme-toggle:hover { background: var(--surface3); color: var(--text); }

/* ===== Main ===== */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

#topbar {
  height: 52px; min-height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 12px;
  transition: background var(--transition), border-color var(--transition);
}
#topbar-title { font-size: 15px; font-weight: 700; flex: 1; color: var(--text); }
#search-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px 7px 10px;
  color: var(--text); font-size: 13px; width: 220px;
  outline: none; transition: all var(--transition); font-family: inherit;
}
#search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#search-box::placeholder { color: var(--text3); }

#content { flex: 1; overflow-y: auto; padding: 24px; background: var(--bg); transition: background var(--transition); }

/* ===== Login ===== */
#login-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  transition: background var(--transition);
}
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px; width: 360px;
  box-shadow: var(--shadow);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-logo .logo-icon { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
.login-logo span { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.login-card .subtitle { font-size: 13px; color: var(--text3); margin-bottom: 28px; padding-left: 46px; margin-top: -4px; }
.login-error { color: var(--failed); font-size: 12px; margin-bottom: 12px; display: none; background: var(--failed-soft); padding: 8px 12px; border-radius: var(--radius-xs); }

/* ===== Form ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 9px 12px;
  color: var(--text); font-size: 13.5px; outline: none;
  transition: all var(--transition); font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select { cursor: pointer; }
.form-group input[type="color"] {
  height: 40px; padding: 3px; cursor: pointer;
}
.form-hint { font-size: 11.5px; color: var(--text3); margin-top: 5px; }

/* ===== Buttons ===== */
.btn {
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; transition: all var(--transition);
  font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(8,145,178,0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-secondary:hover { background: var(--surface3); color: var(--text); border-color: var(--border2); }
.btn-danger { background: transparent; color: var(--failed); border: 1px solid rgba(244,63,94,0.25); }
.btn-danger:hover { background: var(--failed); color: #fff; border-color: var(--failed); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: var(--radius-xs); }
.btn-icon {
  padding: 5px 7px; background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 14px; border-radius: var(--radius-xs);
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--surface3); color: var(--text); }
.btn-full { width: 100%; justify-content: center; }

/* ===== Cards ===== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  transition: background var(--transition), border-color var(--transition);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-actions { display: flex; gap: 6px; }

/* ===== Stats ===== */
.stats-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 100px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.stat-card .s-num { font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.stat-card .s-label { font-size: 11.5px; color: var(--text3); margin-top: 2px; font-weight: 500; }

/* ===== Calendar ===== */
.calendar-nav {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.calendar-nav h2 { font-size: 18px; font-weight: 800; flex: 1; letter-spacing: -0.5px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-header {
  text-align: center; padding: 8px 4px;
  font-size: 10.5px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cal-day {
  min-height: 70px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px; cursor: pointer;
  transition: all var(--transition); position: relative;
}
.cal-day:hover { border-color: var(--border2); background: var(--surface2); }
.cal-day.other-month { opacity: 0.25; cursor: default; pointer-events: none; }
.cal-day.today { border-color: var(--accent); }
.cal-day.today .day-num { color: var(--accent-h); }
.cal-day.has-tasks { background: var(--surface2); }
.cal-day.selected { border-color: var(--accent); background: var(--accent-softer); }
.cal-day .day-num { font-size: 12.5px; font-weight: 700; color: var(--text2); display: block; margin-bottom: 5px; }
.task-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.task-dot { width: 6px; height: 6px; border-radius: 50%; }
.task-dot.done { background: var(--done); }
.task-dot.failed { background: var(--failed); }
.task-dot.in_progress { background: var(--inprog); }
.task-dot.todo { background: var(--text3); }

/* ===== Date Panel ===== */
#date-panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: 400px;
  background: var(--surface); border-left: 1px solid var(--border);
  z-index: 50; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow);
}
#date-panel.open { transform: translateX(0); }
#date-panel-header {
  padding: 16px 18px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
#date-panel-header h3 { flex: 1; font-size: 15px; font-weight: 700; }
#date-panel-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
#date-panel-footer { padding: 12px 16px; border-top: 1px solid var(--border); }

/* ===== Tasks ===== */
.task-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 7px;
  display: flex; align-items: flex-start; gap: 10px;
  transition: all var(--transition);
}
.task-item:hover { border-color: var(--border2); }
.task-status-btn {
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid var(--border2); flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; transition: all var(--transition); margin-top: 2px; background: none;
}
.task-status-btn.done { background: var(--done); border-color: var(--done); color: #fff; }
.task-status-btn.failed { background: var(--failed); border-color: var(--failed); color: #fff; }
.task-status-btn.in_progress { background: var(--inprog); border-color: var(--inprog); color: #fff; }
.task-status-btn.todo { border-color: var(--text3); }
.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 13.5px; color: var(--text); line-height: 1.4; }
.task-title.done { text-decoration: line-through; color: var(--text3); }
.task-title.failed { color: var(--failed); opacity: 0.75; }
.task-meta { display: flex; gap: 5px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.task-notes { font-size: 11.5px; color: var(--text3); }
.task-course-tag {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 99px; background: var(--accent-soft); color: var(--accent-h);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.task-links { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.task-link { font-size: 11.5px; color: var(--accent-h); text-decoration: none; }
.task-link:hover { text-decoration: underline; }
.task-actions { display: flex; gap: 2px; flex-shrink: 0; }

/* ===== Courses ===== */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.course-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; cursor: pointer;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.course-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--course-color, var(--accent));
  border-radius: 3px 0 0 3px;
}
.course-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.course-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.course-short {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  color: var(--text3); letter-spacing: 0.5px; margin-bottom: 10px;
}
.course-stats { display: flex; gap: 12px; }
.course-stat { font-size: 12px; color: var(--text3); }
.course-stat span { font-weight: 700; color: var(--text2); }

/* Course detail */
.course-detail-header {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px;
}
.course-color-badge {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff; flex-shrink: 0; letter-spacing: -0.5px;
}
.tabs { display: flex; gap: 1px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  padding: 9px 14px; font-size: 13px; cursor: pointer; color: var(--text3); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-h); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Lectures */
.lecture-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.lecture-item:last-child { border-bottom: none; }
.lecture-date { font-size: 11.5px; font-weight: 600; color: var(--text3); min-width: 92px; font-family: 'Courier New', monospace; }
.lecture-topic { font-size: 13.5px; flex: 1; }
.lecture-absent { font-size: 10px; color: var(--failed); font-weight: 700; margin-top: 2px; letter-spacing: 0.3px; }
.lecture-notes { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* Lab table */
.lab-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lab-table th { text-align: left; padding: 8px 12px; color: var(--text3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.lab-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.lab-table tr:hover td { background: var(--surface2); }
.lab-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-h); }
.lab-launch { color: var(--inprog); font-weight: 500; }
.lab-meeting { color: var(--blue); font-weight: 500; }
.lab-submission { color: var(--done); font-weight: 500; }

/* ===== Skills ===== */
.skills-filter { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border2); color: var(--text3);
  background: none; transition: all var(--transition);
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent-h); }
.filter-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-h); }

.skill-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 5px; transition: all var(--transition);
}
.skill-item:hover { border-color: var(--border2); }
.skill-status-icon { font-size: 15px; margin-top: 1px; flex-shrink: 0; }
.skill-content { flex: 1; min-width: 0; }
.skill-title { font-size: 13.5px; color: var(--text); }
.skill-title.done { text-decoration: line-through; color: var(--text3); }
.skill-notes { font-size: 12px; color: var(--text3); margin-top: 3px; }
.skill-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.skill-actions { display: flex; gap: 2px; }

.skills-progress { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.progress-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px; text-align: center; flex: 1; min-width: 80px;
}
.progress-stat .num { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.progress-stat .label { font-size: 10.5px; color: var(--text3); font-weight: 500; }

/* ===== Admin ===== */
.user-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 6px; transition: all var(--transition);
}
.user-row:hover { border-color: var(--border2); }
.user-info-big { flex: 1; }
.user-info-big .uname { font-size: 13.5px; font-weight: 600; }
.user-info-big .umeta { font-size: 11.5px; color: var(--text3); margin-top: 2px; }
.role-badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.role-badge.admin { background: var(--accent-soft); color: var(--accent-h); }
.role-badge.user { background: var(--surface3); color: var(--text3); }
.public-link { font-size: 11px; color: var(--accent-h); text-decoration: none; font-family: monospace; }
.public-link:hover { text-decoration: underline; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s; backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 14px; padding: 24px; width: 480px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
  animation: slideUp 0.15s;
}
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== Profile ===== */
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.profile-header {
  padding: 24px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  display: flex; align-items: center; gap: 16px;
}
.profile-avatar {
  width: 52px; height: 52px; border-radius: 12px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.profile-body { padding: 20px 24px; }
.profile-section { margin-bottom: 22px; }
.profile-section-title {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px;
}
.slug-row {
  display: flex; gap: 8px; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
}
.slug-prefix { font-size: 12px; color: var(--text3); white-space: nowrap; }
.slug-input {
  flex: 1; background: none; border: none; outline: none; color: var(--accent-h);
  font-size: 13px; font-weight: 600; font-family: monospace;
  padding: 0; min-width: 0;
}
.slug-input:focus { color: var(--text); }
.slug-row.editing { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ===== Badge / misc ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600;
}
.badge.done { background: var(--done-soft); color: var(--done); }
.badge.failed { background: var(--failed-soft); color: var(--failed); }
.badge.in_progress { background: var(--inprog-soft); color: var(--inprog); }
.badge.todo { background: var(--surface3); color: var(--text3); }
.badge.learning { background: rgba(59,130,246,0.1); color: var(--blue); }

.divider { height: 1px; background: var(--border); margin: 14px 0; }
.text-muted { color: var(--text3); font-size: 12px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.flex { display: flex; } .flex-1 { flex: 1; }
.gap-2 { gap: 8px; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ===== Empty states ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text3); }
.empty-state .icon { font-size: 36px; margin-bottom: 10px; opacity: 0.6; }
.empty-state p { font-size: 13.5px; }

/* ===== Search results ===== */
.search-result-item {
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 5px; cursor: pointer; transition: all var(--transition);
}
.search-result-item:hover { border-color: var(--accent); background: var(--surface2); }
.search-result-type { font-size: 10.5px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-bottom: 2px; }
.search-result-title { font-size: 13.5px; color: var(--text); }
.search-result-meta { font-size: 11.5px; color: var(--text3); margin-top: 2px; }

/* ===== Toast ===== */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 6px;
}
.toast {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 9px 14px; font-size: 13px;
  box-shadow: var(--shadow); animation: toastIn 0.2s cubic-bezier(0.2,0,0,1);
  display: flex; align-items: center; gap: 8px; min-width: 200px; max-width: 300px;
}
.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.error { border-color: rgba(244,63,94,0.3); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== Hamburger button ===== */
#menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; background: none; border: none;
  cursor: pointer; color: var(--text2); font-size: 20px; flex-shrink: 0;
  border-radius: var(--radius-sm); transition: all var(--transition);
}
#menu-btn:hover { background: var(--surface2); color: var(--text); }

/* Sidebar overlay backdrop */
#sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 49;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(1px);
}
#sidebar-overlay.show { display: block; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body { overflow: auto; }

  #app { height: auto; min-height: 100vh; }

  /* Sidebar slides in over content */
  #sidebar {
    position: fixed; left: -220px; top: 0; bottom: 0;
    width: 220px; min-width: 220px; z-index: 50;
    transition: left 0.22s cubic-bezier(0.4,0,0.2,1);
    box-shadow: none;
  }
  #sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }

  #main { width: 100%; min-height: 100vh; }

  #menu-btn { display: flex; }

  #topbar { padding: 0 12px; gap: 8px; }
  #topbar-title { font-size: 14px; }
  #search-box { width: 100%; max-width: 180px; font-size: 12px; padding: 6px 10px; }

  #content { padding: 14px; }

  /* Calendar cells smaller on mobile */
  .cal-day { min-height: 48px; padding: 4px; }
  .cal-day .day-num { font-size: 11px; margin-bottom: 3px; }
  .cal-header { font-size: 9px; padding: 6px 2px; }
  .task-dot { width: 5px; height: 5px; }

  /* Date panel full screen */
  #date-panel { width: 100vw; }

  /* Courses single column */
  .courses-grid { grid-template-columns: 1fr; }

  /* Stats wrap nicely */
  .stats-row { gap: 7px; }
  .stat-card { min-width: 80px; padding: 10px 12px; }
  .stat-card .s-num { font-size: 20px; }

  /* Login card full width */
  .login-card { width: calc(100vw - 32px); padding: 24px 20px; }

  /* Modal full width */
  .modal { width: calc(100vw - 24px); padding: 18px 16px; }

  /* User row on admin wraps */
  .user-row { flex-wrap: wrap; gap: 8px; }
  .user-info-big { width: 100%; }

  /* Profile */
  .profile-header { padding: 16px; }
  .profile-body { padding: 14px 16px; }

  /* Lab table scroll */
  .lab-table-wrap { overflow-x: auto; }

  /* Toast smaller */
  .toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast { max-width: 100%; }
}

@media (max-width: 420px) {
  #search-box { max-width: 130px; }
  .cal-day { min-height: 38px; }
}
