/* Hoodle - Accelerated Classroom & Lab Learning Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --accent-indigo: #4f46e5;
  --accent-emerald: #059669;
  --accent-purple: #7c3aed;
  --accent-rose: #e11d48;
  --accent-amber: #d97706;
  --accent-sky: #0284c7;

  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning: #ea580c;
  --warning-bg: #fff7ed;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hoodle Brand & Logo Typography */
.brand-logos-cluster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
}

/* ACCL Lab Logo Visibility Container (Dark & Light Themes) */
.brand-logo.accl-logo,
.accl-mini-logo,
.accl-logo-badge,
.accl-logo-wrap,
img[src*="accl_logo.png"] {
  background: #ffffff !important;
  border-radius: 6px;
  padding: 2px 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  display: inline-block;
  vertical-align: middle;
  box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
  .brand-logo.accl-logo,
  .accl-mini-logo,
  .accl-logo-badge,
  .accl-logo-wrap,
  img[src*="accl_logo.png"] {
    background: #ffffff !important;
    border-radius: 6px;
    padding: 2px 6px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
  }
}

.brand-logos-divider {
  width: 1.5px;
  height: 24px;
  background: #cbd5e1;
}

.hoodle-brand-logo {
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}

.hoodle-name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hoodle-accent-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 2.5px;
  border-radius: 50%;
  background: #f97316;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.55);
}

.brand-tagline {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.15;
}

/* Navbar Structure */
.lms-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.navbar-primary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.navbar-user-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.guest-nav-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #f8fafc;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
}

.user-menu-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-chip-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #f8fafc;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 0.15s ease;
}

.user-chip-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.user-desktop-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-action-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  padding: 0.5rem 0;
  animation: fadeInUserDropdown 0.15s ease-out;
}

.user-action-dropdown.show {
  display: block;
}

@keyframes fadeInUserDropdown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-info {
  padding: 0.5rem 0.95rem 0.4rem;
}

.user-dropdown-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.2;
}

.user-dropdown-role {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.user-dropdown-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-separator {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

/* Network Mode Switcher in User Dropdown & Modal */
.user-dropdown-network-box {
  margin: 0.35rem 0.65rem 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.network-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.network-box-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.network-mode-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  background: #dcfce7;
  color: #166534;
}

.network-toggle-buttons {
  display: flex;
  gap: 0.35rem;
}

.btn-network-toggle {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-network-toggle:hover {
  border-color: #93c5fd;
  color: var(--primary);
  background: #eff6ff;
}

.btn-network-toggle.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12);
}

.btn-network-toggle .net-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background 0.15s ease;
}

.btn-network-toggle.active .net-dot {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.net-chip-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: #dcfce7;
  color: #166534;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.user-dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  transition: background 0.12s ease;
}

.user-dropdown-link:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.user-dropdown-danger {
  color: #dc2626 !important;
}

.user-dropdown-danger:hover {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-signout {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: white;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s ease;
}

/* Base Footer Styles */
.lms-footer {
  margin-top: auto;
  padding: 1.15rem 1.5rem;
  border-top: 1px solid var(--border);
  background: white;
}

body.is-android-app .lms-footer {
  display: none !important;
}

.lms-footer-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-branding {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 220px;
}

.footer-brand-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 800;
}

.footer-sep {
  color: #94a3b8;
  font-weight: 400;
}

.footer-tagline {
  font-size: 0.84rem;
  color: #475569;
  font-weight: 600;
}

.footer-guide {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.footer-guide-btn {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eff6ff;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
  transition: all 0.15s ease;
}

.footer-guide-btn:hover {
  background: #dbeafe;
}

.footer-apk-btn {
  color: #047857;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ecfdf5;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid #a7f3d0;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.08);
  transition: all 0.15s ease;
}

.footer-apk-btn:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.footer-credits {
  font-size: 0.83rem;
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 220px;
  justify-content: flex-end;
}

.footer-author-badge {
  font-family: var(--font-display);
  font-weight: 700;
  color: #0f172a;
  font-size: 0.86rem;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.footer-org {
  font-weight: 600;
  color: #1e3a8a;
}

.btn-signout:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* Nav Strip */
.navbar-nav-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-top: 0.2rem;
  border-top: 1px solid #f1f5f9;
}

.navbar-nav-strip::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-pill:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.nav-pill.active {
  background: #eff6ff;
  color: var(--primary);
  border-color: #bfdbfe;
}

.nav-pill-bordered,
.nav-pill-scan-qr {
  border: 1.5px solid #2563eb !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
  border-radius: 9999px !important;
  padding: 0.35rem 0.9rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12) !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

.nav-pill-courses {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.35rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}

.nav-pill-courses:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.nav-pill-courses.active {
  border: 1.5px solid #2563eb !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12) !important;
}

.nav-pill-bordered:hover,
.nav-pill-scan-qr:hover,
.nav-pill-bordered:focus,
.nav-pill-scan-qr:focus {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
}

.nav-pill-action {
  background: var(--primary);
  color: white !important;
  border: 1px solid var(--primary);
}

.nav-pill-action:hover {
  background: var(--primary-hover);
}

.role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.role-student { background: #e0e7ff; color: #3730a3; }
.role-teacher { background: #dcfce7; color: #166534; }
.role-admin { background: #fef3c7; color: #92400e; }

/* Main Container */
.lms-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.25rem;
}

/* Flash Alerts */
.alerts-container {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0 1.25rem;
}

.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
}

.alert-success { background: var(--success-bg); color: var(--success); border-color: #bbf7d0; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #fed7aa; }
.alert-info { background: var(--primary-light); color: var(--primary); border-color: #bfdbfe; }

/* Exam Lockdown Banner */
.exam-lockdown-banner {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
  from { box-shadow: 0 0 10px rgba(220, 38, 38, 0.4); }
  to { box-shadow: 0 0 20px rgba(220, 38, 38, 0.8); }
}

/* Google Classroom Course Header Banner */
.course-banner {
  position: relative;
  border-radius: var(--radius-lg);
  color: white;
  padding: 2.25rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.banner-indigo { background: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%); }
.banner-emerald { background: linear-gradient(135deg, #065f46 0%, #059669 100%); }
.banner-purple { background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%); }
.banner-rose { background: linear-gradient(135deg, #9f1239 0%, #e11d48 100%); }
.banner-amber { background: linear-gradient(135deg, #92400e 0%, #d97706 100%); }
.banner-sky { background: linear-gradient(135deg, #075985 0%, #0284c7 100%); }

.course-banner h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.course-banner .course-subtitle {
  font-size: 1.1rem;
  opacity: 0.92;
  font-weight: 500;
}

.course-banner .course-meta {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.88rem;
  opacity: 0.95;
}

.class-code-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: monospace;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.class-code-badge:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Course Tabs Bar */
.course-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.course-tab {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.course-tab:hover {
  color: var(--primary);
}

.course-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Cards & Layout */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Responsive Dashboard Layout Grid */
.dashboard-layout-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 1.5rem;
  align-items: start;
}

.todo-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: white;
  border: 1px solid var(--border);
  padding: 1.25rem;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.todo-item {
  border-left: 3px solid var(--primary);
  padding-left: 0.75rem;
  transition: transform 0.15s ease;
}

.todo-item:hover {
  transform: translateX(2px);
}

.todo-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  margin-top: 0.15rem;
  line-height: 1.35;
}

.todo-title:hover {
  color: var(--primary);
}

.todo-due {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Course Grid (Dashboard) */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.course-card-banner {
  padding: 1.5rem;
  color: white;
}

.course-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: #f1f5f9; color: var(--text-main); border-color: var(--border); }
.btn-secondary:hover { background: #e2e8f0; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }

.btn-sm { font-size: 0.8rem; padding: 0.35rem 0.75rem; }

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.badge-assigned { background: #e2e8f0; color: #475569; }
.badge-turned-in { background: #dbeafe; color: #1e40af; }
.badge-graded { background: #dcfce7; color: #15803d; }
.badge-late { background: #ffedd5; color: #c2410c; }
.badge-missing { background: #fee2e2; color: #b91c1c; }

/* Locker Quota Progress Bar */
.quota-bar-wrapper {
  background: #e2e8f0;
  border-radius: 9999px;
  height: 8px;
  width: 100%;
  overflow: hidden;
  margin: 0.5rem 0;
}

.quota-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Tables */
.lms-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.92rem;
}

.lms-table th, .lms-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.lms-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.lms-table tbody tr:hover {
  background: #f8fafc;
}

/* =======================================================
   In-Portal Camera QR Scanner & Viewfinder Styles
   ======================================================= */
.scanner-modal-card {
  max-width: 460px;
  width: 95%;
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
}

.scanner-viewfinder-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--primary);
  background: #000000;
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.25);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-preset-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoom-preset-btn:hover, .zoom-preset-btn.active {
  background: #2563eb;
  border-color: #60a5fa;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
}

.rich-format-toolbar {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 5px 8px;
  flex-wrap: wrap;
}

.format-btn {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.35;
}

.format-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.scanner-laser-line {
  position: absolute;
  top: 0;
  left: 5%;
  width: 90%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #22c55e, transparent);
  box-shadow: 0 0 10px #22c55e;
  animation: laserSweep 2s infinite ease-in-out;
  pointer-events: none;
  z-index: 10;
}

@keyframes laserSweep {
  0% { top: 8%; opacity: 0.3; }
  50% { top: 90%; opacity: 1; }
  100% { top: 8%; opacity: 0.3; }
}

/* Floating Action Button (FAB) for Mobile Students */
.scanner-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 0.85rem 1.35rem;
  display: none; /* Shown on mobile screens */
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  z-index: 90;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scanner-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.5);
}

.scanner-fab:active {
  transform: translateY(1px) scale(0.98);
}

/* Responsive Table Scroll Container */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Nav User Section Desktop Styles */
.nav-right-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-user-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 1px solid var(--border);
  padding-left: 1rem;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.user-display-name {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.user-role-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Camera Permission Guide Tabs in Scanner Modal */
.os-guide-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.os-tab-btn {
  background: var(--bg-app);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.os-tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.mobile-scroll-hint {
  display: none;
}

/* =======================================================
   Multi-Device & Responsive Viewport Rules
   ======================================================= */

/* Tablets & Small Desktops (<= 1024px) */
@media (max-width: 1024px) {
  .lms-main {
    padding: 1.25rem 1rem;
  }
  .course-banner {
    padding: 1.5rem 1.25rem;
  }
}

/* Tablets & Laptops (<= 900px) */
@media (max-width: 900px) {
  .dashboard-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  .lms-footer,
  .footer {
    display: none !important;
  }
}

/* Mobile Devices & Portrait Mode (<= 768px) */
@media (max-width: 768px) {
  /* Floating Camera Button removed in favor of top-bar Scan QR button */
  .scanner-fab {
    display: none !important;
  }

  /* Compact 2-Tier Mobile Header: Row 1 = Brand + User; Row 2 = Nav Pills */
  .lms-navbar {
    padding: 0.45rem 0.75rem;
    gap: 0.35rem;
  }

  .navbar-primary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .brand-logo {
    height: 28px;
  }

  .hoodle-name {
    font-size: 1.35rem;
  }

  .brand-tagline {
    display: none; /* conserve vertical mobile space */
  }

  .navbar-user-actions {
    gap: 0.4rem;
  }

  /* Mobile Guest/Login Top Bar - Centered Brand & Buttons */
  .navbar-primary-row.has-guest-nav {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.55rem;
    padding: 0.25rem 0 0.15rem 0;
  }

  .navbar-primary-row.has-guest-nav .brand-section {
    margin: 0 auto;
    justify-content: center;
    text-align: center;
  }

  .navbar-primary-row.has-guest-nav .brand-logos-cluster {
    justify-content: center;
  }

  .navbar-guest-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .guest-nav-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    margin: 0 auto;
  }

  .guest-nav-buttons .btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    text-align: center;
  }

  .user-desktop-actions {
    display: none !important;
  }

  .user-chip-btn {
    padding: 2px 4px;
    border-radius: 9999px;
    background: #f8fafc;
    border: 1px solid var(--border);
    cursor: pointer;
  }

  .user-chip-btn .user-meta {
    display: none !important;
  }

  .user-avatar-circle {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
  }

  .user-action-dropdown {
    right: 0;
    min-width: 210px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  }

  /* Mobile & In-App Footer: Hidden to maximize workspace screen area */
  .lms-footer {
    display: none !important;
  }

  .navbar-nav-strip {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.35rem;
    padding-top: 0.25rem;
  }

  .navbar-nav-strip::-webkit-scrollbar {
    display: none;
  }

  .nav-pill {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  .nav-item {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    flex-shrink: 0;
  }

  .scanner-nav-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    flex-shrink: 0;
  }

  /* Course Tabs Navigation on mobile */
  .course-tabs-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    gap: 0.25rem;
  }

  .course-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .course-tab {
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    flex-shrink: 0;
  }

  /* Course Header Banner */
  .course-banner {
    padding: 1.15rem 0.85rem;
    border-radius: var(--radius-md);
  }

  .course-banner h1 {
    font-size: 1.15rem;
    line-height: 1.25;
  }

  .course-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .class-code-badge {
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
  }

  /* Responsive Metric Stat Cards in Portrait */
  .attendance-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }

  /* Responsive Filter Controls in Portrait */
  .attendance-filter-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .attendance-filter-bar #rosterSearch {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  .attendance-filter-bar #studentSelectFilter {
    max-width: 100% !important;
  }

  /* Action Buttons Full Width on Mobile */
  .attendance-action-btns {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .attendance-action-btns .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Mobile horizontal scroll helper */
  .mobile-scroll-hint {
    display: block !important;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.35rem 0;
    background: #f1f5f9;
    border-radius: 4px;
    margin-bottom: 0.5rem;
  }

  /* Scanner modal fits mobile portrait screens */
  .scanner-modal-card {
    padding: 1rem 0.85rem;
    max-width: 95vw;
  }

  .scanner-viewfinder-wrap {
    min-height: 220px;
    max-height: 280px;
  }

  /* Stream Page Mobile Layout: Polished Coursework-Like Tiles */
  .stream-layout-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
  }

  .stream-sidebar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.65rem !important;
    margin-bottom: 0.25rem !important;
  }

  .stream-sidebar .card {
    padding: 0.75rem 0.85rem !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    background: #ffffff !important;
    box-shadow: var(--shadow-sm) !important;
  }

  .stream-card-label {
    font-size: 0.75rem !important;
    margin-bottom: 0.35rem !important;
  }

  .stream-code-box {
    font-size: 1.05rem !important;
    padding: 0.4rem 0.65rem !important;
  }

  .stream-desc-text {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
  }

  .announcement-composer-card {
    padding: 0.95rem 0.85rem !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    background: #ffffff !important;
    box-shadow: var(--shadow-sm) !important;
    margin-bottom: 0.85rem !important;
  }

  .announcements-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  /* Polished Stream Tile matching .classwork-card */
  .announcement-card {
    padding: 1rem 0.85rem !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    background: #ffffff !important;
    box-shadow: var(--shadow-sm) !important;
    margin-bottom: 0 !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  }

  .announcement-card:hover {
    box-shadow: var(--shadow-md) !important;
  }

  .announcement-header {
    margin-bottom: 0.65rem !important;
    gap: 0.55rem !important;
    align-items: center !important;
  }

  .announcement-author-info {
    gap: 0.65rem !important;
  }

  .announcement-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.95rem !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }

  .announcement-author-name {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    gap: 0.35rem !important;
  }

  .announcement-meta-sub {
    font-size: 0.72rem !important;
    margin-top: 0.1rem !important;
  }

  .announcement-actions .btn-sm {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.74rem !important;
  }

  .announcement-body {
    font-size: 0.88rem !important;
    line-height: 1.55 !important;
    margin-bottom: 0.75rem !important;
    color: #334155 !important;
  }

  /* Sleek attachment tile matching classwork resource tile */
  .announcement-attachment-box {
    padding: 0.6rem 0.75rem !important;
    border-radius: 8px !important;
    margin-bottom: 0.65rem !important;
    gap: 0.5rem !important;
    background: #f8fafc !important;
    border: 1px solid var(--border) !important;
  }

  .attachment-filename {
    max-width: 140px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
  }

  .announcement-attachment-box .btn-sm {
    padding: 0.25rem 0.55rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
  }

  /* Comments section separated with subtle dashed line */
  .announcement-comments-wrap {
    border-top: 1px dashed var(--border) !important;
    padding-top: 0.65rem !important;
    margin-top: 0.35rem !important;
  }

  .comment-item {
    gap: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  .comment-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.75rem !important;
  }

  .comment-bubble {
    padding: 0.45rem 0.65rem !important;
    border-radius: 8px !important;
  }

  .comment-author {
    font-size: 0.76rem !important;
  }

  .comment-time {
    font-size: 0.68rem !important;
  }

  .comment-text {
    font-size: 0.8rem !important;
  }

  .composer-actions-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .composer-actions-row .attach-file-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .composer-actions-row .attach-file-btn input[type="file"] {
    max-width: none !important;
    width: 100% !important;
  }

  .composer-post-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.55rem !important;
  }
}

/* Extra Small Mobile Devices & Tight Portrait (< 480px) */
@media (max-width: 480px) {
  body {
    font-size: 13.5px;
  }

  .lms-navbar {
    padding: 0.4rem 0.6rem;
  }

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

  .attendance-filter-bar {
    grid-template-columns: 1fr !important;
  }

  .card {
    padding: 0.85rem;
    margin-bottom: 1.25rem;
  }

  .course-tab {
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
  }

  .lms-table th, .lms-table td {
    padding: 0.55rem 0.45rem;
    font-size: 0.78rem;
  }

  /* Stream Sidebar stacks vertically on tight mobile */
  .stream-sidebar {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
  }

  .announcement-header {
    flex-direction: row !important;
    gap: 0.5rem !important;
  }

  .announcement-avatar {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.95rem !important;
  }

  .announcement-author-name {
    font-size: 0.88rem !important;
  }

  .announcement-attachment-box {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
    padding: 0.75rem !important;
  }

  .announcement-attachment-box .download-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .attachment-filename {
    max-width: 220px !important;
  }
}

/* =======================================================
   Course Stream Desktop & Base Styles
   ======================================================= */
.stream-layout-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.stream-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stream-info-card {
  padding: 1.25rem;
}

.stream-card-label {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--text-main);
}

.stream-code-box {
  background: #f1f5f9;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  text-align: center;
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.08em;
  border: 1px dashed var(--border);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s ease;
}

.stream-code-box:hover {
  background: #e2e8f0;
}

.stream-card-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
  line-height: 1.35;
}

.stream-desc-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  word-break: break-word;
}

.announcement-composer-card {
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.stream-textarea {
  resize: vertical;
  min-height: 70px;
  font-size: 0.92rem;
}

.composer-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.attach-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  border: 1px dashed var(--border);
  max-width: 100%;
}

.attach-file-btn input[type="file"] {
  font-size: 0.78rem;
  max-width: 200px;
}

.composer-post-btn {
  font-weight: 600;
}

.announcements-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.announcement-card {
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.announcement-pinned {
  border-left: 4px solid var(--primary) !important;
}

.announcement-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.announcement-author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.announcement-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.announcement-author-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.announcement-meta-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.pinned-tag {
  color: var(--primary);
  font-weight: 700;
}

.announcement-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.action-icon-btn {
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
}

.action-icon-btn.delete-btn {
  color: var(--danger);
}

.announcement-body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  margin-bottom: 1rem;
}

.announcement-attachment-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.attachment-file-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 0;
}

.attachment-filename {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.attachment-size {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: normal;
}

.announcement-comments-wrap {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.comment-item {
  display: flex;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.comment-bubble {
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.comment-author-row {
  margin-bottom: 0.2rem;
}

.comment-author {
  font-weight: 700;
  font-size: 0.8rem;
}

.comment-time {
  font-weight: normal;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.comment-text {
  color: var(--text-main);
  line-height: 1.35;
}

.comment-input-form {
  display: flex;
  gap: 0.5rem;
}

.comment-input {
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  flex: 1;
  min-width: 0;
}

.comment-submit-btn {
  flex-shrink: 0;
}

.stream-empty-card {
  text-align: center;
  padding: 3rem 1rem;
}

/* =======================================================
   Course Classwork Base Styles
   ======================================================= */
.classwork-actions-strip {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.topic-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topic-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0;
}

.classwork-card {
  margin-bottom: 0 !important;
  padding: 1.15rem 1.35rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.classwork-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.classwork-card.exam-mode {
  border-left: 4px solid var(--danger) !important;
  background: #fffbfb !important;
}

.classwork-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.classwork-item-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1;
}

.classwork-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.classwork-item-content {
  min-width: 0;
  flex: 1;
}

.classwork-item-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.classwork-item-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  word-break: break-word;
}

.classwork-item-title:hover {
  color: var(--primary);
}

.classwork-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.35;
}

.classwork-item-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.modal-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* =======================================================
   Assignment Detail Base Styles
   ======================================================= */
.coursework-detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.coursework-detail-grid.single-col {
  grid-template-columns: 1fr !important;
}

.coursework-header-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.coursework-header-info {
  flex: 1;
  min-width: 240px;
}

.coursework-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.25rem;
  line-height: 1.25;
  word-break: break-word;
}

.coursework-header-badge-box {
  text-align: right;
  flex-shrink: 0;
}

.roster-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* =======================================================
   Exam Lockdown View Base Styles
   ======================================================= */
.exam-view-container {
  max-width: 800px;
  margin: 1rem auto;
}

.exam-hero-card {
  background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.exam-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.exam-hero-meta-strip {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
}

.exam-timer-box {
  background: rgba(0,0,0,0.3);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: monospace;
}

.exam-receipt-box {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.exam-receipt-card {
  max-width: 540px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: left;
  font-size: 0.88rem;
}

.exam-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.exam-receipt-val {
  text-align: right;
  word-break: break-word;
}

/* =======================================================
   Responsive Viewport Overrides for Classwork, Assignment, Exam
   ======================================================= */
@media (max-width: 900px) {
  .coursework-detail-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}

@media (max-width: 768px) {
  /* Classwork Mobile */
  .classwork-actions-strip {
    margin-bottom: 1.25rem;
  }

  .classwork-actions-strip .btn {
    flex: 1;
    min-width: 140px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .topic-title {
    font-size: 1.15rem;
  }

  .classwork-card {
    padding: 1rem 0.85rem !important;
  }

  .classwork-item-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .classwork-item-main {
    gap: 0.75rem;
    width: 100%;
  }

  .classwork-item-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .classwork-item-title {
    font-size: 0.95rem;
  }

  .classwork-item-actions {
    width: 100%;
    border-top: 1px dashed var(--border);
    padding-top: 0.65rem;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .classwork-item-actions .btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }

  /* Assignment Detail Mobile */
  .coursework-header-box {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  .coursework-title {
    font-size: 1.3rem;
  }

  .coursework-header-badge-box {
    width: 100%;
    text-align: left;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .coursework-header-badge-box .points-val {
    font-size: 1.05rem !important;
  }

  .roster-header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .roster-header-row .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Exam View Mobile */
  .exam-view-container {
    padding: 0 0.25rem;
  }

  .exam-hero-card {
    padding: 1.25rem 1rem !important;
    margin-bottom: 1.25rem !important;
  }

  .exam-hero-top {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem;
  }

  .exam-hero-card h1 {
    font-size: 1.35rem !important;
  }

  .exam-timer-box {
    width: 100%;
    text-align: center;
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
  }

  .exam-hero-meta-strip {
    margin-top: 1rem;
    padding-top: 0.75rem;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .exam-receipt-box {
    padding: 1.15rem 0.85rem;
  }

  .exam-receipt-card {
    padding: 0.85rem;
    font-size: 0.82rem;
  }

  .exam-receipt-box .btn-success {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .modal-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  .classwork-actions-strip {
    flex-direction: column;
  }

  .classwork-actions-strip .btn {
    width: 100%;
  }
}

/* ==========================================================================
   In-App PDF Opener / Reader
   ========================================================================== */
.pdf-reader-modal {
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  background: rgba(15, 23, 42, 0.75);
}

.pdf-modal-content {
  width: 95vw;
  max-width: 1200px;
  height: 90vh;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.25s ease;
}

.pdf-modal-content.pdf-fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.pdf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  color: #f8fafc;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  gap: 1rem;
}

.pdf-header-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.pdf-badge-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.pdf-viewer-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 450px;
}

.pdf-viewer-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  display: block;
}

.pdf-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pdf-header-actions .btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
}

.pdf-viewer-body {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  background: #334155;
  overflow: hidden;
}

.pdf-viewer-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #525659;
  display: block;
}

@media (max-width: 768px) {
  .pdf-reader-modal {
    padding: 0;
  }

  .pdf-modal-content {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .pdf-viewer-title {
    max-width: 180px;
    font-size: 0.88rem;
  }

  .pdf-header-actions #pdfViewerFullscreenBtn {
    display: none;
  }
}

/* =======================================================
   Live Exam Mode Lockdown Telemetry Panel
   ======================================================= */
.exam-telemetry-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.25);
  border: 1px solid #334155;
}

.exam-telemetry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.telemetry-beacon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.telemetry-beacon.live-green {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.pulse-dot-red {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: telemetryPulse 1s infinite alternate;
}

.pulse-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: telemetryPulse 1s infinite alternate;
}

@keyframes telemetryPulse {
  from { opacity: 0.3; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

.telemetry-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.telemetry-stat-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s, background 0.2s;
}

.telemetry-stat-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.telemetry-stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.telemetry-stat-lbl {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.telemetry-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  overflow: hidden;
}

.telemetry-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

@keyframes newSubmissionFlash {
  0% { background-color: #d1fae5; }
  50% { background-color: #a7f3d0; }
  100% { background-color: transparent; }
}

.new-submission-pulse {
  animation: newSubmissionFlash 2.5s ease-out;
}

/* ==========================================================================
   Responsive Chat & 1-on-1 Messaging System
   ========================================================================== */
.messages-container {
  max-width: 1100px;
  margin: 0 auto;
  height: calc(100vh - 165px);
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

.chat-app-card {
  padding: 0 !important;
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: white;
  min-height: 480px;
}

.chat-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: #fafafa;
  overflow: hidden;
  height: 100%;
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: white;
  overflow: hidden;
  height: 100%;
}

.chat-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  z-index: 10;
}

.chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #fdfdfd;
}

.chat-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: white;
}

.mobile-back-btn {
  display: none;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  margin-right: 0.5rem;
  border-radius: 6px;
  text-decoration: none;
}

@media (max-width: 768px) {
  .messages-container {
    height: calc(100vh - 120px);
    min-height: 460px;
    padding: 0 0.25rem;
  }

  .chat-app-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100%;
    border-radius: 8px;
  }

  /* When an active conversation is open on mobile */
  .chat-app-card.mobile-active-chat .chat-sidebar {
    display: none !important;
  }

  .chat-app-card.mobile-active-chat .chat-main {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* When viewing the conversation drawer on mobile */
  .chat-app-card:not(.mobile-active-chat) .chat-sidebar {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
  }

  .chat-app-card:not(.mobile-active-chat) .chat-main {
    display: none !important;
  }

  .mobile-back-btn {
    display: inline-flex !important;
  }

  .chat-header {
    padding: 0.65rem 0.85rem;
  }

  .chat-feed {
    padding: 0.75rem;
  }

  .chat-footer {
    padding: 0.65rem 0.85rem;
  }

  .chat-footer textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }
}

/* ============================================================ */
/* Password Visibility Toggle (Show / Hide Password with Eye)  */
/* ============================================================ */
.password-input-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.password-input-wrap input {
  width: 100% !important;
  padding-right: 2.75rem !important;
  box-sizing: border-box !important;
}

.password-toggle-btn {
  position: absolute !important;
  right: 0.6rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0.35rem !important;
  color: #64748b !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  z-index: 5 !important;
  line-height: 1 !important;
  transition: color 0.15s ease, background-color 0.15s ease !important;
}

.password-toggle-btn:hover {
  color: #0f172a !important;
  background-color: #f1f5f9 !important;
}

.password-toggle-btn:active {
  transform: translateY(-50%) scale(0.95) !important;
}

.password-toggle-btn svg {
  display: block;
  pointer-events: none;
}

/* ============================================================ */
/* Global Admin Broadcast Announcement Modal & Banner Styles   */
/* ============================================================ */
.announcement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: announcementFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes announcementFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes announcementScaleUp {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.announcement-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.8);
  max-width: 580px;
  width: 100%;
  overflow: hidden;
  animation: announcementScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.announcement-header {
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.announcement-badge-urgent {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.announcement-badge-important {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.announcement-badge-general {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.announcement-body {
  padding: 1.75rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #334155;
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.announcement-footer {
  padding: 1.25rem 1.75rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-acknowledge {
  background: #4f46e5;
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transition: all 0.15s ease;
}

.btn-acknowledge:hover {
  background: #4338ca;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
  transform: translateY(-1px);
}

.btn-acknowledge:active {
  transform: translateY(0);
}

/* ==========================================================================
   DEDICATED ADMIN SIDEBAR & SHELL LAYOUT (ADMIN ONLY)
   ========================================================================== */

.admin-app-shell {
  display: flex;
  min-height: calc(100vh - 72px);
  position: relative;
  background: #f8fafc;
}

.admin-sidebar {
  width: 260px;
  min-width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  z-index: 90;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

.admin-sidebar-content {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  background: #f1f5f9;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.admin-sidebar-brand-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 0 0.65rem 0.25rem 0.65rem;
}

.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: #475569;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
  border: 1px solid transparent;
}

.admin-sidebar-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.admin-sidebar-item-icon {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.admin-sidebar-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar-item:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #e2e8f0;
}

.admin-sidebar-item.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
  border-color: #bfdbfe;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.06);
}

.admin-nav-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
  flex-shrink: 0;
}

.admin-pulse-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
  animation: pulseBeacon 2s infinite;
}

@keyframes pulseBeacon {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.admin-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.admin-cluster-status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: #475569;
  font-weight: 600;
}

.admin-main-viewport {
  flex: 1;
  min-width: 0;
  padding: 1.75rem 2rem 3rem;
}

.admin-mobile-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-mobile-toggle:hover {
  background: #dbeafe;
}

.admin-backdrop {
  display: none;
}

/* Responsive Drawer for Mobile & Tablets (< 992px) */
@media (max-width: 991px) {
  .admin-mobile-toggle {
    display: inline-flex;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 275px;
    height: 100vh;
    z-index: 10000;
    transform: translateX(-100%);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.2);
  }

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

  .admin-sidebar-close-btn {
    display: block !important;
  }

  .admin-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .admin-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-main-viewport {
    padding: 1rem 0.85rem 2.5rem;
    width: 100%;
  }
}

/* Mobile & Android App Rich Text & Markdown Typography */
strong, b, .rich-text-content strong, .rich-text-content b {
  font-weight: 700 !important;
  color: inherit;
}

em, i, .rich-text-content em, .rich-text-content i {
  font-style: italic !important;
}

.rich-text-content ul, ul.rich-list {
  list-style-type: disc !important;
  padding-left: 1.5rem !important;
  margin: 0.5rem 0 !important;
}

.rich-text-content ol, ol.rich-list {
  list-style-type: decimal !important;
  padding-left: 1.5rem !important;
  margin: 0.5rem 0 !important;
}

.rich-text-content li {
  display: list-item !important;
  margin-bottom: 0.25rem !important;
  line-height: 1.5;
}

.rich-text-content h1, .rich-text-content h2, .rich-text-content h3 {
  font-weight: 800 !important;
  margin-top: 0.75rem !important;
  margin-bottom: 0.35rem !important;
}


