/* ============================================================
   EduTech — Design System
   Mobile-first, fully responsive
   ============================================================ */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --secondary: #0ea5e9;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0891b2;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

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

/* ── Focus visible ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  background: #1e1b4b;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 200;
  flex-shrink: 0;
}

.sb-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sb-brand .brand-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.sb-brand .brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sb-brand .brand-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 2px;
}

.sb-nav {
  flex: 1;
  padding: 14px 12px;
}

.nav-section {
  font-size: .65rem;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 14px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-item.active {
  background: rgba(99,102,241,.25);
  color: #fff;
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-item .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sb-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sb-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sb-footer .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sb-footer .user-name {
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-footer .user-role {
  font-size: .7rem;
  color: rgba(255,255,255,.45);
}

.sb-footer .btn-logout {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.7);
  border: none;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, color .15s;
}

.sb-footer .btn-logout:hover {
  background: rgba(239,68,68,.25);
  color: #fca5a5;
}

/* Hamburger toggle — hidden on desktop */
.sb-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text);
  font-size: 1.3rem;
  transition: background .15s;
}

.sb-toggle:hover {
  background: var(--bg);
}

/* ── Main area ──────────────────────────────────────────── */
.main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  z-index: 100;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Content ────────────────────────────────────────────── */
.content {
  padding: 20px;
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.card-body {
  padding: 20px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.si-indigo  { background: #e0e7ff; color: #4f46e5; }
.si-green   { background: #dcfce7; color: #16a34a; }
.si-blue    { background: #e0f2fe; color: #0284c7; }
.si-orange  { background: #fff7ed; color: #ea580c; }
.si-red     { background: #fee2e2; color: #dc2626; }
.si-purple  { background: #f3e8ff; color: #9333ea; }

.stat-info .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.stat-info .stat-label {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s, box-shadow .15s, transform .1s;
  border: none;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

.btn:active {
  transform: scale(.97);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) {
  background: #16a34a;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}
.btn-warning:hover:not(:disabled) {
  background: #d97706;
}

.btn-info {
  background: var(--info);
  color: #fff;
}
.btn-info:hover:not(:disabled) {
  background: #0e7490;
}

.btn-sm {
  padding: 6px 12px;
  font-size: .8rem;
}

.btn-icon {
  padding: 7px 10px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.badge-primary   { background: #e0e7ff; color: #4f46e5; }
.badge-success   { background: #dcfce7; color: #16a34a; }
.badge-danger    { background: #fee2e2; color: #dc2626; }
.badge-warning   { background: #fef9c3; color: #92400e; }
.badge-info      { background: #e0f2fe; color: #0284c7; }
.badge-secondary { background: #f1f5f9; color: var(--muted); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #94a3b8;
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.form-group select {
  cursor: pointer;
  appearance: auto;
}

.form-hint {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 4px;
}

.form-error {
  font-size: .75rem;
  color: var(--danger);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #f8fafc;
  padding: 10px 14px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  font-size: .875rem;
  border-bottom: 1px solid #f3f4f6;
  color: var(--text);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #fafafa;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.modal-header .modal-title {
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
  color: var(--text);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--muted);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #e2e8f0;
  color: var(--text);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  line-height: 1.4;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fef9c3;
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-info {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  font-size: 1rem;
  padding: 0 2px;
  line-height: 1;
  transition: opacity .15s;
}

.alert-close:hover {
  opacity: 1;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-wrap {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
  min-width: 260px;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1);
  border-left: 4px solid var(--primary);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast.removing {
  animation: toastOut .25s ease forwards;
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-msg {
  flex: 1;
  color: var(--text);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: .9rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

/* ============================================================
   PROGRESS
   ============================================================ */
.progress {
  background: #e2e8f0;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
  transition: width .4s ease;
}

.progress-bar.bar-success { background: var(--success); }
.progress-bar.bar-warning { background: var(--warning); }
.progress-bar.bar-danger  { background: var(--danger); }

/* ============================================================
   VIDEO PLAYER
   ============================================================ */
.video-wrap {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  width: 100%;
}

.video-wrap iframe,
.video-wrap video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  padding: 20px;
}

.login-box {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-icon {
  font-size: 3rem;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 10px;
}

.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.login-logo p {
  font-size: .875rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ============================================================
   ALUNO (STUDENT) CARD
   ============================================================ */
.aluno-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.aluno-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aluno-info {
  flex: 1;
  min-width: 0;
}

.aluno-name {
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aluno-meta {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
.pwa-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 8000;
  display: none;
}

.pwa-banner.show {
  display: flex;
}

.pwa-banner-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.pwa-banner-text {
  flex: 1;
}

.pwa-banner-text strong {
  display: block;
  font-size: .9rem;
}

.pwa-banner-text span {
  font-size: .78rem;
  opacity: .8;
}

.pwa-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-banner .btn-install {
  background: #fff;
  color: var(--primary);
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}

.pwa-banner .btn-install:hover {
  opacity: .9;
}

.pwa-banner .btn-dismiss {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.pwa-banner .btn-dismiss:hover {
  background: rgba(255,255,255,.3);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon {
  font-size: 3rem;
  color: var(--muted);
  margin-bottom: 12px;
  opacity: .5;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 14px 0;
  flex-wrap: wrap;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: background .15s, color .15s, border-color .15s;
}

.page-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 150;
  display: none;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.mb-24  { margin-bottom: 24px; }
.text-muted  { color: var(--muted); }
.text-sm     { font-size: .875rem; }
.text-xs     { font-size: .75rem; }
.font-bold   { font-weight: 700; }
.w-full      { width: 100%; }
.hidden      { display: none !important; }

/* ============================================================
   RESPONSIVE — 768px
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main {
    margin-left: 0 !important;
  }

  .sb-toggle {
    display: flex !important;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .content {
    padding: 14px;
  }

  .topbar {
    padding: 0 14px;
  }

  .card-header {
    padding: 12px 16px;
  }

  .card-body {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px;
  }
}

/* ============================================================
   RESPONSIVE — 480px
   ============================================================ */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .login-box {
    padding: 28px 20px;
  }

  .modal {
    margin: 0;
    border-radius: 14px 14px 0 0;
    max-height: 95vh;
    align-self: flex-end;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .pwa-banner {
    flex-wrap: wrap;
  }

  .toast-wrap {
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: unset;
    max-width: 100%;
  }
}
