/* ═══════════════════════════════════════════════════════════════
   iTutorzz LMS — Obsidian Design System
   Dark-first with CSS variable theming. Toggle .light on <html>.
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── CSS Variables ───────────────────────────────────────────── */
:root {
  /* Dark mode (default) */
  --bg-base:        #0e1014;
  --bg-surface:     #16191f;
  --bg-elevated:    #1e2229;
  --bg-hover:       #252b34;
  --bg-active:      #2d3340;

  --border-subtle:  rgba(255,255,255,0.07);
  --border-muted:   rgba(255,255,255,0.12);
  --border-accent:  rgba(245,158,11,0.4);

  --text-primary:   #f0f2f5;
  --text-secondary: #8b95a5;
  --text-muted:     #525d6e;
  --text-inverse:   #0e1014;

  --accent:         #f59e0b;
  --accent-hover:   #fbbf24;
  --accent-dim:     rgba(245,158,11,0.15);
  --accent-glow:    rgba(245,158,11,0.25);

  --teal:           #14b8a6;
  --teal-dim:       rgba(20,184,166,0.15);
  --red:            #ef4444;
  --red-dim:        rgba(239,68,68,0.15);
  --green:          #22c55e;
  --green-dim:      rgba(34,197,94,0.15);
  --blue:           #3b82f6;
  --blue-dim:       rgba(59,130,246,0.15);

  --shadow-sm:      0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.6);
  --shadow-accent:  0 4px 24px rgba(245,158,11,0.2);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --sidebar-w:  240px;
  --topbar-h:   64px;

  --font-head:  'Sora', sans-serif;
  --font-body:  'DM Sans', sans-serif;

  --transition: 200ms cubic-bezier(0.4,0,0.2,1);
}

/* Light mode overrides */
html.light {
  --bg-base:        #f5f4f0;
  --bg-surface:     #ffffff;
  --bg-elevated:    #f0efe9;
  --bg-hover:       #ebe9e1;
  --bg-active:      #e0ddd4;

  --border-subtle:  rgba(0,0,0,0.06);
  --border-muted:   rgba(0,0,0,0.12);
  --border-accent:  rgba(245,158,11,0.5);

  --text-primary:   #1a1c20;
  --text-secondary: #5a6170;
  --text-muted:     #9ca3af;
  --text-inverse:   #ffffff;

  --shadow-sm:      0 1px 3px rgba(0,0,0,0.1);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.16);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

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

/* ── Layout Shell ────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--transition), background var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 1rem;
}

.sidebar-brand-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-brand-text span {
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-muted) transparent;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-accent);
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Sub-nav */
.nav-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.nav-sub.open { max-height: 300px; }

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 38px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 400;
  transition: all var(--transition);
  text-decoration: none;
}
.nav-sub-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  text-decoration: none;
}
.nav-sub-item::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.nav-toggle-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform var(--transition);
}
.nav-item.open .nav-toggle-arrow { transform: rotate(180deg); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* ── Main content area ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--topbar-h);
  transition: margin var(--transition);
}

/* Chat page: lock height so only chat-messages scrolls */
.main-content.no-scroll-page {
  min-height: 0;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
  /* topbar is fixed, so no additional padding needed */
  padding-top: 0 !important;
  margin-top: var(--topbar-h);
}
.main-content.no-scroll-page .page-content {
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

/* ── Topbar ──────────────────────────────────────────────────── */
#menuToggle { display: none; }
#menuToggle i, #menuToggle svg, #menuToggle * { pointer-events: none; }

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 200;
  gap: 12px;
  transition: background var(--transition);
}

.topbar-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-breadcrumb strong {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-spacer { flex: 1; }

/* Theme toggle */
.theme-toggle {
  width: 44px; height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 2px; left: 2px;
  transition: transform var(--transition), background var(--transition);
}
html.light .theme-toggle::after {
  transform: translateX(20px);
  background: var(--accent);
}
.theme-icon {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  font-size: 0.6rem;
  pointer-events: none;
}
.theme-icon.moon { left: 5px; color: var(--text-muted); }
.theme-icon.sun  { right: 5px; color: var(--text-muted); }

/* Topbar icon buttons */
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-muted);
  text-decoration: none;
}

/* Profile button in topbar */
.topbar-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.topbar-profile:hover {
  background: var(--bg-hover);
  border-color: var(--border-muted);
}
.topbar-profile .user-avatar { width: 28px; height: 28px; font-size: 0.7rem; }
.topbar-profile-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}
.topbar-profile-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--transition);
}
.topbar-profile.open .topbar-profile-arrow { transform: rotate(180deg); }

/* Profile dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 300;
  overflow: hidden;
  display: none;
}
.profile-dropdown.open { display: block; }

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.profile-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.profile-dropdown-item.danger { color: var(--red); }
.profile-dropdown-item.danger:hover { background: var(--red-dim); }

.profile-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* Flash alerts */
.flash-bar {
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideDown 0.3s ease, fadeOut 0.5s 3.5s forwards;
}
.flash-success { background: var(--green-dim); color: var(--green); border-bottom: 1px solid rgba(34,197,94,0.3); }
.flash-error   { background: var(--red-dim);   color: var(--red);   border-bottom: 1px solid rgba(239,68,68,0.3); }

@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeOut   { to   { opacity:0; height:0; padding:0; overflow:hidden; } }

/* ── Page content ────────────────────────────────────────────── */
.page-content {
  padding: 28px 28px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition);
}

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

.card-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 22px;
}

/* Stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.stat-card:hover {
  border-color: var(--border-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.accent::before  { background: var(--accent); }
.stat-card.teal::before    { background: var(--teal); }
.stat-card.blue::before    { background: var(--blue); }
.stat-card.red::before     { background: var(--red); }
.stat-card.green::before   { background: var(--green); }

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-icon {
  position: absolute;
  bottom: 16px; right: 20px;
  font-size: 2rem;
  opacity: 0.08;
}
.stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Progress bar */
.progress-bar-wrap {
  background: var(--bg-elevated);
  border-radius: 4px;
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
  transition: width 0.8s ease;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #000;
  box-shadow: var(--shadow-accent);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-muted);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-lg { padding: 11px 22px; font-size: 0.95rem; }

.btn i { font-size: 0.85em; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody tr:hover td { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-success { background: var(--green-dim); color: var(--green); }
.badge-danger  { background: var(--red-dim);   color: var(--red); }
.badge-info    { background: var(--blue-dim);  color: var(--blue); }
.badge-warning { background: var(--accent-dim); color: var(--accent); }
.badge-muted   { background: var(--bg-elevated); color: var(--text-muted); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: all var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: var(--bg-hover);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b95a5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 100px; }

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--accent);
}

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

/* ── Auth pages ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(245,158,11,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 70%, rgba(20,184,166,0.04) 0%, transparent 60%);
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.auth-logo-icon {
  width: 44px; height: 44px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 1.2rem;
}
.auth-logo-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.auth-heading {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.auth-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 24px 0;
}

/* ── FullCalendar v3 overrides — works in BOTH dark and light mode ──────── */

/* Calendar container */
.calendar-wrap {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: background var(--transition);
  /* Ensure week/day view can scroll — min-height allows FC to show full grid */
  min-height: 720px;
  overflow: visible;
}

/* ── FullCalendar theme integration ─────────────────────────────────────────
   Strategy: give cells an EXPLICIT background that switches with theme.
   Transparent cells are unreliable because FC injects inline styles.
   Event box colours come from the events API — NEVER overridden by theme.
─────────────────────────────────────────────────────────────────────────── */

/* FC container — no own background, let cells handle it */
#calendar,
.fc,
.fc-view-container,
.fc-view,
.fc-basic-view,
.fc-agenda-view,
.fc-month-view,
.fc-basicWeek-view,
.fc-basicDay-view,
.fc-agendaWeek-view,
.fc-agendaDay-view {
  background: transparent !important;
  color: var(--text-primary) !important;
}

/* ── CELL BACKGROUND — explicit, switches with theme ─────────────────── */
/* Dark mode (default): use --bg-elevated (#1e2229) */
.fc td,
.fc-unthemed td,
.fc-unthemed .fc-widget-content {
  background-color: #1e2229 !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
}

/* th / header row */
.fc th,
.fc-unthemed th,
.fc-unthemed .fc-widget-header {
  background-color: #252b34 !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
}

/* Light mode: warm off-white */
html.light .fc td,
html.light .fc-unthemed td,
html.light .fc-unthemed .fc-widget-content {
  background-color: #f0efe9 !important;
  border-color: #ccc9c0 !important;
  color: #1a1a1a !important;
}

html.light .fc th,
html.light .fc-unthemed th,
html.light .fc-unthemed .fc-widget-header {
  background-color: #e2dfd7 !important;
  border-color: #ccc9c0 !important;
  color: #333 !important;
}

/* Today highlight — amber in dark, strong blue in light */
.fc-today,
.fc-unthemed td.fc-today {
  background-color: rgba(243,148,24,0.18) !important;
  box-shadow: inset 0 0 0 2px #f39418 !important;
}
html.light .fc-today,
html.light .fc-unthemed td.fc-today {
  background-color: #dbeafe !important;
  box-shadow: inset 0 0 0 2px #2563eb !important;
}

/* Other-month days — slightly darker */
.fc-other-month {
  background-color: #181b20 !important;
}
html.light .fc-other-month {
  background-color: #e8e5dd !important;
}

/* Time axis (left column in week/day view) */
.fc-axis, .fc-unthemed .fc-axis {
  background-color: #252b34 !important;
  color: var(--text-muted) !important;
  border-color: var(--border-subtle) !important;
}
html.light .fc-axis,
html.light .fc-unthemed .fc-axis {
  background-color: #e2dfd7 !important;
  color: #555 !important;
}

/* ── Week/Day view scrollable ─────────────────────────────────────────── */
.fc-scroller {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

/* ── Event box colours — NEVER touched by theme ────────────────────────── */
.fc-event {
  opacity: 1 !important;
  filter: none !important;
}

/* Remove FullCalendar's white semi-transparent overlay on event time area */
.fc-event .fc-bg {
  background: transparent !important;
  background-color: transparent !important;
  opacity: 0 !important;
}

/* Event text: always white, no background of its own */
.fc-event .fc-title,
.fc-event .fc-content,
.fc-event .fc-time {
  color: #fff !important;
  background: transparent !important;
  background-color: transparent !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4) !important;
}

/* Toolbar */
.fc-toolbar {
  margin-bottom: 16px !important;
}

.fc-toolbar h2 {
  font-family: var(--font-head) !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
}

/* Toolbar buttons */
.fc-button,
.fc-button-group .fc-button {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-muted) !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-body) !important;
  font-size: 0.8rem !important;
  padding: 5px 10px !important;
  border-radius: var(--radius-sm) !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transition: all var(--transition) !important;
}

.fc-button:hover,
.fc-button-active,
.fc-button.fc-state-active,
.fc-button.fc-state-down {
  background: var(--accent-dim) !important;
  border-color: var(--border-accent) !important;
  color: var(--accent) !important;
}

/* Day headers (Mon, Tue…) */
.fc-day-header {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: var(--text-muted) !important;
  padding: 8px 0 !important;
  background: var(--bg-elevated) !important;
}

/* Day numbers */
.fc-day-number {
  color: var(--text-secondary) !important;
  font-size: 0.82rem !important;
}

/* Events */
.fc-event {
  border: none !important;
  border-radius: 4px !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  padding: 2px 6px !important;
  cursor: pointer !important;
  /* Event background/text color must NEVER be overridden by theme —
     FullCalendar sets these as inline styles from the API color property */
  opacity: 1 !important;
  filter: none !important;
}

/* Protect event title text — always white for readability on colored bg */
.fc-event .fc-title,
.fc-event .fc-content,
.fc-event .fc-time {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
}

/* Ensure the big .fc-unthemed td/th color override doesn't bleed into events */
.fc-event,
.fc-event *,
.fc-event:hover {
  color: #fff !important;
}

/* Content skeleton borders */
.fc-row .fc-content-skeleton td {
  border-color: var(--border-subtle) !important;
}

/* Agenda / week view time axis */
.fc-axis, .fc-time {
  color: var(--text-muted) !important;
  background: var(--bg-elevated) !important;
}

/* Popover */
.fc-popover {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-muted) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
}
.fc-popover .fc-header {
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
}

/* Light mode explicit overrides (in case FC injects inline styles) */
html.light .calendar-wrap {
  background: #f0eeea;
}
html.light .fc-day-header {
  background: #e8e6e0 !important;
}
html.light .fc-other-month {
  background: #ebe9e1 !important;
}
.fc-unthemed td.fc-today { background: var(--accent-dim) !important; }

/* Context menu */
.event-menu {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 9999;
  overflow: hidden;
  min-width: 160px;
  display: none;
}
.event-menu.open { display: block; }
.event-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 0.83rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.event-menu-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.event-menu-item.danger { color: var(--red); }
.event-menu-item.danger:hover { background: var(--red-dim); }
.event-menu-item i { width: 14px; text-align: center; font-size: 0.8rem; }
.event-menu-divider { height: 1px; background: var(--border-subtle); }

/* ── Chat ────────────────────────────────────────────────────── */
.chat-layout {
  display: flex;
  height: calc(100vh - var(--topbar-h) - 56px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.chat-contacts {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-contacts-header {
  padding: 16px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.chat-contacts-list { flex: 1; overflow-y: auto; }
.chat-contact {
  padding: 12px 16px;
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-contact:hover { background: var(--bg-hover); }
.chat-contact.active { background: var(--accent-dim); }
.chat-contact-name { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  overflow: hidden;
  min-height: 0; /* critical for flex children to scroll */
}
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0; /* critical — without this, flex child won't scroll */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.chat-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-bubble.sent {
  align-self: flex-end;
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 4px;
}
.chat-bubble.received {
  align-self: flex-start;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-subtle);
}
.chat-time {
  font-size: 0.68rem;
  opacity: 0.6;
  display: block;
  margin-top: 3px;
}
.chat-date-sep {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 8px 0;
}
.chat-input-row {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  background: var(--bg-surface);
}
.chat-input-row textarea {
  flex: 1;
  resize: none;
  height: 42px;
  line-height: 1.4;
}
.chat-send-btn {
  padding: 0 16px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
}
.chat-send-btn:hover { background: var(--accent-hover); }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.modal-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Scroll to top ───────────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 40px; height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  z-index: 100;
  font-size: 0.85rem;
  text-decoration: none;
}
.scroll-top:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  text-decoration: none;
}

/* ── DataTables override ─────────────────────────────────────── */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
}
.dataTables_wrapper .dataTables_info { color: var(--text-muted); font-size: 0.8rem; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 4px 8px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--accent-dim) !important;
  color: var(--accent) !important;
  border-color: var(--border-accent) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-muted) !important;
}

/* ── Responsive ──────────────────────────────────────────────── */
/* ── Sidebar overlay backdrop (mobile only) ──────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
}
.sidebar-backdrop.open { display: block; }

/* ── Mobile ≤ 768px ────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Topbar: span full viewport width, correct items visible */
  .topbar {
    left: 0 !important;
    right: 0 !important;
    padding: 0 8px !important;
    gap: 6px !important;
  }
  .topbar-spacer { display: none !important; }
  .topbar-breadcrumb {
    flex: 1 !important;
    min-width: 0;
    overflow: hidden;
  }
  .topbar-breadcrumb strong {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .topbar-profile-name { display: none !important; }
  #menuToggle { display: flex !important; flex-shrink: 0; order: -1; }
  #sidebarClose { display: block !important; }

  /* Sidebar */
  .sidebar { transform: translateX(-100%) !important; z-index: 400; }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 32px rgba(0,0,0,0.4);
  }

  /* Main content */
  .main-content { margin-left: 0 !important; padding-top: var(--topbar-h) !important; }
  .page-content { padding: 14px 10px !important; }

  /* Forms */
  .form-row-2, .form-row-3 { grid-template-columns: 1fr !important; }

  /* Stat cards */
  .stat-cards { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }

  /* Tables scroll */
  .table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }

  /* Calendar toolbar */
  .fc-toolbar { flex-wrap: wrap !important; gap: 4px !important; justify-content: center !important; }
  .fc-toolbar .fc-left,
  .fc-toolbar .fc-center,
  .fc-toolbar .fc-right { float: none !important; margin: 0 !important; }
  .fc-button, .fc-button-group .fc-button {
    font-size: 0.72rem !important;
    padding: 3px 7px !important;
  }

  /* Page header stacks */
  .page-header { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; }
  .page-actions { flex-wrap: wrap !important; gap: 6px !important; }

  /* Cards */
  .card-body { padding: 14px 10px !important; }
  .card-header { padding: 12px 12px !important; flex-wrap: wrap !important; gap: 8px !important; }

  /* Chat */
  .chat-layout { flex-direction: column !important; height: auto !important; }
  .chat-contacts { width: 100% !important; max-height: 200px !important; border-right: none !important; border-bottom: 1px solid var(--border-subtle); }
  .chat-area { flex: 1; }

  /* Session card */
  .session-card { flex-direction: column !important; }

  /* Modals */
  .modal-box {
    margin: 6px !important;
    width: calc(100vw - 12px) !important;
    max-width: none !important;
    max-height: 90vh !important;
    overflow-y: auto;
  }
}

/* ── Very small (≤ 420px) ── */
@media (max-width: 420px) {
  .stat-cards { grid-template-columns: 1fr !important; }
  .topbar { padding: 0 6px !important; gap: 4px !important; }
  .btn { font-size: 0.78rem !important; padding: 6px 10px !important; }
  .proposal-card { min-width: 160px !important; max-width: 220px !important; }
}

/* Chat mobile open/close handled in main 768px block */

/* ── Profile page mobile ─────────────────────────────────── */


/* ── Chat viewer / admin mobile ──────────────────────────── */


@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .page-content { padding: 12px 8px; }
  .card-body { padding: 14px; }
  .topbar-btn { width: 34px; height: 34px; }
  .btn { font-size: 0.8rem; padding: 7px 12px; }
  .chat-contacts { max-height: 180px; }
  .topbar-breadcrumb strong { font-size: 0.85rem; }
}

/* ── Utility ─────────────────────────────────────────────────── */
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--text-muted); }
.text-success  { color: var(--green); }
.text-danger   { color: var(--red); }
.text-info     { color: var(--blue); }
.text-center   { text-align: center; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 28px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

/* ── FullCalendar forced overrides — nuclear option ───────────────────────
   FullCalendar v3 style.css sets background:#fff on many elements.
   We use !important on every relevant rule to win the specificity war.
   Theme switching is also handled via the JS MutationObserver in calendar.ejs
─────────────────────────────────────────────────────────────────────────── */
.fc-unthemed .fc-divider,
.fc-unthemed .fc-list-heading td,
.fc-unthemed .fc-list-view,
.fc-unthemed .fc-popover,
.fc-unthemed .fc-row,
.fc-unthemed tbody,
.fc-unthemed td,
.fc-unthemed th,
.fc-unthemed thead,
.fc-unthemed .fc-widget-content,
.fc-unthemed .fc-widget-header {
  background: transparent !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
}

/* fc-content inside cells (NOT events) */
.fc-unthemed td > .fc-content,
.fc-unthemed th > .fc-content {
  color: var(--text-primary) !important;
}

.fc-unthemed .fc-today {
  background: var(--accent-dim) !important;
}

.fc-unthemed .fc-other-month {
  background: rgba(0,0,0,0.12) !important;
}

html.light .fc-unthemed .fc-other-month {
  background: rgba(0,0,0,0.04) !important;
}

/* Agenda/week view time slots */
.fc-unthemed .fc-slats td,
.fc-unthemed .fc-minor td {
  background: transparent !important;
  border-color: var(--border-subtle) !important;
}

/* Make time labels readable */
.fc-unthemed .fc-axis {
  color: var(--text-muted) !important;
  background: var(--bg-elevated) !important;
  border-color: var(--border-subtle) !important;
}

/* The main calendar background wrapper */
.fc-view-container,
.fc-view,
.fc-basicWeek-view,
.fc-basicDay-view,
.fc-agendaWeek-view,
.fc-agendaDay-view,
.fc-month-view {
  background: transparent !important;
}

/* ── Custom colour picker swatch select ──────────────────────── */
.color-select-wrap { position: relative; }
.color-select-wrap select { display: none; }

.color-swatch-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
  width: 100%;
  text-align: left;
  transition: all var(--transition);
}
.color-swatch-btn:hover { border-color: var(--accent); }

.color-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
}

.color-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.color-dropdown.open { display: block; }

.color-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: background var(--transition);
}
.color-option:hover { background: var(--bg-hover); color: var(--text-primary); }
.color-option.selected { background: var(--accent-dim); color: var(--accent); }

/* ── Table / list avatar cell — always circular ──────────────── */
.user-av-cell {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  font-family: var(--font-head);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border-accent);
}
.user-av-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.av-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}

/* ── Upcoming Session Card ────────────────────────────────────── */
.session-card {
  background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(245,158,11,0.3);
}

html.light .session-card {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
  box-shadow: 0 8px 32px rgba(30,64,175,0.25);
}

.session-card::before {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
}
.session-card::after {
  content: '';
  position: absolute;
  right: 60px; bottom: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 10px;
}

.session-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.session-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
}

.session-remaining {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.15);
  padding: 3px 10px;
  border-radius: 20px;
}

.session-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  z-index: 1;
  flex-shrink: 0;
}

.btn-join {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.95);
  color: #1e40af;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 150ms;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.btn-join:hover {
  background: #fff;
  color: #1e40af;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
html:not(.light) .btn-join { color: var(--accent); }
html:not(.light) .btn-join:hover { color: #d97706; }

.btn-msg-session {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 150ms;
}
.btn-msg-session:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 600px) {
  .session-card { padding: 18px 20px; }
  .session-title { font-size: 1.2rem; }
  .session-actions { width: 100%; flex-direction: row; align-items: center; }
}
/* ── Attendance-locked calendar events ──────────────────────── */
.fc-event-locked {
  opacity: 0.75 !important;
  cursor: not-allowed !important;
}
.fc-event-locked::after {
  content: ' 🔒';
  font-size: 0.7em;
}

/* ── Lesson Proposal Chat Bubble ─────────────────────────────── */
.proposal-card {
  /* Always use a clean card look regardless of dark/light theme or bubble color */
  background: #1a1f27;
  border: 1.5px solid #f39418;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 220px;
  max-width: 300px;
  font-size: 0.85rem;
  color: #e8e6e0 !important; /* always readable text */
}
html.light .proposal-card {
  background: #ffffff;
  border-color: #f39418;
  color: #1c2126 !important;
}
.proposal-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f39418;
  margin-bottom: 6px;
}
.proposal-subject {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: #e8e6e0;
  font-weight: 600;
}
html.light .proposal-subject { color: #1c2126; }
.proposal-time {
  color: #a8a29e;
  font-size: 0.82rem;
  margin-bottom: 3px;
}
html.light .proposal-time { color: #555; }
.proposal-duration {
  color: #a8a29e;
  font-size: 0.8rem;
  margin-bottom: 8px;
}
html.light .proposal-duration { color: #666; }
.proposal-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.proposal-badge.pending   { background:rgba(245,158,11,0.25); color:#f59e0b; }
.proposal-badge.accepted  { background:rgba(34,197,94,0.25);  color:#4ade80; }
.proposal-badge.declined  { background:rgba(239,68,68,0.25);  color:#f87171; }
.proposal-badge.cancelled { background:rgba(156,163,175,0.25); color:#9ca3af; }
html.light .proposal-badge.accepted { color:#16a34a; }
html.light .proposal-badge.declined { color:#dc2626; }
.proposal-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:4px; }
