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

:root {
  --c-primary:     var(--c-primary);
  --c-primary-h:   var(--c-primary-h);
  --c-accent:      var(--c-accent);
  --c-sidebar:     #1a2332;
  --c-sidebar-act: var(--c-sidebar-act);
  --c-bg:          #eceff1;
  --c-savebar:     #c8e6c9;
  --c-savebar-b:   #a5d6a7;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--c-bg);
  color: #212121;
  font-size: 14px;
}

/* ===================== LAYOUT ===================== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: 56px;
  background: var(--c-sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 16px;
  flex-shrink: 0;
  z-index: 200;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--c-accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  user-select: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  width: 100%;
  padding: 0 8px;
}

.nav-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #78909c;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.nav-btn:hover { background: var(--c-sidebar-act); color: #cfd8dc; }
.nav-btn.active { background: var(--c-sidebar-act); color: #66bb6a; }

/* ===================== MAIN AREA ===================== */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ===================== TOPBAR ===================== */
.topbar {
  background: var(--c-primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 48px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 6px; }
.topbar-center { flex: 1; text-align: center; }
.topbar-right { display: flex; align-items: center; gap: 6px; }

.salon-select {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  min-width: 200px;
  max-width: 320px;
  cursor: pointer;
  height: 32px;
}
.salon-select option { background: var(--c-primary-h); color: #fff; }

.tb-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 0 10px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  transition: background 0.15s;
}
.tb-btn:hover { background: rgba(255,255,255,0.28); }

.update-label { font-size: 12px; opacity: 0.75; white-space: nowrap; }

.month-nav-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  opacity: 0.85;
  transition: background 0.15s;
}
.month-nav-btn:hover { background: rgba(255,255,255,0.2); opacity: 1; }

.month-display {
  font-size: 14px;
  font-weight: 700;
  min-width: 110px;
  text-align: center;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
  position: relative;
}
.month-display:hover { background: rgba(255,255,255,0.15); }
.month-input-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.user-btn { border-radius: 50% !important; width: 32px; padding: 0 !important; }
.nav-btn-top { color: rgba(255,255,255,0.85); }
.nav-btn-top:hover { background: rgba(255,255,255,0.2) !important; color: #fff !important; }

/* ===================== SAVE BAR ===================== */
.savebar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 7px 16px;
  background: var(--c-savebar);
  border-bottom: 1px solid var(--c-savebar-b);
  flex-shrink: 0;
  z-index: 50;
}

.dirty-label { font-size: 13px; font-weight: 600; color: #388e3c; margin-right: auto; }
.dirty-label.changed { color: #e65100; }

/* ===================== SECTIONS ===================== */
.section { display: none; flex: 1; min-height: 0; flex-direction: column; }
.section.active { display: flex; }

#section-shift.active,
#section-attendance.active,
#section-substitute.active,
#section-settings.active { overflow: hidden; }

.section-scroll { flex: 1; overflow-y: auto; }

/* ===================== SCHEDULE SECTION ===================== */
.schedule-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.selected-emp-label {
  flex: 1;
  font-size: 13px;
  color: #546e7a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-search {
  padding: 6px 14px;
  border: 1px solid #cfd8dc;
  border-radius: 20px;
  font-size: 13px;
  width: 220px;
  background: #f5f5f5;
  transition: border-color 0.15s, background 0.15s;
}
.emp-search:focus { outline: none; border-color: var(--c-accent); background: #fff; }

.schedule-wrap {
  flex: 1;
  overflow: auto;
  background: #fff;
}

/* ===================== SCHEDULE TABLE ===================== */
.scheduleTable {
  border-collapse: collapse;
  font-size: 11px;
  width: max-content;
  min-width: 100%;
}

/* Week header */
.weekHeaderRow th {
  background: #f5f7fa;
  padding: 3px 4px;
  font-size: 10px;
  font-weight: 700;
  color: #90a4ae;
  text-align: center;
  border: 1px solid #e8ecef;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.weekHeaderRow .wh-emp {
  position: sticky;
  left: 0;
  z-index: 7;
  background: #f5f7fa;
  text-align: left;
  padding-left: 10px;
  font-size: 11px;
  color: #78909c;
  font-weight: 600;
}
.weekHeaderRow .wh-label { color: #78909c; }
.weekHeaderRow .wh-label.current { color: var(--c-accent); }

/* Day number row */
.dayHeadRow th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fafbfc;
  border: 1px solid #e8ecef;
  padding: 4px 2px;
  text-align: center;
  white-space: nowrap;
}
.dayHeadRow .dh-emp {
  position: sticky;
  left: 0;
  z-index: 8;
  background: #fafbfc;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
}

.dayHead {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  font-size: 11px;
  font-weight: 700;
  color: #546e7a;
}
.dayHead.weekend { color: #e53935; }

/* Employee rows */
.empRow { transition: background 0.1s; }
.empRow:hover td { background: #f9fffe; }

.empNameTd {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  padding: 5px 8px;
  cursor: pointer;
  border: 1px solid #e8ecef;
  transition: background 0.12s;
}
.empNameTd:hover { background: #f1f8e9; }
.empNameTd.selected {
  background: #e8f5e9;
  border-left: 3px solid var(--c-accent);
}

.emp-cell-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

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

.emp-info { min-width: 0; overflow: hidden; }
.emp-info b {
  display: block;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1a2332;
}
.emp-info span {
  font-size: 10px;
  color: #90a4ae;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.scheduleCell {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  height: 42px;
  vertical-align: top;
  cursor: pointer;
  padding: 1px 1px;
  border: 1px solid #eef0f3;
  background: #fafbfc;
  transition: background 0.1s;
}
.scheduleCell:hover {
  background: #e8f5e9;
  outline: 1px solid #a5d6a7;
  outline-offset: -1px;
}
.scheduleCell.weekend-col { background: #fdf7f7; }
.scheduleCell.weekend-col:hover { background: #fce4ec; outline-color: #f48fb1; }

/* Shift chips */
.scheduleShift {
  border-radius: 3px;
  padding: 1px 2px;
  margin: 1px 0;
  background: #00695c;
  color: #e8f5e9;
  font-size: 9px;
  line-height: 1.15;
  text-align: center;
  min-height: 18px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.scheduleShift:hover { outline: 1.5px solid #212121; }
.scheduleShift.locked { background: #37474f; }
.scheduleShift.pendingCreate { background: #0277bd; }
.scheduleShift.pendingUpdate { background: #e65100; }

/* ===================== PANELS ===================== */
.panels-row {
  display: flex;
  gap: 16px;
  padding: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.panel {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  min-width: 280px;
  max-width: 340px;
  flex: 1;
}

.panel-employees { max-width: 520px; flex: 2; }

.panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a2332;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8f5e9;
}

/* ===================== BUTTONS ===================== */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-h); }
.btn-secondary { background: #546e7a; color: #fff; }
.btn-secondary:hover { background: #37474f; }
.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #b71c1c; }
.btn-save { background: var(--c-primary); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ===================== FORM ELEMENTS ===================== */
label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #546e7a;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="month"],
select {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin: 4px 0 6px;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-size: 13px;
  background: #fafafa;
  color: #212121;
  transition: border-color 0.15s, background 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--c-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(67,160,71,0.12);
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #37474f;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 8px;
  cursor: pointer;
}
.check-label input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }

.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.selected-text {
  padding: 8px 10px;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 12px;
  color: #546e7a;
  margin-bottom: 8px;
}

.status-msg { font-size: 12px; margin: 6px 0 0; min-height: 18px; }
.ok { color: var(--c-primary); font-weight: 600; }
.error { color: #c62828; font-weight: 600; }

/* ===================== EMPLOYEES GRID ===================== */
.employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.employee {
  padding: 10px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #e0e0e0;
  font-size: 12px;
  transition: border-color 0.12s, background 0.12s;
}
.employee.active { border-color: var(--c-accent); background: #e8f5e9; }
.employee:hover { border-color: #a5d6a7; }
.employee button { margin-top: 6px; }

/* ===================== LOGS ===================== */
.logs-list { max-height: 400px; overflow-y: auto; margin-top: 8px; }
.logRow {
  padding: 6px 8px;
  margin-bottom: 5px;
  border-radius: 6px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  word-break: break-all;
  color: #37474f;
}

/* ===================== SHIFT LIST (hidden panel) ===================== */
.shift {
  padding: 10px 12px;
  border-radius: 10px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  margin-bottom: 8px;
  font-size: 12px;
}
.shift.pendingCreate { border-color: #0277bd; background: #e3f2fd; }
.shift.pendingUpdate { border-color: #e65100; background: #fff3e0; }
.shiftActions { margin-top: 6px; }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none !important; }

.modal-box {
  position: relative;
  width: min(480px, 96vw);
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.28);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h2 {
  text-align: center;
  margin: 0 0 4px;
  font-size: 17px;
  color: #1a2332;
}
.modal-date {
  text-align: center;
  color: #78909c;
  font-size: 15px;
  margin-bottom: 14px;
}
.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #eceff1;
  color: #546e7a;
  font-size: 20px;
  cursor: pointer;
  line-height: 28px;
  text-align: center;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: #cfd8dc; }

.time-pick-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.time-pick-row input[type="time"] {
  font-size: 22px;
  text-align: center;
  padding: 10px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
.modal-actions .btn { min-width: 140px; justify-content: center; display: flex; }

/* ===================== CONTEXT MENU ===================== */
.context-menu {
  position: fixed;
  z-index: 9999;
  min-width: 210px;
  padding: 6px;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.18);
}
.context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  color: #212121;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  margin: 1px 0;
  transition: background 0.1s;
}
.context-menu button:hover { background: #e8f5e9; }
.context-menu button.danger { color: #c62828; }
.context-menu button.danger:hover { background: #ffebee; }

/* ===================== ATTENDANCE GRID ===================== */
.attCell {
    min-width: 52px; padding: 3px 2px; vertical-align: top;
    text-align: center; font-size: 11px; cursor: pointer; border: 1px solid #e0e0e0;
    transition: filter 0.1s;
}
.attCell:hover { filter: brightness(0.92); }
.att-ok       { background: #e8f5e9; }
.att-partial  { background: #fff8e1; }
.att-missing  { background: #ffebee; }
.att-future   { background: #f5f5f5; }
.att-empty    { background: #fafafa; }
.att-extra    { background: #e3f2fd; }
.att-plan { color: #90a4ae; font-size: 10px; margin-bottom: 1px; }
.att-fact { font-weight: 600; font-size: 11px; line-height: 1.3; }
.att-in  { color: var(--c-primary); }
.att-out { color: #1565c0; }

/* ===================== EMPLOYEE PREFS ===================== */
.emp-drag-handle {
    font-size: 15px; color: #b0bec5; cursor: grab; padding: 0 5px 0 0;
    user-select: none; flex-shrink: 0; line-height: 1;
}
.emp-drag-handle:active { cursor: grabbing; }
.empNameTd.emp-drop-target { background: #c8e6c9 !important; outline: 2px dashed var(--c-accent); outline-offset: -2px; }
.empNameTd.dragging { opacity: 0.35; }
.empNameTd.emp-is-hidden { opacity: 0.45; }
.empNameTd.emp-is-hidden .emp-avatar { filter: grayscale(1); }
.wh-emp { display: flex; align-items: center; gap: 6px; }
.emp-hidden-toggle {
    background: #eceff1; border: 1px solid #cfd8dc; border-radius: 4px;
    padding: 2px 8px; font-size: 11px; cursor: pointer; color: #546e7a;
    white-space: nowrap; flex-shrink: 0;
}
.emp-hidden-toggle:hover { background: #cfd8dc; }
.emp-hidden-toggle.active { background: #b2dfdb; border-color: #80cbc4; color: #004d40; }

/* ===================== UTILITY ===================== */
.hidden { display: none !important; }

/* ===================== ADMIN USERS ===================== */
#adminUsersList .employee { font-size: 12px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 720px) {

  /* --- Layout: sidebar переезжает вниз --- */
  .app-layout { flex-direction: column; }

  .sidebar {
    order: 1;
    width: 100%;
    height: 56px;
    flex-direction: row;
    padding: 0;
    border-top: 1px solid rgba(255,255,255,0.12);
    justify-content: space-around;
    flex-shrink: 0;
  }

  .main-area { order: 0; }

  .sidebar-logo { display: none; }

  .sidebar-nav {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    padding: 0;
    gap: 0;
  }

  .nav-btn {
    flex: 1;
    height: 56px;
    width: auto;
    border-radius: 0;
  }

  /* --- Топбар --- */
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 6px 10px;
    gap: 4px;
    row-gap: 4px;
  }

  .topbar-left { gap: 4px; }
  .topbar-center { display: none; }
  .topbar-right { gap: 4px; }

  .salon-select {
    min-width: 0;
    max-width: 150px;
    font-size: 12px;
    flex: 1;
  }

  /* Кнопка настроек в топбаре скрыта — есть в нижней нав-панели */
  .user-btn { display: none; }

  .tb-btn { height: 36px; padding: 0 8px; min-width: 36px; }
  .month-display { min-width: 76px; font-size: 13px; padding: 3px 4px; }

  /* --- Save bar --- */
  .savebar { padding: 5px 10px; gap: 6px; }
  .dirty-label { font-size: 12px; }

  /* --- Строка над графиком --- */
  .schedule-topbar { padding: 6px 10px; gap: 6px; }
  .selected-emp-label { display: none; }
  .emp-search { width: 100%; flex: 1; }

  /* --- Таблица графика: уже колонка сотрудника --- */
  .empNameTd,
  .dayHeadRow .dh-emp,
  .weekHeaderRow .wh-emp {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
  }

  .emp-info b { font-size: 10px; }
  .emp-avatar { width: 24px; height: 24px; font-size: 10px; }

  /* Ручка перетаскивания бесполезна на touch — скрываем */
  .emp-drag-handle { display: none; }

  /* Часы чуть меньше чтобы не давить имя */
  .emp-hours { font-size: 9px; }

  /* --- Панели (настройки, замена) --- */
  .panels-row { padding: 10px; gap: 10px; flex-direction: column; }
  .panel { min-width: 100%; max-width: 100%; }
  .logs-list { max-height: 240px; }

  /* --- Логин --- */
  .login-card {
    min-width: 92vw;
    max-width: 92vw;
    padding: 22px 18px 18px;
  }

  /* --- Модалки --- */
  .modal-box { padding: 20px 16px; border-radius: 14px; }
  .time-pick-row input[type="time"] { font-size: 18px; }

  /* --- Кнопки --- */
  .btn { padding: 8px 14px; }
}

/* ===================== LOGIN OVERLAY ===================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: #3a4d63;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  gap: 22px;
  transition: opacity 0.25s ease;
}
.login-overlay.hidden { display: none !important; }
.login-overlay.fading-out { opacity: 0; pointer-events: none; }

.login-brand {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #8baec8;
}
.login-logo-svg { flex-shrink: 0; }
.login-logo-text {
  font-size: 40px;
  font-weight: 300;
  color: #8baec8;
  letter-spacing: -1px;
  line-height: 1;
  margin-top: 4px;
}

.login-card {
  background: #fff;
  border-radius: 8px;
  padding: 30px 34px 26px;
  min-width: 350px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.28);
}

.login-title {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #1a2332;
  margin: 0 0 20px;
}

.login-field {
  display: block;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 10px;
  border: 1px solid #dce3ea;
  border-radius: 6px;
  font-size: 14px;
  background: #eef2f7;
  color: #1a2332;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}
.login-field:focus {
  outline: none;
  border-color: var(--c-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(67,160,71,0.12);
}

.login-btns { margin-top: 6px; }

.btn-login-primary {
  display: block;
  width: 100%;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-login-primary:hover { background: var(--c-primary-h); }
.btn-login-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.login-overlay-status {
  margin: 10px 0 0;
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}

/* ===================== TOAST NOTIFICATIONS ===================== */
.toast-container {
  position: fixed;
  bottom: 72px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
@media (max-width: 720px) { .toast-container { bottom: 68px; right: 12px; left: 12px; } }

.toast {
  background: #37474f;
  color: #fff;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  pointer-events: all;
  max-width: 360px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
  animation: toastIn 0.22s ease;
}
.toast.error   { background: #c62828; }
.toast.warn    { background: #e65100; }
.toast.success { background: var(--c-primary); }
@keyframes toastIn  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(8px); } }

/* ===================== LOADING SPINNER ===================== */
.schedule-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: #90a4ae;
  font-size: 14px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== SHIFT TEMPLATES ===================== */
.shift-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}
.tpl-btn {
  background: #f0f4f8;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #37474f;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.tpl-btn:hover { background: #e8f5e9; border-color: var(--c-accent); color: var(--c-primary); }

/* ===================== EMPLOYEE HOURS BADGE ===================== */
.emp-hours {
  font-size: 10px;
  font-weight: 700;
  color: #90a4ae;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

/* ===================== DRAG AND DROP ===================== */
.scheduleShift[draggable="true"] { cursor: grab; }
.scheduleShift[draggable="true"]:active { cursor: grabbing; }
.scheduleShift.dragging { opacity: 0.3; outline: 2px dashed #fff; }
.scheduleCell.drag-over {
  background: #c8e6c9 !important;
  outline: 2px dashed var(--c-accent) !important;
  outline-offset: -2px;
}

/* ===================== CONTEXT MENU IMPROVEMENTS ===================== */
.context-menu button:disabled {
  color: #b0bec5;
  cursor: default;
  background: transparent !important;
}
