/* --- Theme: Light (Blue/White) --- default --- */
:root,
[data-theme="light"] {
  --bg: #eef3fb;
  --bg-elevated: #f5f9ff;
  --bg-tint: #dbeafe;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-text: #ffffff;
  --lime: #93c5fd;
  --border: #e2e8f0;
  --shadow: rgba(37, 99, 235, 0.08);
  --overlay: rgba(15, 23, 42, 0.35);
  --font: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --space: 1.5rem;
  --radius: 6px;
  /* Calendar --- darker for visibility */
  --schedule-bg: #c5daf6;
  --schedule-border: #90caf9;
  --schedule-header-color: #0f172a;
  --schedule-card-bg: #ffffff;
  --schedule-card-border: #64b5f6;
}

/* --- Theme: Dark --- */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --bg-tint: #1e3a5f;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-text: #ffffff;
  --border: #334155;
  --shadow: rgba(0, 0, 0, 0.2);
  --overlay: rgba(0, 0, 0, 0.6);
  --schedule-bg: #1e3a5f;
  --schedule-border: #334155;
  --schedule-header-color: #f1f5f9;
  --schedule-card-bg: #1e293b;
  --schedule-card-border: #475569;
}

/* --- Reset & base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  background: #eef3fb;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

/* --- Super admin layout & Header --- */
.super-shell {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  align-items: stretch;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1.25rem 2.5rem 0.75rem;
  border-bottom: 1px solid transparent;
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, rgba(248, 249, 252, 0.96), rgba(248, 249, 252, 0.9));
  backdrop-filter: blur(12px);
  z-index: 120;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
}

.menu-btn:hover {
  color: var(--accent);
}

.menu-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.logo {
  display: flex;
  flex-direction: column;
}

.logo-precision {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.logo-run {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  position: relative;
}

.logo-run::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 2rem;
  height: 2px;
  background: var(--accent);
}

.logo-with-img {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.super-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.super-header-greeting {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.super-header-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.super-header-search {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.45rem 0.75rem 0.45rem 0.9rem;
  background: #ffffff;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  min-width: 220px;
  max-width: 320px;
  box-shadow: 0 6px 18px rgba(148, 163, 184, 0.25);
}

.search-icon {
  font-size: 0.85rem;
  margin-right: 0.4rem;
  opacity: 0.75;
}

.search-input {
  border: none;
  outline: none;
  font-size: 0.8rem;
  flex: 1;
  background: transparent;
}

.super-header-icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.super-header-icon-btn:hover {
  background: var(--bg-tint);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(148, 163, 184, 0.5);
  transform: translateY(-1px);
}

/* Hide Super Admin greeting/search for non-superadmin accounts */
body:not(.is-superadmin) .super-header-text,
body:not(.is-superadmin) .super-header-search {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.1rem;
  transition: border-color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--bg-tint);
}

.theme-icon {
  display: none;
}

[data-theme="light"] .theme-icon-sun {
  display: none;
}

[data-theme="light"] .theme-icon-moon {
  display: inline;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: inline;
}

.login-link {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  border: 1px solid var(--accent);
  color: var(--accent-text);
  background: var(--accent);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-text);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* --- Side menu --- */
.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 2rem;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.side-menu.is-open {
  transform: translateX(0);
}

.menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1;
}

.menu-close:hover {
  color: var(--accent);
}

.menu-links {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu-links a,
.menu-links .menu-db-link {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 0;
}

.menu-links .menu-db-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
}

.menu-links .menu-db-link:hover {
  text-decoration: underline;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.menu-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* --- Main / Dashboard --- */
.main {
  flex: 1;
  padding: 1.25rem 1.5rem 1.5rem;
  min-width: 0;
}

.dashboard {
  max-width: 1480px;
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: flex-start;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-card {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(148, 163, 184, 0.28);
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.dashboard-card-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.dashboard-calendar .schedule-wrapper {
  margin-top: 0.6rem;
}

.dashboard-card.dashboard-calendar .schedule-wrapper {
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-card.dashboard-calendar .schedule-grid {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.analytics-toggle {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: #eff3ff;
  border: 1px solid #d1ddff;
}

.analytics-chip {
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.7rem;
  color: var(--text-muted);
}

.analytics-chip-active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.5);
}

.analytics-chart {
  margin-top: 0.25rem;
}

.chart-line {
  position: relative;
  height: 120px;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  overflow: hidden;
}

.chart-line-fill {
  position: absolute;
  inset: 0;
  transform-origin: left bottom;
  transform: scaleX(0);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(37, 99, 235, 0.55));
  clip-path: polygon(0% 80%, 15% 60%, 35% 70%, 50% 40%, 70% 55%, 85% 35%, 100% 45%, 100% 100%, 0% 100%);
  animation: chart-line-in 0.9s ease-out forwards;
}

@keyframes chart-line-in {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.chart-legend {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.legend-dot-reserved {
  background: #2563eb;
}

.dashboard-activity .activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.45rem;
  border-radius: 0.75rem;
  background: rgba(248, 250, 252, 0.9);
  font-size: 0.78rem;
  opacity: 0;
  transform: translateY(6px);
  animation: fade-in-up 0.4s ease forwards;
}

.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e0edff;
  color: #1d4ed8;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.activity-body {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  margin: 0 0 0.15rem;
}

.activity-meta {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.superadmin-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.superadmin-action-btn {
  border-radius: 0.9rem;
  border: 1px solid #e0e7ff;
  background: linear-gradient(135deg, #eff4ff, #ffffff);
  padding: 0.55rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.superadmin-action-btn .action-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.8rem;
}

.superadmin-action-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 28px rgba(148, 163, 184, 0.65);
  border-color: #2563eb;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #f9fafb;
}

.superadmin-action-btn:hover .action-icon {
  background: rgba(248, 250, 252, 0.1);
}

.superadmin-action-btn:active {
  transform: scale(0.97);
}

/* Non-admin (teacher/guest "Client UI"): hide admin dashboard elements,
   drop the sidebar's reserved space, and let the calendar go full width. */
body:not(.is-admin) .dashboard-grid {
  grid-template-columns: 1fr;
}

body:not(.is-admin) .dashboard-col-main,
body:not(.is-admin) .dashboard-activity,
body:not(.is-admin) .superadmin-actions,
body:not(.is-admin) .dashboard-analytics,
body:not(.is-admin) #adminLabUsageSection {
  display: none;
}

/* Was scoped to :not(.is-superadmin) before, which also shrank admin1/admin2's
   two-column dashboard layout. Client UI = non-admin, so scope to :not(.is-admin). */
body:not(.is-admin) .dashboard-col-right,
body:not(.is-admin) .dashboard-calendar {
  width: 100%;
}

/* Page head (title/sub/actions) is entirely dz-admin-only content --
   hide the whole wrapper for Client UI instead of leaving an empty gap. */
body:not(.is-admin) .dz-page-head {
  display: none;
}

/* Let the dashboard container use the full content width once the
   sidebar and admin columns are gone, instead of capping at 1480px. */
body:not(.is-admin) .dashboard {
  max-width: none;
}

.reserve-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.reserve-title {
  font-size: clamp(1.75rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
}

.reserve-desc {
  max-width: 420px;
  font-size: clamp(0.85rem, 2vw, 0.9rem);
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Admin: Lab usage summary */
.admin-lab-usage {
  margin-bottom: 1rem;
  padding: clamp(0.75rem, 2.2vw, 1rem);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 10px 26px rgba(148, 163, 184, 0.22);
  max-width: none;
  width: 100%;
}

.admin-section-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0 0 1rem 0;
  color: var(--text);
}

.lab-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(120px, 18vw, 180px), 1fr));
  gap: clamp(0.5rem, 1.4vw, 0.75rem);
  align-content: start;
}

.lab-usage-card {
  padding: clamp(0.6rem, 1.6vw, 0.75rem) clamp(0.7rem, 2vw, 0.9rem);
  border-radius: 0.75rem;
  background: #f5f9ff;
  border: 1px solid #e3edfd;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  transform: translateY(8px);
  animation: fade-in-up 0.45s ease forwards;
}

.lab-usage-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lab-usage-count {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.lab-usage-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lab-usage-empty {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.75rem 0.5rem;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.schedule-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Lab filter */
.lab-filter {
  position: relative;
}

.filter-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg);
  min-width: 180px;
  justify-content: space-between;
}

.filter-trigger:hover {
  border-color: var(--accent);
}

.filter-trigger[aria-expanded="true"] {
  border-color: var(--accent);
}

.filter-arrow {
  font-size: 0.6rem;
  transition: transform 0.2s;
}

.filter-trigger[aria-expanded="true"] .filter-arrow {
  transform: rotate(180deg);
}

.filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 2px;
  min-width: 180px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.25rem 0;
  z-index: 50;
  display: none;
}

.filter-dropdown.is-open {
  display: block;
}

.filter-dropdown [role="option"] {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  text-align: left;
  color: var(--text);
  background: none;
  cursor: pointer;
}

.filter-dropdown [role="option"]:hover,
.filter-dropdown [role="option"].selected {
  background: var(--bg-tint);
  color: var(--accent);
}

.admin-badge {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.login-link {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

/* --- User menu (avatar & dropdown) --- */
.user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: auto;
  height: auto;
  min-height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 0.25rem 0.85rem 0.25rem 0.25rem;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.user-menu-trigger:hover {
  background: var(--bg-tint);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.user-avatar {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-text);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

/* Name + role text shown next to the avatar in the header */
.dz-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
  min-width: 0;
  max-width: 140px;
}

.dz-user-meta .user-menu-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dz-user-meta .user-menu-role {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .dz-user-meta {
    display: none;
  }

  .user-menu-trigger {
    width: 2.25rem;
    height: 2.25rem;
    min-height: 0;
    padding: 0;
    gap: 0;
    justify-content: center;
  }
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px var(--shadow);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 350;
}

.user-menu-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-header {
  padding: 0.65rem 1rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

.user-menu-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-menu-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.user-menu-item {
  width: 100%;
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
}

.user-menu-item:hover {
  background: var(--bg-tint);
  color: var(--accent);
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.week-link {
  color: var(--text);
  padding: 0.25rem 0.5rem;
}

.week-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.week-range {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

/* Schedule grid --- darker for visibility */
.schedule-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0.75rem 0.5rem;
  background: var(--schedule-bg, rgba(0, 0, 0, 0.06));
  border: 1px solid var(--schedule-border, rgba(0, 0, 0, 0.12));
  border-radius: var(--radius);
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  grid-auto-rows: minmax(120px, auto);
  gap: 0;
  min-width: min(700px, 100%);
}

.schedule-day {
  display: flex;
  flex-direction: column;
  min-height: 120px;
  border-left: 1px solid var(--schedule-border, rgba(0, 0, 0, 0.12));
  border-top: 1px solid var(--schedule-border, rgba(0, 0, 0, 0.12));
  padding: 0 0.4rem 0.5rem;
}

.schedule-day:nth-child(7n + 1) {
  border-left: none;
}

.schedule-day:nth-child(-n + 7) {
  border-top: none;
}

.schedule-day.other-month .day-header .day-num,
.schedule-day.other-month .day-empty {
  opacity: 0.45;
}

.schedule-day.other-month .day-header .day-name {
  opacity: 0.5;
}

.day-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--schedule-border, rgba(0, 0, 0, 0.12));
  border-radius: 6px;
  padding-top: 0.35rem;
  padding-inline: 0.25rem;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.day-header .day-num {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--schedule-header-color, var(--text));
  display: block;
}

.day-header .day-name {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--schedule-header-color, var(--text));
  opacity: 0.9;
  margin-top: 0.15rem;
}

/* Date status colors */
.day-header.status-reserved {
  background: #3B82F6;
  color: #ffffff;
  border-color: rgba(15, 23, 42, 0.2);
}

.day-header.status-reserved .day-name,
.day-header.status-reserved .day-num {
  color: #ffffff;
}

.day-header.status-completed {
  background: #EF4444;
  color: #ffffff;
  border-color: rgba(15, 23, 42, 0.2);
}

.day-header.status-completed .day-name,
.day-header.status-completed .day-num {
  color: #ffffff;
}

.day-header.status-ongoing {
  background: #22C55E;
  color: #ffffff;
  border-color: rgba(15, 23, 42, 0.25);
}

.day-header.status-ongoing .day-name,
.day-header.status-ongoing .day-num {
  color: #ffffff;
}

/* Calendar day interactivity */
.schedule-day.day-available {
  cursor: pointer;
}

.schedule-day.day-available .day-header:hover {
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.schedule-day.day-available:active .day-header {
  transform: scale(0.97);
}

.schedule-day.day-blocked {
  cursor: not-allowed;
}

.schedule-day.day-past-empty .day-num,
.schedule-day.day-past-empty .day-name,
.schedule-day.day-past-empty .day-empty {
  opacity: 0.5;
}

/* Reservation cards in schedule */
.reservation-card {
  display: block;
  width: 100%;
  padding: 0.6rem 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  text-align: center;
  background: var(--schedule-card-bg, var(--bg-elevated));
  border: 1px solid var(--schedule-card-border, rgba(0, 0, 0, 0.14));
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.reservation-card:hover {
  border-color: var(--accent);
  background: var(--bg-tint);
  transform: scale(1.02);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
}

.reservation-card.is-ongoing {
  border-color: #22C55E;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.reservation-card .lab-badge {
  display: inline-block;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0.25rem;
  font-size: clamp(0.55rem, 1.8vw, 0.7rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: clamp(0.1rem, 1.2vw, 0.2rem) clamp(0.3rem, 2.2vw, 0.45rem);
  text-align: center;
  background: var(--accent);
  color: var(--accent-text);
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  border-radius: 999px;
}

.reservation-card .slot-teacher {
  font-weight: 600;
  display: block;
  color: var(--text);
}

.reservation-card .slot-time-range {
  font-size: 0.7rem;
  color: var(--text);
  opacity: 0.85;
}

.reservation-card .slot-grade-section {
  font-size: 0.7rem;
  opacity: 0.95;
  color: var(--text);
}

.reservation-card .slot-purpose {
  font-size: 0.7rem;
  color: var(--text);
  opacity: 0.9;
  margin-top: 0.2rem;
  word-break: break-word;
}

.reservation-card .card-actions {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.reservation-card .card-actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
}

.reservation-card .slot-teacher,
.reservation-card .slot-grade-section {
  word-break: break-word;
  overflow-wrap: break-word;
}

.slot-status-ongoing {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #22C55E;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  margin-left: auto;
  margin-right: auto;
}

.day-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.7rem;
  color: var(--schedule-header-color, var(--text));
  opacity: 0.85;
  font-style: italic;
  padding: 0.5rem 0.25rem;
  min-height: 3rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.footer-logo .logo-precision {
  font-size: 0.65rem;
}

.footer-logo .logo-run {
  font-size: 1.1rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-nav.social a {
  text-transform: uppercase;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom .legal {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.footer-bottom .legal a {
  color: var(--text-muted);
}

.footer-bottom .legal a:hover {
  color: var(--text);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.modal-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  max-width: 420px;
  width: min(420px, 92vw);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px var(--shadow);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1;
}

.modal-close:hover {
  color: var(--accent);
}

.modal-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.modal-body {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-content-wide {
  max-width: 520px;
  width: min(520px, 92vw);
  padding: 1.5rem;
}

/* Forms */
.form label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form textarea {
  resize: vertical;
  min-height: 60px;
}

.form-hint {
  font-size: 0.8rem;
  color: #dc2626;
  margin: -0.5rem 0 0.5rem;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  width: 100%;
  padding-right: 92px;
  margin-bottom: 0;
}

.password-field {
  margin-bottom: 1rem;
}

.pw-toggle {
  position: absolute;
  right: 10px;
  top: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.pw-toggle:hover {
  filter: brightness(1.05);
}

.pw-toggle:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1 1 140px;
  min-width: 140px;
}

.form-row .form-group label {
  display: block;
}

.form-row .form-group input,
.form-row .form-group select {
  margin-bottom: 0;
}

.form .modal-actions {
  margin-top: 1rem;
}

/* Prevent iOS Safari "zoom on focus" for login inputs (requires >= 16px font-size). */
#loginModal .form input {
  font-size: 16px;
}

/* --- Toast notifications --- */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 500;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  color: #0f172a;
  background: #e5e7eb;
  opacity: 0;
  transform: translateX(12px);
  animation: toast-in 0.18s ease-out forwards;
  pointer-events: auto;
  overflow-wrap: anywhere;
}

.toast-icon {
  font-size: 1.1rem;
}

.toast-message {
  flex: 1;
}

.toast-close {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.toast-success {
  background: #dcfce7;
  color: #166534;
  border-left: 4px solid #16a34a;
}

.toast-error {
  background: #fee2e2;
  color: #b91c1c;
  border-left: 4px solid #dc2626;
}

.toast-warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid #f59e0b;
}

.toast-hide {
  animation: toast-out 0.16s ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(12px) translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }

  to {
    opacity: 0;
    transform: translateX(12px) translateY(-4px);
  }
}

/* ========== Responsive ========== */
/* Safe area for notched devices */
@supports (padding: env(safe-area-inset-top)) {
  .header {
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
  }

  .footer {
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .modal {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }
}

@media (max-width: 1024px) {
  .header {
    padding: 1rem 1.5rem;
  }

  .header-left {
    gap: 0.75rem;
  }

  .logo-run {
    font-size: 1.25rem;
  }

  .main {
    padding: 1.25rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-lab-usage {
    padding: 0.85rem;
  }

  .admin-section-title {
    margin-bottom: 0.75rem;
  }

  .lab-usage-grid {
    gap: 0.6rem;
  }

  .lab-usage-card {
    padding: 0.65rem 0.75rem;
  }

  .lab-usage-count {
    font-size: 1.25rem;
  }

  .reserve-header {
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .schedule-grid {
    min-width: 700px;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
  }

  .dashboard-card.dashboard-calendar .schedule-grid {
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .footer {
    padding: 2rem 1.5rem 1rem;
  }

  .footer-inner {
    gap: 2rem;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 900px) {
  .reserve-header {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .reserve-desc {
    max-width: none;
  }

  .schedule-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .lab-filter {
    width: 100%;
  }

  .filter-trigger {
    min-width: 0;
    width: 100%;
  }

  .filter-dropdown {
    min-width: 100%;
    max-width: 100%;
  }

  .week-nav {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .schedule-grid {
    grid-template-columns: repeat(7, minmax(100px, 1fr));
    min-width: 700px;
  }

  .dashboard-card.dashboard-calendar .schedule-grid {
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .modal-content-wide {
    max-width: 90vw;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .header-left {
    flex-wrap: wrap;
    min-width: 0;
  }

  .logo {
    min-width: 0;
  }

  .logo-text {
    white-space: normal;
    line-height: 1.2;
  }

  .super-header-text {
    flex: 1 1 100%;
  }

  .super-header-greeting {
    font-size: 1rem;
  }

  .super-header-subtitle {
    font-size: 0.75rem;
  }

  .super-header-search {
    min-width: 160px;
    max-width: 100%;
    width: 100%;
  }

  .header-right .btn-primary {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
  }

  .header-right .login-link {
    font-size: 0.75rem;
  }

  .logo-precision {
    font-size: 0.65rem;
  }

  .logo-run {
    font-size: 1.1rem;
  }

  .logo-run::after {
    width: 1.5rem;
  }

  .logo-text {
    font-size: 0.9rem;
  }

  .logo-img {
    width: 36px;
    height: 36px;
  }

  .main {
    padding: 1rem;
  }

  .dashboard-card {
    padding: 0.95rem 1rem;
  }

  .reserve-title {
    font-size: 1.5rem;
  }

  .schedule-grid {
    min-width: 600px;
    grid-template-columns: repeat(7, minmax(85px, 1fr));
  }

  /* Dashboard calendar card: keep 7-day calendar layout, but allow it to shrink on phones */
  .dashboard-card.dashboard-calendar .schedule-wrapper {
    margin: 0;
  }

  .dashboard-card.dashboard-calendar .schedule-grid {
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .dashboard-card.dashboard-calendar .schedule-day {
    padding: 0 0.25rem 0.6rem;
  }

  .dashboard-card.dashboard-calendar .day-header {
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
  }

  .dashboard-card.dashboard-calendar .day-header .day-num {
    font-size: 1.5rem;
  }

  .schedule-day {
    padding: 0 0.35rem 0.75rem;
  }

  .day-header {
    font-size: 0.7rem;
  }

  .day-header .day-num {
    font-size: 1.75rem;
  }

  .day-header .day-name {
    font-size: 0.65rem;
  }

  .reservation-card {
    padding: 0.5rem 0.35rem;
    font-size: 0.7rem;
  }

  .reservation-card .slot-time-range,
  .reservation-card .slot-grade-section,
  .reservation-card .slot-purpose {
    font-size: 0.65rem;
  }

  .footer {
    padding: 1.5rem 1rem 1rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 1rem;
  }

  .modal {
    padding: 0.75rem;
    align-items: center;
    justify-content: center;
  }

  .modal-content,
  .modal-content-wide {
    padding: 1.25rem;
    max-height: calc(100vh - 2rem);
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .form-row .form-group {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

@media (max-width: 600px) {
  .header-right {
    gap: 0.5rem;
  }

  .theme-toggle {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .admin-badge {
    font-size: 0.65rem;
  }

  .week-range {
    font-size: 0.75rem;
    word-break: break-all;
  }

  .week-link {
    padding: 0.4rem 0.25rem;
    font-size: 0.75rem;
  }

  .schedule-grid {
    min-width: 504px;
    grid-template-columns: repeat(7, minmax(72px, 1fr));
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions .btn {
    flex: 1;
    min-width: 120px;
  }
}

/* Ultra-compact calendar (small + short): show color indicators only */
@media (max-width: 430px) and (max-height: 932px) {
  .day-header {
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
  }

  .day-header {
    font-size: 0.6rem;
  }

  .day-header .day-num {
    font-size: 1.15rem;
  }

  .day-header .day-name {
    font-size: 0.55rem;
  }

  .day-empty {
    display: none;
  }

  .reservation-card {
    padding: 0;
    margin-bottom: 0.25rem;
    height: 12px;
    border-radius: 6px;
  }

  .reservation-card>* {
    display: none !important;
  }

  .reservation-card.is-ongoing {
    border-color: #22C55E;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0.6rem 0.75rem;
  }

  .header-left {
    gap: 0.5rem;
  }

  .super-header-subtitle {
    display: none;
  }

  .super-header-greeting {
    font-size: 0.95rem;
  }

  .menu-btn .menu-label {
    font-size: 0.65rem;
  }

  .logo-precision {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
  }

  .logo-run {
    font-size: 1rem;
  }

  .logo-run::after {
    width: 1.25rem;
  }

  .logo-text {
    font-size: 0.8rem;
  }

  .logo-img {
    width: 32px;
    height: 32px;
  }

  .header-right .btn-primary {
    font-size: 0.65rem;
    padding: 0.45rem 0.6rem;
    letter-spacing: 0.05em;
  }

  .reserve {
    padding: 0;
  }

  .reserve-title {
    font-size: 1.35rem;
  }

  .reserve-desc {
    font-size: 0.8rem;
  }

  .filter-trigger {
    font-size: 0.75rem;
    padding: 0.45rem 0.6rem;
  }

  .schedule-wrapper {
    margin: 0;
    padding: 0 0.25rem;
  }

  .schedule-grid {
    min-width: 448px;
    grid-template-columns: repeat(7, minmax(64px, 1fr));
    gap: 0;
  }

  .dashboard-card.dashboard-calendar .schedule-grid {
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .dashboard-card.dashboard-calendar .day-header .day-num {
    font-size: 1.35rem;
  }

  .schedule-day {
    padding: 0 0.25rem 0.5rem;
    border-left-width: 1px;
  }

  .day-header {
    font-size: 0.65rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
  }

  .day-header .day-num {
    font-size: 1.5rem;
  }

  .day-header .day-name {
    font-size: 0.6rem;
  }

  .reservation-card {
    padding: 0.4rem 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.65rem;
  }

  .reservation-card .slot-teacher {
    font-size: 0.65rem;
  }

  .reservation-card .slot-time-range,
  .reservation-card .slot-grade-section,
  .reservation-card .slot-purpose {
    font-size: 0.6rem;
  }

  .reservation-card .card-actions .btn {
    padding: 0.2rem 0.35rem;
    font-size: 0.6rem;
  }

  .day-empty {
    font-size: 0.7rem;
  }

  .superadmin-actions-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    padding: 1rem 0.75rem;
  }

  .footer-logo .logo-precision {
    font-size: 0.6rem;
  }

  .footer-logo .logo-run {
    font-size: 1rem;
  }

  .footer-nav {
    gap: 1rem 2rem;
  }

  .footer-nav a {
    font-size: 0.75rem;
  }

  .footer-bottom {
    font-size: 0.75rem;
  }

  .footer-bottom .legal {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal {
    padding: 0.5rem;
    align-items: center;
    justify-content: center;
  }

  .modal-content,
  .modal-content-wide {
    padding: 1rem;
    border-radius: 6px;
    max-width: 100%;
  }

  .modal-close {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.35rem;
  }

  .modal-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .form label {
    font-size: 0.75rem;
  }

  .form input,
  .form select,
  .form textarea {
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .form .modal-actions {
    margin-top: 0.75rem;
    gap: 0.5rem;
  }

  .modal-actions .btn {
    min-width: 0;
    flex: 1 1 auto;
  }
}

/* Ultra-compact view (very small screens): keep text visible, just tighten spacing */
@media (max-width: 420px) and (max-height: 520px) {
  .admin-lab-usage {
    padding: 0.65rem;
  }

  .admin-section-title {
    margin-bottom: 0.6rem;
  }

  .lab-usage-grid {
    gap: 0.45rem;
  }

  .lab-usage-card {
    padding: 0.55rem 0.65rem;
  }

  .day-header {
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
  }

  .day-header {
    font-size: 0.6rem;
  }

  .day-header .day-num {
    font-size: 1.1rem;
  }

  .day-header .day-name {
    font-size: 0.55rem;
  }

  .reservation-card {
    padding: 0.3rem 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.6rem;
  }

  .reservation-card .slot-time-range,
  .reservation-card .slot-grade-section,
  .reservation-card .slot-purpose {
    font-size: 0.55rem;
  }
}

/* Touch-friendly minimum sizes */
@media (hover: none) and (pointer: coarse) {

  .menu-btn,
  .theme-toggle,
  .week-link,
  .filter-trigger {
    min-height: 44px;
  }

  .btn {
    min-height: 44px;
    padding: 0.65rem 1rem;
  }

  .reservation-card {
    min-height: 44px;
    padding: 0.65rem 0.5rem;
  }

  .modal-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ============================================================
   ANIMATION ENHANCEMENTS --- Canossa Lab Reservation System
   ============================================================ */

/* Page load: header slides down */
@keyframes header-drop {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  animation: header-drop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Logo bounce on load */
@keyframes logo-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }

  60% {
    transform: scale(1.05);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.logo-img {
  animation: logo-pulse 0.65s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Greeting text fade-slide */
@keyframes greeting-slide {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.super-header-greeting {
  animation: greeting-slide 0.5s 0.15s ease both;
}

.super-header-subtitle {
  animation: greeting-slide 0.5s 0.25s ease both;
}

/* Button ripple on click */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.22);
  border-radius: inherit;
  opacity: 0;
  transform: scale(0);
}

.btn:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition: transform 0s, opacity 0s;
}

/* Primary button hover lift */
.btn-primary {
  transition: background 0.2s, border-color 0.2s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.32);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: none;
}

/* Dashboard cards stagger in */
@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dashboard-card {
  animation: card-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dashboard-col-main .dashboard-card:nth-child(1) {
  animation-delay: 0.08s;
}

.dashboard-col-main .dashboard-card:nth-child(2) {
  animation-delay: 0.18s;
}

.dashboard-col-main .dashboard-card:nth-child(3) {
  animation-delay: 0.28s;
}

.dashboard-col-right .dashboard-card:nth-child(1) {
  animation-delay: 0.14s;
}

.dashboard-col-right .dashboard-card:nth-child(2) {
  animation-delay: 0.22s;
}

/* Superadmin action buttons: icon spin on hover */
.superadmin-action-btn .action-icon {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}

.superadmin-action-btn:hover .action-icon {
  transform: rotate(-10deg) scale(1.2);
}

/* Notification bell wiggle */
@keyframes bell-ring {

  0%,
  100% {
    transform: rotate(0);
  }

  15% {
    transform: rotate(14deg);
  }

  30% {
    transform: rotate(-12deg);
  }

  45% {
    transform: rotate(9deg);
  }

  60% {
    transform: rotate(-7deg);
  }

  75% {
    transform: rotate(4deg);
  }
}

#notificationBtn:hover span {
  display: inline-block;
  animation: bell-ring 0.6s ease;
}

/* Side menu: smooth slide + shadow */
.side-menu {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.side-menu.is-open {
  box-shadow: 8px 0 40px rgba(15, 23, 42, 0.18);
}

/* Menu links: stagger slide-in when menu opens */
@keyframes menu-link-in {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.side-menu.is-open .menu-links li {
  animation: menu-link-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.side-menu.is-open .menu-links li:nth-child(1) {
  animation-delay: 0.06s;
}

.side-menu.is-open .menu-links li:nth-child(2) {
  animation-delay: 0.11s;
}

.side-menu.is-open .menu-links li:nth-child(3) {
  animation-delay: 0.16s;
}

.side-menu.is-open .menu-links li:nth-child(4) {
  animation-delay: 0.21s;
}

.side-menu.is-open .menu-links li:nth-child(5) {
  animation-delay: 0.26s;
}

.side-menu.is-open .menu-links li:nth-child(6) {
  animation-delay: 0.31s;
}

.side-menu.is-open .menu-links li:nth-child(7) {
  animation-delay: 0.36s;
}

/* Menu link underline wipe */
.menu-links a,
.menu-links .menu-db-link {
  position: relative;
  transition: color 0.2s;
}

.menu-links a::after,
.menu-links .menu-db-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.menu-links a:hover::after,
.menu-links .menu-db-link:hover::after {
  width: 100%;
}

.menu-links .menu-db-link:hover {
  text-decoration: none;
  color: var(--accent);
}

/* Modal: scale-in entrance */
@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(18px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal.is-open .modal-content {
  animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Modal backdrop blur */
.modal-backdrop {
  backdrop-filter: blur(4px);
  transition: opacity 0.25s ease;
}

/* Form inputs glow on focus */
.form input,
.form select,
.form textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* Reservation cards: appear + hover lift */
@keyframes card-shimmer {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reservation-card {
  animation: card-shimmer 0.3s ease both;
  border-radius: 6px;
  transition: background 0.2s ease, border-color 0.2s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.22s ease;
}

.reservation-card:hover {
  transform: translateY(-2px) scale(1.025);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.reservation-card:active {
  transform: scale(0.98);
}

/* Ongoing reservation pulse */
@keyframes pulse-green {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5), 0 0 0 1px rgba(34, 197, 94, 0.35);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0), 0 0 0 1px rgba(34, 197, 94, 0.35);
  }
}

.reservation-card.is-ongoing {
  animation: pulse-green 2.2s ease infinite;
}

/* Day headers: hover float */
.day-header {
  transition: background-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.schedule-day.day-available .day-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.15);
}

/* Day number scale on hover */
.day-header .day-num {
  display: block;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.schedule-day.day-available:hover .day-header .day-num {
  transform: scale(1.12);
}

/* Filter dropdown: fade + slide */
@keyframes dropdown-open {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-dropdown.is-open {
  animation: dropdown-open 0.2s ease both;
}

.filter-dropdown [role="option"] {
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.filter-dropdown [role="option"]:hover {
  padding-left: 1.25rem;
}

/* User menu: pop in */
@keyframes user-menu-pop {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(-8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.user-menu-dropdown {
  transform-origin: top right;
}

.user-menu-dropdown.is-open {
  animation: user-menu-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.user-menu-item {
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
}

.user-menu-item:hover {
  padding-left: 1.35rem;
}

/* Admin badge subtle glow pulse */
@keyframes badge-glow {

  0%,
  100% {
    text-shadow: 0 0 6px rgba(37, 99, 235, 0);
  }

  50% {
    text-shadow: 0 0 12px rgba(37, 99, 235, 0.55);
  }
}

.admin-badge[style*="inline"] {
  animation: badge-glow 2.5s ease infinite;
}

/* Lab usage cards stagger */
.lab-usage-card:nth-child(1) {
  animation-delay: 0.05s;
}

.lab-usage-card:nth-child(2) {
  animation-delay: 0.12s;
}

.lab-usage-card:nth-child(3) {
  animation-delay: 0.19s;
}

.lab-usage-card:nth-child(4) {
  animation-delay: 0.26s;
}

.lab-usage-card:nth-child(5) {
  animation-delay: 0.33s;
}

.lab-usage-card:nth-child(6) {
  animation-delay: 0.40s;
}

/* Lab usage count pop */
@keyframes count-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  70% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.lab-usage-count {
  animation: count-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Schedule wrapper fade in */
@keyframes schedule-appear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.schedule-wrapper {
  animation: schedule-appear 0.5s 0.2s ease both;
}

/* Toast enhanced */
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(28px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(28px) scale(0.92);
  }
}

/* Hamburger hover scale */
.menu-btn {
  transition: color 0.2s, transform 0.2s;
}

.menu-btn:hover {
  transform: scale(1.1);
}

/* Styled scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Smooth theme toggle */
body,
.header,
.dashboard-card,
.side-menu,
.modal-content,
.filter-dropdown,
.user-menu-dropdown,
.reservation-card,
.schedule-wrapper,
.schedule-day,
.day-header,
.admin-lab-usage,
.lab-usage-card {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}


/* ============================================================
   CENTER TOAST --- Login / Logout full-screen notification
   ============================================================ */

/* Overlay: covers entire viewport with blurred backdrop */
.center-toast-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  box-sizing: border-box;
  padding: clamp(0.75rem, 3vw, 1.5rem);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: cto-overlay-in 0.3s ease both;
  cursor: pointer;
}

.center-toast-overlay.center-toast-hide {
  animation: cto-overlay-out 0.38s ease forwards;
}

@keyframes cto-overlay-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes cto-overlay-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* Card */
.center-toast-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1.1rem, 5vw, 3rem) clamp(1rem, 3vw, 1.5rem);
  border-radius: 1.25rem;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  min-width: 0;
  width: 100%;
  max-width: 420px;
  max-width: min(420px, 100%);
  max-height: min(560px, calc(100vh - 2rem));
  overflow: auto;
  animation: cto-card-in 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  cursor: default;
  box-sizing: border-box;
}

/* Safe-area padding for notched devices */
@supports (padding: env(safe-area-inset-top)) {
  .center-toast-overlay {
    padding-top: max(clamp(0.75rem, 3vw, 1.5rem), env(safe-area-inset-top));
    padding-right: max(clamp(0.75rem, 3vw, 1.5rem), env(safe-area-inset-right));
    padding-bottom: max(clamp(0.75rem, 3vw, 1.5rem), env(safe-area-inset-bottom));
    padding-left: max(clamp(0.75rem, 3vw, 1.5rem), env(safe-area-inset-left));
  }
}

/* Short screens: keep toast visible and easy to dismiss */
@media (max-height: 520px) {
  .center-toast-overlay {
    padding: 0.5rem;
  }

  .center-toast-card {
    max-height: calc(100vh - 1rem);
  }
}

/* Very small widths: ensure perfect centering and no clipping */
@media (max-width: 420px) {
  .center-toast-overlay {
    padding: 0.75rem;
  }

  .center-toast-card {
    max-width: none;
    width: 100%;
  }
}

.center-toast-overlay.center-toast-hide .center-toast-card {
  animation: cto-card-out 0.32s ease forwards;
}

@keyframes cto-card-in {
  from {
    opacity: 0;
    transform: scale(0.75) translateY(30px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes cto-card-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  to {
    opacity: 0;
    transform: scale(0.85) translateY(-20px);
  }
}

/* Color variants */
.center-toast-success {
  border-top: 4px solid #16a34a;
  background: linear-gradient(160deg, #f0fdf4 0%, #ffffff 60%);
}

.center-toast-error {
  border-top: 4px solid #dc2626;
  background: linear-gradient(160deg, #fff1f2 0%, #ffffff 60%);
}

.center-toast-warning {
  border-top: 4px solid #f59e0b;
  background: linear-gradient(160deg, #fffbeb 0%, #ffffff 60%);
}

.center-toast-info {
  border-top: 4px solid #2563eb;
  background: linear-gradient(160deg, #eff6ff 0%, #ffffff 60%);
}

/* Big icon */
.center-toast-icon-wrap {
  font-size: clamp(2.25rem, 7vw, 3rem);
  line-height: 1;
  animation: cto-icon-bounce 0.5s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cto-icon-bounce {
  from {
    transform: scale(0.4) rotate(-15deg);
    opacity: 0;
  }

  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Title */
.center-toast-title {
  margin: 0;
  font-size: clamp(1rem, 3.6vw, 1.2rem);
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  letter-spacing: 0.01em;
  animation: cto-text-in 0.4s 0.2s ease both;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Subtitle */
.center-toast-subtitle {
  margin: 0;
  font-size: clamp(0.78rem, 3vw, 0.9rem);
  color: #64748b;
  text-align: center;
  animation: cto-text-in 0.4s 0.28s ease both;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {

  .toast,
  .toast-hide,
  .center-toast-overlay,
  .center-toast-overlay.center-toast-hide,
  .center-toast-card,
  .center-toast-overlay.center-toast-hide .center-toast-card,
  .center-toast-icon-wrap,
  .center-toast-title,
  .center-toast-subtitle,
  .center-toast-bar {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive positioning for toasts on small screens */
@media (max-width: 520px) {
  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem;
    align-items: stretch;
  }

  .toast {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
}

/* Logout transition */
body.is-logging-out .super-shell {
  opacity: 0.4;
  filter: blur(1px);
  transition: opacity 0.18s ease, filter 0.18s ease;
}

@keyframes cto-text-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Progress bar --- shrinks left to right over 2.4s */
.center-toast-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  border-radius: 0 0 1.25rem 1.25rem;
  animation: cto-bar-shrink 2.4s linear forwards;
}

.center-toast-success .center-toast-bar {
  background: #16a34a;
}

.center-toast-error .center-toast-bar {
  background: #dc2626;
}

.center-toast-warning .center-toast-bar {
  background: #f59e0b;
}

.center-toast-info .center-toast-bar {
  background: #2563eb;
}

@keyframes cto-bar-shrink {
  from {
    transform: scaleX(1);
    transform-origin: left;
  }

  to {
    transform: scaleX(0);
    transform-origin: left;
  }
}

/* Dark theme support */
[data-theme="dark"] .center-toast-card {
  background: #1e293b;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .center-toast-success {
  background: linear-gradient(160deg, #052e16 0%, #1e293b 60%);
}

[data-theme="dark"] .center-toast-error {
  background: linear-gradient(160deg, #450a0a 0%, #1e293b 60%);
}

[data-theme="dark"] .center-toast-warning {
  background: linear-gradient(160deg, #451a03 0%, #1e293b 60%);
}

[data-theme="dark"] .center-toast-info {
  background: linear-gradient(160deg, #0c1a3a 0%, #1e293b 60%);
}

[data-theme="dark"] .center-toast-title {
  color: #f1f5f9;
}

[data-theme="dark"] .center-toast-subtitle {
  color: #94a3b8;
}

/* ============================================================
   Approve / Reject Modal (admin1 only)
   ============================================================ */
.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1rem 0;
  line-height: 1.5;
}

.approve-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.approve-filter-bar label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.approve-filter-select {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.approve-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.approve-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
  font-size: 0.9rem;
}

.approve-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color 0.2s;
}

.approve-item--pending {
  border-left: 4px solid #f59e0b;
}

.approve-item--approved {
  border-left: 4px solid #22c55e;
}

.approve-item--rejected {
  border-left: 4px solid #ef4444;
}

.approve-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.approve-item-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.approve-item-teacher {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.approve-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.approve-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Approve/Reject/Reset buttons */
.btn-approve {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-approve:hover {
  background: #15803d;
}

.btn-reject {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-reject:hover {
  background: #b91c1c;
}

.btn-reset-pending {
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  white-space: nowrap;
}

/* Status badges inside approve list */
.approve-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.approve-badge--pending {
  background: #fef3c7;
  color: #92400e;
}

.approve-badge--approved {
  background: #dcfce7;
  color: #166534;
}

.approve-badge--rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* Reservation card status badges (calendar) */
.res-status-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.res-status-pending {
  background: #fef3c7;
  color: #92400e;
}

.res-status-approved {
  background: #dcfce7;
  color: #166534;
}

.res-status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* Dark theme overrides */
[data-theme="dark"] .approve-badge--pending {
  background: #3b2a00;
  color: #fcd34d;
}

[data-theme="dark"] .approve-badge--approved {
  background: #052e16;
  color: #4ade80;
}

[data-theme="dark"] .approve-badge--rejected {
  background: #450a0a;
  color: #fca5a5;
}

[data-theme="dark"] .res-status-pending {
  background: #3b2a00;
  color: #fcd34d;
}

[data-theme="dark"] .res-status-approved {
  background: #052e16;
  color: #4ade80;
}

[data-theme="dark"] .res-status-rejected {
  background: #450a0a;
  color: #fca5a5;
}

[data-theme="dark"] .approve-filter-select {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}

[data-theme="dark"] .approve-item {
  background: #1e293b;
  border-color: #334155;
}

/* ============================================================
   ADMIN DASHBOARD (blue/white)
   Styles for the dz- prefixed structure in index.html.
   ============================================================ */

.dz-app {
  background: #eef3fb;
}

/* ---------- Sidebar (persistent on desktop, off-canvas on mobile) ---------- */
.dz-sidebar {
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.dz-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.dz-brand-mark {
  border-radius: 10px;
  object-fit: contain;
  background: var(--accent);
  padding: 4px;
}

.dz-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem;
}

.dz-nav {
  margin-top: 0 !important;
  gap: 0.2rem !important;
}

.dz-nav-link {
  display: block;
  border-radius: 0.6rem;
  padding: 0.55rem 0.75rem !important;
  font-size: 0.85rem !important;
  font-weight: 600;
  letter-spacing: 0 !important;
  color: var(--text-muted);
}

.dz-nav-link:hover {
  background: #eef4ff;
  color: var(--accent);
}

.dz-nav-link.is-active {
  background: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.dz-nav-link::after {
  display: none !important;
}

.dz-sidebar .menu-links .menu-db-link::after {
  display: none !important;
}

@media (min-width: 993px) {
  .dz-sidebar {
    position: sticky;
    top: 0;
    left: auto;
    height: 100vh;
    max-width: none;
    width: 264px;
    flex-shrink: 0;
    transform: none !important;
    transition: none;
    border-right: 1px solid var(--border);
    z-index: 10;
  }

  .dz-sidebar .menu-close {
    display: none;
  }

  #menuOverlay {
    display: none !important;
  }

  .menu-btn {
    display: none;
  }

  .dz-mobile-logo {
    display: flex;
  }
}

.dz-content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar search kbd + sr-only helper ---------- */
.dz-search-kbd {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #eef2fb;
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
}

.dz-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Page head ---------- */
.dz-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dz-page-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.dz-page-sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dz-page-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dz-page-actions .btn {
  border-radius: 999px;
}

/* ---------- KPI row ---------- */
.dz-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.dz-kpi {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 26px rgba(148, 163, 184, 0.22);
}

.dz-kpi-label {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dz-kpi-value {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
}

.dz-kpi-hint {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dz-kpi-dark {
  background: linear-gradient(155deg, var(--accent), var(--accent-hover));
  color: #ffffff;
}

.dz-kpi-dark .dz-kpi-label {
  color: rgba(255, 255, 255, 0.75);
}

.dz-kpi-dark .dz-kpi-value {
  color: #ffffff;
}

.dz-kpi-dark .dz-kpi-hint {
  color: var(--lime);
}

@media (max-width: 900px) {
  .dz-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .dz-kpi-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Bar chart (Reservation analytics) ---------- */
.dz-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 150px;
  padding: 0.5rem 0.25rem 0;
}

.dz-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  height: 100%;
  gap: 0.4rem;
}

.dz-bar {
  width: 60%;
  min-width: 14px;
  border-radius: 999px 999px 4px 4px;
  background: #e2e8f0;
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.dz-bar-col:nth-child(3) .dz-bar,
.dz-bar-col:nth-child(4) .dz-bar {
  background: linear-gradient(180deg, var(--lime), var(--accent-hover));
}

.dz-bar-col span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------- Reminder card ---------- */
.dz-reminder-title {
  margin: 0.2rem 0 0.15rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.dz-reminder-time {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dz-reminder-btn {
  border-radius: 999px;
  width: 100%;
}

/* ---------- Reservation list ---------- */
.dz-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dz-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.15rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.dz-list-item:last-child {
  border-bottom: none;
}

.dz-list-item div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.dz-list-item strong {
  font-size: 0.82rem;
}

.dz-list-item span {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dz-list-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.75rem 0;
}

.dz-pill {
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dz-pill-run {
  background: #dcfce7;
  color: #166534;
}

.dz-pill-done {
  background: #dbeafe;
  color: var(--accent);
}

.dz-pill-pend {
  background: #fef3c7;
  color: #92400e;
}

/* ---------- Team collaboration ---------- */
.dz-team {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dz-team-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dz-team-item div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dz-team-item strong {
  font-size: 0.83rem;
}

.dz-team-item span {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dz-avatar-sm {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  flex-shrink: 0;
}

/* ---------- Progress gauge ---------- */
.dz-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0 0.75rem;
}

.dz-gauge-svg {
  width: 100%;
  max-width: 220px;
}

.dz-gauge-value {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.dz-gauge-value span {
  font-size: 1.7rem;
}

.dz-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dz-legend li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dz-legend strong {
  color: var(--text);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.dot-done {
  background: var(--accent);
}

.dot-run {
  background: #22c55e;
}

.dot-pend {
  background: #f59e0b;
}

/* ---------- Time tracker ---------- */
.dz-tracker {
  background: radial-gradient(circle at 85% 15%, rgba(147, 197, 253, 0.28), transparent 55%),
    linear-gradient(155deg, var(--accent), var(--accent-hover));
  color: #ffffff;
}

.dz-tracker .dashboard-card-header h2 {
  color: #ffffff;
}

.dz-tracker-label {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.9;
}

.dz-tracker-clock {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.dz-tracker-meta {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--lime);
}

/* ---------- Bottom row (Team / Progress / Tracker) ---------- */
.dz-bottom-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 1024px) {
  .dz-bottom-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .dz-bottom-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Hide admin-only dashboard widgets from teacher accounts ---------- */
body:not(.is-admin) .dz-admin-only {
  display: none !important;
}
/* Admin dashboard: hide the reservation calendar (teachers still see it) */
body.is-admin #reserveSection,
body.is-admin .dashboard-calendar {
  display: none !important;
}
/* ---------- Accent alignment (blue/white throughout) ---------- */
.analytics-chip-active {
  color: var(--accent);
}

.activity-icon {
  background: #dbeafe;
  color: var(--accent);
}

.legend-dot-reserved {
  background: var(--accent);
}

.superadmin-action-btn .action-icon {
  background: var(--accent);
}

.superadmin-action-btn:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
}

.super-header-search:focus-within {
  border-color: var(--accent);
}

.btn {
  border-radius: 999px;
}

.reservation-modal .btn,
.modal .btn {
  border-radius: var(--radius);
}

/* ---------- Canossa top-left branding ---------- */
.dz-topbar .dz-mobile-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.75rem;
}

.dz-topbar .dz-mobile-logo .logo-text {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.dz-topbar .dz-mobile-logo .logo-img {
  width: 42px;
  height: 42px;
}

@media (max-width: 768px) {
  .dz-topbar .dz-mobile-logo .logo-text {
    font-size: 0.9rem;
  }

  .dz-topbar .dz-mobile-logo .logo-img {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .dz-topbar .dz-mobile-logo .logo-text {
    font-size: 0.8rem;
  }

  .dz-topbar .dz-mobile-logo .logo-img {
    width: 32px;
    height: 32px;
  }
}

/* ============================================================
   ADMIN SETTINGS + BURGER SIDEBAR (2026-08-25)
   The administrator navigation is intentionally off-canvas on
   every screen size. The hamburger is the single entry point.
   ============================================================ */
.dz-sidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: min(300px, 88vw) !important;
  max-width: 88vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  padding: 1.5rem !important;
  transform: translateX(-105%) !important;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), box-shadow .28s ease !important;
  z-index: 1200 !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: none;
  overflow-y: auto;
}

.dz-sidebar.is-open {
  transform: translateX(0) !important;
  box-shadow: 12px 0 40px rgba(15, 23, 42, .18);
}

.dz-sidebar .menu-close {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .7rem;
  background: var(--bg-tint);
  right: 1rem;
  top: 1rem;
}

.menu-overlay {
  z-index: 1190 !important;
}

.menu-btn.dz-admin-only {
  display: inline-flex !important;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 3px 12px rgba(15, 23, 42, .06);
}

.menu-btn.dz-admin-only:hover {
  background: var(--bg-tint);
}

.nav-icon {
  width: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex: 0 0 1.35rem;
}

.dz-nav-link {
  display: flex !important;
  align-items: center;
  gap: .7rem;
}

/* Settings page/card */
.admin-settings-panel {
  width: 100%;
  margin-top: 1.25rem;
  scroll-margin-top: 7rem;
}

.settings-header {
  align-items: flex-start;
  padding-bottom: 1.15rem;
}

.settings-title-row {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
}

.settings-title-row h2 {
  margin: 0;
}

.settings-title-row p {
  margin: .25rem 0 0;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
}

.settings-main-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: .85rem;
  background: var(--accent);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .2);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.settings-card {
  display: flex;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: .9rem;
  background: var(--bg-elevated);
}

.settings-card-icon {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 2.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .7rem;
  background: var(--bg-tint);
  font-size: 1rem;
}

.settings-card-body {
  min-width: 0;
  flex: 1;
}

.settings-card-body h3 {
  margin: 0;
  font-size: .95rem;
}

.settings-card-body p {
  margin: .2rem 0 .8rem;
  color: var(--text-muted);
  font-size: .78rem;
}

.settings-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

.settings-action-btn {
  min-height: 2.45rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: var(--bg-elevated);
  color: var(--text);
  text-align: left;
  font-size: .78rem;
  font-weight: 650;
  transition: border-color .18s, background .18s, color .18s, transform .18s;
}

.settings-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-tint);
  transform: translateY(-1px);
}

.settings-action-btn .action-icon {
  margin-right: .35rem;
}

.settings-danger-card {
  border-color: rgba(220, 38, 38, .2);
}

.settings-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.45rem;
  padding: .55rem .85rem;
  border: 1px solid rgba(220, 38, 38, .28);
  border-radius: .65rem;
  background: rgba(220, 38, 38, .06);
  color: #b91c1c;
  font-weight: 700;
}

.settings-logout-btn:hover {
  background: rgba(220, 38, 38, .11);
}

@media (max-width: 760px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-action-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   SIGN-IN / SIGN-OUT LOTTIE OVERLAY
   ========================================================= */
.lottie-event-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at center, rgba(37, 99, 235, .12), rgba(15, 23, 42, .72));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .35s ease, visibility .35s ease;
}

.lottie-event-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lottie-event-card {
  width: min(430px, 100%);
  min-height: 430px;
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98));
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .45), 0 12px 30px rgba(37, 99, 235, .18);
  transform: translateY(30px) scale(.94);
  transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}

.lottie-event-overlay.is-open .lottie-event-card {
  transform: translateY(0) scale(1);
}

.lottie-event-animation {
  width: min(270px, 75vw);
  height: min(270px, 75vw);
  margin-bottom: .5rem;
}

.lottie-event-animation svg {
  width: 100% !important;
  height: 100% !important;
}

#lottieEventTitle {
  margin: .5rem 0;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: #0f172a;
}

#lottieEventMessage {
  margin: 0;
  max-width: 32ch;
  font-size: .95rem;
  line-height: 1.6;
  color: #64748b;
}

body.is-showing-lottie-event {
  overflow: hidden;
}

@media (max-width:480px) {
  .lottie-event-card {
    min-height: 380px;
    padding: 1.5rem;
  }

  .lottie-event-animation {
    width: 220px;
    height: 220px;
  }
}


/* Teacher/user menu sign-out action */
.user-menu-logout {
  margin-top: .25rem;
  border-top: 1px solid rgba(148, 163, 184, .22);
  color: #dc2626;
}

.user-menu-logout:hover {
  background: rgba(254, 226, 226, .72);
  color: #b91c1c;
}

.user-menu-logout span[aria-hidden="true"] {
  font-size: 1rem;
  line-height: 1;
}
/* ---------- Hamburger: Super admin controls ---------- */
.menu-admin-panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0 0.15rem;
}
.menu-admin-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.menu-admin-btn:hover {
  border-color: var(--accent);
  background: var(--bg-tint);
  color: var(--accent);
}
.menu-admin-btn .nav-icon {
  flex: 0 0 1.35rem;
  width: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu-admin-btn-danger {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.06);
  color: #b91c1c;
}
.menu-admin-btn-danger:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.45);
  color: #991b1b;
}
.dz-sidebar .dz-nav-label {
  margin: 1rem 0 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* GUEST FRONT PAGE: force calendar visible */
body:not(.is-admin) #reserveSection,
body:not(.is-admin) .dashboard-calendar {
  display: block !important;
  visibility: visible !important;
  width: 100% !important;
  max-width: none;
}

body:not(.is-admin) .dashboard-col-right {
  display: flex !important;
  flex-direction: column;
  width: 100% !important;
}

body:not(.is-admin) .dashboard-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
}

body:not(.is-admin) .schedule-wrapper {
  display: block !important;
  visibility: visible !important;
  width: 100%;
  overflow-x: auto;
}

body:not(.is-admin) .schedule-grid {
  display: grid !important;
  visibility: visible !important;
  min-height: 360px;
}

body:not(.is-admin) .dashboard-card.dashboard-calendar {
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(148, 163, 184, 0.28);
  padding: 1rem;
  margin-top: 0.5rem;
}

/* Admin still hides calendar */
body.is-admin #reserveSection,
body.is-admin .dashboard-calendar {
  display: none !important;
}

/* ============================================================
   LIST HEIGHT CAPS — keep these LAST so they always win
   Recent activity: 3 visible rows, rest scroll
   Reservation list: 6 visible rows, rest scroll
   ============================================================ */
#recentActivityList.activity-list,
.dashboard-activity .activity-list {
  max-height: calc(3 * 3.65rem + 2 * 0.5rem) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

#recentActivityList.activity-list::-webkit-scrollbar,
.dashboard-activity .activity-list::-webkit-scrollbar {
  width: 6px;
}

#recentActivityList.activity-list::-webkit-scrollbar-thumb,
.dashboard-activity .activity-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

#recentActivityList .activity-item,
.dashboard-activity .activity-item {
  flex: 0 0 auto;
  min-height: 3.65rem;
  box-sizing: border-box;
}

#reservationList.dz-list {
  max-height: calc(6 * 3.4rem + 5 * 0.5rem) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

#reservationList.dz-list::-webkit-scrollbar {
  width: 6px;
}

#reservationList.dz-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

#reservationList .dz-list-item {
  flex: 0 0 auto;
  min-height: 3.4rem;
  box-sizing: border-box;
}