/* ============================================================
   Oxton Hotels — Main Stylesheet
   Professional, Apple/Hyra-inspired dark sidebar design
   Brand colour: Oxton Blue #005AC8
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --brand-purple: #005AC8;
  --brand-blue: #005AC8;
  --gradient: linear-gradient(135deg, #005AC8 0%, #1f7fe3 50%, #66b3ff 100%);
  --gradient-hover: linear-gradient(135deg, #005AC8 0%, #3399ff 100%);

  /* Sidebar */
  --sidebar-bg: #005AC8;
  --sidebar-width: 220px;
  --sidebar-collapsed: 64px;

  /* Surface colours */
  --bg-primary: #005AC8;
  --bg-secondary: rgba(255, 255, 255, 0.12);
  --bg-card: rgba(255, 255, 255, 0.14);
  --bg-card-hover: rgba(255, 255, 255, 0.2);
  --bg-hover: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.18);
  --border-active: rgba(255, 255, 255, 0.32);

  /* Text */
  --text-primary: #f8fbff;
  --text-secondary: rgba(248, 251, 255, 0.84);
  --text-muted: rgba(248, 251, 255, 0.6);

  /* Status */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* Prevent horizontal scrolling on mobile — users should only be able to scroll up/down,
     even if a nested element (table, wide card, etc.) would otherwise cause overflow. */
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
  /* Only allow vertical panning on touch devices so accidental horizontal swipes
     don't reveal content that has leaked past the viewport width. */
  touch-action: pan-y;
}

body.has-sidebar {
  background:
    radial-gradient(circle at top right, rgba(51,153,255,0.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(0,90,200,0.12), transparent 30%),
    var(--bg-primary);
}

.staff-logo-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--text-primary); }

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

ul, ol { list-style: none; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- Utility Classes ---------- */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-bg { background: var(--gradient); }

.hidden { display: none !important; }

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

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  overflow-x: hidden;
  transition: margin-left var(--transition-slow);
  width: calc(100% - var(--sidebar-width));
  position: relative;
  z-index: 1;
}

.page-content {
  padding: 32px 40px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition-slow);
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-logo img {
  width: 40px;
  height: auto;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  line-height: 1.2;
}

.sidebar-logo-text span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 2px; }

.nav-section {
  margin-bottom: 4px;
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 20px 4px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-section-toggle:hover { color: var(--text-secondary); }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: inherit;
  padding: 0;
  white-space: nowrap;
}

.nav-section-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  opacity: 0.5;
}
.nav-section-toggle[aria-expanded="false"] .nav-section-chevron {
  transform: rotate(-90deg);
}

.nav-section-items {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 1;
}
.nav-section-items.collapsed {
  max-height: 0;
  opacity: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(0, 90, 200, 0.12);
  color: var(--brand-blue);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient);
  border-radius: 0 2px 2px 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.nav-item:hover svg,
.nav-item.active svg {
  opacity: 1;
}

.nav-label { white-space: nowrap; }
.nav-separator { height: 1px; background: var(--border); margin: 8px 16px; }

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}

.sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ---------- Top Bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.clock {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ---------- Dashboard Banner ---------- */
.dashboard-banner {
  background: var(--gradient);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.dashboard-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.dashboard-banner::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: 80px;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.banner-greeting {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.banner-title {
  font-size: 28px;
  font-weight: 800;
  color: white;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.banner-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

/* ---------- Grid Layouts ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.col-span-2 { grid-column: span 2; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
  z-index: 1;
}

.card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.sessions-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.slot-role-list {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.slot-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.slot-role-pill.is-open {
  border-color: rgba(34,197,94,0.35);
  color: #86efac;
  background: rgba(34,197,94,0.08);
}

.slot-role-pill.is-booked {
  border-color: rgba(59,130,246,0.32);
  color: #bfdbfe;
  background: rgba(59,130,246,0.1);
}

.slot-role-pill.is-full {
  border-color: rgba(239,68,68,0.35);
  color: #fca5a5;
  background: rgba(239,68,68,0.08);
}

.slot-role-avatars {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
}

.slot-role-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.slot-role-avatar + .slot-role-avatar {
  margin-left: -6px;
}

.slot-role-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* In-game (Trello) booking marker — distinguishes Roblox tablet bookings from website bookings. */
.slot-role-avatar.is-ingame {
  position: relative;
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34,197,94,0.35);
}
.slot-role-avatar.is-ingame::after {
  content: "🎮";
  position: absolute;
  bottom: -6px;
  right: -6px;
  font-size: 9px;
  line-height: 1;
  background: #0b1220;
  border-radius: 50%;
  padding: 1px 2px;
  border: 1px solid rgba(34,197,94,0.6);
}

.schedule-slot-card.is-clickable {
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.schedule-slot-card.is-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.schedule-slot-card.is-expanded {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.slot-booking-details {
  margin: -2px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.slot-booking-role + .slot-booking-role {
  margin-top: 10px;
}

.slot-booking-role strong {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.slot-booking-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.slot-booking-member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Game Cards ---------- */
.game-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}

.game-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.game-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  position: relative;
  overflow: hidden;
}

.game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  opacity: 0.6;
}

.game-card-body {
  padding: 14px;
}

.game-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: var(--gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74, 0, 224, 0.35);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-full { width: 100%; justify-content: center; }

/* ---------- Progress Bar ---------- */
.progress-container { margin-top: 8px; }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* ---------- Stats Cards ---------- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-change {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(33, 150, 243, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-icon svg {
  width: 18px;
  height: 18px;
  color: var(--brand-blue);
}

/* ---------- Activity Heatmap ---------- */
.heatmap-container {
  overflow-x: auto;
  padding-bottom: 8px;
}

.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  gap: 3px;
  min-width: fit-content;
}

.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  transition: transform var(--transition);
  cursor: default;
}

.heatmap-cell:hover { transform: scale(1.4); }

.heatmap-cell[data-level="1"] { background: rgba(33, 150, 243, 0.25); }
.heatmap-cell[data-level="2"] { background: rgba(33, 150, 243, 0.45); }
.heatmap-cell[data-level="3"] { background: rgba(33, 150, 243, 0.70); }
.heatmap-cell[data-level="4"] { background: rgba(33, 150, 243, 0.92); }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  justify-content: flex-end;
}

.heatmap-legend-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* ---------- Tables ---------- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead tr {
  background: var(--bg-secondary);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 14px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* ---------- Rank Badges ---------- */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.rank-2 { background: linear-gradient(135deg, #9ca3af, #6b7280); color: white; }
.rank-3 { background: linear-gradient(135deg, #b45309, #92400e); color: white; }
.rank-default { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); }

/* ---------- User Row ---------- */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ---------- Sessions ---------- */
.session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all var(--transition);
  position: relative;
  z-index: 1;
}

.session-item:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.session-info { flex: 1; }

.session-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

.session-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.tag-training {
  background: rgba(0, 90, 200, 0.12);
  color: var(--brand-blue);
}

.tag-shift {
  background: rgba(0, 90, 200, 0.15);
  color: #3399ff;
}

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

.session-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.session-spots {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 18px;
}

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

.form-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
}

.form-input::placeholder { color: var(--text-muted); }

select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ---------- Quick Links ---------- */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.quick-link {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition);
}

.quick-link:hover {
  border-color: rgba(33, 150, 243, 0.35);
  background: rgba(33, 150, 243, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.quick-link-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-link-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

.quick-link-text { flex: 1; }

.quick-link-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-link-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---------- Assignments ---------- */
.assignment-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.assignment-item:last-child { border-bottom: none; }

.assignment-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.assignment-due {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ---------- Alerts / Flash Messages ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--success);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--warning);
}

/* ---------- Login Page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(74, 0, 224, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.login-logo img {
  height: 56px;
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 32px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Empty States ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.empty-state-icon svg {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 280px;
}

/* ---------- Badges / Pill ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-blue {
  background: rgba(33, 150, 243, 0.12);
  color: var(--brand-blue);
}

.badge-purple {
  background: rgba(74, 0, 224, 0.12);
  color: var(--brand-purple);
}

.badge-green {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.badge-orange {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.badge-red {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

/* ---------- Mobile Toggle (hamburger) ---------- */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    transition: transform var(--transition-slow);
  }

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

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .sidebar-toggle { display: flex; }

  .topbar {
    padding: 14px 20px;
  }

  .page-content {
    padding: 20px;
  }

  .dashboard-banner {
    padding: 24px 20px;
  }

  .banner-title {
    font-size: 22px;
  }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .col-span-2 { grid-column: span 1; }

  .sidebar-overlay {
    display: block;
  }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
}

/* ---------- Sidebar Overlay (mobile) ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ---------- Tooltip (optional) ---------- */
[data-tooltip] { position: relative; }

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 200;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ---------- Loading Spinner ---------- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---------- Toast Notifications ---------- */
.toast {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  max-width: 300px;
  animation: slideIn 0.3s ease;
}

.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }

.toast-fade {
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

/* ---------- Tabs ---------- */
.tab-btn {
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  transition: all 0.15s;
}

.tab-btn.active {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.sub-tab-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  transition: all 0.15s;
}

.sub-tab-btn.active {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* ---------- Misc ---------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* ---------- Document Library ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.doc-card { display: flex; flex-direction: column; gap: 0; }
.doc-icon { color: var(--brand-blue); margin-bottom: 14px; }
.doc-body { flex: 1; }
.doc-category-tag {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand-blue);
  background: rgba(51,153,255,0.1); padding: 3px 9px;
  border-radius: 20px; margin-bottom: 8px;
}
.doc-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.doc-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 12px; }
.doc-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 14px; }
.doc-actions { display: flex; gap: 8px; }

/* ---------- Warning button ---------- */
.btn-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.btn-warning:hover {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.page-content { animation: fadeIn 0.4s ease; }
.card { animation: fadeInUp 0.35s ease both; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }
.nav-item { animation: slideInLeft 0.3s ease both; }
.nav-item:nth-child(2) { animation-delay: 0.04s; }
.nav-item:nth-child(3) { animation-delay: 0.08s; }
.nav-item:nth-child(4) { animation-delay: 0.12s; }
.nav-item:nth-child(5) { animation-delay: 0.16s; }
.nav-item:nth-child(6) { animation-delay: 0.2s; }
.nav-item:nth-child(7) { animation-delay: 0.24s; }

/* Sidebar blue accent line */
.sidebar { border-right: 1px solid rgba(0, 90, 200, 0.1); }
.sidebar-logo { border-bottom: 1px solid rgba(0, 90, 200, 0.08); }

/* Active nav glow */
.nav-item.active { box-shadow: 0 0 12px rgba(0, 90, 200, 0.15); }

/* ---------- Feature Cards (Dashboard) ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(0, 90, 200, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--brand-blue);
}

.feature-icon svg { width: 20px; height: 20px; }

.feature-info { flex: 1; min-width: 0; }
.feature-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.feature-desc { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.feature-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 20px;
  background: rgba(0, 90, 200, 0.12);
  color: var(--brand-blue);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Rank tier colour accents */
.feature-card-management { border-color: rgba(245, 158, 11, 0.12); }
.feature-card-management:hover { border-color: rgba(245, 158, 11, 0.3); }
.feature-card-management .feature-icon { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.feature-badge-management { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.feature-card-corporate { border-color: rgba(139, 92, 246, 0.12); }
.feature-card-corporate:hover { border-color: rgba(139, 92, 246, 0.3); }
.feature-card-corporate .feature-icon { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.feature-badge-corporate { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }

.feature-card-executive { border-color: rgba(34, 197, 94, 0.12); }
.feature-card-executive:hover { border-color: rgba(34, 197, 94, 0.3); }
.feature-card-executive .feature-icon { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.feature-badge-executive { background: rgba(34, 197, 94, 0.12); color: #22c55e; }

.feature-card-vice { border-color: rgba(251, 191, 36, 0.12); }
.feature-card-vice:hover { border-color: rgba(251, 191, 36, 0.3); }
.feature-card-vice .feature-icon { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.feature-badge-vice { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }

.feature-card-chairman { border-color: rgba(239, 68, 68, 0.12); }
.feature-card-chairman:hover { border-color: rgba(239, 68, 68, 0.3); }
.feature-card-chairman .feature-icon { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.feature-badge-chairman { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

/* ---------- Form Styles (shared across new feature pages) ---------- */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 680px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Dashboard — Apple-inspired redesign
   ============================================================ */

/* Entrance animations */
@keyframes dash-fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero welcome card */
.dash-hero {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.08) 100%);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  margin-bottom: 28px;
  overflow: hidden;
  animation: dash-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.dash-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 75% 50%, rgba(51,153,255,0.14) 0%, transparent 65%);
  pointer-events: none;
}
.dash-hero-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.dash-hero-left { flex: 1; min-width: 0; }
.dash-hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: rgba(147,197,253,0.75);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.dash-hero-name {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1.1;
  margin: 0 0 10px;
}
.dash-hero-date {
  font-size: 14px;
  color: rgba(147,197,253,0.6);
  margin-top: 10px;
  font-weight: 400;
}
.dash-hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(51,153,255,0.4);
  box-shadow: 0 0 0 6px rgba(51,153,255,0.1);
  flex-shrink: 0;
  object-fit: cover;
}
.dash-hero-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(51,153,255,0.25);
  background: rgba(51,153,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(147,197,253,0.5);
}

.dash-greeting h1 {
  font-size: clamp(22px, 3.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.15;
  margin: 0 0 8px;
  word-break: break-word;
}
.dash-subtitle {
  font-size: 14px;
  color: rgba(147,197,253,0.65);
  font-weight: 400;
  margin-top: 4px;
}

.dash-rank-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #66b3ff;
  background: rgba(0,90,200,0.15);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(0,90,200,0.2);
}

/* Announcement banner */
.dash-announcement {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-blue);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
}
.dash-announcement-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-announcement-icon {
  flex-shrink: 0;
  color: var(--brand-blue);
}
.dash-announcement-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.dash-announcement-text strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 2px;
}
.dash-announcement-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}

/* Stats grid with icons */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
  animation: dash-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}
.dash-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.dash-stat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,90,200,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.dash-stat:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.dash-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.dash-stat-icon-blue   { background: rgba(0,90,200,0.12); color: #3399ff; }
.dash-stat-icon-purple { background: rgba(139,92,246,0.12); color: #a78bfa; }
.dash-stat-icon-green  { background: rgba(34,197,94,0.12);  color: #4ade80; }
.dash-stat-icon-orange { background: rgba(249,115,22,0.12); color: #fb923c; }
.dash-stat-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}
.dash-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.dash-stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Feature grid inside a section */
.dash-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.dash-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
}
.dash-feature:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
  transform: translateY(-2px);
}
.dash-feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
}
.dash-feature-icon svg {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
}
.dash-feature:hover .dash-feature-icon svg { color: var(--text-primary); }
.dash-feature-icon-blue { background: rgba(0,90,200,0.08); }
.dash-feature-icon-blue svg { color: #3399ff !important; }
.dash-feature-icon-purple { background: rgba(139,92,246,0.08); }
.dash-feature-icon-purple svg { color: #a78bfa !important; }
.dash-feature-icon-gold { background: rgba(245,158,11,0.08); }
.dash-feature-icon-gold svg { color: #fbbf24 !important; }

/* Dashboard sections */
.dash-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dash-section-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}
.dash-section-link {
  font-size: 13px;
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 500;
}
.dash-section-link:hover { text-decoration: underline; }
.dash-section-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Sessions list */
.dash-sessions-list { display: flex; flex-direction: column; gap: 0; }
.dash-session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.dash-session-item:last-child { border-bottom: none; }
.dash-session-avatar { border-radius: 50%; flex-shrink: 0; }
.dash-session-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.dash-session-info { flex: 1; min-width: 0; }
.dash-session-host { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.dash-session-time { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }
.dash-session-type {
  font-size: 11px;
  font-weight: 600;
  background: rgba(0,90,200,0.1);
  color: var(--brand-blue);
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Progress */
.dash-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.dash-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.dash-progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.dash-progress-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Assignment items */
.dash-assignment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}
.dash-assignment:last-child { border-bottom: none; }
.dash-assignment-done span:first-child { text-decoration: line-through; color: var(--text-muted); }
.dash-assignment-due {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.dash-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Bottom two-column layout for sessions + assignments */
.dash-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dash-bottom-grid .dash-section { margin-bottom: 0; }

/* Responsive two-column grid used inline in dashboard.html */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .dash-bottom-grid { grid-template-columns: 1fr; }
  .dash-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-features { grid-template-columns: repeat(3, 1fr); }
  .dash-hero { padding: 20px 18px; }
  .dash-hero-content {
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
  }
  .dash-hero-content .dash-greeting h1 {
    font-size: 22px;
    line-height: 1.2;
  }
  .dash-hero-avatar,
  .dash-hero-avatar-placeholder { width: 52px; height: 52px; flex-shrink: 0; }
  .dash-subtitle { font-size: 13px; }
}
@media (max-width: 480px) {
  .dash-features { grid-template-columns: repeat(2, 1fr); }
  .dash-hero { padding: 18px 16px; }
  .dash-hero-content {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 10px;
  }
  .dash-hero-avatar,
  .dash-hero-avatar-placeholder { width: 44px; height: 44px; }
  .dash-hero-content .dash-greeting h1 {
    font-size: 20px;
    line-height: 1.2;
  }
  .dash-subtitle { font-size: 12px; }
}

/* ── Sidebar: icon-only by default, expand on hover (desktop) ── */
@media (min-width: 769px) {
  .sidebar {
    width: var(--sidebar-collapsed);
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar:hover {
    width: var(--sidebar-width);
    z-index: 201;
  }
  .main-content {
    margin-left: var(--sidebar-collapsed) !important;
    width: calc(100% - var(--sidebar-collapsed)) !important;
    transition: none;
  }
  /* Center icons when sidebar is icon-only */
  .sidebar .nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  .sidebar:hover .nav-item {
    justify-content: flex-start;
    padding-left: 20px;
    padding-right: 20px;
  }
  .sidebar .nav-section-toggle {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  .sidebar:hover .nav-section-toggle {
    justify-content: space-between;
    padding-left: 20px;
    padding-right: 20px;
  }
  .sidebar .sidebar-logo {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  .sidebar:hover .sidebar-logo {
    justify-content: flex-start;
    padding-left: 20px;
    padding-right: 20px;
  }
  .sidebar .sidebar-footer {
    padding-left: 8px;
    padding-right: 8px;
    overflow: hidden;
  }
  .sidebar:hover .sidebar-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .sidebar .nav-label,
  .sidebar .sidebar-logo-text,
  .sidebar .nav-section-label,
  .sidebar .nav-section-chevron {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.18s ease, max-width 0.22s ease;
    white-space: nowrap;
  }
  .sidebar:hover .nav-label,
  .sidebar:hover .sidebar-logo-text,
  .sidebar:hover .nav-section-label,
  .sidebar:hover .nav-section-chevron {
    opacity: 1;
    max-width: 200px;
  }
  .sidebar .sidebar-footer .sidebar-avatar + div,
  .sidebar .sidebar-footer .sidebar-logout {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.18s ease, max-width 0.22s ease;
    white-space: nowrap;
  }
  .sidebar:hover .sidebar-footer .sidebar-avatar + div,
  .sidebar:hover .sidebar-footer .sidebar-logout {
    opacity: 1;
    max-width: 200px;
  }
}

/* ── Centred form card layout ── */
.form-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 16px;
}
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  margin-top: 24px;
}
.form-card h1, .form-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.form-card .form-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}
.form-card .form-group {
  margin-bottom: 20px;
}
.form-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-card input,
.form-card select,
.form-card textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  border-color: var(--brand-blue);
}
.form-card .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}
@media (max-width: 768px) {
  .form-card { padding: 24px 20px; }
}

/* ============================================================
   Accent colour override — injected per-user via <style> tag
   All accent elements fall back to --brand-blue if not set
   ============================================================ */
:root { --accent: var(--brand-blue); }

.btn-primary,
.btn.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}
.btn-primary:hover,
.btn.btn-primary:hover {
  filter: brightness(1.12);
}
.nav-item.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent) !important;
  color: var(--accent) !important;
}
.nav-item.active::before {
  background: var(--accent) !important;
}

/* Direct dashboard link in sidebar (no section wrapper) */
.nav-item-dashboard {
  margin: 8px 8px 4px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Warning revoked style */
.warning-revoked {
  opacity: 0.5;
  text-decoration: line-through;
}
.badge-revoked {
  background: rgba(100,100,100,0.15);
  color: #888;
}

/* Full-width table pages */
.table-page { width: 100%; }

/* ---------- Dashboard Quick Access Cards ---------- */
.dash-quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.15s ease;
  color: var(--text-primary);
}
.dash-quick-card:hover {
  border-color: var(--brand-blue);
  box-shadow: 0 4px 24px rgba(0,90,200,0.12);
  transform: translateY(-2px);
}
.dash-quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-quick-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.dash-quick-sub {
  font-size: 12px;
  color: var(--brand-blue);
  font-weight: 500;
}

/* ====================================================================
   Mobile / Tablet Optimisation
   Breakpoints: 768px (tablets/small screens), 480px (phones)
   ==================================================================== */

/* ---- Sidebar ---- */
@media (max-width: 768px) {
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 16px !important;
  }
  .page-header {
    padding: 16px 0 !important;
    margin-bottom: 16px !important;
  }
  .page-title {
    font-size: 20px !important;
  }
}

/* ---- Cards & Tables ---- */
@media (max-width: 768px) {
  .card {
    padding: 16px !important;
    border-radius: 12px !important;
  }
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 600px;
  }
  th, td {
    padding: 10px 12px !important;
    font-size: 13px !important;
  }
  /* Stack table rows on very small screens for simple tables */
  @media (max-width: 480px) {
    .table-stack tbody tr {
      display: block;
      border-bottom: 1px solid var(--border);
      padding: 10px 0;
    }
    .table-stack tbody td {
      display: flex;
      justify-content: space-between;
      padding: 4px 8px !important;
      border: none !important;
    }
    .table-stack tbody td::before {
      content: attr(data-label);
      font-weight: 600;
      color: var(--text-secondary);
      flex-shrink: 0;
      margin-right: 12px;
    }
    .table-stack thead { display: none; }
  }
}

/* ---- Buttons & Forms ---- */
@media (max-width: 480px) {
  .btn, button.btn {
    padding: 10px 14px !important;
    font-size: 13px !important;
  }
  .form-input, input, select, textarea {
    font-size: 16px !important; /* prevents zoom on iOS */
    padding: 10px 14px !important;
  }
  .form-card {
    padding: 16px !important;
    border-radius: 12px !important;
  }
}

/* ---- Sessions page ---- */
@media (max-width: 600px) {
  .tab-btn {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
  /* Session slot row: stack items vertically */
  .session-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  /* Capacity badges: allow wrap */
  .session-item .badge-row {
    flex-wrap: wrap;
  }
}

/* ---- Live chat widget ---- */
@media (max-width: 480px) {
  #chat-panel {
    width: 100vw !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 80vh !important;
  }
  #chat-toggle {
    bottom: 16px !important;
    right: 16px !important;
  }
}

/* ---- Notifications ---- */
@media (max-width: 600px) {
  .notif-panel {
    width: 95vw !important;
    right: 2.5vw !important;
    max-height: 70vh !important;
  }
}

/* ---- Leaderboard / Logs ---- */
@media (max-width: 600px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .stat-card {
    padding: 12px !important;
  }
}

/* ---- Dashboard stats ---- */
@media (max-width: 600px) {
  .dash-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
}

/* ---- Assignments page ---- */
@media (max-width: 600px) {
  .assign-row {
    padding: 14px !important;
  }
  .assign-row > div {
    flex-direction: column !important;
  }
}

/* ---- Profile / Settings header ---- */
@media (max-width: 600px) {
  .profile-header {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 12px !important;
  }
}

/* ---- General grid fixes ---- */
/* Use .mobile-stack-grid class on template elements that should go single-column on mobile */
@media (max-width: 600px) {
  .mobile-stack-grid {
    grid-template-columns: 1fr !important;
  }
}
