/* ═══════════════════════════════════════════════════════════════════════
   SMOOTH TRANSITIONS SCHEDULER — styles.css
   PM / brand color: #18b89e
═══════════════════════════════════════════════════════════════════════ */

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

:root {
  --pm:          #18b89e;
  --pm-dark:     #129e87;
  --pm-light:    #e6f9f6;
  --blue:        #4a90e2;
  --blue-dark:   #357abd;
  --border:      #b8dfd8;
  --grid-border: #7ab8ae;
  --bg:          #d4f0ea;   /* light green — main area background */
  --surface:     #ffffff;
  --text:        #1a1a2e;
  --text-muted:  #6b7280;
  --sandbox-clr: #f59e0b;
  --radius:      6px;
  --shadow:      0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.18);

  /* layout measurements */
  --toolbar-h:   52px;
  --hours-h:     150px;
  --panel-w:     210px;
  --hour-px:     72px;   /* height per hour in time-grid */
  --time-lbl-w:  54px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}
body {
  display: flex;
  flex-direction: column;
}

/* ── BANNERS ──────────────────────────────────────────────────────────── */

.auth-banner {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
  padding: 6px 16px;
  font-size: 13px;
  text-align: center;
}
.auth-banner a { color: #991b1b; font-weight: 700; }
.auth-banner.hidden { display: none; }

.update-banner {
  background: #fee2e2;
  color: #c62828;
  border-bottom: 1px solid #fca5a5;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  letter-spacing: .3px;
}
.update-banner:hover { background: #fecaca; }
.update-banner.hidden { display: none; }

.sandbox-banner {
  background: var(--sandbox-clr);
  color: #fff;
  text-align: center;
  padding: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
}
.sandbox-banner.hidden { display: none; }

/* ── TOOLBAR ──────────────────────────────────────────────────────────── */

.toolbar {
  height: var(--toolbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 50;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-divider {
  width: 2px;
  height: 24px;
  background: var(--pm);
  flex-shrink: 0;
}

.brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--pm);
  white-space: nowrap;
  letter-spacing: -.3px;
  flex-shrink: 0;
  border: 2px solid var(--pm);
  border-radius: 10px;
  padding: 3px 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.brand:hover { background: var(--pm); color: #fff; }

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* view toggles */
.view-toggles {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.view-btn {
  background: var(--surface);
  border: none;
  border-right: 1px solid var(--border);
  padding: 5px 13px;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s;
}
.view-btn:last-child { border-right: none; }
.view-btn.active { background: var(--pm); color: #fff; font-weight: 700; }
.view-btn:hover:not(.active) { background: #f0faf8; }

/* Day-header and column outage indicators */
.day-head-cell--outage-fullday {
  border: 2px solid #e53935;
  color: #c62828;
  background: #ffebee;
}
.day-head-cell--outage-partial {
  color: #d97706;
}
.day-col--outage-fullday {
  box-shadow: inset 0 0 0 2px #e53935;
}
.avail-block--pinned {
  display: flex; align-items: center; justify-content: flex-start;
  padding: 2px 6px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: auto;
}
.avail-block--pinned .avail-block-label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  width: 100%;
}

/* nav */
.nav-group { gap: 4px; }
.nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  transition: background .12s;
}
.nav-btn:hover { background: var(--bg); }
.today-nav { font-size: 12px; font-weight: 700; padding: 5px 9px; }

.date-input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 7px;
  font-size: 13px;
  outline: none;
}
.date-input:focus { border-color: var(--pm); }

.search-group { gap: 4px; }
.search-toggle-btn { font-size: 13px; padding: 4px 8px; }
.search-input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 13px;
  width: 180px;
  outline: none;
}
.search-input:focus { border-color: var(--pm); }
.search-input.hidden, .search-clear-btn.hidden { display: none; }
.search-clear-btn { font-size: 11px; padding: 4px 7px; }

.cal-event.search-dim, .month-event-bar.search-dim { opacity: 0.18; }
/* While hovered-to-front, a dimmed (non-match) event restores full opacity
   so the user can read it. Mouseout removes .ev-hover-front and the dim
   returns automatically. */
.cal-event.search-dim.ev-hover-front { opacity: 1; }

.search-results-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}
.search-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.search-result-row:hover { background: var(--pm-light); border-color: var(--pm); }
.search-result-date {
  flex-shrink: 0;
  width: 130px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.search-result-title {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-cal {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-results-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}
.cal-event.search-match, .month-event-bar.search-match {
  outline: 2px solid #f59e0b;
  outline-offset: 1px;
}

.range-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 220px;
  text-align: center;
}

/* ── BUTTONS ──────────────────────────────────────────────────────────── */

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .12s, opacity .12s;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:not(:disabled):hover { filter: brightness(1.08); }

.btn-commit  { background: #4a5568; color: #fff; }
.btn-pull    { background: var(--blue); color: #fff; }
#pullBtn.btn-pull { background: #18b89e; }
#pullBtn.btn-pull:hover { background: #129e87; }
.btn-pull-errors {
  background: #f59e0b; color: #fff;
  font-size: 14px; font-weight: 700;
  padding: 0 9px;
}
.btn-pull-errors:hover { background: #000000; }
.btn-save    { background: var(--pm); color: #fff; }
.btn-cancel  { background: #f3f4f6; color: var(--text); }
.btn-add          { background: var(--pm); color: #fff; padding: 6px 10px; width: 100%; }
.add-emp-row { display: flex; gap: 6px; }
.add-emp-row .btn-add { flex: 1; }
.btn-all-emps { background: #374151; color: #fff; flex-shrink: 0; }

/* all employees modal */
.all-emps-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 420px;
  overflow-y: auto;
}
.all-emps-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: default;
  user-select: none;
  transition: background .12s;
}
.all-emps-row:hover { background: var(--pm-light); }
.all-emps-pm { border-left-color: var(--pm); }
.all-emps-name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.all-emps-meta { font-size: 11px; color: var(--text-muted); }
.all-emps-active-at {
  font-size: 11px;
  color: #18b89e;
  font-weight: 600;
  margin-left: 8px;
  font-style: normal;
}
.all-emps-empty { font-size: 13px; color: var(--text-muted); font-style: italic; padding: 8px 0; text-align: center; }

/* all-employees tabs */
.all-emps-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.all-emps-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.all-emps-tab:hover { color: var(--text); }
.all-emps-tab-active { color: var(--pm) !important; border-bottom-color: var(--pm) !important; }

/* per-row action buttons */
.all-emps-action-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .12s, transform .1s;
  line-height: 1;
}
.all-emps-action-btn:hover { opacity: .85; transform: scale(1.12); }
.all-emps-sep-btn    { background: #fee2e2; color: #b91c1c; }
.all-emps-reinstate-btn { background: #d1fae5; color: #065f46; font-size: 16px; }
.all-emps-delete-btn { background: #fee2e2; color: #b91c1c; }

/* separated tab rows */
.all-emps-row-separated { opacity: .75; }
.all-emps-sep-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* invisible tab rows */
.all-emps-row-invisible { opacity: .6; font-style: italic; }

/* employee remove choice dialog */
.emp-remove-msg { font-size: 14px; color: var(--text); margin: 0 0 14px; }
.emp-remove-choices { display: flex; flex-direction: column; gap: 10px; }
.emp-remove-choice-btn {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 8px;
  border: 2px solid transparent; cursor: pointer;
  background: var(--bg); transition: border-color .15s, background .15s;
}
.emp-remove-choice-btn:hover { background: var(--surface); }
.emp-remove-invisible { border-color: #a5b4fc; }
.emp-remove-invisible:hover { border-color: #6366f1; background: #eef2ff; }
.emp-remove-separate  { border-color: #fca5a5; }
.emp-remove-separate:hover  { border-color: #ef4444; background: #fef2f2; }
.emp-remove-delete    { border-color: #d1d5db; }
.emp-remove-delete:hover    { border-color: #6b7280; background: #f3f4f6; }
.emp-remove-icon  { font-size: 20px; flex-shrink: 0; line-height: 1.2; }
.emp-remove-label { font-size: 14px; font-weight: 700; color: var(--text); display: block; }
.emp-remove-desc  { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }

/* Separate button in emp modal */
.btn-separate {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.btn-separate:hover { background: #fde68a; }

/* ── Pull warnings modal ─────────────────────────────────────────────── */
.pull-errors-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.pull-errors-toolbar .btn-sm { padding: 4px 10px; font-size: 12px; flex-shrink: 0; }
.pull-errors-cal-filter { flex: 1; font-size: 12px; padding: 4px 8px; }
/* Alerts modal tabs */
.alerts-cal-row { margin-bottom: 8px; }
.alerts-tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid #333;
  margin-bottom: 10px;
}
.alerts-tab {
  background: #d4d4d4;
  color: #000;
  border: none;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-bottom: -1px;
}
.alerts-tab:hover { background: #e4e4e4; }
.alerts-tab.active {
  background: #18b89e;
  color: #000;
}
.alerts-tab.active:hover { background: #18b89e; }
.alerts-tab-panel { min-height: 40px; }
.alerts-tab-panel.hidden { display: none; }
.alerts-tab-placeholder { color: #888; font-size: 12px; padding: 8px 2px; }
.pull-errors-list { display: flex; flex-direction: column; gap: 6px; }
.pull-errors-empty { color: var(--text-muted); font-size: 13px; padding: 8px 0; }
.pull-error-row {
  display: flex; align-items: flex-start; gap: 8px;
  background: #fff8e1; border: 1px solid #fde68a;
  border-radius: 6px; padding: 8px 10px;
}
.pull-error-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pull-error-text--clickable { cursor: pointer; }
.pull-error-text--clickable:hover .pull-error-event { text-decoration: underline; color: var(--primary, #4f46e5); }
.pull-error-event { font-weight: 600; font-size: 13px; color: var(--text); }
.pull-error-msg   { font-size: 12px; color: #92400e; }
.pull-error-cal   { font-size: 11px; color: var(--text-muted); font-style: italic; }
.pull-error-dismiss {
  flex-shrink: 0; background: none; border: none;
  color: #b45309; cursor: pointer; font-size: 13px;
  padding: 0 2px; line-height: 1;
  opacity: .7;
}
.pull-error-dismiss:hover { opacity: 1; }
.pull-error-assign {
  flex-shrink: 0; font-size: 11px; padding: 2px 4px;
  border: 1px solid #fde68a; border-radius: 4px;
  background: #fff; color: #92400e; max-width: 130px;
}

/* ── Event modal address field ───────────────────────────────────────── */
.modal-address-text {
  font-size: 13px; color: var(--text);
  background: #f9fafb; border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 10px;
  line-height: 1.5;
}

/* ── Employee modal alias hint ───────────────────────────────────────── */
.modal-field-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; }

.btn-view-hours   { background: var(--pm); color: #fff; }
.btn-hours-toggle { background: #1e3a34; color: #7de8d4; border: 1px solid #2a5248; font-size: 12px; padding: 4px 11px; }
.btn-hours-toggle:not(:disabled):hover { filter: brightness(1.2); }
.btn-hidden-items { background: #374151; color: #fff; }
.btn-hidden-items:not(:disabled):hover { filter: brightness(1.2); }
.btn-hide         { background: #dc2626; color: #fff; }

/* gear settings button */
.settings-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 9px;
  font-size: 17px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.settings-btn:hover { background: var(--bg); color: var(--text); }

/* ── MAIN LAYOUT ──────────────────────────────────────────────────────── */

.main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── EMPLOYEE PANEL ───────────────────────────────────────────────────── */

.employee-panel {
  width: var(--panel-w);
  flex-shrink: 0;
  background: #c2e8e0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.emp-sections-container {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.emp-section {
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.pm-section {}
.emp-section-employees {}
.emp-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 4px;
  flex-shrink: 0;
}

.emp-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.emp-chip {
  padding: 6px 10px;
  border-radius: var(--radius);
  background: #f0f2f5;
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: grab;
  user-select: none;
  transition: box-shadow .12s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.emp-chip .chip-name { flex: 1; text-align: center; }
.emp-chip.pm-chip {
  background: var(--pm);
  color: #fff;
  border-color: var(--pm-dark);
}
.emp-chip:hover { box-shadow: var(--shadow); transform: translateX(2px); }
.emp-chip:active { cursor: grabbing; opacity: .75; }
.emp-chip--busy { opacity: 0.38; color: #000000; }
.emp-chip--busy:hover { opacity: 0.6; color: #000000; }
.emp-chip.pm-chip.emp-chip--busy { opacity: 0.45; filter: grayscale(70%); color: #000000; }
.emp-chip.pm-chip.emp-chip--busy:hover { opacity: 0.65; filter: grayscale(40%); color: #000000; }
.emp-chip--off {
  position: relative;
  overflow: hidden;
}
.emp-chip--off::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    25deg,
    transparent 0px,
    transparent 7px,
    rgba(220,38,38,.85) 7px,
    rgba(220,38,38,.85) 10px
  );
  border-radius: inherit;
  pointer-events: none;
}
.emp-chip.emp-chip--no-hours { border: 2px solid #e53935; }
/* PMs get a black rectangle instead — their pill already has a colored
   gradient, so red would clash. */
.emp-chip.pm-chip.emp-chip--no-hours { border: 2px solid #000 !important; }
.chip-no-hours-mark {
  color: #e53935;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 22px;
  height: 12px;
  flex-shrink: 0;
  margin: 0;
  line-height: 1;
}
.chip-no-hours-icon { display: block; }
.chip-no-hours-letter {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
}

.chip-color-bar {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  padding: 2px;
  /* Mask trick: render the gradient background, then punch out everything
     except a 2px frame so the gradient shows as a border around the pill. */
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}

.chip-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  opacity: 0;
  padding: 0;
  line-height: 1;
  color: inherit;
  flex-shrink: 0;
  transition: opacity .12s;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}
.emp-chip:hover .chip-delete { opacity: .7; }
.chip-delete:hover { opacity: 1 !important; }

.add-emp-form {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.add-emp-form input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 13px;
  outline: none;
}
.add-emp-form input[type="text"]:focus { border-color: var(--pm); }
.app-version {
  padding: 6px 10px 8px;
  font-size: 10px;
  color: #aaa;
  text-align: right;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.pm-check-label {
  display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer;
}
.pm-check-label input { accent-color: var(--pm); }

/* ── CALENDAR AREA ────────────────────────────────────────────────────── */

.calendar-area {
  flex: 1;
  overflow: auto;
  background: var(--bg);
  position: relative;
}

/* sandbox outline on calendar area */
body.sandbox-active .calendar-area {
  outline: 3px solid var(--sandbox-clr);
  outline-offset: -3px;
}

/* ── WEEK / DAY — time grid ───────────────────────────────────────────── */

.week-view,
.day-view,
.month-view { min-width: 0; }

.cal-sticky-header {
  position: sticky;
  top: 0;
  /* Above shifts AND above the sticky time-labels column (1500), so the
     hour labels scroll behind the date row at the corner. */
  z-index: 1510;
  background: #c2e8e0;
  border-bottom: 1px solid var(--border);
  display: flex;
  width: 100%;
}
.time-corner {
  width: var(--time-lbl-w);
  flex-shrink: 0;
  background: var(--pm);
  border-right: 1px solid var(--pm-dark);
  display: flex; align-items: center; justify-content: center;
}
.time-corner-map-btn {
  background: transparent; border: none; cursor: pointer;
  padding: 4px; border-radius: 4px;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.time-corner-map-btn:hover { background: rgba(255,255,255,.18); }
.time-corner-map-btn.active {
  background: #fff;
  color: var(--pm);
}
/* Mark-filled-shifts mode: marked shifts dim to 50%; flag persists out of mode */
body.mark-mode .cal-event { cursor: pointer; }
body.mark-mode .cal-event--filled { opacity: 0.3; }

body.distance-mode .cal-event { cursor: crosshair; }
body.distance-mode .cal-event:hover { outline: 2px solid #fbbf24; outline-offset: -1px; }
.cal-event.distance-picked {
  outline: 2px solid #f59e0b;
  outline-offset: -1px;
  box-shadow: 0 0 0 3px rgba(245,158,11,.35);
}
.day-head-cell {
  flex: 1;
  text-align: center;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border-right: 1px solid var(--grid-border);
  min-width: 90px;
  /* Each cell paints its own background so it stays opaque even when the
     calendar scrolls horizontally past the .cal-sticky-header's flex line. */
  background: #c2e8e0;
}
.day-head-cell:last-child { border-right: none; }
.day-head-cell.is-today { color: var(--pm); }
.day-head-cell.clickable { cursor: pointer; }
.day-head-cell.clickable:hover { background: var(--pm-light); color: var(--pm); }

.time-grid {
  display: flex;
  width: 100%;
}
.time-labels {
  width: var(--time-lbl-w);
  flex-shrink: 0;
  border-right: 1px solid var(--pm-dark);
  background: var(--pm);
  position: sticky;
  left: 0;
  /* Sit above all shifts, including ev-hover-front (999) */
  z-index: 1500;
}
.time-label {
  height: var(--hour-px);
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  text-align: right;
  padding-right: 7px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 3px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.time-label:first-child { border-top: none; }

.day-col {
  flex: 1;
  position: relative;
  background: #d4f0ea;
  border-right: 1px solid var(--grid-border);
  min-width: 90px;
}
.day-col:last-child { border-right: none; }
.day-col.is-today-col { background: #bde8de; }

.hour-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px solid #eef0f3;
  pointer-events: none;
}
.half-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dashed #f0f2f5;
  pointer-events: none;
}
.day-view .hour-line { border-top-color: var(--grid-border); }
.day-view .half-line { border-top-color: var(--grid-border); }

/* now-line */
.now-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: #ef4444;
  z-index: 8;
  pointer-events: none;
}
.now-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #ef4444;
}

/* ── CALENDAR EVENTS ──────────────────────────────────────────────────── */

.cal-event {
  position: absolute;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: filter .12s, z-index 0s;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--blue);
  color: #000;
}
.cal-event:hover { filter: brightness(1.1); box-shadow: var(--shadow); }
.cal-event.drag-over { outline: 2px dashed #fff; filter: brightness(.9); }
.cal-event.ev-hover-front { z-index: 999 !important; }
.cal-event.is-sandbox { border: 2px dashed var(--sandbox-clr) !important; }
.cal-event.is-dirty  { border-left: 4px solid var(--sandbox-clr) !important; }
.cal-event.ev-moved  { border: 2px solid #ef4444; outline: 2px solid #000; outline-offset: 2px; }
.cal-event.is-subshift { opacity: .72; border-left: 3px solid rgba(255,255,255,.5) !important; }

/* Lane drag handle — visible on hover (desktop) or always (touch). */
.lane-grip {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 13px;
  line-height: 1;
  padding: 4px 6px;
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.35);
  border-radius: 3px;
  cursor: ew-resize;
  opacity: 0;
  user-select: none;
  z-index: 6;
  transition: opacity .12s;
  touch-action: none; /* let pointer events drive the drag instead of native scroll */
}
.cal-event:hover .lane-grip { opacity: 1; }
.lane-grip:hover { background: rgba(0,0,0,.55); }
/* Touch devices have no hover — keep the grip visible at a low opacity, and
   enlarge the hit area so it's actually tappable with a finger. */
@media (hover: none) {
  .lane-grip {
    opacity: .75;
    padding: 6px 8px;
    font-size: 14px;
  }
}
.cal-event.lane-dragging { opacity: .85; z-index: 9999 !important; }

/* Manual-combine "+" button — top-right corner of a shift block. */
.ev-combine-btn {
  position: absolute;
  top: 2px;
  right: 30px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 16px;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0;
  z-index: 7;
  transition: opacity .12s, background .12s;
}
.cal-event:hover .ev-combine-btn { opacity: 1; }
.ev-combine-btn:hover { background: rgba(0,0,0,.6); }
.ev-combine-btn--linked { opacity: 1; background: rgba(34,197,94,.85); }
.ev-combine-btn--linked:hover { background: rgba(220,38,38,.85); }
.ev-combine-btn--picking { opacity: 1; background: #f59e0b; color: #000; }
body.combine-mode .cal-event { cursor: crosshair; }
body.combine-mode .cal-event:hover { outline: 2px solid #f59e0b; outline-offset: -1px; }
@media (hover: none) {
  .ev-combine-btn { opacity: .75; }
}

/* ── CONFLICT INDICATORS ──────────────────────────────────────────────── */

/* Red dot in day-column headers (week + day view) */
.day-head-cell { position: relative; }
.conflict-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Red "!" badge pinned to top-right of a conflicting event tile */
.cal-event.has-conflict { outline: 2px solid rgba(239,68,68,.75); }
.conflict-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  background: #ef4444;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  z-index: 3;
  flex-shrink: 0;
}
.conflict-badge::before { content: '!'; }

/* Red outline box around a specific employee name that is double-booked */
.conflict-name {
  outline: 1.5px solid #ef4444;
  border-radius: 3px;
  padding: 0 2px;
}

/* Smaller badge variant for inline sub-shift rows */
.ev-subshift-row--conflict { outline: 1px solid rgba(239,68,68,.6); border-radius: 4px; }
.conflict-badge--sub {
  width: 12px;
  height: 12px;
  font-size: 8px;
  position: static;
  display: inline-flex;
  margin-left: 4px;
  flex-shrink: 0;
  pointer-events: none;
}

.ev-title  { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.ev-time {
  font-size: 10px;
  margin-top: auto;          /* push to the very bottom of the flex rectangle */
  align-self: stretch;
  background: rgba(255,255,255,.9);
  color: #000;
  padding: 1px 5px;
  border-radius: 3px;
  text-align: center;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-pm-tag { font-size: 10px; font-weight: 700; background: rgba(255,255,255,.22); border-radius: 3px; padding: 0 3px; display: inline-block; }
.ev-emps   { font-size: 10px; opacity: .95; display: flex; flex-wrap: wrap; gap: 2px; overflow: hidden; }
.ev-prev-emps { display: flex; flex-direction: column; gap: 2px; }
.ev-prev-hr   { border: none; border-top: 1px solid rgba(255,255,255,.25); margin: 3px 0; }
.ev-prev-label { font-size: 9px; font-weight: 700; opacity: .85; text-transform: uppercase; letter-spacing: .04em; color: #111; background: rgba(255,255,255,.85); display: inline-block; padding: 0 4px; border-radius: 3px; align-self: flex-start; }
/* Comma-separated list. Each entry is a high-contrast pill so the names are
   readable regardless of the shift card's background color (PM gradients,
   etc.). The separator inherits the same look so it doesn't disappear. */
.ev-prev-names { font-size: 10px; line-height: 1.4; word-spacing: -2px; }
.ev-prev-name {
  display: inline-block;
  background: rgba(255,255,255,.9);
  color: #111;
  padding: 0 5px;
  margin: 1px 0;
  border-radius: 3px;
  white-space: nowrap;
}
.ev-prev-hrs { color: #555; font-weight: 400; }
.ev-prev-sep { color: rgba(255,255,255,.85); font-weight: 700; padding: 0 1px; }
.day-view .ev-prev-label { font-size: 10px; }
.day-view .ev-prev-names { font-size: 11px; }
.ev-spot {
  display: inline-block;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(255,255,255,.25);
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.3;
}
.ev-spot.ev-spot--empty {
  background: transparent;
  border: 1px dashed rgba(255,255,255,.6);
  color: rgba(255,255,255,.7);
  min-width: 14px;
  text-align: center;
  font-weight: 700;
  padding: 0 3px;
}
.ev-spot--day-off {
  position: relative;
  opacity: 0.65;
}
.ev-spot--day-off::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: repeating-linear-gradient(
    25deg,
    transparent 0px,
    transparent 7px,
    rgba(220,38,38,.9) 7px,
    rgba(220,38,38,.9) 10px
  );
  border-radius: inherit;
  pointer-events: none;
}

/* sub-shift badge on primary (week view) */
.ev-subshift-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.35);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  border-radius: 8px;
  padding: 0 5px;
  height: 14px;
  flex-shrink: 0;
}

/* inline sub-shifts in day view */
.ev-subshifts-inline {
  margin-top: 6px;
  border-top: 1px solid rgba(255,255,255,.3);
  padding-top: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ev-subshift-row {
  background: rgba(0,0,0,.18);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 11px;
  color: #fff;
  cursor: pointer;
  transition: background .12s;
}
.ev-subshift-row:hover { background: rgba(0,0,0,.3); }
.ev-subshift-time  { font-weight: 700; font-size: 11px; }
.ev-subshift-label { opacity: .75; font-weight: 600; }
.ev-subshift-pm    { font-size: 10px; opacity: .9; }
.ev-subshift-emps  { font-size: 10px; opacity: .85; }

/* Master time pill when it sits above the sub block (not pushed to bottom) */
.ev-time.ev-time--above-subs {
  margin-top: 2px;
  margin-bottom: 2px;
}

/* Per-sub bottom time pill — smaller white pill inside each sub row */
.ev-subshift-time-pill {
  margin-top: 3px;
  background: rgba(255,255,255,.85);
  color: #000;
  padding: 1px 5px;
  border-radius: 3px;
  text-align: center;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* week view: allow primary block to grow to show sub-shifts */
.week-view .cal-event { overflow: hidden; min-height: 33px; }

/* week + day view: let titles wrap instead of truncating */
.week-view .ev-title,
.day-view  .ev-title {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

/* week + day view: let employee names wrap instead of truncating */
.week-view .ev-emps,
.day-view  .ev-emps {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

/* enlarged text in day view */
.day-view .cal-event        { font-size: 14px; padding: 5px 8px; gap: 3px; min-height: 72px; overflow: hidden; }
.day-view .ev-time          { font-size: 12px; }
.day-view .ev-pm-tag        { font-size: 12px; }
.day-view .ev-emps          { font-size: 12px; }

/* sub-shifts section in event popup modal */
.modal-subshifts {
  border-top: 2px solid var(--border);
  padding-top: 14px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-subshifts.hidden { display: none; }
.modal-subshifts-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}
.modal-subshift-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color .12s, background .12s;
}
.modal-subshift-row:not(.modal-subshift-row-active):hover {
  border-color: var(--pm);
  background: var(--pm-light);
}
.modal-subshift-row-active {
  border-color: var(--pm);
  border-width: 2px;
}
.modal-subshift-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-subshift-primary-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--pm);
  color: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.modal-subshift-detail {
  font-size: 12px;
  color: var(--text-muted);
}

/* Google Calendar color IDs → CSS */
.gc-1  { background: #D50000; }
.gc-2  { background: #E67C73; }
.gc-3  { background: #F4511E; }
.gc-4  { background: #F6BF26; color: #333; }
.gc-5  { background: #33B679; }
.gc-6  { background: #0B8043; }
.gc-7  { background: #039BE5; }
.gc-8  { background: #3F51B5; }
.gc-9  { background: #7986CB; }
.gc-10 { background: #8E24AA; }
.gc-11 { background: #616161; }

/* ── MONTH VIEW ───────────────────────────────────────────────────────── */

.month-day-names {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
  background: #c2e8e0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.month-day-name {
  text-align: center;
  padding: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-right: 1px solid var(--grid-border);
}
.month-day-name:last-child { border-right: none; }

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
}
.month-cell {
  min-height: 110px;
  border-right: 1px solid var(--grid-border);
  border-bottom: 1px solid var(--grid-border);
  padding: 4px;
  background: #d4f0ea;
  overflow: hidden;
}
.month-cell.other-month { background: #bfe6de; }
.month-cell.is-today    { background: #bde8de; }
.month-date-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px;
  cursor: pointer;
  display: inline-block;
  padding: 1px 4px;
  border-radius: 3px;
  transition: background .12s, color .12s;
}
.month-date-num:hover { background: var(--pm-light); color: var(--pm); }
.month-cell.is-today .month-date-num { color: var(--pm); }

.month-event-bar {
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.month-event-bar:hover { filter: brightness(1.1); }
.month-event-bar.drag-over { opacity: .7; outline: 2px dashed rgba(255,255,255,.8); }
.month-more {
  font-size: 10px;
  color: var(--text-muted);
  padding: 1px 2px;
}

/* ── HOURS PANEL (bottom) ─────────────────────────────────────────────── */

.hours-panel {
  max-height: var(--hours-h);
  background: #0a0a0a;
  border-top: 2px solid #18b89e;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.hours-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 6px;
  flex-shrink: 0;
}
.hours-panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #7de8d4;
}
.weekly-hours-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}
.hours-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius);
  background: #1c1c1c;
  border: 1px solid #2e2e2e;
  font-size: 13px;
  color: #e5e5e5;
}
.hours-row.pm-row { background: #0f2e29; border-color: var(--pm); }
.hours-name {
  font-weight: 600;
  color: #f0f0f0;
}
.hours-name.pm-name {
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 1px 7px;
  border-radius: 12px;
  font-size: 12px;
}
.hours-count {
  color: #8a8a8a;
  font-size: 12px;
}
/* "!" conflict marker in the hours panel — one per conflicting employee */
.conflict-exclaim {
  font-weight: 800;
  font-size: 13px;
  color: #ef4444;
  flex-shrink: 0;
  line-height: 1;
}
.conflict-exclaim::before { content: '!'; }
.no-hours-msg {
  color: #555;
  font-style: italic;
  font-size: 13px;
  padding: 6px 4px;
}

/* ── HOURS BAR CHART ─────────────────────────────────────────────────── */

.hours-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}
.chart-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chart-label {
  width: 130px;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-track {
  flex: 1;
  background: #f0f2f5;
  border-radius: 4px;
  height: 28px;
  position: relative;
  overflow: hidden;
}
.chart-bar {
  height: 100%;
  border-radius: 4px;
  min-width: 4px;
  transition: width .4s cubic-bezier(.25,.8,.25,1);
}
.chart-value {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  width: 54px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════════════ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10,10,20,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(2px);
}
.modal.hidden { display: none; }

.modal-box {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: 500px;
  max-width: 95vw;
  min-height: 60vh;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-box-sm { width: 380px; min-height: 60vh; }
.modal-box-lg { width: 640px; min-height: 60vh; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 800; }
.modal-close {
  background: none; border: none; font-size: 16px;
  cursor: pointer; color: var(--text-muted); padding: 2px 6px; border-radius: 4px;
}
.modal-close:hover { background: var(--bg); }

.settings-send-receive-row {
  display: flex; gap: 8px; margin: 4px 0 12px;
}
.settings-send-receive-row .btn { flex: 1; }

.settings-header-right { display: flex; align-items: center; gap: 10px; }
.settings-loggedin-name { font-size: 12px; font-weight: 600; color: var(--text-muted); }

.settings-pw-details { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }
.settings-pw-details > summary {
  list-style: none; cursor: pointer; font-size: 13px; font-weight: 700;
  color: var(--text); padding: 4px 0; user-select: none;
  display: flex; align-items: center; gap: 6px;
}
.settings-pw-details > summary::-webkit-details-marker { display: none; }
.settings-pw-details > summary::before {
  content: '▸'; font-size: 10px; color: var(--text-muted);
  transition: transform .15s ease;
}
.settings-pw-details[open] > summary::before { transform: rotate(90deg); }
.settings-pw-body { margin-top: 8px; }

.modal-body {
  padding: 18px 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-time-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-time-input {
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
  transition: border-color .15s;
}
.modal-time-input:focus {
  border-color: var(--pm);
}
.modal-time-sep {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.modal-original-time {
  font-size: 12px;
  color: #f59e0b;
  font-style: italic;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-original-time.hidden { display: none; }
.modal-section { display: flex; flex-direction: column; gap: 6px; }
.modal-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}

.modal-emp-chips-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.modal-emp-chips {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.modal-emp-add-wrap { position: relative; flex-shrink: 0; }
.modal-emp-add-btn { align-self: flex-start; }
.modal-emp-add-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 100;
  min-width: 200px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal-emp-add-menu.hidden { display: none; }
.modal-emp-add-item {
  padding: 6px 10px;
  border-radius: var(--radius);
  background: #f0f2f5;
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.modal-emp-add-item:hover { filter: brightness(0.95); }
.modal-emp-add-empty { padding: 6px 10px; font-size: 12px; color: var(--text-muted); }
.modal-emp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
}
/* Spot pills (horizontal) in the shift pop-up */
.modal-spot-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 12px;
  border-radius: 20px;
  background: #e5e7eb;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}
.modal-spot-pill--empty {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  cursor: pointer;
}
.modal-spot-pill--empty:hover { background: #f5f5f5; }
.modal-spot-pill .spot-q {
  display: inline-block;
  min-width: 14px;
  text-align: center;
  font-weight: 700;
}
.modal-spot-pill .spot-x {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 50%;
  opacity: .55;
  color: inherit;
}
.modal-spot-pill .spot-x:hover { opacity: 1; background: rgba(0,0,0,.08); }
.modal-prev-emp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.modal-prev-emp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 4px 3px 10px;
  border-radius: 20px;
  background: #efefef;
  font-size: 12px;
  color: #666;
  font-weight: 500;
}
.prev-emp-name { white-space: nowrap; }
.prev-emp-hrs  { font-size: 11px; color: #888; font-weight: 400; white-space: nowrap; }
.prev-emp-x {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 50%;
  opacity: .5;
  color: inherit;
}
.prev-emp-x:hover { opacity: 1; background: rgba(0,0,0,.1); }
.spot-pill-wrap {
  display: inline-flex;
  align-items: center;
}
.spot-x-outer {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 50%;
  opacity: .4;
  color: #555;
  margin-left: 1px;
}
.spot-x-outer:hover { opacity: 1; background: rgba(0,0,0,.08); }
.modal-emp-chip.pm-chip-modal {
  background: var(--pm);
  color: #fff;
}
.remove-emp-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; opacity: .6; padding: 0; line-height: 1;
}
.remove-emp-btn:hover { opacity: 1; }

.modal-drop-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.modal-select,
.modal-textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  width: 100%;
}
.modal-select:focus,
.modal-textarea:focus { border-color: var(--pm); }
.modal-textarea { min-height: 80px; resize: vertical; }

.modal-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* PM workload modal */
.pm-workload-controls {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.pm-workload-date-label {
  font-size: 12px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.pm-workload-date-label input { font-size: 13px; }
.modal-dontnest-label {
  font-size: 12px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
}

.pm-workload-future-label {
  font-size: 12px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; user-select: none;
}
.pm-workload-hint {
  font-size: 11px; color: var(--text-muted); font-style: italic;
  margin-bottom: 10px;
}
.pm-workload-list {
  display: flex; flex-direction: column; gap: 14px;
  max-height: 60vh; overflow-y: auto;
}
.pm-workload-empty {
  color: var(--text-muted); font-size: 13px; padding: 8px 0;
}
.pm-workload-pm {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); padding: 10px 12px;
}
.pm-workload-pm-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.pm-workload-pm-name {
  font-weight: 700; font-size: 13px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--pm); color: #fff;
}
.pm-workload-pm-count {
  font-size: 11px; color: var(--text-muted);
}
.pm-workload-project-list {
  display: flex; flex-direction: column; gap: 6px;
}
.pm-workload-project-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 8px; border-radius: 6px; background: #fff;
  border: 1px solid var(--border);
}
.pm-workload-project-name {
  font-weight: 600; font-size: 13px; color: var(--text);
}
.pm-workload-project-meta {
  font-size: 11px; color: var(--text-muted);
}

/* hidden items modal */
.hidden-items-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-style: italic;
}
.hidden-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
}
.hidden-item-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.hidden-item-row:hover {
  background: var(--pm-light);
  border-color: var(--pm);
}
.hidden-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.hidden-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.hidden-items-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 0;
  text-align: center;
}

.pm-confirm-text {
  font-size: 14px;
  line-height: 1.5;
  padding: 4px 0;
}

/* PM color picker */
.pm-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pm-color-row input[type="color"] {
  width: 40px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 2px;
  background: none;
}
.pm-color-preview {
  height: 28px;
  width: 90px;
  border-radius: 14px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.pm-color-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

/* assign PM modal */
.assign-pm-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 10px;
}
.assign-pm-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.assign-pm-controls button {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
}
.assign-pm-controls button:hover { background: var(--pm-light); border-color: var(--pm); }
.assign-pm-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}
.assign-pm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.assign-pm-row:hover { background: var(--pm-light); border-color: var(--pm); }
.assign-pm-row input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--pm);
  cursor: pointer;
  flex-shrink: 0;
}
.assign-pm-info { flex: 1; }
.assign-pm-name { font-size: 13px; font-weight: 700; }
.assign-pm-meta { font-size: 11px; color: var(--text-muted); }

/* create event modal */
.create-event-box { width: 460px; }
.ce-type-row {
  display: flex;
  gap: 20px;
}
.ce-type-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.ce-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ce-datetime-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.ce-datetime-header .modal-section-label { margin-bottom: 0; }
.ce-multiday-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.ce-time-row { gap: 6px; margin-bottom: 6px; }
.ce-time-row:last-child { margin-bottom: 0; }
.ce-row-label {
  font-size: 11px;
  color: var(--text-muted);
  width: 30px;
  flex-shrink: 0;
  padding-top: 7px;
}
.ce-date { flex: 1.4; }
.ce-time { flex: 1; }
.ce-end-date-input { display: none; }
.ce-end-date-input.visible { display: block; }
.ce-emp-add { margin-top: 6px; }
#ceShiftFields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* employee profile modal */
.emp-modal-row {
  display: flex;
  gap: 8px;
}
.emp-modal-row .modal-select {
  flex: 1;
}
.emp-modal-pm-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.emp-modal-pm-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  user-select: none;
}
.emp-modal-pm-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--pm);
  cursor: pointer;
}
.emp-modal-pm-text { color: var(--text); }
.emp-modal-pm-badge {
  background: var(--pm);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: .5px;
}
.emp-modal-pm-badge.hidden { display: none; }
.emp-modal-hours {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.emp-modal-hours strong { color: var(--pm); font-size: 15px; }

/* calendar check list in settings */
.calendar-check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}
.cal-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  user-select: none;
}
.cal-check-row:hover { background: var(--pm-light); border-color: var(--pm); }
.cal-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-check-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}
.cal-check-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--pm);
  cursor: pointer;
}

/* ── SETTINGS COLLAPSIBLE SECTIONS ───────────────────────────────────── */

.settings-collapse-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
}
.settings-collapse-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-alt, #f5f7fa);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  user-select: none;
  transition: background 0.12s;
}
.settings-collapse-btn:hover { background: var(--pm-light); }
.settings-collapse-arrow {
  font-size: 11px;
  transition: transform 0.2s;
  display: inline-block;
}
.settings-collapse-btn[aria-expanded="false"] .settings-collapse-arrow {
  transform: rotate(-90deg);
}
.settings-collapse-body {
  padding: 10px;
  border-top: 1px solid var(--border);
}
.settings-collapse-body.collapsed { display: none; }

.settings-pull-scope-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.settings-pull-scope-label { flex: 1; font-size: 13px; }
.settings-pull-scope-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #bbb;
  border-radius: 22px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: #18b89e; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── SCROLLBAR ────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8cdd6; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0a8b4; }

.hours-panel ::-webkit-scrollbar-thumb { background: #333; }
.hours-panel ::-webkit-scrollbar-thumb:hover { background: #555; }

/* employee shifts modal */
.emp-shifts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
}
.emp-shift-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--pm);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.emp-shift-row:hover { background: var(--pm-light); }
.emp-shift-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.emp-shift-pm-badge {
  background: var(--pm);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  letter-spacing: .4px;
}
.emp-shift-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.emp-shift-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.emp-shift-hrs {
  font-size: 11px;
  font-weight: 700;
  color: var(--pm-dark);
}
/* calendar list inside employee modal */
.emp-cal-list {
  max-height: 240px;
  overflow-y: auto;
  margin-top: 6px;
}
.emp-cal-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.emp-cal-details > summary::-webkit-details-marker { display: none; }
.emp-cal-details > summary::before {
  content: '▸';
  font-size: 11px;
  transition: transform 0.15s;
}
.emp-cal-details[open] > summary::before { transform: rotate(90deg); }
.emp-cal-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.add-emp-cal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.add-emp-cal-list .emp-cal-hint {
  padding: 4px 0;
}

.emp-shifts-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: 10px 0;
  text-align: center;
}

/* ── EMPLOYEE DAY CONTEXT MENU ─────────────────────────────────────────── */

#empDayMenu {
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 320px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.emp-day-menu-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.emp-day-section {
  display: flex;
  flex-direction: column;
}
.emp-day-section + .emp-day-section {
  border-top: 1px solid var(--border);
}
.emp-day-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--pm-dark);
  padding: 7px 14px 3px;
}
.emp-day-section-label-assigned {
  color: var(--text-muted);
}
.emp-day-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .1s;
}
.emp-day-row:hover {
  background: var(--bg);
}
.emp-day-row-add:hover {
  background: var(--pm-light);
}
.emp-day-row-remove {
  opacity: .75;
}
.emp-day-row-remove:hover {
  background: #fef2f2;
  opacity: 1;
}
.emp-day-row-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emp-day-row-add .emp-day-row-name::before {
  content: '+ ';
  color: var(--pm-dark);
}
.emp-day-row-remove .emp-day-row-name::before {
  content: '✕ ';
  color: #ef4444;
  font-size: 10px;
}
.emp-day-row-time {
  font-size: 11px;
  color: var(--text-muted);
}
.emp-day-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: 14px;
  text-align: center;
}

/* ═════════════════════════════════════════════════════════════════════════
   RESPONSIVE — tablet + phone
   ═════════════════════════════════════════════════════════════════════════ */

/* employee panel drawer toggle — hidden on desktop */
.emp-panel-toggle { display: none; }

/* ── Tablet ≤ 1024px ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --panel-w: 180px;
    --hours-h: 130px;
  }
  .toolbar { gap: 10px; padding: 0 12px; }
  .toolbar-divider { display: none; }
  .brand { font-size: 13px; padding: 2px 8px; }
  .range-label { font-size: 12px; }
}

/* ── Phone ≤ 720px: employee panel becomes a slide-over drawer ────── */
@media (max-width: 720px) {
  :root {
    --toolbar-h: 48px;
    --hours-h: 180px;
  }
  .toolbar {
    gap: 6px;
    /* No left padding — the sticky hamburger must start at exactly 0 so no
       content can peek to its left when the toolbar scrolls horizontally. */
    padding: 0 8px 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .toolbar::-webkit-scrollbar { display: none; }
  .brand { display: none; }
  .emp-panel-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 6px 14px;
    margin-left: 0;
    flex-shrink: 0;
    /* Stay pinned to the left edge of the toolbar even when the user
       scrolls the toolbar horizontally to reach buttons on the right.
       An opaque background + right-side shadow fully mask anything that
       tries to scroll underneath or peek to its left. */
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: 6px 0 10px -2px rgba(0,0,0,.22);
  }
  /* Extra opaque strip attached to the button's right edge, guarantees no
     scrolling content bleeds through the 1-2px seam between the button and
     the next toolbar item. */
  .emp-panel-toggle::after {
    content: '';
    position: absolute;
    top: 0;
    right: -6px;
    width: 6px;
    height: 100%;
    background: var(--surface);
  }
  .toolbar-spacer { display: none; }
  .range-label { display: none; }

  /* Employee panel as slide-in drawer */
  .main-layout { position: relative; }
  .employee-panel {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: min(280px, 82vw);
    z-index: 1600;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,.18);
  }
  body.emp-panel-open .employee-panel { transform: translateX(0); }
  body.emp-panel-open::after {
    content: '';
    position: fixed;
    inset: var(--toolbar-h) 0 0 0;
    background: rgba(0,0,0,.35);
    z-index: 1550;
  }
  .calendar-area { width: 100%; }

  /* Bigger tap targets */
  .nav-btn, .view-btn, .btn { min-height: 36px; }
  .view-btn { padding: 6px 14px; font-size: 14px; }
  .nav-btn { padding: 6px 12px; font-size: 16px; }
  .date-input { font-size: 14px; padding: 4px 6px; }

  /* Hours panel compact */
  .hours-panel-header { padding: 4px 10px; font-size: 12px; }
  .hours-panel-title { font-size: 13px; }

  /* Modals: near-full screen */
  .modal-box,
  .modal-box-sm,
  .modal-box-lg {
    width: 96vw;
    max-width: 96vw;
    min-height: 0;
    max-height: 94vh;
  }
  .modal-header { padding: 12px 14px 10px; }
  .modal-title { font-size: 16px; }
  .modal-body { padding: 12px 14px; }
  .modal-footer { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
  .modal-footer .btn { min-height: 40px; }

  /* Make form rows stack */
  .emp-modal-row { flex-direction: column; gap: 6px; }
  .emp-modal-row .modal-select { width: 100%; }


  /* Create event time rows */
  .ce-time-row { flex-wrap: wrap; }
  .ce-time-row .ce-date,
  .ce-time-row .ce-time { flex: 1 1 140px; }
}

/* ── Very narrow / phone portrait ≤ 480px ────────────────────────────── */
@media (max-width: 480px) {
  :root { --hours-h: 170px; }
  .toolbar { gap: 4px; padding: 0 6px; }
  .view-btn { padding: 6px 10px; font-size: 13px; }
  .btn { font-size: 13px; padding: 6px 10px; }
  .search-input { max-width: 140px; }
}

/* ── Fine tweak for pointer: coarse (touch) — enlarge hit areas ─────── */
@media (pointer: coarse) {
  .emp-chip, .calendar-check-row, .add-emp-cal-row { padding-top: 8px; padding-bottom: 8px; }
}

/* ── Unavailability (empModal list + inline editor) ───────────────────── */
.unavail-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.unavail-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 2px;
}
.unavail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #fdf2f2;
  border: 1px solid #f3c7cc;
  border-radius: var(--radius);
  font-size: 13px;
}
.unavail-text { flex: 1; }
.unavail-note { color: var(--text-muted); font-style: italic; }
.unavail-remove {
  background: none; border: none; cursor: pointer; font-size: 14px;
  opacity: .55; color: inherit; padding: 2px 6px; border-radius: 50%;
}
.unavail-remove:hover { opacity: 1; background: rgba(0,0,0,.08); }
.unavail-add-btn { align-self: flex-start; }
.unavail-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #f8f8fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 4px;
}
.unavail-editor-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.unavail-editor-sep { font-weight: 700; opacity: .6; }
.unavail-editor input[type="date"],
.unavail-editor input[type="time"] {
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.unavail-note-input {
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.unavail-editor-actions { display: flex; gap: 6px; }
.unavail-fullday-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}
.unavail-fullday-row input { margin: 0; }
.avail-block--fullday {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(178, 58, 72, .28) 0 4px,
    rgba(178, 58, 72, .5) 4px 8px
  );
  border-style: solid;
  border-width: 1.5px;
}

/* ── Outage blocks (rendered inline in every column) ───────────────────── */
.avail-block {
  position: absolute;
  left: 2px;
  right: 2px;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(178, 58, 72, .18) 0 6px,
    rgba(178, 58, 72, .32) 6px 12px
  );
  border: 1px dashed #b23a48;
  border-radius: 3px;
  color: #7a1823;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 4px;
  pointer-events: auto;
  cursor: default;
  z-index: 4;
  overflow: hidden;
  transition: opacity .12s;
}
.avail-block:hover {
  /* Elevate on hover so stacked/overlapping blocks reveal their owner */
  z-index: 50 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.avail-block-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
/* Full-name overlay — hidden until hover */
.avail-block-hovername {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avail-block:hover .avail-block-hovername { display: block; }
/* Filtered employee chip in availability mode */
.emp-chip--avail-selected {
  outline: 2px solid #b23a48;
  outline-offset: 1px;
}

/* ── Unavailability override dot on assignment pills ───────────────────── */
.ev-spot-override {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
  margin-left: 4px;
  vertical-align: middle;
}
.modal-spot-pill--override { box-shadow: inset 0 0 0 1px #f59e0b; }

/* ── Login screen ────────────────────────────────────────────────────────── */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-screen.hidden { display: none; }

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 32px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.login-brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--pm);
  letter-spacing: -.5px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -6px;
  margin-bottom: 4px;
}
.login-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.login-input:focus { border-color: var(--pm); }
.login-btn {
  width: 100%;
  padding: 10px;
  background: var(--pm);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}
.login-btn:hover { background: var(--pm-dark); }
.login-error {
  font-size: 12px;
  color: #c62828;
  min-height: 16px;
}
/* Prevent background interaction while login is showing */
body.login-active > *:not(#loginScreen) { pointer-events: none; }

/* PM visibility filter — checkbox on each PM chip + "Select All PMs" row */
.pm-select-all-row {
  padding: 4px 10px 6px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.pm-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #666);
  cursor: pointer;
  user-select: none;
}
.pm-select-all-cb { cursor: pointer; margin: 0; }
.chip-pm-visible {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  margin: 0;
  cursor: pointer;
  z-index: 2;
  accent-color: var(--pm-dark, #4a5568);
}
.emp-chip--pm-hidden { opacity: 0.42; }
.emp-chip--pm-hidden:hover { opacity: 0.72; }
