/* ============================================================
   BrightSpots Manager App — Desktop Layout
   ============================================================ */

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal: #1D9E75;
  --teal-light: #E1F5EE;
  --teal-dark: #085041;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: rgba(0,0,0,0.10);
  --bg: #f4f6f8;
  --surface: #ffffff;
  --sidebar: #0F1F1A;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(29,158,117,0.25);
  --radius: 12px;
  --radius-sm: 8px;
  --danger: #dc2626;
  --danger-bg: #FCEBEB;
  --danger-border: #F09595;
  --success-bg: #EAF3DE;
  --success-text: #27500A;
  --success-border: #97C459;
  --warn-bg: #FAEEDA;
  --warn-text: #633806;
  --sidebar-width: 220px;
}

html, body {
  height: 100%; width: 100%;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── LOGIN PAGE ──────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: flex; }

#page-login {
  width: 100vw; height: 100vh;
  align-items: center; justify-content: center;
  background: var(--bg);
}

.login-wrap {
  width: 400px; background: var(--surface);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.login-logo { text-align: center; margin-bottom: 36px; }
.logo-icon {
  width: 56px; height: 56px; background: var(--teal-light);
  border-radius: 16px; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 12px;
}
.logo-icon i { font-size: 28px; color: var(--teal); }
.login-logo h1 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.login-logo p { font-size: 13px; color: var(--text-secondary); }

.field { margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; background: var(--surface); color: var(--text); display: block;
}
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(29,158,117,0.12); }

.btn-primary {
  width: 100%; padding: 12px;
  background: var(--teal); color: white;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.err-msg { font-size: 13px; color: var(--danger); background: var(--danger-bg); border-radius: var(--radius-sm); padding: 8px 12px; margin-top: 10px; display: none; }
.err-msg.show { display: block; }

/* ── MAIN DASHBOARD LAYOUT ───────────────────────────────────── */
#page-main {
  width: 100vw; height: 100vh;
  flex-direction: row;
  overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo-icon {
  width: 34px; height: 34px; background: var(--teal);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.sidebar-logo-icon i { font-size: 18px; color: white; }
.sidebar-logo-text { flex: 1; min-width: 0; }
.sidebar-logo-text p { font-size: 13px; font-weight: 600; color: white; }
.sidebar-logo-text span { font-size: 11px; color: rgba(255,255,255,0.45); }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.sidebar-section-label {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.3);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: rgba(255,255,255,0.6);
  font-size: 13px; font-weight: 500;
  transition: all 0.15s; margin-bottom: 2px;
  border: none; background: none; font-family: inherit;
  width: 100%; text-align: left;
}
.nav-item:hover { background: var(--sidebar-hover); color: rgba(255,255,255,0.9); }
.nav-item.active { background: var(--sidebar-active); color: var(--teal); }
.nav-item.active i { color: var(--teal); }
.nav-item i { font-size: 17px; width: 20px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--teal); color: white;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 99px; min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.sidebar-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--teal); display: flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 600;
  color: white; flex-shrink: 0;
}
.sidebar-user-name { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.8); }

/* ── MAIN CONTENT AREA ───────────────────────────────────────── */
.main-content {
  flex: 1; height: 100vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.top-bar {
  padding: 0 32px;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.top-bar h2 { font-size: 18px; font-weight: 600; }
.top-bar-right { display: flex; align-items: center; gap: 12px; }

.refresh-bar {
  text-align: center; padding: 4px;
  font-size: 11px; color: var(--text-tertiary);
  background: var(--bg); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.page-body {
  flex: 1; overflow-y: auto;
  padding: 28px 32px;
}

/* ── STATS GRID ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 20px 24px; border: 1px solid var(--border);
}
.stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 500; }
.stat-value { font-size: 32px; font-weight: 700; }
.stat-value.teal { color: var(--teal); }

/* ── CARDS ───────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; }

/* REQUEST CARDS */
.request-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 10px; }
.request-card.pending { border-left: 3px solid #EF9F27; }
.rc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rc-name { font-size: 15px; font-weight: 600; }
.rc-pos { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.pill { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill-pending { background: var(--warn-bg); color: var(--warn-text); }
.pill-approved { background: var(--success-bg); color: var(--success-text); }
.pill-denied { background: var(--danger-bg); color: var(--danger); }
.rc-dates { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 4px; }
.rc-dates i { font-size: 15px; color: var(--text-tertiary); }
.rc-note-row { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.rc-actions { display: flex; gap: 8px; }
.btn-approve { flex: 1; padding: 10px; background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 5px; }
.btn-deny { flex: 1; padding: 10px; background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 5px; }
.rc-reviewed { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; border-top: 1px solid var(--border); padding-top: 6px; font-style: italic; }

/* Request list layout - two columns on desktop */
#requests-container { max-width: 900px; }

/* STAFF LIST */
.staff-card { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.staff-card:last-child { border-bottom: none; }
.staff-card:active { opacity: 0.7; }
.staff-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--teal-light); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--teal-dark); flex-shrink: 0; }
.staff-info { flex: 1; min-width: 0; }
.staff-name { font-size: 14px; font-weight: 500; }
.staff-meta { font-size: 12px; color: var(--text-secondary); }
.role-pill { font-size: 11px; padding: 3px 8px; border-radius: 99px; font-weight: 500; }
.role-manager { background: var(--teal-light); color: var(--teal-dark); }
.role-staff { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

/* EMPTY STATE */
.empty { text-align: center; padding: 60px 16px; color: var(--text-tertiary); }
.empty i { font-size: 40px; display: block; margin-bottom: 12px; }
.empty p { font-size: 14px; }

/* SECTION TITLE */
.section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; }

/* ── PUNCH EDITOR ────────────────────────────────────────────── */
.punch-summary { background: var(--teal-light); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.punch-summary span { font-size: 13px; color: var(--teal-dark); }
.punch-summary strong { font-size: 16px; font-weight: 700; color: var(--teal); }
.punch-day { margin-bottom: 14px; }
.punch-day-header { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.punch-row { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 6px; }
.punch-badge-in { font-size: 11px; font-weight: 700; width: 28px; color: var(--teal); }
.punch-badge-out { font-size: 11px; font-weight: 700; width: 28px; color: var(--text-secondary); }
.punch-time-text { flex: 1; font-size: 14px; font-weight: 500; }
.punch-actions { display: flex; gap: 6px; }
.punch-edit-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; font-size: 16px; }
.punch-delete-btn { background: none; border: none; color: var(--danger); cursor: pointer; padding: 4px; font-size: 16px; }
.add-punch-box { background: var(--bg); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px; }
.add-punch-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.add-punch-bar { display: flex; gap: 8px; }
.select-type { flex: 1; padding: 10px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: var(--surface); color: var(--text); font-family: inherit; }
.input-time { flex: 2; padding: 10px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: var(--surface); color: var(--text); font-family: inherit; }
.btn-add-punch { padding: 10px 14px; background: var(--teal); color: white; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; }
.staff-select-field { margin-bottom: 14px; }
.staff-select-field label { font-size: 13px; font-weight: 500; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.staff-select-field select { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: var(--surface); color: var(--text); font-family: inherit; }

/* ── MODALS ──────────────────────────────────────────────────── */
.tl-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 500; }
.tl-modal-overlay.show { display: flex; }
.tl-modal { background: var(--surface); border-radius: var(--radius); width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); overflow: hidden; }
.tl-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.tl-modal-header h3 { font-size: 15px; font-weight: 600; }
.tl-modal-close { background: none; border: none; font-size: 18px; color: var(--text-secondary); cursor: pointer; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.tl-modal-close:hover { background: var(--bg); }
.tl-modal-body { padding: 20px; }
.tl-modal-fields { display: flex; gap: 12px; }
.tl-modal-field { flex: 1; }
.tl-modal-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.tl-modal-field input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; color: var(--text); background: var(--surface); }
.tl-modal-field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(29,158,117,0.12); }
.tl-modal-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg); }
.tl-modal-delete { padding: 9px 16px; background: var(--danger); color: white; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.tl-modal-save { padding: 9px 20px; background: var(--teal); color: white; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.tl-modal-close-btn { padding: 9px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; color: var(--text-secondary); cursor: pointer; font-family: inherit; }

/* ── TIMELINE ────────────────────────────────────────────────── */
.tl-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tl-today-btn { padding: 7px 16px; background: var(--teal); color: white; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
#tl-date-picker { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); color: var(--text); font-family: inherit; }
.tl-date-label { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.tl-loading { text-align: center; padding: 48px; color: var(--text-tertiary); font-size: 14px; }
.tl-grid { width: 100%; }
.tl-header-row { display: flex; align-items: center; border-bottom: 2px solid var(--border); padding-bottom: 6px; margin-bottom: 4px; }
.tl-header-name { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.tl-hour-labels { display: flex; width: 100%; }
.tl-hour-label { flex: 1; font-size: 10px; color: var(--text-tertiary); text-align: left; padding-left: 2px; }
.tl-row { display: flex; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); min-height: 44px; }
.tl-row:last-child { border-bottom: none; }
.tl-row-empty:hover { background: var(--bg); cursor: pointer; }
.tl-name-col { width: 180px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding-right: 12px; }
.tl-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--teal-light); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: var(--teal-dark); flex-shrink: 0; }
.tl-staff-info { min-width: 0; }
.tl-staff-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-staff-hours { font-size: 11px; color: #3B82F6; font-weight: 500; }
.tl-bar-col { flex: 1; min-width: 0; }
.tl-bar-track { position: relative; height: 34px; background: var(--bg); border-radius: var(--radius-sm); }
.tl-bar-label { font-size: 10px; color: white; font-weight: 500; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); border-radius: 1px; z-index: 10; }
.tl-now-line::before { content: ''; position: absolute; top: -3px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* Timeline bar colors */
.tl-bar-scheduled { position: absolute; top: 5px; height: 24px; background: rgba(59,130,246,0.15); border: 2px dashed #3B82F6; border-radius: 6px; cursor: default; display: flex; align-items: center; overflow: hidden; }
.tl-bar-scheduled .tl-bar-label { color: #3B82F6; }
.tl-bar-absent { position: absolute; top: 5px; height: 24px; background: rgba(239,68,68,0.1); border: 2px dashed #EF4444; border-radius: 6px; cursor: default; display: flex; align-items: center; overflow: hidden; }
.tl-bar-absent .tl-bar-label { color: #EF4444; font-weight: 600; }
.tl-bar-active { position: absolute; top: 5px; height: 24px; background: linear-gradient(90deg, #16A34A, #22C55E); border-radius: 6px; cursor: pointer; display: flex; align-items: center; overflow: hidden; animation: pulse-bar 2s ease-in-out infinite; }
.tl-bar-complete { position: absolute; top: 5px; height: 24px; background: #1D9E75; border-radius: 6px; cursor: pointer; display: flex; align-items: center; overflow: hidden; transition: filter 0.1s; }
.tl-bar-complete:hover { filter: brightness(1.1); }
.tl-bar-short { position: absolute; top: 5px; height: 24px; background: #F97316; border-radius: 6px; cursor: pointer; display: flex; align-items: center; overflow: hidden; transition: filter 0.1s; }
.tl-bar-short:hover { filter: brightness(1.1); }
.tl-bar { position: absolute; top: 5px; height: 24px; background: #1D9E75; border-radius: 6px; cursor: pointer; overflow: hidden; display: flex; align-items: center; transition: filter 0.1s; }
.tl-bar:hover { filter: brightness(1.1); }
.tl-bar-ghost { position: absolute; top: 5px; height: 24px; background: rgba(0,0,0,0.06); border: 1px dashed rgba(0,0,0,0.18); border-radius: 6px; pointer-events: none; }
@keyframes pulse-bar { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }
.tl-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; padding: 10px 0; }
.tl-legend-item { display: flex; align-items: center; gap: 5px; }
.tl-legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ── SCHEDULE ────────────────────────────────────────────────── */
.sched-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sched-nav-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); font-size: 16px; }
.sched-today-btn { padding: 7px 16px; background: var(--teal); color: white; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.sched-week-label { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.sched-copy-btn { padding: 7px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-secondary); cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.sched-loading { text-align: center; padding: 48px; color: var(--text-tertiary); font-size: 14px; }
.sched-grid { width: 100%; }
.sched-header-row, .sched-row { display: grid; grid-template-columns: 160px repeat(5,minmax(0,1fr)); gap: 4px; margin-bottom: 4px; }
.sched-header-cell { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 6px; text-align: center; }
.sched-name-col { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 0; }
.sched-staff-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--teal-light); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: var(--teal-dark); flex-shrink: 0; }
.sched-staff-name { font-size: 12px; font-weight: 500; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-header-cell.sched-today-col { color: var(--teal); }
.sched-cell { border-radius: var(--radius-sm); padding: 5px 7px; cursor: pointer; min-height: 48px; display: flex; flex-direction: column; justify-content: center; transition: filter 0.1s; border: 1px solid transparent; }
.sched-cell:hover { filter: brightness(0.96); }
.sched-cell-empty { background: var(--bg); border: 1px dashed var(--border); align-items: center; }
.sched-cell-empty:hover { border-color: var(--teal); background: var(--teal-light); }
.sched-add-hint { font-size: 18px; color: var(--text-tertiary); }
.sched-cell-empty:hover .sched-add-hint { color: var(--teal); }
.sched-cell-filled { border-left-width: 3px !important; }
.sched-cell-timeoff { background: #F3F4F6; border: 1px solid #D1D5DB; }
.sched-shift-time { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.3; }
.sched-shift-status { font-size: 10px; font-weight: 600; margin-top: 2px; }
.sched-shift-label { font-size: 11px; color: var(--text-tertiary); font-style: italic; }
.sched-fill-hint { font-size: 9px; color: var(--teal); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0; transition: opacity 0.15s; }
.sched-day-col:hover .sched-fill-hint { opacity: 1; }
.sched-name-clickable { cursor: pointer; }
.sched-fill-week-hint { font-size: 9px; color: var(--teal); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0; transition: opacity 0.15s; }
.sched-name-clickable:hover .sched-fill-week-hint { opacity: 1; }
.sched-name-clickable:hover .sched-staff-name { color: var(--teal); }
.sched-partial-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; box-shadow: 0 0 0 2px white; }
.sched-legend { display: flex; gap: 16px; margin-bottom: 14px; font-size: 12px; color: var(--text-secondary); }
.sched-legend-item { display: flex; align-items: center; gap: 5px; }
.sched-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Shift modal */
.shift-modal { width: 420px; }
.shift-status-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; }
.shift-status-btn { padding: 8px 10px; border-radius: var(--radius-sm); border: 1.5px solid; background: transparent; font-size: 12px; cursor: pointer; font-family: inherit; text-align: left; transition: all 0.1s; }

/* Staff edit modal */
.staff-modal { width: 420px; }
.staff-edit-grid { display: flex; gap: 10px; }
.staff-edit-field { flex: 1; }
.staff-edit-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 5px; }
.staff-edit-field input, .staff-edit-field select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; color: var(--text); background: var(--surface); }
.staff-edit-field input:focus, .staff-edit-field select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(29,158,117,0.12); }

/* Timeline modal */
.tl-modal-overlay.show { display: flex; }

/* ── AI PANEL ────────────────────────────────────────────────── */
.ai-action-btn { flex: 1; padding: 20px 16px; background: var(--teal-light); border: 1px solid var(--teal); border-radius: var(--radius); cursor: pointer; font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--teal-dark); transition: all 0.15s; max-width: 200px; }
.ai-action-btn:hover { background: var(--teal); color: white; }
.ai-action-btn span:first-of-type { font-size: 14px; font-weight: 600; }
.ai-result-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.ai-result-box.ai-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; }
.ai-spinner { width: 28px; height: 28px; border: 3px solid var(--teal-light); border-top-color: var(--teal); border-radius: 50%; animation: spin 0.7s linear infinite; }
.ai-chat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; max-width: 700px; }
.ai-chat-msg { max-width: 80%; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5; }
.ai-chat-user { background: var(--teal); color: white; align-self: flex-end; border-radius: 12px 12px 2px 12px; }
.ai-chat-bot { background: var(--bg); border: 1px solid var(--border); align-self: flex-start; border-radius: 12px 12px 12px 2px; color: var(--text); }
#ai-chat-messages { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; margin-bottom: 12px; }

/* ── LOADING ─────────────────────────────────────────────────── */
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.75); display: none; align-items: center; justify-content: center; z-index: 300; }
.loading-overlay.show { display: flex; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--teal-light); border-top-color: var(--teal); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* toggle (for shift modal partial) */
.toggle { width: 44px; height: 26px; background: #d1d5db; border-radius: 13px; cursor: pointer; position: relative; transition: background 0.2s; border: none; flex-shrink: 0; }
.toggle.on { background: var(--teal); }
.toggle::after { content: ''; position: absolute; width: 20px; height: 20px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle.on::after { left: 21px; }
