/* ==========================================================
   HYPERSCHEDULE — App-Specific Styles
   ========================================================== */

/* ── SIDEBAR EXTRAS ── */
.sidebar.mobile-open {
  display: flex !important;
  position: fixed;
  inset-y: 0;
  left: 0;
  z-index: 50;
  width: 260px !important;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 49;
}
.mobile-overlay.visible { display: block; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  transition: background 0.1s ease;
  cursor: pointer;
  overflow: hidden;
}
.sidebar-user:hover { background: var(--glass-bg); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; transition: opacity 0.14s ease; }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }
.sidebar-user-name { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.sidebar-user-role { display: block; font-size: 11px; color: var(--silver-600); white-space: nowrap; }

/* Location Menu — fixed-positioned so it escapes sidebar overflow clip */
.location-menu {
  position: fixed;
  z-index: 9999;
  width: 232px;   /* matches sidebar inner width (260 - 28px padding) */
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
}
.location-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.location-menu-inner {
  background: var(--sidebar-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.location-menu-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-body);
}
.location-menu-item:hover { background: var(--glass-bg); }
.location-menu-item span:first-child { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.location-sub { font-size: 11px; color: var(--silver-600); }

/* Topbar Date */
.topbar-date { font-size: 13px; color: var(--silver-500); margin-right: 8px; display: none; }
@media (min-width: 768px) { .topbar-date { display: block; } }

/* ── DASHBOARD ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  padding: 20px;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--silver-500);
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi-icon svg { width: 16px; height: 16px; }

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.kpi-sub {
  font-size: 12px;
  color: var(--silver-600);
  margin-bottom: 12px;
}

.kpi-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.55s cubic-bezier(0.25,0.1,0.25,1);
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  margin-top: 8px;
}
.dash-section-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.dash-section-link { font-size: 12px; color: var(--primary-400); transition: color 0.1s ease; }
.dash-section-link:hover { color: var(--primary-300); }

/* Today's Schedule */
.today-schedule {
  overflow: hidden;
}

.today-dive-header {
  display: grid;
  grid-template-columns: 80px 100px repeat(4, 1fr);
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
}
.today-dive-header span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--silver-600);
}

.today-dive-row {
  display: grid;
  grid-template-columns: 80px 100px repeat(4, 1fr);
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--glass-border);
  align-items: center;
  transition: background 0.15s;
}
.today-dive-row:last-child { border-bottom: none; }
.today-dive-row:hover { background: var(--glass-bg); }

.dive-time-col { font-size: 13px; font-weight: 600; font-family: var(--font-mono); color: var(--primary-300); }
.dive-type-col { font-size: 11px; color: var(--silver-600); }
.dive-staff-col { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.dive-staff-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 11px;
  font-weight: 500;
  color: var(--silver-300);
}

/* Hours Summary */
.hours-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--glass-border);
}
.hours-row:last-child { border-bottom: none; }
.hours-name { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.hours-bar-wrap { flex: 1; height: 4px; background: var(--glass-bg-md); border-radius: 2px; overflow: hidden; min-width: 80px; }
.hours-bar-inner { height: 100%; border-radius: 2px; transition: width 0.55s cubic-bezier(0.25,0.1,0.25,1); }
.hours-num {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--silver-400);
  min-width: 40px;
  text-align: right;
}

/* Cert Alerts */
.cert-alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
.cert-alert-item:last-child { margin-bottom: 0; }
.cert-urgency-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cert-info { flex: 1; }
.cert-emp-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.cert-type { font-size: 11px; color: var(--silver-600); }
.cert-days { font-size: 11px; font-weight: 700; font-family: var(--font-mono); }

/* Availability Coverage */
.avail-coverage-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.avail-coverage-label { font-size: 12px; color: var(--silver-500); min-width: 60px; }
.avail-coverage-track { flex: 1; height: 6px; background: var(--glass-bg-md); border-radius: 3px; overflow: hidden; }
.avail-coverage-fill { height: 100%; border-radius: 3px; background: var(--primary-500); transition: width 0.55s cubic-bezier(0.25,0.1,0.25,1); }
.avail-coverage-pct { font-size: 11px; font-weight: 700; font-family: var(--font-mono); color: var(--silver-500); min-width: 32px; text-align: right; }

/* Activity Feed */
.activity-feed {
  padding: 0;
  overflow: hidden;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.15s;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--glass-bg); }

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-icon svg { width: 15px; height: 15px; }

.activity-text { flex: 1; }
.activity-main { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.activity-main strong { color: var(--text-primary); font-weight: 600; }
.activity-time { font-size: 11px; color: var(--silver-600); margin-top: 2px; }

/* Gen AI note */
.gen-ai-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.15);
  font-size: 12px;
  color: var(--silver-400);
  line-height: 1.6;
}

/* ── SCHEDULE PAGE ── */
.schedule-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 6px 8px;
}

.week-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  color: var(--silver-400);
  transition: color 0.1s ease, background 0.1s ease;
  cursor: pointer;
  font-family: var(--font-body);
}
.week-nav-btn:hover { color: var(--text-primary); background: rgba(128,128,128,0.12); }
.week-nav-btn svg { width: 16px; height: 16px; }

.week-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 8px;
  min-width: 180px;
  text-align: center;
}

.schedule-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Schedule table scroll wrapper */
.schedule-table-wrap {
  background: var(--glass-bg);
}

/* Schedule Grid Table */
.schedule-grid-wrap {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.24);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 900px;
}

.schedule-table th {
  padding: 10px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.schedule-table th.day-header {
  text-align: center;
  border-left: 1px solid var(--glass-border);
  padding: 8px;
}
.schedule-table th.name-header { text-align: left; padding-left: 16px; }
.schedule-table th.hrs-header { text-align: center; min-width: 52px; }

.schedule-table td {
  padding: 0;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
}

.table-emp-cell {
  padding: 8px 12px 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  cursor: pointer;
  transition: background 0.15s;
  border-right: 1px solid var(--glass-border);
  position: sticky;
  left: 0;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 5;
}
.table-emp-cell:hover { background: var(--glass-bg); }

.table-emp-name { font-size: 12px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }

.assignment-cell {
  text-align: center;
  padding: 8px 4px;
  border-left: 1px solid var(--glass-border);
  min-width: 60px;
  cursor: pointer;
  transition: background 0.15s;
}
.assignment-cell:hover { background: rgba(10,110,245,0.04); }
.assignment-cell.weekend-cell { background: rgba(255,255,255,0.01); }
.assignment-cell.unavail-bg { background: rgba(239,68,68,0.04); }

.hrs-cell {
  text-align: center;
  padding: 8px;
  border-left: 1px solid var(--glass-border);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--silver-500);
  min-width: 52px;
}

/* .slot-time-header removed \u2014 definition consolidated into css/global.css (Refinement #3) */
.slot-time { font-size: 9px; font-family: var(--font-mono); color: var(--silver-700); font-weight: 500; }

.schedule-table tr:hover td { background: var(--glass-bg); }
.schedule-table tr:hover .table-emp-cell { background: var(--glass-bg-md); }

/* Schedule Controls */
.sched-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  flex-wrap: wrap;
}

/* Violation Panel */
.violation-panel {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  background: rgba(239,68,68,0.04);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  display: none;
}
.violation-panel.has-violations { display: block; }
.violation-title { font-size: 12px; font-weight: 700; color: var(--error); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.violation-list { display: flex; flex-direction: column; gap: 6px; }
.violation-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--silver-400); }
.violation-item-icon { width: 16px; height: 16px; color: var(--error); flex-shrink: 0; margin-top: 1px; }

/* ── AVAILABILITY PAGE ── */
.avail-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.avail-day-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.1s ease;
}
.avail-day-card:hover { border-color: var(--glass-border-strong); }

.avail-day-header {
  padding: 12px;
  border-bottom: 1px solid var(--glass-border);
  text-align: center;
  background: var(--glass-bg);
}
.avail-day-name { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--silver-500); margin-bottom: 4px; }
.avail-day-num  { font-size: 20px; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 6px; }

.avail-all-day-btn {
  display: block;
  width: 100%;
  padding: 5px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
  text-align: center;
  border: 1px solid transparent;
}
.avail-btn-available   { background: rgba(16,185,129,0.1);   color: #34D399; border-color: rgba(16,185,129,0.2); }
.avail-btn-unavailable { background: rgba(239,68,68,0.12);   color: #FCA5A5; border-color: rgba(239,68,68,0.2);  }
.avail-btn-preferred   { background: rgba(245,158,11,0.1);   color: #FCD34D; border-color: rgba(245,158,11,0.2); }

.avail-slots { padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; }

.avail-slot-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.09s ease, border-color 0.09s ease;
  border: 1px solid var(--glass-border);
  background: transparent;
  font-family: var(--font-body);
  width: 100%;
}
.avail-slot-btn:hover { background: rgba(255,255,255,0.04); }
.avail-slot-time { font-size: 11px; font-weight: 600; font-family: var(--font-mono); color: var(--silver-400); }
.avail-slot-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.avail-slot-btn.status-available   { border-color: rgba(16,185,129,0.2); background: rgba(16,185,129,0.05); }
.avail-slot-btn.status-unavailable { border-color: rgba(239,68,68,0.2);  background: rgba(239,68,68,0.05);  }
.avail-slot-btn.status-preferred   { border-color: rgba(245,158,11,0.2); background: rgba(245,158,11,0.05); }

.avail-slot-btn.status-available   .avail-slot-status { background: var(--success); }
.avail-slot-btn.status-unavailable .avail-slot-status { background: var(--error); }
.avail-slot-btn.status-preferred   .avail-slot-status { background: var(--warning); }

/* ── AI ASSISTANT PAGE ── */
.ai-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  height: calc(100vh - 64px - 56px);
  overflow: hidden;
}

.ai-chat-panel {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.ai-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
  flex-shrink: 0;
}

.ai-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
}
.ai-model-claude { background: rgba(200,162,255,0.1); color: #C8A2FF; border-color: rgba(200,162,255,0.2); }
.ai-model-gemini { background: rgba(10,110,245,0.1);  color: var(--primary-300); border-color: rgba(10,110,245,0.2); }

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: scaleIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.ai-message-user {
  flex-direction: row-reverse;
}

.ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}
.ai-avatar-ai { background: linear-gradient(135deg, rgba(200,162,255,0.2), rgba(10,110,245,0.2)); color: #C8A2FF; border: 1px solid rgba(200,162,255,0.2); }
.ai-avatar-user { background: linear-gradient(135deg, var(--primary-500), var(--accent-600)); color: #fff; }

.ai-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.65;
}
.ai-bubble-ai {
  background: var(--glass-bg-md);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
}
.ai-bubble-user {
  background: var(--primary-500);
  color: #fff;
  border-radius: var(--radius-lg) 4px var(--radius-lg) var(--radius-lg);
}
.ai-bubble p { margin-bottom: 8px; }
.ai-bubble p:last-child { margin-bottom: 0; }
.ai-bubble strong { color: inherit; font-weight: 600; }
.ai-bubble ul { padding-left: 16px; margin-top: 6px; }
.ai-bubble li { margin-bottom: 4px; }

.ai-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
}
.ai-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--silver-500);
  animation: pulse 1.2s ease-in-out infinite;
}
.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

.ai-input-area {
  border-top: 1px solid var(--glass-border);
  padding: 16px;
  background: var(--glass-bg);
  flex-shrink: 0;
}
.ai-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.ai-input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  resize: none;
  max-height: 120px;
  min-height: 42px;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}
.ai-input::placeholder { color: var(--silver-600); }
.ai-input:focus { border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(10,110,245,0.15); }

.ai-send-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-lg);
  background: var(--primary-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
  font-family: var(--font-body);
  border: none;
}
.ai-send-btn:hover { background: var(--primary-400); transform: scale(1.05); }
.ai-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.ai-send-btn svg { width: 18px; height: 18px; }

.ai-quick-prompts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ai-quick-btn {
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--silver-400);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  font-family: var(--font-body);
  white-space: nowrap;
}
.ai-quick-btn:hover { background: rgba(10,110,245,0.1); color: var(--primary-300); border-color: rgba(10,110,245,0.2); }

/* AI Sidebar */
.ai-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

/* ── STAFF PAGE ── */
.staff-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.staff-card {
  padding: 20px;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.34,1.2,0.64,1), border-color 0.12s ease, box-shadow 0.14s ease;
}
.staff-card:hover { transform: translateY(-3px); border-color: var(--glass-border-strong); }

.staff-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.staff-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.staff-name-block { flex: 1; }
.staff-full-name { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.staff-category { font-size: 11px; color: var(--silver-600); text-transform: capitalize; }

.staff-certs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cert-tag {
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.staff-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--silver-600);
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

/* ── REPORTS PAGE ── */
.chart-card {
  padding: 24px;
}
.chart-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.chart-sub   { font-size: 12px; color: var(--silver-600); margin-bottom: 20px; }
.chart-canvas-wrap { position: relative; }

/* ── SETTINGS PAGE ── */
.settings-section {
  margin-bottom: 32px;
}
.settings-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--silver-500);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  gap: 16px;
}
.settings-item:last-child { border-bottom: none; }
.settings-item-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.settings-item-desc  { font-size: 12px; color: var(--silver-600); margin-top: 2px; }
.settings-item-right { flex-shrink: 0; }

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--glass-bg-md);
  border-radius: 12px;
  transition: background 0.15s ease, border-color 0.15s ease;
  border: 1px solid var(--glass-border);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--silver-400);
  border-radius: 50%;
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
}
.toggle input:checked + .toggle-slider { background: var(--primary-500); border-color: var(--primary-600); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

/* Rule Set Display */
.rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--glass-border);
}
.rule-item:last-child { border-bottom: none; }
.rule-name { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.rule-desc { font-size: 11px; color: var(--silver-600); margin-top: 2px; }
.rule-value {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary-300);
  flex-shrink: 0;
}
.rule-value.hard { color: var(--error); }
.rule-value.soft { color: var(--warning); }

/* ── AUTH PAGES ── */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-orb-1 {
  position: fixed;
  width: 500px; height: 500px;
  top: -100px; left: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10,110,245,0.35), transparent 70%);
  filter: blur(80px);
  animation: orbFloat 10s ease-in-out infinite;
}
.auth-orb-2 {
  position: fixed;
  width: 400px; height: 400px;
  bottom: -100px; right: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,0.28), transparent 70%);
  filter: blur(80px);
  animation: orbFloat 12s ease-in-out infinite reverse;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 10;
  animation: scaleIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.auth-logo-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-600));
  display: flex; align-items: center; justify-content: center;
}
.auth-logo-icon svg { width: 22px; height: 22px; color: #fff; }
.auth-logo-text { font-size: 20px; font-weight: 800; background: linear-gradient(135deg, #fff, var(--silver-300)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-title { font-size: 24px; font-weight: 800; color: var(--text-primary); text-align: center; margin-bottom: 6px; letter-spacing: -0.02em; }
.auth-sub { font-size: 14px; color: var(--silver-500); text-align: center; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--silver-600); }
.auth-footer a { color: var(--primary-400); transition: color 0.2s; }
.auth-footer a:hover { color: var(--primary-300); }

/* ── NOTIFICATIONS PAGE ── */
.notif-list { display: flex; flex-direction: column; gap: 0; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--glass-bg); }
.notif-item.unread { background: rgba(10,110,245,0.06); }
.notif-icon-wrap { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-icon-wrap svg { width: 16px; height: 16px; }
.notif-body { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.notif-desc  { font-size: 12px; color: var(--silver-500); line-height: 1.5; }
.notif-time  { font-size: 11px; color: var(--silver-700); margin-top: 4px; }
.notif-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-500); flex-shrink: 0; margin-top: 4px; }

/* ── RESPONSIVE ADJUSTMENTS ── */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-layout { grid-template-columns: 1fr; }
  .ai-sidebar-panel { display: none; }
}

@media (max-width: 900px) {
  .schedule-table th.name-header { min-width: 120px; }
  .avail-week-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .today-dive-header, .today-dive-row { grid-template-columns: 70px 80px 1fr 1fr; }
  .avail-week-grid { grid-template-columns: repeat(2, 1fr); }
  .staff-grid { grid-template-columns: 1fr; }
}

/* ── INLINE-STYLE ELEMENT OVERRIDES (theme-aware via global select/input) ── */
/* Any select/input/textarea with inline dark backgrounds gets overridden by type selectors */
select, input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], input[type="number"], textarea {
  background: var(--input-bg);
  color: var(--text-primary);
  border-color: var(--input-border);
}
select option {
  background: var(--sidebar-bg);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════
   LIGHT THEME — APP.CSS OVERRIDES
   All dark-only rgba(255,255,255,...) values and hardcoded
   colours need light-mode counterparts for full visibility.
   ═══════════════════════════════════════════════════════ */

/* Dashboard */
html.light .kpi-label           { color: var(--silver-600); }
html.light .kpi-value           { color: var(--silver-900); }
html.light .kpi-sub             { color: var(--silver-500); }
html.light .kpi-bar             { background: rgba(0,0,0,0.08); }
html.light .dash-section-title  { color: var(--silver-800); }
html.light .today-dive-header   { background: rgba(0,0,0,0.03); }
html.light .today-dive-header span { color: var(--silver-600); }
html.light .today-dive-row      { border-color: rgba(0,0,0,0.06); }
html.light .today-dive-row:hover { background: rgba(0,0,0,0.02); }
html.light .dive-time-col       { color: var(--primary-600); }
html.light .dive-type-col       { color: var(--silver-500); }
html.light .dive-staff-pill     { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.09); color: var(--silver-700); }
html.light .hours-name          { color: var(--silver-700); }
html.light .hours-bar-wrap      { background: rgba(0,0,0,0.08); }
html.light .hours-num           { color: var(--silver-600); }
html.light .cert-emp-name       { color: var(--silver-800); }
html.light .cert-type           { color: var(--silver-500); }
html.light .avail-coverage-label { color: var(--silver-600); }
html.light .avail-coverage-track { background: rgba(0,0,0,0.08); }
html.light .avail-coverage-pct  { color: var(--silver-600); }
html.light .activity-item:hover { background: rgba(0,0,0,0.02); }
html.light .activity-main       { color: var(--silver-700); }
html.light .activity-main strong { color: var(--silver-900); }
html.light .activity-time       { color: var(--silver-500); }
html.light .cert-alert-item     { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.07); }
html.light .gen-ai-note         { color: var(--silver-600); }

/* Schedule */
html.light .schedule-table th   { background: rgba(0,0,0,0.03); color: var(--silver-600); }
html.light .schedule-table td   { border-color: rgba(0,0,0,0.05); }
html.light .table-emp-cell      { background: rgba(255,255,255,0.97); border-right-color: rgba(0,0,0,0.07); }
html.light .table-emp-cell:hover { background: rgba(0,0,0,0.02); }
html.light .table-emp-name      { color: var(--silver-800); }
html.light .assignment-cell     { border-color: rgba(0,0,0,0.05); }
html.light .assignment-cell.weekend-cell { background: rgba(0,0,0,0.02); }
html.light .sched-status-bar    { background: rgba(0,0,0,0.02); }
html.light .week-nav            { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.09); }
html.light .week-nav-btn        { color: var(--silver-600); }
html.light .week-nav-btn:hover  { background: rgba(0,0,0,0.07); color: var(--silver-900); }
html.light .week-label          { color: var(--silver-800); }
html.light .hrs-cell            { color: var(--silver-600); }
html.light .slot-time           { color: var(--silver-500); }
html.light .violation-item      { color: var(--silver-700); }
html.light .schedule-grid-wrap  { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }

/* Availability */
html.light .avail-day-card      { background: #FFFFFF; border-color: rgba(0,0,0,0.08); }
html.light .avail-day-header    { background: rgba(0,0,0,0.02); }
html.light .avail-day-name      { color: var(--silver-500); }
html.light .avail-day-num       { color: var(--silver-900); }
html.light .avail-slot-btn      { border-color: rgba(0,0,0,0.09); }
html.light .avail-slot-btn:hover { background: rgba(0,0,0,0.03); }
html.light .avail-slot-time     { color: var(--silver-600); }
html.light .avail-btn-available   { background: rgba(16,185,129,0.10); color: #059669; border-color: rgba(16,185,129,0.25); }
html.light .avail-btn-unavailable { background: rgba(239,68,68,0.10);  color: #DC2626; border-color: rgba(239,68,68,0.25); }
html.light .avail-btn-preferred   { background: rgba(245,158,11,0.10); color: #D97706; border-color: rgba(245,158,11,0.25); }

/* Staff */
html.light .staff-card          { background: #FFFFFF; }
html.light .staff-full-name     { color: var(--silver-900); }
html.light .staff-category      { color: var(--silver-500); }
html.light .staff-meta          { color: var(--silver-500); border-color: rgba(0,0,0,0.07); }

/* Reports */
html.light .chart-title         { color: var(--silver-800); }
html.light .chart-sub           { color: var(--silver-500); }

/* Settings */
html.light .settings-section-title { color: var(--silver-600); border-color: rgba(0,0,0,0.08); }
html.light .settings-item       { border-color: rgba(0,0,0,0.05); }
html.light .settings-item-label { color: var(--silver-800); }
html.light .settings-item-desc  { color: var(--silver-500); }
html.light .rule-item           { border-color: rgba(0,0,0,0.05); }
html.light .rule-name           { color: var(--silver-700); }
html.light .rule-desc           { color: var(--silver-500); }
html.light .toggle-slider       { background: rgba(0,0,0,0.12); border-color: rgba(0,0,0,0.14); }
html.light .toggle-slider::before { background: var(--silver-500); }

/* AI Assistant */
html.light .ai-chat-panel       { background: #FFFFFF; border-color: rgba(0,0,0,0.08); }
html.light .ai-chat-header      { background: rgba(0,0,0,0.02); }
html.light .ai-bubble-ai        { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.09); color: var(--silver-800); }
html.light .ai-bubble-ai strong { color: var(--silver-900); }
html.light .ai-input-area       { background: rgba(0,0,0,0.02); }
html.light .ai-input            { background: #FFFFFF; border-color: rgba(0,0,0,0.12); color: var(--silver-900); }
html.light .ai-input::placeholder { color: var(--silver-500); }
html.light .ai-quick-btn        { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.09); color: var(--silver-600); }
html.light .ai-quick-btn:hover  { background: rgba(10,110,245,0.08); color: var(--primary-600); border-color: rgba(10,110,245,0.20); }

/* Notifications */
html.light .notif-item:hover    { background: rgba(0,0,0,0.02); }
html.light .notif-item.unread   { background: rgba(10,110,245,0.04); }
html.light .notif-title         { color: var(--silver-800); }
html.light .notif-desc          { color: var(--silver-600); }
html.light .notif-time          { color: var(--silver-500); }

/* Auth */
html.light .auth-layout         { background: var(--page-bg); }
html.light .auth-logo-text      { background: linear-gradient(135deg, var(--silver-800), var(--silver-600)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
html.light .auth-title          { color: var(--silver-900); }
html.light .auth-sub            { color: var(--silver-600); }
html.light .auth-footer         { color: var(--silver-600); }

/* Location menu */
html.light .location-menu-inner { background: #FFFFFF; border-color: rgba(0,0,0,0.10); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
html.light .location-menu-item span:first-child { color: var(--silver-900); }
html.light .location-sub        { color: var(--silver-500); }
html.light .location-menu-item:hover { background: rgba(0,0,0,0.04); }

/* Sidebar user */
html.light .sidebar-user:hover  { background: rgba(0,0,0,0.04); }
html.light .sidebar-user-name   { color: var(--silver-800); }
html.light .sidebar-user-role   { color: var(--silver-500); }

/* Progress bars / tracks that use rgba-white */
html.light .kpi-bar,
html.light .hours-bar-wrap,
html.light .avail-coverage-track { background: rgba(0,0,0,0.08); }
