/* ==========================================================================
   BBB Monitor - Premium Design System (Vanilla CSS)
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-primary: #080b11;
  --bg-secondary: #0f1524;
  --card-bg: rgba(17, 25, 44, 0.65);
  --card-border: rgba(255, 255, 255, 0.07);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  
  /* Brand/Status Colors */
  --color-blue: #3b82f6;
  --color-blue-glow: rgba(59, 130, 246, 0.35);
  --color-emerald: #10b981;
  --color-emerald-glow: rgba(16, 185, 129, 0.35);
  --color-red: #ef4444;
  --color-red-glow: rgba(239, 68, 68, 0.35);
  --color-amber: #f59e0b;
  --color-amber-glow: rgba(245, 158, 11, 0.35);
  --color-purple: #8b5cf6;
  --color-purple-glow: rgba(139, 92, 246, 0.35);

  /* Typography & Layout */
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Premium Background Glowing Spheres */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.sphere-1 {
  top: -10%;
  left: 10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--color-blue) 0%, transparent 70%);
  animation: floatSphere 20s infinite alternate;
}

.sphere-2 {
  bottom: -10%;
  right: 10%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, var(--color-purple) 0%, transparent 70%);
  animation: floatSphere 25s infinite alternate-reverse;
}

@keyframes floatSphere {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 30px) scale(1.1); }
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.dashboard-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Glassmorphism Card System */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-purple) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 4px 15px var(--color-blue-glow);
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.logo-text h1 span {
  background: linear-gradient(to right, var(--color-blue), var(--color-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.header-meta form {
  margin: 0;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.logout-button:hover,
.logout-button:focus-visible {
  color: white;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  outline: none;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
}

.uptime-badge i {
  color: var(--color-blue);
}

/* Status Badges */
.status-badge {
  font-weight: 600;
}

.status-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Badge States */
.status-loading .pulse-dot {
  background-color: var(--text-muted);
  animation: pulse 1s infinite;
}
.status-loading { color: var(--text-muted); }

.status-live .pulse-dot {
  background-color: var(--color-emerald);
  box-shadow: 0 0 10px var(--color-emerald);
  animation: pulse 1.5s infinite;
}
.status-live { color: var(--color-emerald); }

.status-demo .pulse-dot {
  background-color: var(--color-amber);
  box-shadow: 0 0 10px var(--color-amber);
  animation: pulse 1.5s infinite;
}
.status-demo { color: var(--color-amber); }

.status-offline .pulse-dot {
  background-color: var(--color-red);
  box-shadow: 0 0 10px var(--color-red);
}
.status-offline { color: var(--color-red); }

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* ==========================================================================
   Banners (Errors / Info)
   ========================================================================== */
.banner {
  display: flex;
  gap: 1.2rem;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  animation: slideDown 0.4s ease-out;
}

.hidden {
  display: none !important;
}

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

.banner-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.banner-error .banner-icon {
  font-size: 1.5rem;
  color: var(--color-red);
  text-shadow: 0 0 10px var(--color-red-glow);
}

.banner-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde047;
}
.banner-warning .banner-icon {
  font-size: 1.5rem;
  color: var(--color-amber);
  text-shadow: 0 0 10px var(--color-amber-glow);
}

.banner-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.banner-content p {
  font-size: 0.875rem;
  opacity: 0.9;
}
.banner-content code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
}

/* ==========================================================================
   Stats Grid
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.icon-blue {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-blue);
  border: 1px solid rgba(59, 130, 246, 0.15);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.05);
}

.icon-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.15);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.05);
}

.card-info h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0.2rem 0;
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Resource Cards (Gauges)
   ========================================================================== */
.resource-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  min-height: 140px;
}

.resource-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resource-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.resource-title h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.resource-title i {
  font-size: 1.1rem;
}
.icon-cpu { color: var(--color-blue); }
.icon-mem { color: var(--color-purple); }

.resource-percent {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

/* Gauge SVGs */
.gauge-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 55px;
  margin: 0.4rem 0;
}

.gauge-svg {
  width: 50px;
  height: 50px;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}

.gauge-bar {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2; /* 2 * PI * r (r=40) */
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-cpu {
  stroke: var(--color-blue);
  filter: drop-shadow(0 0 3px var(--color-blue-glow));
}

.bar-mem {
  stroke: var(--color-purple);
  filter: drop-shadow(0 0 3px var(--color-purple-glow));
}

.resource-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Upcoming Courses
   ========================================================================== */
.upcoming-section {
  padding: 1.5rem;
}

.upcoming-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.upcoming-header .header-title > div {
  min-width: 0;
}

.upcoming-header .header-title p {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.course-actions {
  display: flex;
  gap: 0.7rem;
}

.course-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.course-action-button:hover,
.course-action-button:focus-visible {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.45);
  outline: none;
}

.course-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.course-import-button {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}

.course-action-button.alerts-enabled {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.course-feedback {
  min-height: 1.25rem;
  margin: 0.8rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.feedback-loading { color: #bfdbfe; }
.feedback-success { color: #a7f3d0; }
.feedback-error { color: #fca5a5; }
.feedback-alert { color: #fde68a; }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.course-card {
  position: relative;
  padding: 1rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

.course-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--color-blue);
  content: '';
}

.course-status-upcoming::before,
.course-status-starting_soon::before { background: var(--color-amber); }
.course-status-in_progress::before { background: var(--color-emerald); }

.course-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.course-code {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.72rem;
}

.course-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.course-status-upcoming .course-status,
.course-status-starting_soon .course-status {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
}

.course-status-in_progress .course-status {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.12);
}

.course-card h3 {
  margin-bottom: 0.8rem;
  font-family: var(--font-display);
  font-size: 1rem;
}

.course-meta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.course-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.course-meta i {
  width: 14px;
  color: var(--color-blue);
  text-align: center;
}

.compact-loading,
.compact-empty {
  grid-column: 1 / -1;
  padding: 2rem 1rem;
}

.compact-empty span {
  font-size: 0.75rem;
}

.refresh-status {
  color: var(--text-muted);
}

.refresh-status i {
  color: var(--color-blue);
}

.refresh-ok i {
  color: var(--color-emerald);
}

.refresh-error i {
  color: var(--color-red);
}

.problem-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
}

.problem-count {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.problem-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.problem-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left-width: 3px;
  border-radius: var(--radius-md);
}

.problem-critical {
  border-left-color: var(--color-red);
}

.problem-warning {
  border-left-color: var(--color-amber);
}

.problem-card strong,
.problem-card span {
  display: block;
}

.problem-card > div > span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.problem-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.problem-tag {
  width: fit-content;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
}

.tag-critical {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
}

.tag-warning {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
}

/* ==========================================================================
   Meeting History Modal
   ========================================================================== */
.modal-open {
  overflow: hidden;
}

.history-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.history-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
}

.history-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  max-height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
}

.history-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-dialog-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.history-dialog-header p,
.history-summary {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.history-close-button {
  width: 36px;
  height: 36px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  cursor: pointer;
}

.history-controls {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.history-controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.history-controls input,
.history-controls select {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
}

.history-search-label {
  flex: 1 1 240px;
}

.history-search-label input {
  width: 100%;
}

.email-settings-dialog {
  width: min(760px, 100%);
}

.email-settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.email-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.email-settings-grid label,
.email-toggle-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.email-settings-grid input,
.email-settings-grid select {
  width: 100%;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  font-family: var(--font-body);
}

.email-settings-grid input:focus,
.email-settings-grid select:focus {
  border-color: rgba(59, 130, 246, 0.55);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.email-toggle-row {
  flex-direction: row;
  align-items: center;
  color: var(--text-main);
}

.email-toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-blue);
}

.email-settings-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.85rem;
}

.history-pagination span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.history-pagination button {
  padding: 0.45rem 0.75rem;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.history-pagination button:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.history-content {
  min-height: 280px;
  overflow: auto;
}

.history-table-wrap {
  overflow-x: auto;
  margin-top: 0.8rem;
}

.history-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: top;
}

.history-table th {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.history-table td {
  font-size: 0.8rem;
}

.history-table td span,
.history-table td strong {
  display: block;
}

.history-table td span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.history-status {
  display: inline-flex !important;
  width: fit-content;
  margin-bottom: 0.3rem;
  padding: 0.22rem 0.5rem;
  border-radius: 50px;
  font-size: 0.68rem !important;
  font-weight: 800;
}

.history-status-matched {
  color: #a7f3d0 !important;
  background: rgba(16, 185, 129, 0.12);
}

.history-status-ambiguous {
  color: #fde68a !important;
  background: rgba(245, 158, 11, 0.12);
}

.history-status-unmatched {
  color: #cbd5e1 !important;
  background: rgba(148, 163, 184, 0.12);
}

.history-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.history-row-actions button,
.associated-card button {
  padding: 0.38rem 0.55rem;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.history-detail-row td {
  background: rgba(0, 0, 0, 0.12);
}

.history-attendees {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.6rem;
}

.history-attendee {
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.associated-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.associated-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

.associated-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
}

.associated-card p,
.associated-card small {
  color: var(--text-muted);
}

.associated-history {
  margin-top: -0.5rem;
  padding: 0.7rem;
  border-left: 2px solid rgba(59, 130, 246, 0.35);
}

@media (max-width: 720px) {
  .history-modal {
    padding: 0.75rem;
  }

  .history-dialog {
    max-height: 92vh;
    padding: 1rem;
  }

  .email-settings-grid {
    grid-template-columns: 1fr;
  }

  .email-settings-actions .course-action-button {
    width: 100%;
  }

  .associated-card {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .upcoming-header,
  .course-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .course-action-button {
    width: 100%;
  }
}

/* ==========================================================================
   Main Layout Modules (Split Panel)
   ========================================================================== */
.main-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Active Rooms Component
   ========================================================================== */
.rooms-section {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 1rem;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.header-title h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.header-title i {
  color: var(--color-blue);
  font-size: 1.2rem;
}

/* Search Box styling */
.search-box {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-box input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

/* Rooms dynamic list container */
.rooms-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Loading & Empty States */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  gap: 1rem;
  text-align: center;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--color-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.empty-state i {
  font-size: 2.5rem;
  opacity: 0.4;
  color: var(--color-blue);
}

/* Room Accordion Item */
.room-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.room-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.room-header {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) auto auto 1fr auto;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
}

@media (max-width: 1200px) and (min-width: 641px) {
  .room-header {
    grid-template-columns: auto auto 1fr auto;
  }

  .room-name-wrapper {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .room-header {
    grid-template-columns: 1fr auto;
    gap: 0.8rem;
  }

  .room-name-wrapper {
    grid-column: 1 / -1;
  }

  .attendance-button,
  .room-arrow {
    justify-self: end;
  }
}

.room-name-wrapper {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.room-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.room-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.room-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.room-stats-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-size: 0.825rem;
  font-weight: 500;
  justify-self: start;
}
.room-stats-pill i {
  color: var(--color-blue);
}

.room-time {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.attendance-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.attendance-button:hover,
.attendance-button:focus-visible {
  color: white;
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.55);
  outline: none;
}

.attendance-button:active {
  transform: translateY(1px);
}

.room-arrow {
  color: var(--text-muted);
  transition: transform 0.3s ease;
  justify-self: end;
}

.room-card.expanded .room-arrow {
  transform: rotate(180deg);
  color: var(--text-main);
}

/* Room Collapsible Body (Attendees details) */
.room-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(0, 0, 0, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.room-card.expanded .room-body {
  max-height: 500px; /* safety limit */
  overflow-y: auto;
}

.room-body-inner {
  padding: 1.25rem;
}

.room-match {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
}

.room-match i {
  width: 18px;
  text-align: center;
}

.room-match strong,
.room-match span {
  display: block;
}

.room-match strong {
  font-size: 0.82rem;
}

.room-match span {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.room-match-matched {
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.22);
}

.room-match-ambiguous {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.25);
}

.room-match-unmatched {
  color: #cbd5e1;
}

.attendees-title {
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.8rem;
}

.attendees-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}

.attendee-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
}

.attendee-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
}
.role-moderator {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.2);
}
.role-viewer {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.attendee-media {
  display: flex;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.media-active {
  color: var(--color-emerald);
}

/* ==========================================================================
   Sidebar Panels (Chart & Disk)
   ========================================================================== */
.sidebar-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-layout h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.chart-card {
  padding: 1.5rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
}

.card-title i {
  color: var(--color-purple);
  font-size: 1.1rem;
}

.card-title .icon-disk {
  color: var(--color-amber);
}

.chart-wrapper {
  position: relative;
  height: 180px;
  width: 100%;
}

/* Disk Card Styling */
.disk-card {
  padding: 1.5rem;
}

.disk-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.25rem;
}

.disk-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.disk-meta span:first-child {
  font-weight: 600;
}

.badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(to right, var(--color-amber), var(--color-red));
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.disk-total {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.disk-total strong {
  color: var(--text-main);
}

/* ==========================================================================
   Login
   ========================================================================== */
.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.5rem;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-brand .logo-text h1 {
  font-size: 1.6rem;
}

.login-card {
  padding: 2rem;
}

.login-card h2 {
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
}

.login-intro {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-alert {
  margin-bottom: 1.25rem;
  padding: 0.8rem 1rem;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-field label {
  font-size: 0.8rem;
  font-weight: 600;
}

.input-wrapper {
  position: relative;
}

.input-wrapper i {
  position: absolute;
  top: 50%;
  left: 1rem;
  color: var(--text-muted);
  transform: translateY(-50%);
}

.input-wrapper input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.7rem;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition-smooth);
}

.input-wrapper input:focus {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.4rem;
  padding: 0.8rem 1rem;
  color: white;
  background: linear-gradient(135deg, var(--color-blue), var(--color-purple));
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--color-blue-glow);
  transition: var(--transition-smooth);
}

.login-submit:hover,
.login-submit:focus-visible {
  filter: brightness(1.1);
  transform: translateY(-1px);
  outline: none;
}

@media (max-width: 640px) {
  .header-meta {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .header-meta form,
  .logout-button {
    width: 100%;
  }

  .logout-button {
    justify-content: center;
  }

  .login-card {
    padding: 1.5rem;
  }
}

/* Micro-animations */
.hover-trigger {
  transition: var(--transition-smooth);
}
.hover-trigger:hover {
  transform: translateY(-4px);
}
