/* ==========================================================================
   SmartShift — shared design system
   Tokens + component classes reused across login, scheduler, employees,
   settings and users. Keep this file as the single source of visual truth;
   page-level <style> blocks should only hold layout that is unique to that
   page (grid templates, print rules, etc).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* brand */
  --color-navy-950: #0b1830;
  --color-navy-900: #11213f;
  --color-navy-800: #172a4d;
  --color-navy-700: #22375f;
  --color-navy-600: #33486f;

  --color-brand: #1a73e8;         /* SmartShift blue — kept exact, used as an accent */
  --color-brand-dark: #0f5bc4;
  --color-brand-600: #1558b0;
  --color-brand-soft: #eaf1fd;
  --color-brand-soft-border: #cfe0fb;
  --color-accent: #3f8ce8;

  /* neutrals */
  --color-bg: #f4f6fa;
  --color-surface: #ffffff;
  --color-surface-alt: #fafbfc;
  --color-surface-sunken: #eef1f6;
  --color-border: #dfe4ec;
  --color-border-strong: #c8d0dc;

  --color-text: #16213a;
  --color-text-secondary: #545f74;
  --color-text-muted: #8892a3;
  --color-text-inverse: #eef2f9;
  --color-text-inverse-muted: #9fadc7;

  /* status */
  --color-success: #1c7c42;
  --color-success-bg: #e5f5ea;
  --color-success-border: #bfe3cb;
  --color-warning: #8a5a00;
  --color-warning-bg: #fdf1dc;
  --color-warning-border: #f2dba8;
  --color-danger: #b3261e;
  --color-danger-bg: #fbe9e7;
  --color-danger-border: #f0c6c1;
  --color-info: #1f5fae;
  --color-info-bg: #e8f0fd;
  --color-info-border: #c9dcf7;

  /* geometry */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-modal: 0 24px 60px -16px rgba(9, 16, 32, .35);

  --control-h: 38px;
  --control-h-sm: 32px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(.2, .6, .3, 1);
}

/* ── reset / base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

::selection { background: var(--color-brand-soft-border); }

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* ── app shell / nav ──────────────────────────────────────────────────── */
.app-nav {
  background: linear-gradient(180deg, var(--color-navy-950), var(--color-navy-900));
  border-bottom: 1px solid var(--color-navy-700);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 20px;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.wordmark {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
  color: var(--color-text-inverse);
  margin-right: 14px;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.wordmark-accent { color: var(--color-accent); }
.wordmark-text { display: flex; align-items: baseline; gap: 1px; }
.wordmark-icon { width: 20px; height: 20px; display: block; flex-shrink: 0; }

/* Scrollable strip for the nav links: on narrow screens with long labels
   (e.g. French) or extra admin-only links, this row scrolls horizontally
   instead of pushing the language selector / sign-out button off-screen,
   which must always stay fully visible. */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.app-nav .nav-link {
  text-decoration: none;
  color: var(--color-text-inverse-muted);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.app-nav .nav-link:hover { color: var(--color-text-inverse); background: rgba(255,255,255,.06); }
.app-nav .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-logout {
  background: none; border: none;
  color: var(--color-text-inverse-muted);
  cursor: pointer; font-size: 13px; font-weight: 500;
  padding: 7px 8px; border-radius: var(--radius-md);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.btn-logout:hover { color: #fff; background: rgba(255,255,255,.06); }

.lang-select {
  /* Override the generic form-control `width: 100%` rule above — this
     select lives in a flex nav bar, not a form column, and must size to
     its own content or it corrupts the nav's flex layout (it was
     stealing width the sign-out button needed, pushing it off-screen). */
  width: auto;
  padding: 6px 6px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--color-text-inverse-muted);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.lang-select:hover { color: #fff; border-color: rgba(255,255,255,.32); }
.lang-select:focus-visible { outline-color: var(--color-accent); }
.lang-select option { color: #111; }

/* Light-surface variant of the language select, used on the login screen */
.lang-select.on-light {
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  background: var(--color-surface);
}
.lang-select.on-light:hover { color: var(--color-text); border-color: var(--color-border-strong); }

/* ── page scaffolding ─────────────────────────────────────────────────── */
.page { max-width: 1160px; margin: 0 auto; padding: 28px 24px 48px; }
.page.page-narrow { max-width: 760px; }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.page-title { font-size: 20px; font-weight: 700; color: var(--color-text); letter-spacing: -.01em; }
.page-sub { font-size: 13px; color: var(--color-text-secondary); margin-top: 4px; }

.section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-muted);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: var(--space-3);
}
.section-label input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--color-brand); cursor: pointer; }

.divider { border: none; border-top: 1px solid var(--color-border); margin: var(--space-5) 0; }

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

/* ── panels (used sparingly — a meaningful grouping, not decoration) ──── */
.panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: var(--space-5);
}
.panel-title { font-size: 14px; font-weight: 700; color: var(--color-text); margin-bottom: var(--space-4); }

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-h);
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:disabled { cursor: not-allowed; opacity: .6; }

.btn-primary { background: var(--color-brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--color-brand-600); }
.btn-primary:active:not(:disabled) { background: var(--color-brand-dark); }
.btn-primary:disabled { background: #a9c8f5; color: #fff; }

.btn-secondary {
  background: var(--color-surface); color: var(--color-text-secondary);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--color-surface-sunken); color: var(--color-text); border-color: var(--color-border-strong); }

.btn-ghost {
  background: transparent; color: var(--color-text-secondary); border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--color-surface-sunken); color: var(--color-text); }

.btn-danger-outline {
  background: var(--color-surface); color: var(--color-danger);
  border-color: var(--color-danger-border);
}
.btn-danger-outline:hover:not(:disabled) { background: var(--color-danger-bg); border-color: var(--color-danger); }

.btn-sm { height: var(--control-h-sm); padding: 0 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* icon-only / compact row actions */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer; color: var(--color-text-secondary);
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon:hover { background: var(--color-surface-sunken); border-color: var(--color-border-strong); color: var(--color-text); }
.btn-icon.danger:hover { background: var(--color-danger-bg); border-color: var(--color-danger-border); color: var(--color-danger); }

/* text-style action button, e.g. Edit / Remove in employee rows */
.btn-text {
  background: none; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary);
  padding: 6px 10px; border-radius: var(--radius-sm);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.btn-text:hover { background: var(--color-surface-sunken); color: var(--color-text); }
.btn-text.danger:hover { background: var(--color-danger-bg); color: var(--color-danger); }

/* ── forms ────────────────────────────────────────────────────────────── */
label, .field-label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary);
  margin-bottom: 6px;
}

input[type="text"], input[type="password"], input[type="time"], input[type="date"],
input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  height: var(--control-h);
  padding: 0 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 13.5px;
  color: var(--color-text);
  outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
select { cursor: pointer; }

input:hover, select:hover, textarea:hover { border-color: var(--color-border-strong); }
input:focus, select:focus, textarea:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-soft);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--color-surface-sunken); color: var(--color-text-muted); cursor: not-allowed;
}
input::placeholder, textarea::placeholder { color: var(--color-text-muted); }

.field-row { margin-bottom: var(--space-4); }
.field-error { border-color: var(--color-danger) !important; }
.field-hint { font-size: 12px; color: var(--color-text-muted); margin-top: 5px; }
.field-hint.error { color: var(--color-danger); }

input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--color-brand); cursor: pointer; }

/* ── badges / status chips ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  line-height: 1.6;
}

/* ── alerts (warnings panel — class names match what scheduler.js emits) ─ */
.warning-item {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 12.5px; padding: 9px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  margin-bottom: 6px;
  background: var(--color-surface-alt);
}
.warning-item svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.warning-item strong { font-weight: 700; letter-spacing: .02em; margin-right: 2px; }
.warning-critical { border-left-color: var(--color-danger); background: var(--color-danger-bg); color: #7a1a15; }
.warning-warning  { border-left-color: var(--color-warning); background: var(--color-warning-bg); color: #6b4400; }
.warning-info     { border-left-color: var(--color-info); background: var(--color-info-bg); color: #163f78; }

/* ── modal system ─────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(11, 24, 48, .45);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 6vh 20px;
  z-index: 100;
  overflow-y: auto;
}
.overlay.open { display: flex; }

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%; max-width: 520px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal.modal-wide { max-width: 640px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--color-text); }

.modal-body { padding: 20px 24px; overflow-y: auto; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-surface-alt);
}

/* legacy modal alias used on a couple of pages before consolidation */
.modal-footer.no-border { border-top: none; background: transparent; }

/* ── tables (generic — grid-table below refines the scheduler grid) ──── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; color: var(--color-text-muted);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em;
  padding: 9px 10px; border-bottom: 1px solid var(--color-border);
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--color-border); }
.table tr:last-child td { border-bottom: none; }

/* ── empty states ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 44px 20px;
  color: var(--color-text-muted); font-size: 13.5px;
}
.empty-icon {
  width: 34px; height: 34px; margin: 0 auto 12px;
  color: var(--color-border-strong);
}
.empty-icon svg { width: 100%; height: 100%; }
.empty-state strong { color: var(--color-text-secondary); }

/* ── misc ─────────────────────────────────────────────────────────────── */
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

.no-print { }

@media (max-width: 640px) {
  .page { padding: 20px 16px 40px; }
  .app-nav { padding: 0 14px; gap: 2px; }
  .app-nav .nav-link { padding: 7px 9px; font-size: 13px; }
  .wordmark { margin-right: 8px; }
  /* On narrow screens the link row can't fit every item; it scrolls
     horizontally (see .nav-links) rather than clipping the language
     selector / sign-out button. Fade the trailing edge so a scrollable
     row reads as "more to see" instead of an abrupt cut. */
  .nav-links {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent 100%);
            mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent 100%);
  }
}

/* ==========================================================================
   Week / date navigation control (scheduler)
   ========================================================================== */
.week-nav {
  display: inline-flex; align-items: stretch;
  max-width: 100%;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}
.week-nav .btn-week {
  background: transparent; border: none;
  border-right: 1px solid var(--color-border);
  padding: 0 14px; height: var(--control-h);
  flex-shrink: 0;
  cursor: pointer; font-size: 13px; color: var(--color-text-secondary); font-weight: 600;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.week-nav .btn-week:hover { background: var(--color-surface-sunken); color: var(--color-text); }
.week-nav .week-label {
  padding: 0 18px; height: var(--control-h);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--color-text);
  border-right: 1px solid var(--color-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.week-nav .btn-today {
  background: transparent; border: none;
  padding: 0 14px; height: var(--control-h);
  flex-shrink: 0;
  cursor: pointer; font-size: 13px; color: var(--color-brand); font-weight: 700;
  transition: background .15s var(--ease);
}
.week-nav .btn-today:hover { background: var(--color-brand-soft); }

@media (max-width: 640px) {
  .week-nav { display: flex; flex-wrap: wrap; width: 100%; height: auto; }
  .week-nav .week-label {
    flex: 1 1 100%; order: -1;
    height: auto; min-height: var(--control-h);
    padding: 8px 10px; font-size: 12.5px;
    white-space: normal; text-overflow: clip; text-align: center;
    border-right: none; border-bottom: 1px solid var(--color-border);
  }
  .week-nav .btn-week, .week-nav .btn-today { flex: 1 1 0; padding: 0 8px; font-size: 12px; }
}

/* ── day tabs (class names emitted directly by scheduler.js) ─────────── */
.day-tabs { display: flex; gap: 4px; margin-bottom: var(--space-5); flex-wrap: wrap; }
.day-tab {
  padding: 8px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface); cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary);
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.day-tab:hover:not(.active) { background: var(--color-surface-sunken); border-color: var(--color-border-strong); }
.day-tab.active { background: var(--color-navy-900); color: #fff; border-color: var(--color-navy-900); }
.day-tab.is-today:not(.active) { border-color: var(--color-brand); color: var(--color-brand); }

/* ── who's-working rows (scheduler left panel) ────────────────────────── */
.emp-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid var(--color-border);
}
.emp-row:last-child { border-bottom: none; }
.emp-checkbox { margin-top: 3px; }
.emp-row-info { flex: 1; min-width: 0; }
.emp-row-name { font-size: 13.5px; font-weight: 600; color: var(--color-text); margin-bottom: 4px; }
.time-inputs { display: flex; gap: 6px; align-items: center; }
.time-inputs input[type="time"] { width: 104px; height: var(--control-h-sm); padding: 0 8px; font-size: 12.5px; }
.time-sep { font-size: 12px; color: var(--color-text-muted); }
.memory-hint {
  font-size: 11px; color: var(--color-brand); margin-top: 5px;
  cursor: pointer; display: inline-block;
  border-bottom: 1px dashed var(--color-brand-soft-border);
}
.memory-hint:hover { border-bottom-color: var(--color-brand); }

.btn-generate {
  width: 100%; height: 42px;
  background: var(--color-brand); color: #fff;
  border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background .15s var(--ease);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-generate:hover:not(:disabled) { background: var(--color-brand-600); }
.btn-generate:disabled { background: #aac8f2; cursor: not-allowed; }

.btn-print {
  background: var(--color-surface); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md); padding: 0 14px; height: var(--control-h-sm);
  font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--color-text-secondary);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.btn-print:hover { background: var(--color-surface-sunken); color: var(--color-text); }

/* ── schedule grid ─────────────────────────────────────────────────────── */
.grid-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 720px; }
.grid-table thead th {
  background: var(--color-surface-sunken); font-weight: 700;
  padding: 8px 6px; text-align: center;
  border: 1px solid var(--color-border); color: var(--color-text-secondary);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em;
}
.grid-table th.name-col { text-align: left; min-width: 128px; text-transform: none; font-size: 11.5px; }
.grid-table td {
  padding: 6px 4px; text-align: center;
  border: 1px solid var(--color-border);
  font-size: 11px; min-width: 54px;
}
.grid-table tbody tr:nth-child(even) td:not([class*="cell-"]) { background: var(--color-surface-alt); }
.grid-table td.name-cell {
  font-weight: 600; text-align: left;
  padding-left: 10px; font-size: 12px; color: var(--color-text);
  background: var(--color-surface-alt);
}

/* station colours — one distinguishable, muted hue per station */
.cell-off     { color: #b3bac6; }
.cell-break   { background: #f7f1d4; color: #7a6300; font-weight: 600; }
.cell-prep    { background: #efece3; color: #5c5040; font-weight: 600; }
.cell-Poste1  { background: #e0f2e8; color: #1e6b46; font-weight: 600; }
.cell-Poste2  { background: #e1f0f4; color: #1f6e82; font-weight: 600; }
.cell-Poste3  { background: #e7e7f7; color: #48479e; font-weight: 600; }
.cell-TEL     { background: #e2eef8; color: #1f6fae; font-weight: 600; }
.cell-TEL_2   { background: #c8e0f5; color: #135d9a; font-weight: 600; }
.cell-Caisse  { background: #eee6f8; color: #6a3f9e; font-weight: 600; }
.cell-H       { background: #f6ecd8; color: #8a5a12; font-weight: 600; }
.cell-RPA     { background: #f3e6ee; color: #7d3a63; font-weight: 600; }
.cell-Dispill { background: #e8eaee; color: #4a5568; font-weight: 600; }
.cell-HorsChaine { background: #faeddb; color: #a05a10; font-weight: 600; font-style: italic; }
.cell-PlaceOrder { background: #dcf0f7; color: #146685; font-weight: 600; }
.cell-Nurse      { background: #fbe6ea; color: #99304f; font-weight: 600; }

/* editable cells — no emoji affordance, just a quiet interactive treatment */
.cell-editable { cursor: pointer; transition: box-shadow .12s var(--ease); }
.cell-editable:hover { box-shadow: inset 0 0 0 1.5px var(--color-brand); }

.cell-select {
  font-size: 11px; border: none; background: transparent;
  width: 100%; cursor: pointer; text-align: center; outline: none;
}

/* ==========================================================================
   Employees
   ========================================================================== */
.emp-list { display: flex; flex-direction: column; gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.emp-card {
  background: var(--color-surface);
  padding: 13px 16px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: background .12s var(--ease);
}
.emp-card:hover { background: var(--color-surface-alt); }
.emp-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--color-navy-800); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13.5px; flex-shrink: 0;
}
.emp-name { font-weight: 600; font-size: 14px; color: var(--color-text); }
.emp-notes { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }
.emp-skills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }

/* Skill badges — restrained: a small dot + label rather than a bright pill */
.skill-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px 2px 6px;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
.skill-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.skill-preferred::before { background: var(--color-success); }
.skill-preferred { color: #1e6b34; border-color: var(--color-success-border); }
.skill-trained::before { background: var(--color-brand); }
.skill-trained { color: var(--color-brand-dark); border-color: var(--color-brand-soft-border); }
.skill-backup::before { background: #a5730c; }
.skill-backup { color: #8a5a00; border-color: var(--color-warning-border); }
.skill-avoid_unless_necessary::before { background: var(--color-danger); }
.skill-avoid_unless_necessary { color: var(--color-danger); border-color: var(--color-danger-border); }
.skill-not_trained::before { background: var(--color-border-strong); }
.skill-not_trained { color: var(--color-text-muted); }

.emp-actions { margin-left: auto; display: flex; gap: 4px; flex-shrink: 0; }

/* skills grid inside the employee modal */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.skill-row { display: flex; flex-direction: column; gap: 4px; }
.skill-row label { margin-bottom: 0; }
.skill-row select { height: var(--control-h-sm); font-size: 12.5px; }

/* schedule-block config */
#sbConfig { display: none; padding-top: 4px; }
#sbConfig.visible { display: block; }
.sb-row { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-end; }
.sb-field { flex: 1; }
.sb-field label { margin-bottom: 4px; }
.sb-field select, .sb-field input[type="time"] { height: var(--control-h-sm); font-size: 12.5px; }

.days-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.day-chip {
  padding: 5px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong); background: var(--color-surface);
  font-size: 12px; font-weight: 600; color: var(--color-text-secondary);
  cursor: pointer; user-select: none; transition: all .12s var(--ease);
}
.day-chip:hover { border-color: var(--color-brand); color: var(--color-brand); }
.day-chip.selected { background: var(--color-navy-900); color: #fff; border-color: var(--color-navy-900); }

/* Special weekly assignment cards */
.swa-card {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  padding: 14px 16px; margin-bottom: 12px;
}
.swa-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.swa-card-head strong { font-size: 12px; font-weight: 700; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: .03em; }
.swa-block-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.swa-block-row select { height: var(--control-h-sm); font-size: 12.5px; }
.swa-block-row span { color: var(--color-text-muted); font-size: 12px; }

/* ==========================================================================
   Settings — break priority list
   ========================================================================== */
#priorityList {
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.priority-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  cursor: grab; user-select: none;
  transition: background .1s var(--ease);
}
.priority-item:last-child { border-bottom: none; }
.priority-item:active { cursor: grabbing; }
.priority-item.dragging { opacity: .4; }
.priority-item.drag-over { background: var(--color-brand-soft); }

.drag-handle { color: var(--color-border-strong); flex-shrink: 0; display: flex; }
.drag-handle svg { width: 16px; height: 16px; }

.priority-badge {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-navy-900); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.priority-badge.disabled { background: var(--color-border-strong); color: var(--color-surface); }

.station-name { font-size: 13.5px; font-weight: 600; color: var(--color-text); flex: 1; }
.station-tag { font-size: 11.5px; color: var(--color-text-muted); }

.priority-toggle {
  width: 34px; height: 19px; border-radius: 10px;
  background: var(--color-border-strong); border: none; cursor: pointer;
  position: relative; transition: background .18s var(--ease); flex-shrink: 0;
}
.priority-toggle.on { background: var(--color-brand); }
.priority-toggle::after {
  content: ""; position: absolute;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px;
  transition: transform .18s var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.priority-toggle.on::after { transform: translateX(15px); }

.save-msg {
  display: none; margin-top: 12px;
  font-size: 12.5px; color: var(--color-success); font-weight: 600;
}

.dot-Poste1  { background: #1e6b46; }
.dot-Poste2  { background: #1f6e82; }
.dot-Poste3  { background: #48479e; }
.dot-TEL     { background: #1f6fae; }
.dot-TEL_2   { background: #135d9a; }
.dot-Caisse  { background: #6a3f9e; }
.dot-H       { background: #8a5a12; }
.dot-RPA     { background: #7d3a63; }
.dot-Dispill { background: #4a5568; }

/* ==========================================================================
   Users
   ========================================================================== */
.user-list { display: flex; flex-direction: column; gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.user-card {
  background: var(--color-surface);
  padding: 13px 16px;
  display: flex; align-items: center; gap: 14px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--color-navy-800); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13.5px; flex-shrink: 0;
}
.user-avatar.admin-avatar { background: var(--color-brand-dark); }
.user-name { font-weight: 600; font-size: 14px; color: var(--color-text); }
.role-badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px;
  border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: .04em;
  display: inline-block; margin-top: 3px;
}
.role-admin  { background: var(--color-brand-soft); color: var(--color-brand-dark); border: 1px solid var(--color-brand-soft-border); }
.role-viewer { background: var(--color-surface-sunken); color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.user-actions { margin-left: auto; display: flex; gap: 4px; flex-shrink: 0; }

.info-box {
  background: var(--color-surface-alt); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 12.5px; color: var(--color-text-secondary); margin-bottom: 16px;
}
strong.uname { color: var(--color-text); }
.err {
  color: var(--color-danger); font-size: 12.5px; margin-top: 10px; display: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* ── per-employee station block (shift-level lock) ── */
.sb-toggle-btn {
  margin-top: 5px; background: none; border: none; padding: 0;
  font-size: 11px; color: var(--color-brand); cursor: pointer;
  border-bottom: 1px dashed var(--color-brand-soft-border);
}
.sb-toggle-btn:hover { border-bottom-color: var(--color-brand); }
.sb-lock-fields {
  margin-top: 6px; padding: 8px 10px;
  background: var(--color-surface-sunken); border-radius: 6px;
  border: 1px solid var(--color-border);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.sb-lock-fields select {
  height: var(--control-h-sm); font-size: 12px; padding: 0 6px;
  border: 1px solid var(--color-border); border-radius: 4px;
  background: var(--color-surface); color: var(--color-text);
}
.sb-lock-fields input[type="time"] {
  width: 94px; height: var(--control-h-sm); padding: 0 6px;
  font-size: 12px; border: 1px solid var(--color-border);
  border-radius: 4px; background: var(--color-surface); color: var(--color-text);
}
.sb-lock-fields label { font-size: 11.5px; color: var(--color-text-muted); display: flex; align-items: center; gap: 4px; }
.sb-sep { font-size: 11px; color: var(--color-text-muted); }
