/* Valorio app shell — uses design tokens only; no competing palette. */
@import url("/design/styles.css");

:root {
  --sidebar-width: 236px;
  --topbar-height: 56px;
  --page-gutter: 24px;
  --content-max: 1440px;
}

html, body {
  height: 100%;
  margin: 0;
}

body:has(.app-shell) {
  overflow: hidden;
}

/* ——— Layout ——— */
.app-shell {
  display: flex;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  background: var(--surface-page);
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--surface-chrome);
  color: var(--text-on-chrome);
  display: flex;
  flex-direction: column;
  z-index: 40;
  border-right: 1px solid var(--border-chrome);
}

.app-sidebar__brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-chrome);
  background: #fff;
}

.app-sidebar__brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  max-width: 100%;
  min-width: 0;
}

.app-sidebar__brand img {
  height: 30px;
  width: auto;
  max-width: 190px;
  display: block;
  object-fit: contain;
}

.app-sidebar__close {
  display: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted, #555);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.app-sidebar__close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.app-nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-on-chrome);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.app-nav-toggle__bars,
.app-nav-toggle__bars::before,
.app-nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
}

.app-nav-toggle__bars::before,
.app-nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.app-nav-toggle__bars::before { top: -6px; }
.app-nav-toggle__bars::after { top: 6px; }

.app-nav-scrim {
  display: none;
}

html.nav-lock,
html.nav-lock body {
  overflow: hidden;
}

.app-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.app-sidebar__section {
  margin-bottom: 14px;
}

.app-sidebar__section-label {
  display: block;
  padding: 6px 10px 4px;
  font-size: var(--text-11);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-on-chrome-muted);
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--text-on-chrome);
  text-decoration: none;
  font-size: var(--text-13);
  position: relative;
  transition: background var(--dur-fast) var(--ease-out);
}

.app-sidebar__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-inverse);
  text-decoration: none;
}

.app-sidebar__link.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-inverse);
  font-weight: 600;
}

.app-sidebar__link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--citron-400);
}

.app-sidebar__footer {
  padding: 12px;
  border-top: 1px solid var(--border-chrome);
  font-size: var(--text-12);
  color: var(--text-on-chrome-muted);
}

.app-main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
  height: var(--topbar-height);
  background: var(--surface-chrome-deep);
  color: var(--text-on-chrome);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--page-gutter);
  border-bottom: 1px solid var(--border-chrome);
}

.app-topbar__left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.app-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.app-topbar__brand img {
  height: 32px;
  width: auto;
  display: block;
}

.app-topbar__titles {
  min-width: 0;
}

.app-topbar__meta {
  font-size: var(--text-12);
  color: var(--text-on-chrome-muted);
  white-space: nowrap;
}

.app-topbar__crumb {
  font-size: var(--text-12);
  color: var(--text-on-chrome-muted);
}

.app-topbar__title {
  font-size: var(--text-14);
  font-weight: 600;
  color: var(--text-inverse);
  margin: 0;
}

.app-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page {
  max-width: min(var(--content-max), 100%);
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 0 0 32px;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px var(--page-gutter) 0;
  min-width: 0;
}

.page-header__title {
  font-size: var(--text-22);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.page-header__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: var(--text-12);
  color: var(--text-muted);
}

.page-body {
  padding: 16px var(--page-gutter) 0;
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.page-body > * {
  min-width: 0;
  max-width: 100%;
}

/* ——— Components ——— */
.v-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  max-width: 100%;
  min-width: 0;
}

.v-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

.v-card__title {
  margin: 0;
  font-size: var(--text-14);
  font-weight: 600;
}

.v-card__subtitle {
  margin: 2px 0 0;
  font-size: var(--text-12);
  color: var(--text-muted);
}

.v-card__body {
  padding: 14px 16px 16px;
}

.v-card--flush .v-card__body {
  padding: 0;
}

/* Flush : tableau bord à bord, mais contenu hors table (liens, textes, formulaires) reste indenté */
.v-card--flush .v-card__head {
  padding-bottom: 12px;
}

.v-card--flush .v-card__body:not(:has(> .v-table)):not(:has(> .v-table-scroll)) {
  padding: 14px 16px 16px;
}

.v-card--flush .v-card__body > :not(.v-table):not(.v-table-scroll) {
  margin-left: 16px;
  margin-right: 16px;
}

.v-card--flush .v-card__body > :not(.v-table):not(.v-table-scroll):first-child {
  margin-top: 12px;
}

.v-card--flush .v-card__body > :not(.v-table):not(.v-table-scroll):last-child {
  margin-bottom: 16px;
}

.v-card__footer {
  padding: 12px 16px 16px;
  font-size: var(--text-12);
  color: var(--text-muted);
}

.v-card--flush .v-card__footer {
  margin: 0;
  border-top: 1px solid var(--border-subtle);
}

.v-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--control-height);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--action-secondary);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-13);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-control);
  box-sizing: border-box;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.v-btn:hover {
  background: var(--surface-hover);
  text-decoration: none;
  color: var(--text-body);
  border-color: color-mix(in srgb, var(--border-default) 70%, var(--text-muted));
}

.v-btn--primary {
  background: var(--action-primary);
  border-color: transparent;
  color: var(--text-on-accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.v-btn--primary:hover {
  background: var(--action-primary-hover);
  color: var(--text-on-accent);
}

.v-btn--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-muted);
}
.v-btn--ghost:hover {
  background: var(--surface-hover);
  color: var(--text-body);
}

.v-btn--soft {
  background: color-mix(in srgb, var(--action-primary) 14%, #fff);
  border-color: color-mix(in srgb, var(--action-primary) 28%, transparent);
  color: var(--citron-800, #3f6212);
  box-shadow: none;
}
.v-btn--soft:hover {
  background: color-mix(in srgb, var(--action-primary) 22%, #fff);
  color: var(--citron-800, #3f6212);
}

.v-btn--sm {
  height: var(--control-height-sm);
  padding: 0 10px;
  font-size: var(--text-12);
}

/* Keep filter/action buttons aligned with adjacent inputs */
.control-row > .v-btn.v-btn--sm,
.employees-filters .v-btn.v-btn--sm,
.leave-accrual-form .v-btn.v-btn--sm {
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 14px;
  font-size: var(--text-13);
}

.v-btn--block {
  width: 100%;
}

.v-field {
  display: grid;
  gap: 6px;
}

.v-field__label {
  font-size: var(--text-12);
  font-weight: 600;
  color: var(--text-body);
}

.v-field__hint {
  font-size: var(--text-11);
  color: var(--text-muted);
}

.v-input,
.v-select,
.v-textarea {
  width: 100%;
  height: var(--control-height);
  padding: 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  font-family: var(--font-sans);
  font-size: var(--text-13);
  color: var(--text-strong);
  box-sizing: border-box;
}

.v-textarea {
  height: auto;
  min-height: 88px;
  padding: 8px 10px;
  resize: vertical;
}

.v-input:focus,
.v-select:focus,
.v-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--ring-focus);
}

.v-input--invalid {
  border-color: var(--action-danger);
}

.v-input-wrap {
  display: flex;
  align-items: center;
  height: var(--control-height);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.v-input-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--ring-focus);
}

.v-input-wrap .v-input {
  border: 0;
  box-shadow: none;
  height: 100%;
}

.v-input-wrap__affix {
  padding: 0 10px;
  font-size: var(--text-12);
  color: var(--text-faint);
  white-space: nowrap;
}

.v-input--numeric {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
}

.v-switch {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  cursor: pointer;
}

.v-switch__label {
  font-size: var(--text-13);
  color: var(--text-strong);
  font-weight: var(--weight-medium);
}

/* Switch track — Design System Switch.jsx (pill 34×20) */
.v-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 20px;
  flex: 0 0 34px;
  cursor: pointer;
  vertical-align: middle;
  overflow: visible;
}

.v-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.v-toggle__track {
  display: block;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--slate-300);
  transition: background-color var(--dur-fast) var(--ease-out);
  position: relative;
  box-sizing: border-box;
}

.v-toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-fast) var(--ease-out);
}

.v-toggle input:checked + .v-toggle__track {
  background: var(--citron-400);
}

.v-toggle input:checked + .v-toggle__track::after {
  transform: translateX(14px);
}

.v-toggle input:focus-visible + .v-toggle__track {
  box-shadow: var(--ring-focus);
}

.v-toggle input:disabled + .v-toggle__track {
  opacity: 0.45;
  cursor: not-allowed;
}

.v-toggle.is-saving {
  opacity: 0.6;
  pointer-events: none;
}

.v-toggle-wrap {
  display: inline-flex;
  align-items: center;
  height: var(--control-height);
  flex: 0 0 auto;
}

.v-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
  border: 1px solid rgba(16, 22, 31, 0.12);
  vertical-align: middle;
}

.v-name-with-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.v-alert {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--status-info-line);
  background: linear-gradient(135deg, var(--status-info-bg), color-mix(in srgb, var(--status-info-bg) 70%, #fff));
  color: var(--status-info-fg);
  font-size: var(--text-13);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}
.v-alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: currentColor;
  opacity: 0.55;
}
.v-alert__icon {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  flex-shrink: 0;
}
.v-alert__icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.v-alert--warning {
  border-color: var(--status-warning-line);
  background: linear-gradient(135deg, var(--status-warning-bg), color-mix(in srgb, var(--status-warning-bg) 65%, #fff));
  color: var(--status-warning-fg);
}

.v-alert--success {
  border-color: var(--status-success-line);
  background: linear-gradient(135deg, var(--status-success-bg), color-mix(in srgb, var(--status-success-bg) 65%, #fff));
  color: var(--status-success-fg);
}

.v-alert--danger {
  border-color: var(--status-danger-line);
  background: linear-gradient(135deg, var(--status-danger-bg), color-mix(in srgb, var(--status-danger-bg) 65%, #fff));
  color: var(--status-danger-fg);
}

.v-alert__title {
  font-weight: 650;
  font-size: var(--text-13);
  line-height: 1.35;
}
.v-alert__body {
  grid-column: 2;
  opacity: 0.92;
  font-size: var(--text-12);
}

.v-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: var(--text-11);
  font-weight: 600;
  background: var(--status-neutral-bg);
  color: var(--status-neutral-fg);
}

.v-badge--success { background: var(--status-success-bg); color: var(--status-success-fg); }
.v-badge--accent { background: var(--citron-100); color: var(--citron-700); }
.v-badge--warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.v-badge--danger { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.v-badge--info { background: var(--status-info-bg); color: var(--status-info-fg); }
.v-badge--muted { background: var(--slate-100, #eef2f6); color: var(--text-muted); }

.v-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-13);
}

/* Scroll horizontal confiné aux blocs (pas à la page) */
.v-table-scroll,
.v-card--flush:has(> .v-table),
.v-card__body:has(> .v-table) {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.v-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 32px;
  padding: 0 16px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  font-size: var(--text-11);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--slate-50);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: none;
}

.v-table thead th.num {
  text-align: right;
}

.v-table thead th.v-table__col-toggle {
  width: 110px;
  text-align: center;
}

.v-table tbody td {
  height: var(--row-height-compact);
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-body);
  vertical-align: middle;
}

.v-table tbody td.v-table__col-toggle {
  text-align: center;
  overflow: visible;
  width: 110px;
}

.v-table tbody tr:last-child td {
  border-bottom: 0;
}

.v-table:has(> tfoot) tbody tr:last-child td {
  border-bottom: 1px solid var(--border-subtle);
}

.v-table tfoot td {
  height: auto;
  min-height: var(--row-height-compact);
  padding: 12px 16px;
  vertical-align: middle;
  background: var(--slate-50, #f8fafc);
  border-top: 2px solid var(--border-default, #d0d7de);
  color: var(--text-strong, #0f172a);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.v-table tfoot td.num {
  text-align: right;
}

.v-table tfoot .sim-metric__sub {
  font-weight: 500;
  color: var(--text-muted);
}

.v-table tbody tr.v-table__highlight-row td {
  background: color-mix(in srgb, var(--accent, #2563eb) 6%, transparent);
}

.v-table tbody tr:hover td {
  background: var(--surface-hover);
}

.v-card--flush > .v-card__head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.v-card--flush > .v-card__body {
  padding: 0;
}

.v-card--flush > .v-card__body:not(:has(> .v-table)):not(:has(> .v-table-scroll)) {
  padding: 14px 16px 16px;
}

.v-list-add {
  border-top: 1px solid var(--border-subtle);
  background: var(--slate-50);
  padding: 12px 16px 14px;
}

.v-list-add__fields {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.v-list-add__fields > .v-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.v-list-add__fields > .v-field--grow {
  flex: 1 1 160px;
}

.v-btn--danger {
  background: var(--action-danger);
  border-color: transparent;
  color: var(--text-inverse);
}

.v-btn--danger:hover {
  background: var(--action-danger-hover);
  color: var(--text-inverse);
}

.v-card--flush > .v-card__head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

.v-color {
  display: block;
  width: 34px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.v-color::-webkit-color-swatch-wrapper {
  padding: 0;
}

.v-color::-webkit-color-swatch {
  border: 0;
  border-radius: 3px;
}

.v-color::-moz-color-swatch {
  border: 0;
  border-radius: 3px;
}

.v-field-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.v-field-row > .v-field--grow {
  flex: 1 1 auto;
  min-width: 0;
}

.v-modal--sm {
  width: min(400px, 100%);
}

.v-list-add__fields > .v-field .v-input,
.v-list-add__fields > .v-field .v-select {
  height: var(--control-height);
}

.v-list-add__fields > .v-toggle-wrap {
  height: var(--control-height);
  margin: 0;
}

.v-list-add__fields > .v-btn {
  height: var(--control-height);
  margin: 0;
  flex: 0 0 auto;
}

.v-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-control);
}

.v-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}

.v-icon-btn--danger:hover {
  background: var(--status-danger-bg);
  color: var(--status-danger-fg);
}

.v-table__col-actions {
  width: 72px;
  text-align: right;
  white-space: nowrap;
}

.v-table thead th.v-table__col-actions,
.v-table tbody td.v-table__col-actions {
  width: 72px;
  text-align: right;
  padding-right: var(--space-5);
}

.v-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.v-modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 22, 31, 0.45);
  backdrop-filter: blur(2px);
}

.v-modal {
  width: min(480px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
}

.v-modal.v-modal--wide {
  width: min(960px, calc(100vw - 48px));
  max-width: min(960px, calc(100vw - 48px));
}

.v-modal.v-modal--wide .v-modal__body {
  overflow-x: hidden;
}

.v-modal.v-modal--wide .v-table {
  width: 100%;
  table-layout: fixed;
}

.v-modal.v-modal--wide .v-table th,
.v-modal.v-modal--wide .v-table td {
  white-space: normal;
  word-break: break-word;
  padding-left: 10px;
  padding-right: 10px;
}

.v-modal.v-modal--wide .v-table thead th {
  white-space: normal;
}

.v-modal.v-modal--wide .v-table__col-actions {
  width: 88px;
}

.v-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.v-modal__title {
  margin: 0;
  font-size: var(--text-16);
  font-weight: var(--weight-semibold);
}

.v-modal__body {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.v-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border-subtle);
}

.v-presence-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  border-radius: 2px;
  color: #111;
}

.v-presence-cell[data-code="W"] { background: var(--pc-w-bg); color: #ffefef; }
.v-presence-cell[data-code="A"] { background: var(--pc-a-bg); color: #fbfbfb; }
.v-presence-cell[data-code="M"] { background: var(--pc-m-bg); color: var(--pc-m-fg); }
.v-presence-cell[data-code="F"],
.v-presence-cell[data-code="RF"],
.v-presence-cell[data-code="RA"] { background: var(--pc-f-bg); color: #fbfbfb; }
.v-presence-cell[data-code="P"] { background: var(--pc-p-bg); color: var(--pc-p-fg); }
.v-presence-cell[data-code="D"] { background: var(--pc-d-bg); color: var(--pc-d-fg); }
.v-presence-cell[data-code="T"] { background: var(--pc-t-bg); color: var(--pc-t-fg); }
.v-presence-cell[data-code="RP"] { background: var(--pc-rp-bg); color: var(--pc-rp-fg); }
.v-presence-cell[data-code="RT"] { background: var(--pc-rt-bg); color: var(--pc-rt-fg); }
.v-presence-cell[data-code="I"],
.v-presence-cell[data-code="DS"],
.v-presence-cell[data-code="TI"] { background: var(--pc-i-bg); color: #f7f7f7; }
.v-presence-cell[data-code="C"] { background: var(--pc-c-bg); color: var(--pc-c-fg); }
.v-presence-cell[data-code="CN"] { background: var(--pc-cn-bg); color: var(--pc-cn-fg); }
.v-presence-cell[data-code="S"] { background: var(--pc-s-bg); color: var(--pc-s-fg); }

.v-presence-cell.is-clickable { cursor: cell; border: none; padding: 0; }
.v-presence-cell.is-selected { outline: 2px solid var(--ink); outline-offset: 2px; }
.v-presence-cell.is-in-selection {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 1.5px #3b82f6;
}
.v-presence-cell.is-in-selection::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(59, 130, 246, 0.22);
  pointer-events: none;
  border-radius: inherit;
}
.v-presence-cell.is-sel-focus {
  box-shadow: inset 0 0 0 2px #1d4ed8;
}
.v-presence-cell.is-locked { opacity: 0.72; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.v-presence-cell:disabled { opacity: 0.85; cursor: default; }
.v-presence-cell:not([data-code]) {
  background: var(--slate-100, #f1f5f9);
  color: var(--text-faint);
  font-weight: 500;
}

.presence-grid-wrap {
  --presence-col-name: 160px;
  --presence-col-info: 128px;
  --presence-col-day: 34px;
  --presence-head-letters: 20px;
  display: block;
  overflow: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: min(70vh, calc(100vh - 260px));
  border-top: 1px solid var(--border-subtle);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.presence-grid-wrap.is-selecting {
  user-select: none;
  cursor: cell;
}
.presence-grid-wrap.is-selecting .v-presence-cell.is-clickable {
  cursor: cell;
}
.presence-selection-hint {
  font-size: var(--text-12);
  color: var(--text-muted);
  font-weight: 600;
}
.presence-grid-head-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.presence-billable-days {
  font-size: var(--text-12);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.presence-grid {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: var(--text-12);
}
.presence-grid th,
.presence-grid td {
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  padding: 4px;
  text-align: center;
  vertical-align: middle;
}
.presence-grid__sticky {
  position: sticky;
  z-index: 2;
  background: var(--surface-card);
  text-align: left !important;
  padding: 8px 12px !important;
}
.presence-grid__sticky--name {
  left: 0;
  width: var(--presence-col-name);
  min-width: var(--presence-col-name);
  max-width: var(--presence-col-name);
  z-index: 3;
}
.presence-grid__sticky--info {
  left: var(--presence-col-name);
  width: var(--presence-col-info);
  min-width: var(--presence-col-info);
  max-width: var(--presence-col-info);
  z-index: 3;
  box-shadow: 2px 0 0 var(--border-subtle);
}
.presence-grid-wrap.is-no-info {
  --presence-col-info: 0px;
}
.presence-grid-wrap.is-no-info .presence-grid__sticky--name {
  box-shadow: 2px 0 0 var(--border-subtle);
}
.presence-grid thead th {
  position: sticky;
  z-index: 4;
  background: var(--surface-card);
  font-weight: 600;
}
.presence-grid thead .presence-grid__sticky {
  z-index: 6;
  top: 0;
  vertical-align: bottom;
}
.presence-grid thead tr.presence-grid__letters th.presence-grid__day {
  top: 0;
  z-index: 4;
  height: var(--presence-head-letters);
  padding: 2px 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  border-bottom: none;
}
.presence-grid thead tr.presence-grid__numbers th.presence-grid__day {
  top: var(--presence-head-letters);
  z-index: 4;
  padding-top: 0;
  padding-bottom: 4px;
}
.presence-grid__corner {
  vertical-align: bottom !important;
}
.presence-grid__corner-label {
  display: block;
  font-size: var(--text-12);
  font-weight: 600;
  color: var(--text);
}
.presence-grid__corner-hint {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-faint);
  margin-top: 2px;
}
.presence-grid__day,
.presence-grid__day-cell {
  width: var(--presence-col-day);
  min-width: var(--presence-col-day);
  max-width: var(--presence-col-day);
  box-sizing: border-box;
}
.presence-grid__day.is-weekend,
.presence-grid__day-cell.is-weekend { background: color-mix(in srgb, var(--slate-100, #f1f5f9) 70%, transparent); }
.presence-grid__letter.is-weekend { color: var(--text-faint); }
.presence-grid__dow { display: block; font-size: 11px; }
.presence-grid__emp { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presence-grid__meta { font-size: 11px; color: var(--text-faint); }
.presence-grid__info {
  vertical-align: middle;
}
.presence-grid__mission {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.presence-grid__mission--empty { color: var(--text-faint); font-style: italic; }
.presence-grid__count {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.presence-grid__count span {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 10px;
}
.presence-grid__day-cell {
  display: table-cell;
}
.presence-grid__day-cell .v-presence-cell {
  display: flex;
  width: 26px;
  height: 18px;
  margin: 1px auto;
  font-size: 9px;
  font-weight: 800;
}

#attendance-panel,
#attendance-root {
  min-width: 0;
  max-width: 100%;
}

#attendance-root > .v-card--flush {
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}
.presence-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 16px;
}
.presence-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-12);
}
.presence-code-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.presence-code-picker .v-presence-cell {
  width: 30px;
  height: 30px;
  cursor: pointer;
  border: none;
}
.presence-code-picker .v-presence-cell.is-selected {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.presence-popover {
  position: fixed;
  z-index: 120;
  width: min(300px, calc(100vw - 24px));
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-3);
}
.presence-popover__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.presence-popover__title {
  font-size: var(--text-14);
  font-weight: 600;
  line-height: 1.2;
}
.presence-popover__meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}
.presence-popover__body {
  padding: 12px;
  display: grid;
  gap: 10px;
}
.presence-popover__note {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}
.presence-popover__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 12px 12px;
}

.v-tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: var(--text-12);
  background: var(--surface-card);
  color: var(--text-body);
  cursor: pointer;
  user-select: none;
}

.v-tag.is-active {
  background: var(--pc-w-bg);
  border-color: transparent;
  color: #fff;
}

.v-tag input { display: none; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.gap-14 { display: grid; gap: 14px; }

.fx-rate-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 16px;
  align-items: start;
}
.fx-rate-row .v-field__hint {
  min-height: 1.2em;
  margin: 4px 0 0;
}
.fx-rate-row__action .v-btn {
  width: 100%;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .fx-rate-row {
    grid-template-columns: 1fr 1fr;
  }
  .fx-rate-row__action {
    grid-column: 1 / -1;
  }
}

.mc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.mc-kpi {
  padding: 12px 14px;
  background: var(--surface-2, #f8fafc);
  border-radius: 10px;
}
.mc-kpi__label {
  display: block;
  font-size: .78rem;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.mc-kpi strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.mc-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border, #e2e8f0);
  margin: 0 -4px;
}
.mc-tabs__link {
  padding: 10px 14px;
  color: var(--text-faint);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: .92rem;
}
.mc-tabs__link.is-active {
  color: var(--text, #0f172a);
  border-bottom-color: var(--accent, #84cc16);
  font-weight: 600;
}
.mc-emp-block {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--surface-2, #f8fafc);
  border-radius: 8px;
}
.mc-emp-block > summary {
  cursor: pointer;
  list-style: none;
}
@media (max-width: 900px) {
  .mc-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}

.settings-nav {
  padding: 6px;
  display: grid;
}

.settings-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-13);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.settings-nav__item:hover {
  background: var(--surface-hover);
  text-decoration: none;
  color: var(--text-body);
}

.settings-nav__item.is-active {
  background: var(--surface-selected);
  color: var(--text-strong);
  font-weight: 600;
}

.allowance-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.flash-stack {
  padding: 12px var(--page-gutter) 0;
  display: grid;
  gap: 8px;
}

.flash-stack--live {
  position: sticky;
  top: 0;
  z-index: 40;
}

.employees-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
}

.employees-filters .v-field {
  min-width: 140px;
}

.employees-filters__search {
  min-width: 180px;
  flex: 1 1 180px;
}

/* ——— Login ——— */
.login-shell {
  display: flex;
  min-height: 100vh;
  background: var(--surface-page);
}

.login-panel {
  flex: 0 0 42%;
  background: var(--slate-800);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-on-chrome);
}

.login-panel__logo {
  height: 96px;
  width: auto;
  max-width: 420px;
  align-self: flex-start;
  display: block;
  object-fit: contain;
  padding: 12px 18px;
  border-radius: 12px;
  background: #fff;
}

.login-panel h2 {
  color: var(--white);
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.login-panel p {
  color: var(--text-on-chrome);
  font-size: var(--text-14);
  margin: 0;
  line-height: 1.5;
  max-width: 28ch;
}

.login-panel__copy {
  display: grid;
  gap: 14px;
  max-width: 360px;
}

.login-form .v-alert {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
}
.login-form .v-alert__title {
  grid-column: 1;
}
.login-form .v-alert__body {
  grid-column: 1;
  margin: 0;
  line-height: 1.45;
}

.login-form-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-form {
  width: 320px;
  display: grid;
  gap: 16px;
}

@media (max-width: 900px) {
  .app-nav-toggle { display: inline-flex; }
  .app-sidebar__close { display: inline-flex; align-items: center; justify-content: center; }
  .app-nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15, 23, 42, 0.45);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }
  .app-nav-scrim[hidden] { display: none !important; }
  .app-sidebar {
    display: flex;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: none;
    width: min(var(--sidebar-width), 86vw);
  }
  .app-shell.is-nav-open .app-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.2);
  }
  .app-main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
  .settings-layout,
  .grid-2,
  .grid-3,
  .allowance-grid { grid-template-columns: 1fr; }
  .login-shell { flex-direction: column; }
  .login-panel { flex: none; min-height: 220px; padding: 28px; }
}

/* —— Invoice wizard —— */
.invoice-wizard-modal {
  width: min(960px, 100%);
}

.invoice-wizard-steps {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-muted, rgba(0, 0, 0, 0.02));
}

.invoice-wizard-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  font-size: var(--text-12);
  color: var(--text-faint);
}

.invoice-wizard-step__num {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.invoice-wizard-step.is-active {
  color: var(--text);
}

.invoice-wizard-step.is-active .invoice-wizard-step__num {
  background: var(--accent, #2563eb);
  border-color: transparent;
  color: #fff;
}

.invoice-wizard-step.is-done .invoice-wizard-step__num {
  background: var(--success-soft, #dcfce7);
  border-color: transparent;
  color: var(--success, #166534);
}

.invoice-wizard-step__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-lines-wrap {
  max-height: min(52vh, 420px);
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
}

.invoice-lines-table {
  font-size: var(--text-12);
}

.invoice-lines-table th,
.invoice-lines-table td {
  padding: 10px 8px;
  vertical-align: middle;
}

.invoice-lines-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.invoice-col-check {
  width: 28px;
}

.invoice-lines-table tr.is-deselected {
  opacity: 0.45;
}

.invoice-line-name {
  font-weight: 600;
  color: var(--text);
}

.invoice-line-meta {
  color: var(--text-faint);
  font-size: 11px;
  margin-top: 1px;
}

.invoice-input-num {
  width: 72px;
  padding: 5px 6px;
  margin: 2px 0;
  font-size: var(--text-12);
  text-align: right;
  box-sizing: border-box;
}

.invoice-subtotal {
  font-weight: 600;
}

.invoice-detail-row td {
  background: var(--surface-muted, rgba(0, 0, 0, 0.025));
  padding: 14px 12px !important;
}

.employee-presence-cal {
  max-width: 640px;
  margin-inline: 0;
}
.employee-presence-cal .invoice-pastille {
  cursor: default;
}

.invoice-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.invoice-cal__head strong {
  text-transform: capitalize;
  font-size: var(--text-13);
}

.invoice-cal__legend {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-faint);
}

.invoice-cal__leg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.invoice-cal__leg i {
  width: 16px;
  height: 16px;
  min-height: 0;
  border-radius: 4px;
  pointer-events: none;
  display: inline-block;
  padding: 0;
  font-size: 0;
  border-width: 1.5px;
  box-sizing: border-box;
}

.invoice-cal__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
}

.invoice-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.invoice-cal__day {
  min-height: 68px;
  padding: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface-card);
}

.invoice-cal__day.is-empty,
.invoice-cal__day.is-outside {
  background: transparent;
  border-color: transparent;
}

.invoice-cal__day.has-presence {
  border-color: color-mix(in srgb, var(--accent, #2563eb) 28%, var(--border-subtle));
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 22, 31, 0.04);
}

.invoice-cal__num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.invoice-cal__day.has-presence .invoice-cal__num {
  color: var(--accent, #1d4ed8);
}

.invoice-cal__slots {
  display: flex;
  gap: 4px;
}

.invoice-pastille {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 3px 0;
  border: 1.5px solid #94a3b8;
  border-radius: 5px;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.05;
  cursor: pointer;
  color: #0f172a;
}

.invoice-pastille small {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.invoice-pastille:disabled,
.invoice-pastille.is-empty {
  opacity: 0.28;
  cursor: default;
  background: transparent;
  border-style: dashed;
  border-color: var(--border-subtle);
  color: var(--text-faint);
  font-weight: 600;
}

.invoice-pastille.is-on {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1e3a8a;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.invoice-pastille.is-maj {
  background: #ffedd5;
  border-color: #ea580c;
  color: #9a3412;
  box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.18);
}

.invoice-pastille.is-off {
  background: #fff;
  border-color: #64748b;
  border-style: dashed;
  color: #334155;
  opacity: 1;
  text-decoration: none;
}

.invoice-pastille.is-off::after {
  content: none;
}

.invoice-pastille:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
}

.invoice-cells-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-faint);
}

.invoice-running-total {
  font-size: var(--text-13);
  color: var(--text-muted);
  text-align: right;
}

.invoice-recap {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
}

.invoice-recap__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-13);
  color: var(--text-muted);
}

.invoice-recap__row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.invoice-recap__row--total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-14);
}

@media (max-width: 720px) {
  .invoice-wizard-step__label { display: none; }
  .invoice-input-num { width: 56px; }
  .invoice-cal { max-width: 100%; }
}

/* —— Simulateur TJM —— */
.sim-health {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}
.sim-health::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: currentColor;
  opacity: 0.45;
}
.sim-health--success { border-color: var(--status-success-line); background: var(--status-success-bg); color: var(--status-success-fg); }
.sim-health--info { border-color: var(--status-info-line); background: var(--status-info-bg); color: var(--status-info-fg); }
.sim-health--warning { border-color: var(--status-warning-line); background: var(--status-warning-bg); color: var(--status-warning-fg); }
.sim-health--danger { border-color: var(--status-danger-line); background: var(--status-danger-bg); color: var(--status-danger-fg); }
.sim-health__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sim-health__title { font-weight: 700; font-size: var(--text-16, 16px); }
.sim-health__meta { font-size: var(--text-13); opacity: 0.9; margin-top: 2px; }
.sim-health__list { margin: 0; padding-left: 18px; font-size: var(--text-13); display: grid; gap: 4px; }

/* Status icons — replace English level labels (danger/warning/…) in alerts */
.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  background: color-mix(in srgb, currentColor 16%, transparent);
  color: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent);
}
.status-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.status-icon--success { color: var(--status-success-fg, #15803d); background: color-mix(in srgb, var(--status-success-fg, #15803d) 14%, transparent); }
.status-icon--info { color: var(--status-info-fg, #1d4ed8); background: color-mix(in srgb, var(--status-info-fg, #1d4ed8) 14%, transparent); }
.status-icon--warning { color: var(--status-warning-fg, #b45309); background: color-mix(in srgb, var(--status-warning-fg, #b45309) 14%, transparent); }
.status-icon--danger { color: var(--status-danger-fg, #b91c1c); background: color-mix(in srgb, var(--status-danger-fg, #b91c1c) 14%, transparent); }

/* Align filter / toolbar buttons with inputs */
.control-row,
.employees-filters .v-card__body,
.leave-accrual-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.control-row .v-btn,
.employees-filters .v-btn,
.leave-accrual-form .v-btn,
.page-header .margins-tabs .v-btn,
.page-header .v-field .v-btn,
.expenses-quick .v-btn,
.sim-expense-row .v-btn:not(.v-icon-btn) {
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0 14px;
  font-size: var(--text-13);
  box-sizing: border-box;
}
.page-header .margins-tabs {
  align-items: stretch;
}
.page-header .margins-tabs .v-btn {
  align-self: stretch;
}
.margins-modal-hero {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised, #fafafa);
}
.margins-modal-hero__label {
  font-size: var(--text-11);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 600;
}
.margins-modal-hero__value {
  font-size: var(--text-22, 22px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.margins-modal-hero__hint {
  font-size: var(--text-12);
  color: var(--text-muted);
}
.margins-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.margins-modal-tile {
  padding: 12px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border-subtle);
  background: #fff;
  display: grid;
  gap: 4px;
}
.margins-modal-tile span {
  font-size: var(--text-11);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  font-weight: 600;
}
.margins-modal-tile strong {
  font-size: var(--text-15, 15px);
  font-variant-numeric: tabular-nums;
}
.sim-gauge {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 18%, transparent);
  overflow: hidden;
}
.sim-gauge__fill {
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  transition: width 280ms ease;
}
.sim-kv { display: grid; gap: 8px; }
.sim-kv > div,
.sim-kv--compact > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-13);
}
.sim-kv--compact { padding: 8px 0; border-top: 1px solid var(--border-subtle); }
.audit-code {
  font-size: var(--text-12);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  color: var(--text-muted);
}
.audit-json {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-subtle, #f4f4f5);
  border: 1px solid var(--border-subtle);
  font-size: var(--text-12);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
}
.sim-rate-row {
  display: grid;
  grid-template-columns: 1fr 88px auto;
  gap: 8px;
  align-items: center;
}
.sim-expense-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.9fr 0.7fr auto;
  gap: 8px;
  align-items: end;
}
.sim-expense-row__del { margin-bottom: 2px; }
.sim-results-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sim-results-table__focus td { padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.sim-pos { color: var(--status-success-fg, #1b5e20); }
.sim-neg { color: var(--status-danger-fg, #b71c1c); }
.sim-payroll { padding-top: 8px; border-top: 1px solid var(--border-subtle); }
.sim-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  align-items: start;
}
.sim-fields .v-field { margin: 0; min-width: 0; }
.sim-fields .v-field__hint { min-height: 1.2em; }
.sim-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: var(--text-13);
}
.sim-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sim-calc {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-muted, #f7f7f8);
}
.sim-calc__title {
  font-weight: 700;
  font-size: var(--text-13);
  margin-bottom: 2px;
}
.sim-calc__step {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-subtle);
}
.sim-calc__step:last-child { border-bottom: 0; padding-bottom: 0; }
.sim-calc__label { font-weight: 600; }
.sim-calc__detail { color: var(--text-muted); font-size: var(--text-12, 12px); margin-top: 2px; }
.sim-calc__value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sim-metric {
  display: grid;
  gap: 2px;
  line-height: 1.25;
}
.sim-metric__sub {
  display: block;
  font-size: var(--text-11, 11px);
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}
.sim-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  justify-content: flex-end;
}
.sim-actions .v-icon-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}
.sim-actions-col { width: 1%; white-space: nowrap; }
.v-table td:has(.sim-actions),
.v-table th.sim-actions-col,
.v-table th.v-table__col-actions {
  padding-right: 10px;
  padding-left: 10px;
}
.sim-irpp {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-muted, #f7f7f8);
}
.sim-irpp-table { font-size: var(--text-12, 12px); }
.sim-irpp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sim-irpp-table tr.is-active td { font-weight: 600; background: color-mix(in srgb, var(--status-info-bg, #e3f2fd) 55%, transparent); }
.sim-irpp-table tfoot td { border-top: 1px solid var(--border-subtle); padding-top: 8px; }

/* —— Marges —— */
.margins-section-label {
  font-size: var(--text-11, 11px);
  font-weight: var(--weight-semibold, 600);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.margins-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.margins-widgets--sim .margins-widget {
  border-style: dashed;
  background: color-mix(in srgb, var(--surface-muted, #f7f7f8) 70%, transparent);
}
.margins-widget {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-raised, #fff);
  cursor: pointer;
  transition: var(--transition-control, 0.15s ease);
  color: inherit;
  font: inherit;
}
.margins-widget:hover {
  border-color: var(--border-strong, #c5c9d1);
  background: var(--surface-hover, #f5f6f8);
}
.margins-widget--focus {
  border-color: var(--status-info-line, #90caf9);
  background: var(--status-info-bg, #e3f2fd);
}
.margins-widget__label {
  font-size: var(--text-11, 11px);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.margins-widget strong {
  font-size: var(--text-16, 16px);
  font-variant-numeric: tabular-nums;
}
.margins-widget__hint {
  font-size: var(--text-11, 11px);
  color: var(--text-muted);
}
.margins-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}
.margins-kpi {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-muted, #f7f7f8);
}
.margins-kpi span { font-size: var(--text-11, 11px); color: var(--text-muted); }
.margins-kpi strong { font-size: var(--text-18, 18px); }

.leave-balances__head {
  margin-bottom: 10px;
}
.leave-balances__title {
  margin: 0;
  font-size: var(--text-14);
  font-weight: 600;
  color: var(--text-body);
}
.leave-balances__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px) {
  .leave-balances__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .leave-balances__grid { grid-template-columns: 1fr; }
}
.leave-balances__group-label {
  margin: 0 0 8px;
  font-size: var(--text-13);
  font-weight: 600;
  color: var(--text-muted);
}
.leave-balance-widget {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card, #fff);
  min-height: 96px;
}
.leave-balance-widget--reste {
  border-color: color-mix(in srgb, var(--status-info-line, #90caf9) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-info-bg, #e3f2fd) 35%, #fff);
}
.leave-balance-widget--reste-ok {
  border-color: color-mix(in srgb, var(--status-success-line, #9CCFB4) 75%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-success-bg, #e8f5e9) 45%, #fff);
}
.leave-balance-widget--reste-ok .leave-balance-widget__value {
  color: var(--status-success-fg, #15803d);
}
.leave-balance-widget--reste-warn {
  border-color: color-mix(in srgb, var(--status-warning-line, #E8C48A) 75%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-warning-bg, #fff8e1) 50%, #fff);
}
.leave-balance-widget--reste-warn .leave-balance-widget__value {
  color: var(--status-warning-fg, #b45309);
}
.leave-balance-widget--reste-danger {
  border-color: color-mix(in srgb, var(--status-danger-line, #EAAFAA) 75%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-danger-bg, #ffebee) 50%, #fff);
}
.leave-balance-widget--reste-danger .leave-balance-widget__value {
  color: var(--status-danger-fg, #b91c1c);
}
.leave-reste--ok { color: var(--status-success-fg, #15803d); }
.leave-reste--warn { color: var(--status-warning-fg, #b45309); }
.leave-reste--danger { color: var(--status-danger-fg, #b91c1c); }

.leave-carryover-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
}
.leave-carryover-inline .v-input {
  width: 88px;
  text-align: right;
}
.leave-balance-widget--empty {
  color: var(--text-faint);
  align-content: center;
  grid-column: 1 / -1;
}
.leave-balance-widget__emp {
  font-size: var(--text-12);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leave-balance-widget__type {
  font-size: var(--text-12);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.leave-balance-widget__value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text-body);
}
.leave-balance-widget__hint {
  font-size: var(--text-12);
  color: var(--text-faint);
}
.leave-balance-widget__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
  font-size: var(--text-11);
  color: var(--text-muted);
}
.leave-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.leave-history__item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: var(--text-13);
  color: var(--text-body);
}
.leave-history__item--empty {
  color: var(--text-faint);
}
.leave-history__date {
  flex-shrink: 0;
  min-width: 72px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: var(--text-12);
}
.leave-history__meta {
  color: var(--text-faint);
  font-size: var(--text-12);
}

.profile-page {
  display: grid;
}
.profile-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 22px 22px 18px;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--status-info-bg, #e3f2fd) 55%, #fff) 0%, #fff 48%, color-mix(in srgb, var(--surface-sunken, #f1f5f9) 70%, #fff) 100%);
  box-shadow: var(--shadow-2);
}
.profile-hero__glow {
  position: absolute;
  inset: -40% auto auto -10%;
  width: 320px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--status-info-line, #90caf9) 35%, transparent), transparent 70%);
  pointer-events: none;
}
.profile-hero__top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  z-index: 1;
}
.profile-hero__main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.profile-hero__avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-20, 20px);
  letter-spacing: 0.02em;
  color: var(--status-info-fg, #1d4ed8);
  background: color-mix(in srgb, #fff 70%, var(--status-info-bg, #e3f2fd));
  border: 1px solid color-mix(in srgb, var(--status-info-line, #90caf9) 65%, transparent);
  box-shadow: var(--shadow-1);
  flex-shrink: 0;
}
.profile-hero__name {
  margin: 0 0 8px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-body);
  line-height: 1.15;
}
.profile-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.profile-hero__email {
  margin-top: 8px;
  font-size: var(--text-13);
  color: var(--text-muted);
}
.profile-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 5px);
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, #fff 80%, transparent);
  font-size: var(--text-12);
  font-weight: 600;
  color: var(--text-body);
}
.profile-chip--role {
  border-color: color-mix(in srgb, var(--status-info-line, #90caf9) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-info-bg, #e3f2fd) 55%, #fff);
  color: var(--status-info-fg, #1d4ed8);
}
.profile-chip--muted {
  color: var(--text-muted);
  font-weight: 500;
}
.profile-hero__highlights {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 860px) {
  .profile-hero__highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .profile-hero__highlights { grid-template-columns: 1fr; }
}
.profile-highlight {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 80%, transparent);
  background: color-mix(in srgb, #fff 88%, transparent);
  backdrop-filter: blur(6px);
  min-height: 68px;
}
.profile-highlight__label {
  font-size: var(--text-11);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.profile-highlight strong {
  font-size: var(--text-16);
  font-weight: 700;
  color: var(--text-body);
  line-height: 1.2;
}
.profile-highlight--mode-sur_site {
  border-color: color-mix(in srgb, var(--status-success-line, #9CCFB4) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-success-bg, #e8f5e9) 45%, #fff);
}
.profile-highlight--mode-hybride {
  border-color: color-mix(in srgb, var(--status-info-line, #A8C7E8) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-info-bg, #e3f2fd) 45%, #fff);
}
.profile-highlight--mode-remote {
  border-color: color-mix(in srgb, var(--status-warning-line, #E8C48A) 65%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-warning-bg, #fff8e1) 45%, #fff);
}
.profile-highlight--status-actif {
  border-color: color-mix(in srgb, var(--status-success-line, #9CCFB4) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-success-bg, #e8f5e9) 40%, #fff);
}
.profile-highlight--status-preavis,
.profile-highlight--status-suspendu {
  border-color: color-mix(in srgb, var(--status-warning-line, #E8C48A) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-warning-bg, #fff8e1) 40%, #fff);
}
.profile-highlight--status-inactif {
  border-color: color-mix(in srgb, var(--status-neutral-line, #cbd5e1) 80%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-neutral-bg, #f1f5f9) 55%, #fff);
}
.profile-panel {
  display: grid;
  gap: 14px;
  padding: 18px 18px 16px;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card, #fff);
  box-shadow: var(--shadow-1);
}
.profile-panel__head {
  display: grid;
  gap: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.profile-panel__title {
  margin: 0;
  font-size: var(--text-15, 15px);
  font-weight: 700;
  color: var(--text-body);
}
.profile-panel__desc {
  margin: 0;
  font-size: var(--text-12);
  color: var(--text-faint);
}
.profile-widgets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.profile-widgets--bank {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 980px) {
  .profile-widgets,
  .profile-widgets--bank { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .profile-widgets,
  .profile-widgets--bank { grid-template-columns: 1fr; }
}
.profile-widget {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px 16px 14px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-sunken, #f8fafc) 55%, #fff) 0%, #fff 100%);
  min-height: 92px;
  transition: border-color var(--dur-fast, 0.15s) ease, box-shadow var(--dur-fast, 0.15s) ease, transform var(--dur-fast, 0.15s) ease;
}
.profile-widget:hover {
  border-color: var(--border-strong, #c5c9d1);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}
.profile-widget--accent {
  overflow: hidden;
}
.profile-widget--accent::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--status-info-line, #A8C7E8);
}
.profile-widget--mode-sur_site::before,
.profile-widget--status-actif::before {
  background: var(--status-success-line, #9CCFB4);
}
.profile-widget--mode-hybride::before {
  background: var(--status-info-line, #A8C7E8);
}
.profile-widget--mode-remote::before,
.profile-widget--status-preavis::before,
.profile-widget--status-suspendu::before {
  background: var(--status-warning-line, #E8C48A);
}
.profile-widget--status-inactif::before {
  background: var(--status-neutral-line, #cbd5e1);
}
.profile-widget--mode-sur_site,
.profile-widget--status-actif {
  background: linear-gradient(180deg, color-mix(in srgb, var(--status-success-bg, #e8f5e9) 40%, #fff) 0%, #fff 100%);
}
.profile-widget--mode-hybride {
  background: linear-gradient(180deg, color-mix(in srgb, var(--status-info-bg, #e3f2fd) 40%, #fff) 0%, #fff 100%);
}
.profile-widget--mode-remote,
.profile-widget--status-preavis,
.profile-widget--status-suspendu {
  background: linear-gradient(180deg, color-mix(in srgb, var(--status-warning-bg, #fff8e1) 40%, #fff) 0%, #fff 100%);
}
.profile-widget--wide {
  grid-column: span 2;
}
@media (max-width: 560px) {
  .profile-widget--wide { grid-column: auto; }
}
.profile-widget__label {
  font-size: var(--text-11);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.profile-widget__value {
  font-size: var(--text-16);
  font-weight: 700;
  color: var(--text-body);
  line-height: 1.3;
  word-break: break-word;
}
.profile-widget__value--sm {
  font-size: var(--text-13);
  font-weight: 600;
}
.profile-widget__value--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-13);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.profile-widget__value--empty {
  color: var(--text-faint);
  font-weight: 500;
}
.profile-widget__hint {
  font-size: var(--text-11);
  color: var(--text-faint);
}

.margins-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.v-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: var(--slate-100, #eef2f6);
  border: 1px solid var(--border-subtle, #e2e8f0);
}
.v-seg__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-12);
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-control);
}
.v-seg__btn:hover {
  color: var(--text-body);
  background: color-mix(in srgb, #fff 55%, transparent);
}
.v-seg__btn.is-active {
  background: #fff;
  color: var(--text-body);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.v-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.v-table td.num .sim-metric { justify-items: end; text-align: right; }

@media (max-width: 900px) {
  .sim-expense-row {
    grid-template-columns: 1fr 1fr;
  }
  .sim-rate-row {
    grid-template-columns: 1fr 80px auto;
  }
  .sim-fields {
    grid-template-columns: 1fr;
  }
}


/* —— Dashboard —— */
.gap-10 { display: grid; gap: 10px; }
.gap-16 { display: grid; gap: 16px; }

.dash-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised, #fff);
  color: var(--text-body);
  font-size: var(--text-13);
  font-weight: 600;
  text-decoration: none;
}
.dash-link:hover {
  background: var(--surface-hover, #f5f6f8);
  text-decoration: none;
  color: var(--text-body);
}

.dash-section {
  display: grid;
  gap: 14px;
}
.dash-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dash-section__title {
  margin: 0;
  font-size: var(--text-18, 18px);
  font-weight: 700;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.dash-kpi {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-raised, #fff);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
a.dash-kpi:hover {
  border-color: var(--border-strong, #c5c9d1);
  background: var(--surface-hover, #f5f6f8);
  text-decoration: none;
  color: inherit;
}
.dash-kpi__label {
  font-size: var(--text-11, 11px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.dash-kpi__value {
  font-size: var(--text-20, 20px);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.dash-kpi__hint {
  font-size: var(--text-12, 12px);
  color: var(--text-muted);
}
.dash-kpi--success { border-color: var(--status-success-line, #a5d6a7); background: color-mix(in srgb, var(--status-success-bg, #e8f5e9) 55%, #fff); }
.dash-kpi--warning { border-color: var(--status-warning-line, #ffe082); background: color-mix(in srgb, var(--status-warning-bg, #fff8e1) 55%, #fff); }
.dash-kpi--danger { border-color: var(--status-danger-line, #ef9a9a); background: color-mix(in srgb, var(--status-danger-bg, #ffebee) 55%, #fff); }
.dash-kpi--info { border-color: var(--status-info-line, #90caf9); background: color-mix(in srgb, var(--status-info-bg, #e3f2fd) 40%, #fff); }

.dash-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.dash-widget {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 108px;
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-raised, #fff);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur-fast, 0.15s) ease, transform var(--dur-fast, 0.15s) ease;
}
a.dash-widget:hover {
  border-color: var(--border-strong, #c5c9d1);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}
.dash-widget__label {
  font-size: var(--text-11, 11px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.dash-widget__value {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text-body);
}
.dash-widget__hint {
  font-size: var(--text-12, 12px);
  color: var(--text-muted);
}
.dash-widget--success {
  border-color: color-mix(in srgb, var(--status-success-line, #9CCFB4) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-success-bg, #e8f5e9) 45%, #fff);
}
.dash-widget--success .dash-widget__value { color: var(--status-success-fg, #15803d); }
.dash-widget--warning {
  border-color: color-mix(in srgb, var(--status-warning-line, #E8C48A) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-warning-bg, #fff8e1) 50%, #fff);
}
.dash-widget--warning .dash-widget__value { color: var(--status-warning-fg, #b45309); }
.dash-widget--danger {
  border-color: color-mix(in srgb, var(--status-danger-line, #EAAFAA) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-danger-bg, #ffebee) 50%, #fff);
}
.dash-widget--danger .dash-widget__value { color: var(--status-danger-fg, #b91c1c); }
.dash-widget--info {
  border-color: color-mix(in srgb, var(--status-info-line, #A8C7E8) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--status-info-bg, #e3f2fd) 40%, #fff);
}
.dash-widget--info .dash-widget__value { color: var(--status-info-fg, #1d4ed8); }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  align-items: stretch;
}
.dash-grid--pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dash-grid--pair > .v-card:only-child {
  grid-column: 1 / -1;
}
.dash-grid__full {
  grid-column: 1 / -1;
  min-width: 0;
}
@media (max-width: 700px) {
  .dash-grid--pair {
    grid-template-columns: 1fr;
  }
}

.dash-alert {
  display: grid;
  gap: 3px;
  padding: 12px 14px 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  font-size: var(--text-13);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dash-alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-muted);
  opacity: 0.5;
}
.dash-alert strong {
  font-size: var(--text-11);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.dash-alert span,
.dash-alert a {
  color: var(--text-body);
  font-weight: 550;
}
.dash-alert--warning {
  background: linear-gradient(135deg, var(--status-warning-bg), color-mix(in srgb, var(--status-warning-bg) 55%, #fff));
  border-color: var(--status-warning-line);
}
.dash-alert--warning::before { background: var(--status-warning-fg); opacity: 0.7; }
.dash-alert--info {
  background: linear-gradient(135deg, var(--status-info-bg), color-mix(in srgb, var(--status-info-bg) 55%, #fff));
  border-color: var(--status-info-line);
}
.dash-alert--info::before { background: var(--status-info-fg); opacity: 0.7; }
.dash-alert--success {
  background: linear-gradient(135deg, var(--status-success-bg), color-mix(in srgb, var(--status-success-bg) 55%, #fff));
  border-color: var(--status-success-line);
}
.dash-alert--success::before { background: var(--status-success-fg); opacity: 0.7; }
.dash-alert--danger {
  background: linear-gradient(135deg, var(--status-danger-bg), color-mix(in srgb, var(--status-danger-bg) 55%, #fff));
  border-color: var(--status-danger-line);
}
.dash-alert--danger::before { background: var(--status-danger-fg); opacity: 0.7; }

/* Page Alertes — lignes compactes, action à droite */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alert-list__empty {
  margin: 0;
  color: var(--text-faint);
}
.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--surface, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}
.alert-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-muted);
  opacity: 0.45;
}
.alert-row__main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}
.alert-row__label {
  font-size: var(--text-11);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}
.alert-row__detail {
  font-size: var(--text-14);
  line-height: 1.35;
  word-break: break-word;
  color: var(--text-body);
}
.alert-row__detail a {
  text-decoration: none;
  color: inherit;
  font-weight: 550;
}
.alert-row__detail a:hover {
  text-decoration: underline;
}
.alert-row__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.alert-row__actions form {
  margin: 0;
}
.alert-row--warning {
  background: linear-gradient(135deg, var(--status-warning-bg), color-mix(in srgb, var(--status-warning-bg) 60%, #fff));
  border-color: var(--status-warning-line);
}
.alert-row--warning::before { background: var(--status-warning-fg); opacity: 0.7; }
.alert-row--info {
  background: linear-gradient(135deg, var(--status-info-bg), color-mix(in srgb, var(--status-info-bg) 60%, #fff));
  border-color: var(--status-info-line);
}
.alert-row--info::before { background: var(--status-info-fg); opacity: 0.7; }
.alert-row--success {
  background: linear-gradient(135deg, var(--status-success-bg), color-mix(in srgb, var(--status-success-bg) 60%, #fff));
  border-color: var(--status-success-line);
}
.alert-row--success::before { background: var(--status-success-fg); opacity: 0.7; }
.alert-row--danger {
  background: linear-gradient(135deg, var(--status-danger-bg), color-mix(in srgb, var(--status-danger-bg) 60%, #fff));
  border-color: var(--status-danger-line);
}
.alert-row--danger::before { background: var(--status-danger-fg); opacity: 0.7; }
.alert-row--muted {
  opacity: 0.78;
}
@media (max-width: 640px) {
  .alert-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .alert-row__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.dash-mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}
.dash-mini-stats > div {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  background: var(--surface-muted, #f7f7f8);
  border-radius: var(--radius-sm, 8px);
}
.dash-mini-stats span { font-size: var(--text-11); color: var(--text-muted); }
.dash-mini-stats strong { font-variant-numeric: tabular-nums; }

.dash-row--warn td { background: color-mix(in srgb, var(--status-warning-bg, #fff8e1) 70%, transparent); }

@media (max-width: 700px) {
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .dash-widgets { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}

.dash-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.dash-charts--trio {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dash-chart-card--wide {
  grid-column: 1 / -1;
}
.dash-chart-wrap {
  position: relative;
  height: 220px;
}
.dash-chart-wrap--tall {
  height: 280px;
}
.dash-chart-empty {
  margin: 0;
  padding: 40px 12px;
  text-align: center;
  color: var(--text-faint);
  font-size: var(--text-13);
}
.page-header {
  margin-bottom: 4px;
}
#dashboard-page .page-body {
  padding-top: 12px;
}
#dashboard-page .dash-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 4px;
}

/* ——— Coffre-fort : carte révélation ——— */
#vault-root .vault-list-table tbody td {
  height: auto;
  min-height: var(--row-height-compact);
  vertical-align: middle;
  padding-top: 12px;
  padding-bottom: 12px;
}
#vault-root .vault-cell-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  line-height: 1.3;
}
#vault-root .vault-cell-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  vertical-align: middle;
}
.vault-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.vault-filters__q {
  width: 100%;
}
.vault-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.vault-filters__row .v-input {
  width: auto;
  min-width: 140px;
}
.vault-form .vault-form__row {
  align-items: end;
}
.vault-form .v-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin: 0;
  min-width: 0;
}
.vault-form .v-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-12);
  line-height: 1.45;
}
.vault-cat-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.vault-cat-form > .v-input {
  flex: 1;
  min-width: 120px;
}
.vault-color-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--control-height);
}
.vault-color-field__picker {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.vault-color-field__picker::-webkit-color-swatch-wrapper {
  padding: 3px;
}
.vault-color-field__picker::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}
.vault-color-field__hex {
  width: 108px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-12);
}
.vault-cat-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.vault-cat-table tbody td {
  height: auto !important;
  min-height: 44px;
  vertical-align: middle !important;
  padding: 10px 12px !important;
  background-clip: padding-box;
}
.vault-cat-table tbody tr:hover td {
  background: var(--surface-hover) !important;
}
.vault-cat-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  line-height: 1.25;
}
.vault-cat-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}
.vault-cat-count {
  color: var(--text-muted);
  font-size: var(--text-12);
  white-space: nowrap;
  line-height: 1.25;
}
.vault-cat-actions {
  text-align: right;
  white-space: nowrap;
  width: 110px;
}
.vault-cat-actions .v-btn {
  vertical-align: middle;
}
.vault-reveal {
  width: min(520px, 100%);
}
.roles-matrix-table th.roles-matrix-table__action,
.roles-matrix-table td.roles-matrix-table__action {
  text-align: center;
  width: 72px;
  padding-left: 8px;
  padding-right: 8px;
}
.roles-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.roles-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent, #7cba1e);
}

/* ——— Véhicules : actions list + coûts ——— */
#vehicles-root .vehicles-list-table thead th.v-table__col-actions,
#vehicles-root .vehicles-list-table tbody td.v-table__col-actions {
  width: 1%;
  min-width: 280px;
  padding-left: 12px;
  padding-right: 16px;
  white-space: nowrap;
  vertical-align: middle;
}
#vehicles-root .vehicles-row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}
#vehicles-root .vehicles-row-actions .v-btn {
  flex: 0 0 auto;
}
#vehicles-root .v-table-scroll {
  margin: 0;
}
.vehicles-tco-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 14px;
}
.vehicles-tco-card .v-card__body,
.vehicles-tco-body {
  padding-bottom: 14px !important;
}
.vehicles-tco-layout {
  display: block;
}
.vehicles-tco-layout--with-chart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 14px;
  align-items: start;
}
.vehicles-tco-chart {
  width: 100%;
  max-width: 260px;
}
.vehicles-cost-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}
.vehicles-cost-widget {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-muted, #f7f7f8);
  min-width: 0;
}
.vehicles-cost-widget--total {
  background: color-mix(in srgb, var(--accent, #7cba1e) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent, #7cba1e) 35%, var(--border-subtle));
}
.vehicles-cost-widget__label {
  font-size: var(--text-11);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.vehicles-cost-widget__value {
  font-size: var(--text-15);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
  line-height: 1.25;
}
.vehicles-cost-widget__value span {
  font-size: var(--text-12);
  font-weight: 500;
  color: var(--text-muted);
}
.vehicles-cost-widget__meta {
  margin-top: 4px;
  font-size: var(--text-12);
  color: var(--text-muted);
}
.vehicles-lease-params {
  padding: 12px;
  margin-bottom: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-muted, #f7f7f8);
}
@media (max-width: 800px) {
  .vehicles-tco-layout--with-chart {
    grid-template-columns: 1fr;
  }
}
.vault-reveal__hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 4px;
}
.vault-reveal__eyebrow {
  margin: 0;
  font-size: var(--text-12);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.vault-reveal__title {
  margin: 0;
  font-size: var(--text-18);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  color: var(--text-primary);
}
.vault-reveal__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.vault-reveal__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted, #f3f4f6);
  color: var(--text-secondary);
  font-size: var(--text-12);
  font-weight: var(--weight-medium);
}
.vault-reveal__section {
  display: grid;
  gap: 10px;
  padding: 14px 0 0;
  border-top: 1px solid var(--border-subtle);
}
.vault-reveal__section:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.vault-reveal__section-title {
  margin: 0;
  font-size: var(--text-12);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vault-reveal__field {
  display: grid;
  gap: 6px;
}
.vault-reveal__label {
  font-size: var(--text-12);
  color: var(--text-muted);
}
.vault-reveal__value-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.vault-reveal__value-row .v-input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-13);
}
.vault-reveal__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-12);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted, #f8f9fb);
  max-height: 180px;
  overflow: auto;
}
.vault-reveal__meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.vault-reveal__meta-item {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.vault-reveal__meta-item--full {
  grid-column: 1 / -1;
}
.vault-reveal__meta-item strong {
  font-size: var(--text-13);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  word-break: break-word;
}
.vault-reveal__meta-item a {
  color: var(--accent, #2f6fed);
  text-decoration: none;
  font-size: var(--text-13);
  word-break: break-all;
}
.vault-reveal__meta-item a:hover {
  text-decoration: underline;
}
.vault-masked {
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 520px) {
  .vault-reveal__meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .dash-charts--trio {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-charts--trio > .dash-chart-card:last-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 900px) {
  .dash-charts,
  .dash-charts--trio { grid-template-columns: 1fr; }
  .dash-charts--trio > .dash-chart-card:last-child { grid-column: auto; }
  .dash-chart-card--wide { grid-column: auto; }
}
