/* Quran Academy Daily Report System - Modern UI/UX Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

#qar-app-root, #qar-app-root * {
  box-sizing: border-box;
}

:root {
  --primary: #0d5c3a;
  --primary-hover: #09472d;
  --primary-light: #ecfdf5;
  --primary-glow: rgba(13, 92, 58, 0.16);
  --accent: #d97706;
  --accent-light: #fffbeb;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #10b981;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 12px 24px -4px rgba(13, 92, 58, 0.12), 0 6px 12px -2px rgba(15, 23, 42, 0.04);
  --sidebar-w: 260px;
  --header-h: 70px;
  --topbar-h: 62px;
}

#qar-app-root {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

#qar-app-root .hidden { display: none !important; }
#qar-app-root a { color: inherit; text-decoration: none; }
#qar-app-root button { font-family: 'Plus Jakarta Sans', sans-serif; }

/* ===== Auth / Landing Screens ===== */
#qar-app-root .center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px 20px;
  background: radial-gradient(circle at 50% 0%, #e6f4ed 0%, #f8fafc 70%);
  position: relative;
  overflow: hidden;
}

#qar-app-root .center-screen::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: var(--primary-glow);
  filter: blur(60px);
  pointer-events: none;
}

#qar-app-root .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 40px;
  position: relative;
  z-index: 2;
}

#qar-app-root .brand .logo {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, #10b981 0%, #0d5c3a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 18px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  box-shadow: 0 10px 25px -5px rgba(13, 92, 58, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease;
}

#qar-app-root .brand .logo:hover {
  transform: scale(1.05) rotate(2deg);
}

#qar-app-root .brand h1 {
  width: 100%;
  color: #064e3b;
  font-size: 28px;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  word-break: break-word;
}

#qar-app-root .brand p {
  width: 100%;
  color: var(--muted);
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
}

#qar-app-root .choice-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  position: relative;
  z-index: 2;
}

#qar-app-root .choice-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1 1 200px;
  max-width: 235px;
  box-shadow: var(--shadow);
}

#qar-app-root .choice-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
  background: #ffffff;
}

#qar-app-root .choice-card:active {
  transform: translateY(-1px);
}

#qar-app-root .choice-card .icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
  transition: transform 0.25s ease;
}

#qar-app-root .choice-card:hover .icon {
  transform: scale(1.1);
  background: var(--primary);
  color: #fff;
}

#qar-app-root .choice-card h3 {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

#qar-app-root .choice-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* Form Card */
#qar-app-root .card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
}

#qar-app-root .card h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#qar-app-root label {
  display: block !important;
  font-size: 13px !important;
  color: var(--text) !important;
  margin: 16px 0 6px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}

#qar-app-root input,
#qar-app-root select,
#qar-app-root textarea {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: none !important;
  padding: 10px 14px !important;
  margin: 0 !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 10px !important;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  background-color: #f8fafc !important;
  color: var(--text) !important;
  vertical-align: middle !important;
  transition: all 0.18s ease !important;
  box-shadow: none !important;
}

#qar-app-root textarea {
  height: auto !important;
  min-height: 80px !important;
}

#qar-app-root input[type="date"] {
  height: 46px !important;
  min-height: 46px !important;
  line-height: 1.4 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

#qar-app-root select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px !important;
  padding-right: 40px !important;
}

#qar-app-root input:disabled {
  background-color: #f1f5f9 !important;
  color: var(--muted) !important;
  cursor: not-allowed !important;
  opacity: 0.8 !important;
}

#qar-app-root input:focus,
#qar-app-root select:focus,
#qar-app-root textarea:focus {
  outline: none !important;
  border-color: var(--border-focus) !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 4px var(--primary-glow) !important;
}

/* Buttons */
#qar-app-root .btn {
  box-sizing: border-box !important;
  background: linear-gradient(135deg, #10b981 0%, #0d5c3a 100%) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 10px 22px !important;
  border-radius: 10px !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  box-shadow: 0 2px 6px rgba(13, 92, 58, 0.2) !important;
  min-height: 46px !important;
  height: 46px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

#qar-app-root .btn:hover {
  background: linear-gradient(135deg, #059669 0%, #09472d 100%) !important;
  box-shadow: 0 4px 12px rgba(13, 92, 58, 0.3) !important;
  transform: translateY(-1px) !important;
}

#qar-app-root .btn:active {
  transform: translateY(0) !important;
}

#qar-app-root .btn.block {
  width: 100% !important;
  margin-top: 22px !important;
}

#qar-app-root .btn.secondary {
  background: #ffffff !important;
  color: var(--text) !important;
  border: 1.5px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}

#qar-app-root .btn.secondary:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: var(--primary-light) !important;
  box-shadow: var(--shadow) !important;
}

#qar-app-root .btn.danger {
  background: var(--danger) !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2) !important;
}
#qar-app-root .btn.danger:hover {
  background: #dc2626 !important;
}

#qar-app-root .btn.small {
  padding: 6px 14px !important;
  font-size: 13px !important;
  min-height: 38px !important;
  height: 38px !important;
  border-radius: 8px !important;
}

#qar-app-root .link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 4px;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#qar-app-root .link-btn:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

#qar-app-root .msg {
  font-size: 13px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 500;
}

#qar-app-root .msg.error {
  background: var(--danger-light);
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

#qar-app-root .msg.success {
  background: var(--primary-light);
  color: #047857;
  border: 1px solid #6ee7b7;
}

/* ===================================================================
   DASHBOARD SHELL
   =================================================================== */
#qar-app-root .dash-view { min-height: 100vh; }
#qar-app-root .shell { display: flex; min-height: 100vh; position: relative; }

#qar-app-root .sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 200;
}

#qar-app-root .sidebar .brand-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

#qar-app-root .sidebar .brand-mini .logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981 0%, #0d5c3a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(13, 92, 58, 0.2);
}

#qar-app-root .sidebar .brand-mini .t1 {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#qar-app-root .sidebar .brand-mini .t2 {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

#qar-app-root .navitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

#qar-app-root .navitem .ic {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

#qar-app-root .navitem:hover {
  background: #f1f5f9;
  color: var(--text);
}

#qar-app-root .navitem:hover .ic {
  transform: scale(1.1);
}

#qar-app-root .navitem.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

#qar-app-root .navitem.active .ic {
  color: var(--primary);
}

#qar-app-root .sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

#qar-app-root .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border);
}

#qar-app-root .user-chip .av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

#qar-app-root .user-chip .nm {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#qar-app-root .user-chip .rl {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* Mobile topbar & Drawer elements */
#qar-app-root .mobile-topbar { display: none; }
#qar-app-root .drawer-overlay { display: none; }
#qar-app-root .drawer-close { display: none; }

#qar-app-root .main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#qar-app-root .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

#qar-app-root .header h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#qar-app-root .header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

#qar-app-root .content {
  padding: 32px;
  max-width: 1200px;
}

/* Grid & Stat Cards */
#qar-app-root .grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

#qar-app-root .stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

#qar-app-root .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

#qar-app-root .stat-card .num {
  font-size: 30px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

#qar-app-root .stat-card .lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}

/* Section Title */
#qar-app-root .section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

#qar-app-root .section-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Tables */
#qar-app-root table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

#qar-app-root thead, #qar-app-root tbody {
  display: table;
  width: 100%;
  table-layout: auto;
}

#qar-app-root tr { display: table-row; }

#qar-app-root th, #qar-app-root td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

#qar-app-root th {
  color: var(--muted);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f8fafc;
}

#qar-app-root tr:last-child td { border-bottom: none; }
#qar-app-root tr:hover td { background: var(--primary-light); }

#qar-app-root .row-link {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  transition: color 0.15s ease;
}

#qar-app-root .row-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

#qar-app-root .flex {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

#qar-app-root .schedule-row {
  display: flex !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  background: #f8fafc !important;
  padding: 12px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border) !important;
}

#qar-app-root .schedule-row select,
#qar-app-root .schedule-row input {
  flex: 1 1 130px !important;
  min-width: 130px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
  background-color: #ffffff !important;
  font-size: 13.5px !important;
  line-height: 1.4 !important;
}

#qar-app-root table select,
#qar-app-root table input {
  height: 38px !important;
  min-height: 38px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  background-color: #ffffff !important;
}

/* Badges */
#qar-app-root .badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

#qar-app-root .badge.ok {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #a7f3d0;
}

#qar-app-root .badge.cancel {
  background: var(--danger-light);
  color: #dc2626;
  border: 1px solid #fca5a5;
}

/* Toolbar */
#qar-app-root .toolbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 20px;
  background: #ffffff;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

#qar-app-root .toolbar > div {
  flex: 1;
  min-width: 140px;
}

#qar-app-root .toolbar label {
  margin: 0 0 6px !important;
}

#qar-app-root .toolbar input,
#qar-app-root .toolbar select {
  height: 42px !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
  background-color: #ffffff !important;
}

/* Skeleton & Loading States */
#qar-app-root .skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
  background-size: 400% 100%;
  animation: sk 1.4s ease infinite;
  border-radius: 10px;
}

@keyframes sk {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

#qar-app-root .skel-row { height: 48px; margin-bottom: 10px; }
#qar-app-root .skel-card { height: 90px; border-radius: var(--radius-lg); }

#qar-app-root .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#qar-app-root .empty {
  color: var(--muted);
  font-size: 14px;
  padding: 40px 24px;
  text-align: center;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  font-weight: 500;
}

/* ===================================================================
   RESPONSIVE BREAKPOINT: below 993px (tablets + mobile)
   =================================================================== */
@media(max-width: 992px) {
  #qar-app-root .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  #qar-app-root .hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f8fafc;
    border-radius: 10px;
    cursor: pointer;
    padding: 0 10px;
    flex-shrink: 0;
    border: 1px solid var(--border);
  }

  #qar-app-root .hamburger-btn:hover {
    background: var(--primary-light);
  }

  #qar-app-root .hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
  }

  #qar-app-root .mobile-topbar-title {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #qar-app-root .header { display: none; }

  #qar-app-root .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 82%;
    max-width: 290px;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    z-index: 210;
  }

  #qar-app-root .sidebar.open {
    transform: translateX(0);
  }

  #qar-app-root .drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
  }

  #qar-app-root .drawer-close:hover {
    background: var(--primary-light);
    color: var(--primary);
  }

  #qar-app-root .drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 205;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  #qar-app-root .drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  #qar-app-root .content { padding: 20px 16px 50px; }
  #qar-app-root .card { padding: 24px 20px; }
  #qar-app-root .choice-row { gap: 14px; }
  #qar-app-root .choice-card { padding: 28px 20px; flex: 1 1 140px; }
  #qar-app-root th, #qar-app-root td { font-size: 13px; padding: 12px 14px; }
  #qar-app-root .toolbar { padding: 16px; gap: 12px; }
}

@media(max-width: 600px) {
  #qar-app-root .toolbar > div { min-width: 100%; }
  #qar-app-root .brand { margin-bottom: 32px; }
  #qar-app-root .brand .logo { width: 60px; height: 60px; font-size: 26px; margin-bottom: 14px; }
  #qar-app-root .brand h1 { font-size: 22px; }
  #qar-app-root .brand p { font-size: 13.5px; }

  /* Stack Admin Panel / Teacher Portal cards in separate rows on mobile */
  #qar-app-root .choice-row {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 14px;
    max-width: 340px;
  }
  #qar-app-root .choice-card {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
    padding: 22px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 16px;
  }
  #qar-app-root .choice-card .icon {
    margin: 0;
    flex-shrink: 0;
  }
  #qar-app-root .choice-card h3 { margin: 0 0 3px; }
}

@media(max-width: 420px) {
  #qar-app-root .mobile-topbar-title { font-size: 15px; }
  #qar-app-root .content { padding: 16px 12px; }
  #qar-app-root .card { padding: 20px 16px; }
  #qar-app-root .stat-card { padding: 18px 16px; }
  #qar-app-root .stat-card .num { font-size: 24px; }
}

