* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f6f8;
  color: #1d2630;
  user-select: none;
}

.hidden { display: none !important; }

.view { min-height: 100vh; padding: 24px; position: relative; }

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.header h1 { font-size: 28px; margin: 0; }
.current-time { font-size: 20px; color: #5a6a7a; font-weight: 600; }

.header-controls { display: flex; align-items: center; gap: 16px; }
.hour-format-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #5a6a7a;
  cursor: pointer;
}

#admin-settings-modal .hour-format-toggle { margin: 20px 0; justify-content: center; }

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

.employee-card {
  background: white;
  border-radius: 16px;
  padding: 24px 12px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #1d2630;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.1s ease;
}
.employee-card:active { transform: scale(0.96); }
.employee-card.status-clocked_in { background: #e6f7ed; border-color: #2ecc71; }
.employee-card.status-on_break { background: #fef3e2; border-color: #f39c12; }
.employee-card.status-clocked_out { background: white; border-color: #d0d6db; }

.status-label {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7785;
}
.employee-card.status-clocked_in .status-label { color: #1e8e4f; }
.employee-card.status-on_break .status-label { color: #b9710a; }

.admin-trigger {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: #8a96a3;
  font-size: 20px;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.hidden { display: none; }

.modal-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  width: 320px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
}
.modal-card h2 { margin-top: 0; }

.status-pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  background: #eef1f4;
  color: #5a6a7a;
  text-transform: uppercase;
}

.action-buttons { display: flex; flex-direction: column; gap: 10px; }

.primary-btn, .secondary-btn, .danger-btn {
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.primary-btn { background: #2563eb; color: white; }
.secondary-btn { background: #eef1f4; color: #1d2630; margin-top: 14px; }
.danger-btn { background: #e74c3c; color: white; }
.danger-btn:disabled { background: #f3c9c4; cursor: not-allowed; }

.action-btn {
  border: none;
  border-radius: 10px;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  color: white;
}
.action-btn-clock_in { background: #2ecc71; }
.action-btn-break_start, .action-btn-break_end { background: #f39c12; }
.action-btn-clock_out { background: #e74c3c; }

.modal-card h3 { font-size: 14px; margin: 20px 0 8px; color: #5a6a7a; }

.opening-balance-row { display: flex; gap: 8px; }

.ratio-setting-row { display: flex; align-items: center; gap: 8px; }
.ratio-setting-row input[type="number"] {
  width: 70px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d0d6db;
  font-size: 15px;
  text-align: center;
}
.ratio-setting-slash { font-size: 18px; font-weight: 700; color: #5a6a7a; }
.opening-balance-row input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d0d6db;
  font-size: 15px;
}

.collapsible-section {
  margin: 20px 0 8px;
  border: 1px solid #eef1f4;
  border-radius: 10px;
  padding: 4px 14px;
}
.collapsible-section summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #5a6a7a;
  padding: 10px 0;
  list-style: none;
}
.collapsible-section summary::-webkit-details-marker { display: none; }
.collapsible-section summary::before {
  content: '▸ ';
  display: inline-block;
}
.collapsible-section[open] summary::before {
  content: '▾ ';
}
.collapsible-section[open] {
  padding-bottom: 14px;
}

.opening-balance-confirm-row { margin-top: 10px; }
.opening-balance-confirm-row .action-buttons { flex-direction: row; }

#admin-code-input, #pin-input, #employee-pin-input {
  width: 100%;
  font-size: 24px;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #d0d6db;
  margin-bottom: 12px;
  letter-spacing: 6px;
}

.error-text { color: #e74c3c; font-size: 13px; min-height: 18px; margin-bottom: 8px; }

.admin-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header-row h2 { margin: 0; }

#new-employee-name {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d0d6db;
  font-size: 15px;
  margin-bottom: 12px;
}

.employee-list { display: flex; flex-direction: column; gap: 8px; }
.employee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f7f9fa;
}
.employee-row.inactive { opacity: 0.5; }
.employee-row.status-clocked_in { background: #edf9f1; border-left: 3px solid #2ecc71; }
.employee-row.status-on_break   { background: #fef8ee; border-left: 3px solid #f39c12; }
.employee-row input[type="text"] {
  border: 1px solid transparent;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  padding: 4px;
  border-radius: 6px;
}
.employee-row input[type="text"]:focus {
  border-color: #d0d6db;
  background: white;
}
.employee-row .row-actions { display: flex; align-items: center; gap: 8px; }
.employee-row button {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #eef1f4;
}

.row-menu-wrapper { position: relative; }
.row-menu-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: 700;
  color: #5a6a7a;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  line-height: 1;
}
.row-menu-btn:hover { background: #eef1f4; }

.row-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 50;
  min-width: 180px;
  overflow: hidden;
  text-align: left;
}
.row-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: white;
  border-radius: 0;
  padding: 10px 14px;
  font-weight: 500;
}
.row-menu button:hover { background: #f4f6f8; }
.row-menu button.danger-item { color: #e74c3c; }

.timeline-controls { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.timeline-controls button { margin-top: 0; padding: 8px 14px; }
#timeline-date { padding: 8px; border-radius: 8px; border: 1px solid #d0d6db; font-size: 15px; }

.timeline-axis {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 2px solid #d0d6db;
}
.timeline-axis-spacer { width: 242px; flex-shrink: 0; }
.timeline-axis-track {
  position: relative;
  flex: 1;
  height: 16px;
}
.timeline-axis-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 11px;
  color: #8a96a3;
  white-space: nowrap;
}
.timeline-axis-tick::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 1px;
  height: 6px;
  background: #d0d6db;
}

.attendance-chart-block { margin-bottom: 16px; }
.attendance-chart-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.attendance-chart-title { font-size: 13px; font-weight: 600; color: #5a6a7a; }
.attendance-ratio-readout { font-size: 15px; font-weight: 700; color: #1d2630; }
.attendance-chart-row { display: flex; align-items: stretch; gap: 12px; }
.attendance-chart-track {
  position: relative;
  flex: 1;
  height: 100px;
  background: #f7f9fa;
  border-radius: 6px;
  overflow: hidden;
}
.attendance-chart-track svg { display: block; width: 100%; height: 100%; }
.attendance-chart-track { cursor: crosshair; }

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d0d6db;
  border-radius: 999px;
  transition: background-color 0.15s ease;
}
.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-slider { background-color: #2ecc71; }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

.qualified-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1d2630;
  margin: 12px 0;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef1f4;
}
.timeline-row.on-break { background: #fff7ea; }
.timeline-name {
  width: 140px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: pointer;
  color: #2563eb;
  text-decoration: underline;
}
.timeline-hours { width: 90px; flex-shrink: 0; color: #5a6a7a; font-size: 14px; }
.timeline-bar-track {
  position: relative;
  flex: 1;
  height: 24px;
  background: #f0f2f4;
  border-radius: 6px;
  overflow: hidden;
}
.timeline-segment {
  position: absolute;
  top: 0;
  height: 100%;
  background: #2ecc71;
}
.timeline-segment.break {
  background: #f39c12;
}

.timeline-bar-track { cursor: crosshair; }

.timeline-cursor-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0,0,0,0.35);
  pointer-events: none;
}

.timeline-cursor-tooltip {
  position: fixed;
  background: #1d2630;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 200;
  transform: translate(-50%, -130%);
  white-space: normal;
  max-width: 320px;
  line-height: 1.5;
  text-align: center;
}

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn {
  border: none;
  background: #eef1f4;
  color: #5a6a7a;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.tab-btn.active { background: #2563eb; color: white; }

.modal-card-wide { width: 480px; text-align: left; }
.modal-subtext { color: #5a6a7a; font-size: 14px; margin-top: -8px; }

.shift-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.shift-table th, .shift-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #eef1f4;
  font-size: 14px;
}
.shift-table th { color: #5a6a7a; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }

.shift-total { font-weight: 700; font-size: 16px; text-align: right; margin: 12px 0; }
#info-total-hours { text-align: left; }

.employee-hours-axis {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 6px;
}
.employee-hours-axis-spacer-left { width: 110px; flex-shrink: 0; }
.employee-hours-axis-spacer-right { width: 70px; flex-shrink: 0; }
.employee-hours-axis-track {
  position: relative;
  flex: 1;
  height: 14px;
}
.employee-hours-axis-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 10px;
  color: #8a96a3;
  white-space: nowrap;
}

.employee-hours-days { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; margin-bottom: 8px; }
.employee-hours-day-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.employee-hours-day-label { width: 110px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: #5a6a7a; }
.employee-hours-day-hours { width: 70px; flex-shrink: 0; font-size: 13px; color: #5a6a7a; text-align: right; }
.employee-hours-day-track {
  position: relative;
  flex: 1;
  height: 18px;
  background: #f0f2f4;
  border-radius: 5px;
  overflow: hidden;
}

.hours-breakdown-table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.hours-breakdown-table td {
  padding: 6px 0;
  font-size: 14px;
  color: #1d2630;
}
.hours-breakdown-table td:last-child { text-align: right; color: #5a6a7a; }
.hours-breakdown-table .hours-breakdown-total td {
  border-top: 2px solid #d0d6db;
  padding-top: 10px;
  font-weight: 700;
  font-size: 16px;
  color: #1d2630;
}
.hours-breakdown-table .hours-breakdown-total td:last-child { color: #1d2630; }

#departure-date-input, #rehire-date-input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d0d6db;
  font-size: 15px;
  margin: 12px 0;
}

#departure-reason-input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d0d6db;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 4px;
}

.range-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.range-controls label { font-size: 14px; color: #5a6a7a; display: flex; align-items: center; gap: 6px; }
.range-controls input[type="date"] { padding: 8px; border-radius: 8px; border: 1px solid #d0d6db; font-size: 15px; }
.range-controls select { padding: 8px; border-radius: 8px; border: 1px solid #d0d6db; font-size: 15px; }

.range-pay-period-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.range-pay-period-nav button { margin-top: 0; padding: 8px 14px; }
.range-pay-period-label { font-size: 14px; font-weight: 600; color: #1d2630; white-space: nowrap; }

#range-day-today-btn.is-today { background: #2ecc71; color: white; }

.range-specific-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: #f7f9fa;
  border-radius: 10px;
}
.range-specific-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  background: white;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #eef1f4;
  cursor: pointer;
}

.range-summary-container { margin-top: 16px; }
.range-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eef1f4;
  font-size: 15px;
}
.range-summary-name-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.range-summary-row .range-summary-name { font-weight: 600; flex-shrink: 0; }
.range-summary-row .range-summary-name-inactive { color: #e74c3c; }
.range-summary-row .range-summary-hours {
  color: #5a6a7a;
  flex-shrink: 0;
  text-align: right;
  min-width: 90px;
}
.range-summary-breakdown {
  font-size: 12px;
  color: #aab4bd;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.range-summary-total {
  padding: 14px 0 0;
  margin-top: 8px;
  border-top: 2px solid #d0d6db;
}
.range-summary-total-main {
  display: flex;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 700;
}
.range-summary-total-breakdown {
  font-size: 12px;
  color: #aab4bd;
  text-align: right;
  margin-top: 4px;
}

.month-calendar-container { margin-top: 16px; }

.month-calendar-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  min-height: 40px;
}
.month-calendar-nav-left,
.month-calendar-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.month-calendar-nav-right { justify-content: flex-end; }
.month-calendar-nav h3 {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: 19px;
  text-transform: capitalize;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
.month-calendar-nav button { padding: 8px 14px; margin-top: 0; }
.month-calendar-nav select,
.month-calendar-nav input[type="number"] {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d0d6db;
  font-size: 14px;
  color: #1d2630;
}
.month-calendar-nav input[type="number"] { width: 90px; }

.month-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid #eef1f4;
  border-radius: 10px;
  overflow: hidden;
}

.month-calendar-weekday {
  background: #f7f9fa;
  color: #5a6a7a;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f4;
}

.month-calendar-day {
  border: 1px solid #eef1f4;
  min-height: 110px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.month-calendar-day.outside-month { background: #fafbfc; }
.month-calendar-day.outside-month .month-calendar-daynum { color: #c5ccd3; }
.month-calendar-day.is-today { background: #eef4ff; }

.month-calendar-daynum {
  font-size: 13px;
  font-weight: 600;
  color: #5a6a7a;
  text-align: right;
}

.month-calendar-chip {
  display: block;
  text-align: left;
  width: 100%;
  border: none;
  border-radius: 4px;
  border-left: 3px solid #2563eb;
  background: #eaf1fd;
  color: #1d2630;
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.month-calendar-chip.type-maladie { border-left-color: #e74c3c; background: #fdecea; }
.month-calendar-chip.type-vacances { border-left-color: #2ecc71; background: #eafaf1; }
.month-calendar-chip.type-travail-manual { border-left-color: #d4a017; background: #fdf6e3; }

.month-calendar-day-add {
  margin-top: auto;
  border: none;
  background: transparent;
  color: #8a96a3;
  font-size: 16px;
  cursor: pointer;
  align-self: flex-end;
  padding: 0 4px;
}
.month-calendar-day-add:hover { color: #2563eb; }

.modal-field-label {
  display: block;
  font-size: 12px;
  color: #5a6a7a;
  text-align: left;
  margin-top: 10px;
  margin-bottom: 4px;
}
#manual-entry-modal select,
#manual-entry-modal input[type="date"],
#manual-entry-modal input[type="number"],
#manual-entry-modal textarea,
#employee-hours-modal select,
#employee-hours-modal input[type="date"] {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d0d6db;
  font-size: 15px;
  margin-bottom: 8px;
}
#manual-entry-modal textarea { font-family: inherit; resize: vertical; }

/* ---- Section sidebar layout ---- */
.section-with-sidebar {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.section-sidebar {
  width: 148px;
  min-width: 148px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 10px;
  position: sticky;
  top: 57px;
}
.sidebar-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #6b7a8d;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar-btn:hover { background: #e8ecf0; color: #2d3a4a; }
.sidebar-btn.active { background: #e8f0fe; color: #2563eb; font-weight: 600; }
.section-sidebar-content { flex: 1; min-width: 0; }

/* Sidebar collapsible groups */
.sidebar-group { display: flex; flex-direction: column; }
.sidebar-group-hdr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px 4px;
  font-size: 14px; text-transform: none; letter-spacing: 0;
  font-weight: 600; color: #e4e4e7; cursor: pointer;
  border: none; background: transparent; font-family: inherit; width: 100%;
}
.sidebar-group-hdr:hover { color: #ffffff; }
.sidebar-grp-arrow { transition: transform 0.18s; font-size: 11px; color: #71717a; }
.sidebar-group-hdr.collapsed .sidebar-grp-arrow { transform: rotate(-90deg); }
.sidebar-group-items { display: flex; flex-direction: column; overflow: hidden; max-height: 200px; transition: max-height 0.2s ease; }
.sidebar-group-items.collapsed { max-height: 0; }
.sidebar-group-items .sidebar-btn { font-size: 13px; padding-left: 22px; }
.sidebar-group-sep { height: 1px; background: #2a2a2e; margin: 6px 14px; }
.sidebar-btn-standalone { margin-top: 2px; }

/* Calendar range highlight */
.month-calendar-day.in-range { background: rgba(220,38,38,0.13); }
.month-calendar-day.in-range.outside-month { background: rgba(220,38,38,0.05); }
.month-calendar-day.is-today.in-range { background: linear-gradient(135deg, rgba(220,38,38,0.20), rgba(220,38,38,0.10)); }

/* Payment confirmation box */
.pay-confirm-box {
  display: flex; align-items: flex-start; gap: 14px;
  background: #1e1e22; border: 1px solid #3a3a3e; border-radius: 12px;
  padding: 16px 20px; margin-top: 24px;
}
.pay-confirm-box.confirmed { border-color: #22c55e40; background: #0d1f13; }
.pay-confirm-check { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; accent-color: #22c55e; margin-top: 3px; }
.pay-confirm-box-label { font-size: 12px; color: #71717a; margin-bottom: 3px; }
.pay-confirm-box-date { font-size: 15px; font-weight: 600; color: #fafafa; }
.pay-confirm-box-hint { font-size: 12px; color: #52525b; margin-top: 4px; }
.pay-locked-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: #22c55e;
  background: rgba(34,197,94,0.12); border-radius: 6px; padding: 3px 9px; margin-top: 6px;
}

.poupon-badge {
  font-size: 11px;
  font-weight: 600;
  color: #c0392b;
  background: #fdecea;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 4px;
}

.settings-kiosk-link {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid #eef1f4;
}
.settings-kiosk-link a {
  font-size: 13px;
  color: #aab4bf;
  text-decoration: none;
}
.settings-kiosk-link a:hover { color: #6b7a8d; text-decoration: underline; }
.kiosk-url-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f7f9fa; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 14px;
}
.kiosk-url-label { font-size: 12px; font-weight: 600; color: #6b7a8d; white-space: nowrap; }
.kiosk-url-text { font-size: 13px; color: #2d3a4a; font-family: monospace; flex: 1; word-break: break-all; }

/* ---- Admin top nav ---- */
.admin-topnav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e9ec;
  background: white;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-topnav-btn {
  padding: 14px 28px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: #8a96a3;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.admin-topnav-btn.active { color: #2563eb; border-bottom-color: #2563eb; }
.admin-topnav-btn:hover:not(.active) { color: #3d4a5a; }

/* ---- Children attendance chart ---- */
.children-chart-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.children-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #5a6a7a;
}
.children-chart-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.children-chart-scroll {
  width: 100%;
  overflow-x: auto;
}
.children-charts-column {
  display: inline-flex;
  flex-direction: column;
  min-width: 100%;
}
.children-chart-container {
  position: relative;
}
.children-chart-container svg { display: block; overflow: visible; }
.children-chart-popup {
  position: fixed;
  background: white;
  border: 1px solid #d0d6db;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  padding: 14px;
  z-index: 1000;
  min-width: 200px;
  pointer-events: none;
}
.children-chart-popup h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #3d4a5a;
}

/* ---- Groups list ---- */
.group-create-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.group-create-form input[type="text"] {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d0d6db;
  font-size: 14px;
  flex: 1;
  min-width: 160px;
}
.group-create-form input[type="color"] {
  width: 40px;
  height: 36px;
  border: 1px solid #d0d6db;
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
}
.groups-list { display: flex; flex-direction: column; gap: 0; }
.group-row {
  border-bottom: 1px solid #eef1f4;
}
.group-row-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  cursor: pointer;
  user-select: none;
}
.group-row-header:hover { background: #f7f9fa; border-radius: 8px; }
.group-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.group-row-name { font-weight: 600; font-size: 15px; flex: 1; }
.group-row-count { font-size: 13px; color: #8a96a3; }
.group-row-actions { display: flex; gap: 6px; opacity: 0; transition: opacity 0.15s; }
.group-row-header:hover .group-row-actions { opacity: 1; }
.group-row-actions button { padding: 4px 10px; font-size: 12px; margin-top: 0; }
.group-row-chevron { font-size: 12px; color: #8a96a3; transition: transform 0.2s; }
.group-row-chevron.open { transform: rotate(90deg); }
.group-members-panel {
  display: none;
  padding: 8px 4px 16px 30px;
  flex-direction: column;
  gap: 6px;
}
.group-members-panel.open { display: flex; }
.group-member-item {
  font-size: 14px;
  color: #3d4a5a;
  padding: 4px 0;
}
.group-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 12px 4px;
  display: none;
}
.group-edit-row.open { display: flex; }
.group-edit-row input[type="text"] {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #d0d6db;
  font-size: 14px;
  flex: 1;
}
.group-edit-row input[type="color"] {
  width: 36px; height: 32px;
  border: 1px solid #d0d6db;
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
}

/* ---- Login view ---- */
.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f4f6f8;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px 40px 40px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  text-align: center;
}
.login-title {
  font-size: 22px;
  font-weight: 800;
  color: #2563eb;
  margin: 0 0 28px;
  letter-spacing: -0.5px;
}
.login-card h2 {
  font-size: 18px;
  margin: 0 0 20px;
  color: #1d2630;
}
.login-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d0d6db;
  font-size: 15px;
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.login-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.login-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  margin-top: 4px;
  border-radius: 10px;
}

/* ---- Admin header username (inside profile button) ---- */
.admin-username-label {
  font-size: 14px;
  font-weight: 600;
  color: #5a6a7a;
  padding: 0;
}

/* ---- Users list ---- */
.users-list { display: flex; flex-direction: column; gap: 0; }
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #eef1f4;
}
.user-row-name { font-weight: 600; font-size: 15px; flex: 1; }
.user-row-role {
  font-size: 13px;
  color: #5a6a7a;
  background: #eef1f4;
  padding: 3px 10px;
  border-radius: 999px;
}
.user-row-actions button { margin-top: 0; }
.user-edit-row { padding: 0 4px 16px; border-bottom: 1px solid #eef1f4; }
.user-edit-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #f7f9fa;
  border-radius: 10px;
  margin-top: 4px;
}

.staffing-efficiency {
  display: flex;
  gap: 0;
  border: 1px solid #e0e6ec;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 16px;
  width: fit-content;
}
.eff-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 20px;
  border-right: 1px solid #e0e6ec;
  background: #fff;
  min-width: 160px;
}
.eff-row:last-child { border-right: none; }
.eff-label {
  font-size: 11px;
  font-weight: 600;
  color: #8a96a3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.eff-label em { font-style: italic; font-weight: 400; text-transform: none; }
.eff-value {
  font-size: 20px;
  font-weight: 600;
  color: #1d2630;
}
.eff-diff .eff-value { font-size: 22px; }


/* =============================================
   CSS VARIABLES — accent + theme system
   ============================================= */

/* Dark defaults */
:root {
  --accent:     #ffffff;
  --accent-bg:  rgba(255,255,255,0.07);
}

/* Accent overrides — same token works in both themes */
body[data-accent="slate"]  { --accent: #e4e4e7; --accent-bg: rgba(228,228,231,0.10); }
body[data-accent="blue"]   { --accent: #60a5fa; --accent-bg: rgba(96,165,250,0.10); }
body[data-accent="purple"] { --accent: #c084fc; --accent-bg: rgba(192,132,252,0.10); }
body[data-accent="teal"]   { --accent: #2dd4bf; --accent-bg: rgba(45,212,191,0.10); }
body[data-accent="amber"]  { --accent: #fbbf24; --accent-bg: rgba(251,191,36,0.10); }
body[data-accent="rose"]   { --accent: #fb7185; --accent-bg: rgba(251,113,133,0.10); }

/* Light theme accent defaults */
body[data-theme="light"]                        { --accent: #2563eb; --accent-bg: rgba(37,99,235,0.08); }
body[data-theme="light"][data-accent="slate"]   { --accent: #475569; --accent-bg: rgba(71,85,105,0.08); }
body[data-theme="light"][data-accent="blue"]    { --accent: #2563eb; --accent-bg: rgba(37,99,235,0.08); }
body[data-theme="light"][data-accent="purple"]  { --accent: #7c3aed; --accent-bg: rgba(124,58,237,0.08); }
body[data-theme="light"][data-accent="teal"]    { --accent: #0d9488; --accent-bg: rgba(13,148,136,0.08); }
body[data-theme="light"][data-accent="amber"]   { --accent: #d97706; --accent-bg: rgba(217,119,6,0.08); }
body[data-theme="light"][data-accent="rose"]    { --accent: #e11d48; --accent-bg: rgba(225,29,72,0.08); }

/* =============================================
   DARK BASE OVERRIDES
   ============================================= */

body { background: #09090b; color: #fafafa; }
#admin-view { padding: 0; background: #09090b; }
#section-personnel, #section-enfants, #section-acces { padding: 16px 20px; }
h1, h2, h3, h4 { color: #fafafa; }
p  { color: #a1a1aa; }
label { color: #a1a1aa; }
a  { color: #60a5fa; }

/* --- Header --- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: #09090b; border-bottom: 1px solid #27272a;
  height: 60px; margin: 0; padding: 0 24px;
  display: flex; align-items: center; gap: 0;
}
.header h1 { display: none; }
.header-controls { display: none; }
.header-brand { font-size: 13px; font-weight: 600; color: #fafafa; letter-spacing: -0.01em; margin-right: 20px; flex-shrink: 0; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.admin-username-label { font-size: 13px; font-weight: 500; color: #d4d4d8; padding: 0; }
.header-theme-btn {
  border: none; background: transparent; font-size: 15px; color: #52525b;
  cursor: pointer; padding: 5px 8px; border-radius: 6px; line-height: 1; font-family: inherit;
}
.header-theme-btn:hover { background: #27272a; color: #a1a1aa; }

/* --- Top nav --- */
.admin-topnav {
  display: flex; gap: 0; background: transparent;
  border-bottom: none; padding: 0; position: static; align-self: stretch;
}
.admin-topnav-btn {
  height: 100%; padding: 0 16px; border: none; background: transparent;
  font-size: 13px; font-weight: 500; color: #52525b; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: 0; font-family: inherit;
  transition: color 0.12s, border-color 0.12s; white-space: nowrap;
}
.admin-topnav-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-topnav-btn:hover:not(.active) { color: #a1a1aa; }

/* --- Dashboard --- */
.dashboard-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; padding: 24px;
}
.dash-card {
  background: #2a2a2e; border: 1px solid #3a3a3e; border-radius: 12px;
  padding: 20px 22px; display: flex; flex-direction: column; gap: 6px;
}
.dash-card-label { font-size: 11px; color: #52525b; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.dash-card-value { font-size: 32px; font-weight: 700; color: #fafafa; line-height: 1; }
.dash-card-sub   { font-size: 12px; color: #52525b; }
.dash-chart-section { padding: 0 24px 24px; }
.dash-chart-card { background: #2a2a2e; border: 1px solid #3a3a3e; border-radius: 12px; padding: 20px 24px; }
.dash-chart-header { margin-bottom: 14px; }
.dash-chart-body { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-name { flex: 1; color: #a1a1aa; min-width: 120px; }
.donut-legend-val { color: #fafafa; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 24px; text-align: right; }
.donut-center-count { fill: #fafafa; font-size: 26px; font-weight: 700; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.donut-center-sub { fill: #52525b; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.donut-tooltip { position: fixed; background: #18181b; border: 1px solid #3a3a3e; border-radius: 8px; padding: 7px 12px; font-size: 13px; color: #d4d4d8; display: none; pointer-events: none; z-index: 100; white-space: nowrap; }

/* --- Sidebar --- */
.section-sidebar { top: 60px; }
.sidebar-btn { color: #52525b; }
.sidebar-btn:hover { background: #27272a; color: #d4d4d8; }
.sidebar-btn.active { background: var(--accent-bg); color: var(--accent); }

/* --- Cards / sections --- */
.admin-section { background: #2a2a2e; border: 1px solid #3a3a3e; border-radius: 10px; box-shadow: none; }
.admin-section h2 { color: #fafafa; }
.admin-section h3 { color: #71717a; }

/* --- Buttons --- */
.primary-btn { background: #fafafa; color: #09090b; border: none; }
.primary-btn:hover { background: #e4e4e7; }
.secondary-btn { background: #3a3a3e; color: #a1a1aa; border: none; margin-top: 0; }
.secondary-btn:hover { background: #48484d; }
.danger-btn { background: #7f1d1d; color: #fca5a5; border: none; }
.danger-btn:disabled { background: #27272a; color: #52525b; }

/* --- Inputs --- */
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
select, textarea {
  background: #1e1e22 !important; border: 1px solid #3a3a3e !important;
  color: #fafafa !important; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: #71717a !important; outline: none; box-shadow: none !important;
}
input::placeholder, textarea::placeholder { color: #52525b !important; }
input[type="color"] { background: #2a2a2e !important; border-color: #3a3a3e !important; }

/* --- Employee rows --- */
.employee-row { background: #313135; }
.employee-row:hover { background: #3a3a3e; }
.employee-row.status-clocked_in { background: rgba(34,197,94,0.10); border-left: 2px solid #22c55e; }
.employee-row.status-on_break   { background: rgba(249,115,22,0.10); border-left: 2px solid #f97316; }
.employee-row input[type="text"] { color: #fafafa !important; font-weight: 600; background: transparent !important; border-color: transparent !important; }
.employee-row input[type="text"]:focus { background: #1e1e22 !important; border-color: #3a3a3e !important; }
.employee-row button { background: #3a3a3e !important; color: #a1a1aa !important; }

/* --- Timeline rows --- */
.timeline-row { border-bottom-color: #3a3a3e; }
.timeline-row.on-break { background: rgba(249,115,22,0.04); }
.timeline-row.clocked-in .timeline-hours { color: #22c55e; font-weight: 600; }
.timeline-row.on-break   .timeline-hours { color: #f97316; font-weight: 600; }
.timeline-name { color: #60a5fa; }
.timeline-hours { color: #71717a; }
.timeline-bar-track { background: #1e1e22; }
.timeline-segment { background: #22c55e; }
.timeline-segment.break { background: #f97316; }
.timeline-segment.override { background: #a78bfa; }
.timeline-cursor-tooltip { background: #fafafa; color: #09090b; }
.timeline-axis { border-bottom-color: #27272a; }
.timeline-axis-tick { color: #3f3f46; }
.timeline-axis-tick::after { background: #3f3f46; }

/* --- Attendance chart --- */
.attendance-chart-track { background: #1e1e22; }
.attendance-chart-title { color: #52525b; }
.attendance-ratio-readout { color: #a1a1aa; }

/* --- Tab pills --- */
.tab-btn { background: #2a2a2e; color: #71717a; }
.tab-btn.active { background: var(--accent); color: #09090b; }

/* --- Modals --- */
.modal { background: rgba(0,0,0,0.75); }
.modal-card { background: #2a2a2e; border: 1px solid #3a3a3e; box-shadow: 0 16px 48px rgba(0,0,0,0.6); }
.modal-card h2 { color: #fafafa; }
.modal-subtext { color: #71717a; }

/* --- Row menu --- */
.row-menu { background: #2a2a2e; border: 1px solid #3a3a3e; box-shadow: 0 8px 24px rgba(0,0,0,0.6); }
.row-menu button { background: #2a2a2e !important; color: #a1a1aa !important; border-radius: 0; }
.row-menu button:hover { background: #3a3a3e !important; }
.row-menu button.danger-item { color: #f87171 !important; }
.row-menu-btn { color: #52525b; }
.row-menu-btn:hover { background: #3a3a3e; color: #a1a1aa; }

/* --- Login --- */
.login-view { background: #09090b; }
.login-card { background: #2a2a2e; border: 1px solid #3a3a3e; box-shadow: none; }
.login-card h2 { color: #fafafa; }
.login-title { color: #fafafa; }

/* --- Range / payroll --- */
.range-controls label { color: #71717a; }
.range-pay-period-label { color: #fafafa; }
.range-summary-row { border-bottom-color: #3a3a3e; }
.range-summary-row .range-summary-name { color: #fafafa; }
.range-summary-row .range-summary-hours { color: #71717a; }
.range-summary-breakdown { color: #3a3a3e; }
.range-summary-total { border-top-color: #3a3a3e; }
.range-summary-total-main { color: #fafafa; }
.range-summary-total-breakdown { color: #3a3a3e; }
.hours-breakdown-table td { color: #a1a1aa; }
.hours-breakdown-table td:last-child { color: #71717a; }
.hours-breakdown-table .hours-breakdown-total td { border-top-color: #3a3a3e; color: #fafafa; }
.hours-breakdown-table .hours-breakdown-total td:last-child { color: #fafafa; }
.shift-table th { color: #52525b; }
.shift-table td { color: #a1a1aa; }
.shift-table th, .shift-table td { border-bottom-color: #3a3a3e; }
.shift-total { color: #fafafa; }

/* --- Calendar --- */
.month-calendar-grid { border-color: #3a3a3e; }
.month-calendar-weekday { background: #1e1e22; color: #52525b; border-bottom-color: #3a3a3e; }
.month-calendar-day { border-color: #3a3a3e; min-height: 90px; }
.month-calendar-day.outside-month { background: #09090b; }
.month-calendar-day.outside-month .month-calendar-daynum { color: #27272a; }
.month-calendar-day.is-today { background: rgba(59,130,246,0.07); }
.month-calendar-daynum { color: #52525b; }
.month-calendar-nav h3 { color: #fafafa; }
.month-calendar-chip { background: rgba(59,130,246,0.15); border-left-color: #3b82f6; color: #93c5fd; }
.month-calendar-chip.type-maladie    { background: rgba(239,68,68,0.12);  border-left-color: #ef4444; color: #fca5a5; }
.month-calendar-chip.type-vacances   { background: rgba(34,197,94,0.12);  border-left-color: #22c55e; color: #86efac; }
.month-calendar-chip.type-travail-manual { background: rgba(234,179,8,0.12); border-left-color: #eab308; color: #fde047; }
.month-calendar-day-add { color: #27272a; }
.month-calendar-day-add:hover { color: #fafafa; }

/* --- Groups / children --- */
.group-row { border-bottom-color: #3a3a3e; }
.group-row-header:hover { background: #313135; border-radius: 6px; }
.group-row-name { color: #fafafa; }
.group-row-count { color: #52525b; }
.group-row-chevron { color: #52525b; }
.group-member-item { color: #a1a1aa; }
.poupon-badge { background: rgba(239,68,68,0.15); color: #f87171; }
.prematernelle-badge { background: rgba(34,197,94,0.12); color: #86efac; }
.children-chart-popup { background: #2a2a2e; border-color: #3a3a3e; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.children-chart-popup h4 { color: #a1a1aa; }
.children-chart-legend-item { color: #71717a; }

/* --- Efficiency --- */
.staffing-efficiency { border-color: #3a3a3e; }
.eff-row { background: #2a2a2e; border-right-color: #3a3a3e; }
.eff-label { color: #52525b; }
.eff-value { color: #fafafa; }

/* --- Misc / settings --- */
.collapsible-section { border-color: #3a3a3e; }
.collapsible-section summary { color: #52525b; }
.switch-slider { background-color: #3a3a3e; }
.range-specific-picker { background: #313135; }
.range-specific-picker label { background: #1e1e22; border-color: #3a3a3e; color: #a1a1aa; }
.settings-kiosk-link { border-top-color: #3a3a3e; }
.settings-kiosk-link a { color: #3f3f46; }
.settings-kiosk-link a:hover { color: #a1a1aa; }
.kiosk-url-box { background: #1e1e22; border-color: #3a3a3e; }
.kiosk-url-text { color: #e4e4e7; }
.ratio-setting-slash { color: #3f3f46; }
.hour-format-toggle { color: #71717a; }
.user-row { border-bottom-color: #3a3a3e; }
.user-row-name { color: #fafafa; }
.user-row-role { background: #3a3a3e; color: #71717a; }
.user-edit-inner { background: #313135; }
.employee-hours-day-label { color: #71717a; }
.employee-hours-day-hours { color: #71717a; }
.employee-hours-day-track { background: #1e1e22; }
.employee-hours-axis-tick { color: #3a3a3e; }
.section-header-row h2 { color: #fafafa; }

/* --- Scrollbars --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #09090b; }
::-webkit-scrollbar-thumb { background: #3a3a3e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }

/* =============================================
   LIGHT THEME OVERRIDES
   ============================================= */

body[data-theme="light"] { background: #f8fafc; color: #0f172a; }
body[data-theme="light"] h1,
body[data-theme="light"] h2,
body[data-theme="light"] h3,
body[data-theme="light"] h4  { color: #0f172a; }
body[data-theme="light"] p   { color: #475569; }
body[data-theme="light"] label { color: #475569; }
body[data-theme="light"] #admin-view { background: #f8fafc; }

body[data-theme="light"] .header { background: #ffffff; border-bottom-color: #e2e8f0; }
body[data-theme="light"] .header-brand { color: #0f172a; }
body[data-theme="light"] .admin-username-label { color: #475569; }
body[data-theme="light"] .header-theme-btn { color: #94a3b8; }
body[data-theme="light"] .header-theme-btn:hover { background: #f1f5f9; color: #475569; }

body[data-theme="light"] .admin-topnav-btn { color: #94a3b8; }
body[data-theme="light"] .admin-topnav-btn:hover:not(.active) { color: #475569; }

body[data-theme="light"] .stats-bar { background: #ffffff; border-bottom-color: #e2e8f0; }
body[data-theme="light"] .stat-cell { border-right-color: #e2e8f0; }
body[data-theme="light"] .stat-label { color: #cbd5e1; }
body[data-theme="light"] .stat-value { color: #0f172a; }

body[data-theme="light"] .sidebar-btn { color: #94a3b8; }
body[data-theme="light"] .sidebar-btn:hover { background: #f1f5f9; color: #475569; }
body[data-theme="light"] .sidebar-btn.active { background: var(--accent-bg); color: var(--accent); }
body[data-theme="light"] .sidebar-group-hdr { color: #1e293b; }
body[data-theme="light"] .sidebar-group-hdr:hover { color: #0f172a; }
body[data-theme="light"] .sidebar-group-sep { background: #e2e8f0; }
body[data-theme="light"] .month-calendar-day.in-range { background: rgba(220,38,38,0.09); }
body[data-theme="light"] .month-calendar-day.in-range.outside-month { background: rgba(220,38,38,0.04); }
body[data-theme="light"] .pay-confirm-box { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .pay-confirm-box.confirmed { background: #f0fdf4; border-color: #86efac; }
body[data-theme="light"] .pay-confirm-box-label { color: #94a3b8; }
body[data-theme="light"] .pay-confirm-box-date { color: #0f172a; }
body[data-theme="light"] .pay-confirm-box-hint { color: #94a3b8; }
body[data-theme="light"] .pay-locked-badge { background: rgba(34,197,94,0.1); color: #16a34a; }

body[data-theme="light"] .admin-section { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
body[data-theme="light"] .admin-section h2 { color: #0f172a; }
body[data-theme="light"] .admin-section h3 { color: #64748b; }

body[data-theme="light"] .primary-btn { background: var(--accent); color: #ffffff; }
body[data-theme="light"] .primary-btn:hover { opacity: 0.9; background: var(--accent); }
body[data-theme="light"] .secondary-btn { background: #f1f5f9; color: #475569; }
body[data-theme="light"] .secondary-btn:hover { background: #e2e8f0; }
body[data-theme="light"] .danger-btn { background: #ef4444; color: #ffffff; }

body[data-theme="light"] input[type="text"],
body[data-theme="light"] input[type="password"],
body[data-theme="light"] input[type="number"],
body[data-theme="light"] input[type="date"],
body[data-theme="light"] select,
body[data-theme="light"] textarea {
  background: #ffffff !important; border-color: #e2e8f0 !important; color: #0f172a !important;
}
body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder { color: #cbd5e1 !important; }

body[data-theme="light"] .employee-row { background: #f8fafc; }
body[data-theme="light"] .employee-row:hover { background: #f1f5f9; }
body[data-theme="light"] .employee-row.status-clocked_in { background: #f0fdf4; border-left: 2px solid #22c55e; }
body[data-theme="light"] .employee-row.status-on_break   { background: #fff7ed; border-left: 2px solid #f97316; }
body[data-theme="light"] .employee-row input[type="text"] { color: #0f172a !important; background: transparent !important; border-color: transparent !important; }
body[data-theme="light"] .employee-row input[type="text"]:focus { background: #ffffff !important; border-color: #e2e8f0 !important; }
body[data-theme="light"] .employee-row button { background: #f1f5f9 !important; color: #475569 !important; }

body[data-theme="light"] .timeline-row { border-bottom-color: #e2e8f0; }
body[data-theme="light"] .timeline-row.on-break { background: #fff7ed; }
body[data-theme="light"] .timeline-name { color: #2563eb; }
body[data-theme="light"] .timeline-hours { color: #94a3b8; }
body[data-theme="light"] .timeline-bar-track { background: #f1f5f9; }
body[data-theme="light"] .timeline-segment { background: #22c55e; }
body[data-theme="light"] .timeline-segment.break { background: #f97316; }
body[data-theme="light"] .timeline-segment.override { background: #7c3aed; }
body[data-theme="light"] .timeline-cursor-tooltip { background: #0f172a; color: #ffffff; }
body[data-theme="light"] .timeline-axis { border-bottom-color: #e2e8f0; }
body[data-theme="light"] .timeline-axis-tick { color: #cbd5e1; }
body[data-theme="light"] .timeline-axis-tick::after { background: #e2e8f0; }

body[data-theme="light"] .attendance-chart-track { background: #f1f5f9; }
body[data-theme="light"] .attendance-chart-title { color: #94a3b8; }
body[data-theme="light"] .attendance-ratio-readout { color: #475569; }

body[data-theme="light"] .tab-btn { background: #f1f5f9; color: #94a3b8; }
body[data-theme="light"] .tab-btn.active { background: var(--accent); color: #ffffff; }

body[data-theme="light"] .modal { background: rgba(0,0,0,0.4); }
body[data-theme="light"] .modal-card { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
body[data-theme="light"] .modal-card h2 { color: #0f172a; }
body[data-theme="light"] .modal-subtext { color: #94a3b8; }

body[data-theme="light"] .row-menu { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 4px 16px rgba(0,0,0,0.10); }
body[data-theme="light"] .row-menu button { background: #ffffff !important; color: #475569 !important; }
body[data-theme="light"] .row-menu button:hover { background: #f1f5f9 !important; }
body[data-theme="light"] .row-menu button.danger-item { color: #ef4444 !important; }
body[data-theme="light"] .row-menu-btn { color: #94a3b8; }
body[data-theme="light"] .row-menu-btn:hover { background: #f1f5f9; color: #475569; }

body[data-theme="light"] .login-view { background: #f8fafc; }
body[data-theme="light"] .login-card { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
body[data-theme="light"] .login-title { color: #0f172a; }

body[data-theme="light"] .range-controls label { color: #94a3b8; }
body[data-theme="light"] .range-pay-period-label { color: #0f172a; }
body[data-theme="light"] .range-summary-row { border-bottom-color: #e2e8f0; }
body[data-theme="light"] .range-summary-row .range-summary-name { color: #0f172a; }
body[data-theme="light"] .range-summary-row .range-summary-hours { color: #94a3b8; }
body[data-theme="light"] .range-summary-breakdown { color: #cbd5e1; }
body[data-theme="light"] .range-summary-total { border-top-color: #e2e8f0; }
body[data-theme="light"] .range-summary-total-main { color: #0f172a; }
body[data-theme="light"] .range-summary-total-breakdown { color: #cbd5e1; }
body[data-theme="light"] .hours-breakdown-table td { color: #475569; }
body[data-theme="light"] .hours-breakdown-table td:last-child { color: #94a3b8; }
body[data-theme="light"] .hours-breakdown-table .hours-breakdown-total td { border-top-color: #e2e8f0; color: #0f172a; }
body[data-theme="light"] .shift-table th { color: #94a3b8; }
body[data-theme="light"] .shift-table td { color: #475569; }
body[data-theme="light"] .shift-table th,
body[data-theme="light"] .shift-table td { border-bottom-color: #e2e8f0; }
body[data-theme="light"] .shift-total { color: #0f172a; }

body[data-theme="light"] .month-calendar-grid { border-color: #e2e8f0; }
body[data-theme="light"] .month-calendar-weekday { background: #f8fafc; color: #94a3b8; border-bottom-color: #e2e8f0; }
body[data-theme="light"] .month-calendar-day { border-color: #e2e8f0; }
body[data-theme="light"] .month-calendar-day.outside-month { background: #fafbfc; }
body[data-theme="light"] .month-calendar-day.outside-month .month-calendar-daynum { color: #cbd5e1; }
body[data-theme="light"] .month-calendar-day.is-today { background: #eff6ff; }
body[data-theme="light"] .month-calendar-daynum { color: #94a3b8; }
body[data-theme="light"] .month-calendar-nav h3 { color: #0f172a; }
body[data-theme="light"] .month-calendar-chip { background: #eff6ff; border-left-color: #3b82f6; color: #1d4ed8; }
body[data-theme="light"] .month-calendar-chip.type-maladie    { background: #fef2f2; border-left-color: #ef4444; color: #b91c1c; }
body[data-theme="light"] .month-calendar-chip.type-vacances   { background: #f0fdf4; border-left-color: #22c55e; color: #15803d; }
body[data-theme="light"] .month-calendar-chip.type-travail-manual { background: #fefce8; border-left-color: #eab308; color: #a16207; }
body[data-theme="light"] .month-calendar-day-add { color: #e2e8f0; }
body[data-theme="light"] .month-calendar-day-add:hover { color: #475569; }

body[data-theme="light"] .group-row { border-bottom-color: #e2e8f0; }
body[data-theme="light"] .group-row-header:hover { background: #f8fafc; border-radius: 6px; }
body[data-theme="light"] .group-row-name { color: #0f172a; }
body[data-theme="light"] .group-row-count { color: #94a3b8; }
body[data-theme="light"] .group-row-chevron { color: #94a3b8; }
body[data-theme="light"] .group-member-item { color: #475569; }
body[data-theme="light"] .poupon-badge { background: #fef2f2; color: #b91c1c; }
body[data-theme="light"] .prematernelle-badge { background: #f0fdf4; color: #15803d; }
body[data-theme="light"] .children-chart-popup { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 8px 24px rgba(0,0,0,0.10); }
body[data-theme="light"] .children-chart-popup h4 { color: #475569; }
body[data-theme="light"] .children-chart-legend-item { color: #94a3b8; }

body[data-theme="light"] .staffing-efficiency { border-color: #e2e8f0; }
body[data-theme="light"] .eff-row { background: #ffffff; border-right-color: #e2e8f0; }
body[data-theme="light"] .eff-label { color: #94a3b8; }
body[data-theme="light"] .eff-value { color: #0f172a; }

body[data-theme="light"] .collapsible-section { border-color: #e2e8f0; }
body[data-theme="light"] .collapsible-section summary { color: #94a3b8; }
body[data-theme="light"] .switch-slider { background-color: #e2e8f0; }
body[data-theme="light"] .range-specific-picker { background: #f1f5f9; }
body[data-theme="light"] .range-specific-picker label { background: #ffffff; border-color: #e2e8f0; color: #475569; }
body[data-theme="light"] .settings-kiosk-link { border-top-color: #e2e8f0; }
body[data-theme="light"] .settings-kiosk-link a { color: #cbd5e1; }
body[data-theme="light"] .settings-kiosk-link a:hover { color: #94a3b8; }
body[data-theme="light"] .ratio-setting-slash { color: #94a3b8; }
body[data-theme="light"] .hour-format-toggle { color: #94a3b8; }
body[data-theme="light"] .user-row { border-bottom-color: #e2e8f0; }
body[data-theme="light"] .user-row-name { color: #0f172a; }
body[data-theme="light"] .user-row-role { background: #f1f5f9; color: #94a3b8; }
body[data-theme="light"] .user-edit-inner { background: #f1f5f9; }
body[data-theme="light"] .employee-hours-day-label { color: #94a3b8; }
body[data-theme="light"] .employee-hours-day-hours { color: #94a3b8; }
body[data-theme="light"] .employee-hours-day-track { background: #f1f5f9; }
body[data-theme="light"] .employee-hours-axis-tick { color: #cbd5e1; }
body[data-theme="light"] .section-header-row h2 { color: #0f172a; }

body[data-theme="light"] ::-webkit-scrollbar-track { background: #f1f5f9; }
body[data-theme="light"] ::-webkit-scrollbar-thumb { background: #e2e8f0; }
body[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* =============================================
   THEME PICKER PANEL
   ============================================= */

.theme-picker {
  position: fixed; top: 52px; right: 16px;
  background: #2a2a2e; border: 1px solid #3a3a3e; border-radius: 12px;
  padding: 16px; z-index: 300; width: 216px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
body[data-theme="light"] .theme-picker {
  background: #ffffff; border-color: #e2e8f0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.theme-picker-label {
  font-size: 10px; font-weight: 600; color: #52525b;
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px;
}
body[data-theme="light"] .theme-picker-label { color: #94a3b8; }
.theme-toggle-row { display: flex; gap: 6px; margin-bottom: 14px; }
.theme-mode-btn {
  flex: 1; padding: 7px 0;
  border: 1px solid #3a3a3e; border-radius: 8px;
  background: transparent; color: #71717a;
  font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: all 0.12s;
}
body[data-theme="light"] .theme-mode-btn { border-color: #e2e8f0; color: #94a3b8; }
.theme-mode-btn.active { background: var(--accent); color: #09090b; border-color: var(--accent); }
body[data-theme="light"] .theme-mode-btn.active { color: #ffffff; }
.accent-dots { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.accent-dot {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2.5px solid transparent; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  flex-shrink: 0;
}
.accent-dot:hover { transform: scale(1.15); }
.accent-dot.selected { box-shadow: 0 0 0 2px #09090b, 0 0 0 4px var(--dot-color, #fafafa); }
body[data-theme="light"] .accent-dot.selected { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--dot-color, #2563eb); }

/* =============================================
   DASHBOARD — light theme overrides
   ============================================= */
body[data-theme="light"] .dashboard-grid {}
body[data-theme="light"] .dash-card { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
body[data-theme="light"] .dash-card-label { color: #94a3b8; }
body[data-theme="light"] .dash-card-value { color: #0f172a; }
body[data-theme="light"] .dash-card-sub   { color: #94a3b8; }
body[data-theme="light"] .dash-chart-card { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
body[data-theme="light"] .donut-legend-name { color: #64748b; }
body[data-theme="light"] .donut-legend-val { color: #0f172a; }
body[data-theme="light"] .donut-center-count { fill: #0f172a; }
body[data-theme="light"] .donut-center-sub { fill: #94a3b8; }
body[data-theme="light"] .donut-tooltip { background: #ffffff; border-color: #e2e8f0; color: #334155; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* =============================================
   CHILDREN FICHES
   ============================================= */
.child-form {
  background: #313135; border: 1px solid #3a3a3e; border-radius: 10px;
  padding: 20px; margin-bottom: 16px;
}
body[data-theme="light"] .child-form { background: #f8fafc; border-color: #e2e8f0; }
.child-form-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.child-form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #a1a1aa; }
body[data-theme="light"] .child-form-grid label { color: #475569; }
.child-form-grid input, .child-form-grid select { margin-top: 0; }
.child-form-actions { display: flex; align-items: center; gap: 10px; }

.children-fiches-table { width: 100%; border-collapse: collapse; }
.children-fiches-table th {
  font-size: 11px; font-weight: 600; color: #52525b; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 8px 12px; text-align: left;
  border-bottom: 1px solid #3a3a3e;
}
body[data-theme="light"] .children-fiches-table th { color: #94a3b8; border-bottom-color: #e2e8f0; }
.children-fiches-table td {
  padding: 10px 12px; font-size: 13px; color: #a1a1aa; border-bottom: 1px solid #27272a;
  vertical-align: middle;
}
body[data-theme="light"] .children-fiches-table td { color: #475569; border-bottom-color: #f1f5f9; }
.children-fiches-table tr:hover td { background: #313135; }
body[data-theme="light"] .children-fiches-table tr:hover td { background: #f8fafc; }
.fiche-name { color: #fafafa; font-weight: 500; }
body[data-theme="light"] .fiche-name { color: #0f172a; }
.fiche-group-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500;
  background: rgba(96,165,250,0.15); color: #60a5fa;
}
body[data-theme="light"] .fiche-group-badge { background: #eff6ff; color: #2563eb; }
.fiche-btn { border: none; background: #3a3a3e; color: #a1a1aa; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; font-family: inherit; }
.fiche-btn:hover { background: #48484d; }
body[data-theme="light"] .fiche-btn { background: #f1f5f9; color: #475569; }
body[data-theme="light"] .fiche-btn:hover { background: #e2e8f0; }

/* Override shift calendar chip */
.month-calendar-chip.type-override {
  background: rgba(167,139,250,0.18); color: #7c3aed; border-left-color: #7c3aed;
}
body[data-theme="light"] .month-calendar-chip.type-override {
  background: #ede9fe; color: #5b21b6;
}
/* Override shift indicator in modal */
.override-mode-section {
  background: rgba(167,139,250,0.08); border: 1px solid rgba(167,139,250,0.25);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
}
body[data-theme="light"] .override-mode-section { background: #f5f3ff; border-color: #ddd6fe; }
.override-time-row { display: flex; gap: 12px; }
.override-time-row > div { flex: 1; }
.override-mode-label { font-size: 11px; font-weight: 600; color: #a78bfa; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
body[data-theme="light"] .override-mode-label { color: #7c3aed; }

/* ---- Profile dropdown ---- */
.profile-menu-wrap { position: relative; }
.profile-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  padding: 5px 10px; border-radius: 10px;
  color: inherit; font-family: inherit; font-size: 14px; font-weight: 500;
  transition: background 0.15s;
}
.profile-menu-btn:hover { background: rgba(255,255,255,0.07); }
body[data-theme="light"] .profile-menu-btn:hover { background: rgba(0,0,0,0.05); }

.profile-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #3b82f6; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  letter-spacing: 0.02em;
}
.profile-avatar-lg { width: 42px; height: 42px; font-size: 16px; }

.profile-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #1e1e22; border: 1px solid #3a3a3e;
  border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  min-width: 220px; z-index: 1000; overflow: hidden;
  animation: dropdownFadeIn 0.12s ease;
}
body[data-theme="light"] .profile-dropdown {
  background: #ffffff; border-color: #e2e8f0;
  box-shadow: 0 16px 48px rgba(0,0,0,0.14);
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.profile-dropdown-header {
  display: flex; align-items: center; gap: 12px; padding: 16px;
}
.profile-dropdown-name { font-size: 15px; font-weight: 600; color: #f1f5f9; }
body[data-theme="light"] .profile-dropdown-name { color: #0f172a; }
.profile-dropdown-role { font-size: 12px; color: #71717a; margin-top: 2px; }
body[data-theme="light"] .profile-dropdown-role { color: #94a3b8; }
.profile-dropdown-divider { height: 1px; background: #2e2e33; margin: 0 12px; }
body[data-theme="light"] .profile-dropdown-divider { background: #e2e8f0; }
.profile-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 16px; background: none; border: none;
  font-size: 14px; font-weight: 500; color: #d4d4d8; cursor: pointer;
  font-family: inherit; text-align: left; border-radius: 0; transition: background 0.1s;
}
.profile-dropdown-item:hover { background: rgba(255,255,255,0.06); }
body[data-theme="light"] .profile-dropdown-item { color: #374151; }
body[data-theme="light"] .profile-dropdown-item:hover { background: #f8fafc; }
.profile-dropdown-item-danger { color: #f87171 !important; }
body[data-theme="light"] .profile-dropdown-item-danger { color: #dc2626 !important; }
