/* ─── Compteurs / Semaine ─────────────────────────────────────────────── */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Tableau */
.cws-table {
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 100%;
}

/* Sticky colonne employé */
.cws-table .col-emp {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 190px;
  min-width: 190px;
  text-align: left;
  padding: 0 10px;
  background: inherit;
}
.cws-table thead .col-emp { z-index: 3; }

/* Sticky en-tête */
.cws-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
}
.cws-table th, .cws-table td {
  border: 1px solid var(--border);
  height: 30px;
  padding: 0 8px;
  text-align: center;
  vertical-align: middle;
}

/* En-têtes semaines */
.cws-table thead th.th-week {
  background: #e8f0fe;
  font-weight: 600;
  font-size: 11px;
  color: #1a237e;
  min-width: 90px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cws-table thead th.th-week {
    background: #1e2a4a;
    color: #90caf9;
  }
}
[data-theme="dark"] .cws-table thead th.th-week {
  background: #1e2a4a;
  color: #90caf9;
}

.cws-table thead th.th-week .week-sub {
  display: block;
  font-weight: 400;
  font-size: 10px;
  color: var(--text-2);
}

/* En-tête colonne total */
.cws-table thead th.th-total {
  background: #1a237e;
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  min-width: 80px;
}

/* Corps */
.cws-table tbody tr:nth-child(odd)  { background: var(--surface); }
.cws-table tbody tr:nth-child(even) { background: var(--surface-2); }
.cws-table tbody tr:hover td { background: #e3f2fd; color: #0d47a1; }
.cws-table tbody tr:hover td.col-emp { background: #e3f2fd; }
[data-theme="dark"] .cws-table tbody tr:hover td { background: #0d2040; color: #90caf9; }

.cws-table td.col-emp {
  font-weight: 500;
  color: var(--text-1);
  border-right: 2px solid var(--border);
}

.cws-table td.cell-hours { color: var(--text-1); }
.cws-table td.cell-empty { color: var(--text-3); }

.cws-table td.cell-total {
  font-weight: 600;
  color: #1a237e;
  background: #eef2fb !important;
  border-left: 2px solid var(--border);
}
[data-theme="dark"] .cws-table td.cell-total { color: #90caf9; background: #1a1a38 !important; }

/* Pied totaux */
.cws-table tfoot td {
  background: #eef2fb !important;
  font-weight: 600;
  color: var(--text-1);
  border-top: 2px solid var(--border);
}
.cws-table tfoot td.col-emp {
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cws-table tfoot td.grand-total {
  background: #1a73e8 !important;
  color: #fff;
}

/* Barre info bas */
.cws-info-bar {
  padding: 5px 20px;
  font-size: 11px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  display: flex;
  gap: 20px;
}

@media print {
  .page-header, .bs-toolbar, .cws-info-bar { display: none !important; }
  body, #app { height: auto; overflow: visible; }
  .bs-body { overflow: visible; }
  .cws-table thead th { background: #dde4f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cws-table thead th.th-total { background: #1a237e !important; color: #fff !important; }
  .cws-table tfoot td.grand-total { background: #1a73e8 !important; color: #fff !important; }
  .cws-table .col-emp { position: static; }
  .cws-table thead th { position: static; }
}
