:root,
[data-theme='light'],
[data-theme='dark'] {
  --bg: #171614;
  --bg-elevated: #1d1d26;
  --surface: #22211f;
  --surface-soft: #1f1e1c;
  --panel-top: rgba(86, 98, 148, 0.42);
  --panel-bottom: rgba(47, 55, 91, 0.38);
  --panel-border: rgba(255, 255, 255, 0.08);
  --sidebar: rgba(18, 20, 31, 0.92);
  --hero-top: rgba(22, 27, 52, 0.96);
  --hero-bottom: rgba(8, 12, 27, 0.96);
  --text: #ece8df;
  --muted: #b8b3aa;
  --muted-cool: #c8cfe6;
  --primary: #6ea88f;
  --primary-soft: rgba(110, 168, 143, 0.14);
  --warning: #d7b45d;
  --info: #8fb7ff;
  /* Accent d'interaction : survol des chevrons et du retour en haut de page. Etait jusqu'ici
     ecrit en dur a quatre endroits, via un repli sur une variable inexistante. */
  --accent: #3b82f6;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 96%, rgba(41, 92, 187, 0.22), transparent 24%),
    radial-gradient(circle at 82% 98%, rgba(128, 77, 191, 0.20), transparent 22%),
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08), transparent 28%),
    linear-gradient(180deg, #10111a 0%, #171614 100%);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; color: #111; padding: .5rem 1rem; border-radius: 10px; z-index: 50; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.app-shell.is-collapsed {
  grid-template-columns: 74px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 12px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(17, 19, 30, 0.98), rgba(10, 13, 24, 0.96));
  border-right: 1px solid rgba(255,255,255,0.05);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.02);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.sidebar__top {
  padding: 2px 0 6px;
}

.brand {
  display: grid;
  justify-items: start;
  gap: 10px;
  transition: transform 160ms ease;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #dce7e1;
  background: linear-gradient(180deg, rgba(121,179,154,0.16), rgba(94,143,120,0.08));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.brand-mark svg {
  width: 28px;
  height: 28px;
}

.brand-copy {
  display: grid;
  gap: 3px;
  transition: opacity 160ms ease, transform 160ms ease, max-height 160ms ease;
}

.brand-copy strong {
  font-size: 14px;
  line-height: 1.2;
}

.brand-copy span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.2;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-link {
  min-height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  text-align: left;
  font-size: 13px;
  line-height: 1.2;
}

.nav-link:hover,
.nav-link.active {
  background: linear-gradient(180deg, rgba(67, 77, 125, 0.52), rgba(38, 45, 76, 0.52));
  border-color: rgba(255,255,255,0.08);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: var(--muted-cool);
  flex: 0 0 18px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  font-size: 12px;
}

.sidebar-card {
  margin-top: auto;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.03);
  box-shadow: var(--shadow);
}

.sidebar-card__label {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted-cool);
}

.sidebar-card p:last-child {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.main {
  padding: 10px 12px 16px;
}

.hero-shell {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  margin-bottom: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, var(--hero-top), var(--hero-bottom));
  box-shadow: 0 14px 32px rgba(5, 7, 18, 0.3);
}

#page-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.hero-actions {
  display: flex;
  gap: 10px;
}

.ghost-action {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 13px;
}

.view { display: none; gap: 10px; }
.view.active { display: grid; }

.toolbar-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.filter-chip,
.filter-select {
  min-height: 40px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(89, 101, 150, 0.34), rgba(48, 55, 91, 0.3));
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 10px;
}

.panel,
.stat-card,
.table-card,
.chart-card {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  box-shadow: 0 10px 26px rgba(5, 8, 20, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stat-card {
  padding: 12px 14px;
  min-height: 78px;
  position: relative;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 12px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: rgba(110,168,143,0.72);
}

.stat-label {
  font-size: 12px;
  color: var(--muted-cool);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-meta {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(236, 232, 223, 0.62);
}

.panel,
.table-card,
.chart-card {
  padding: 12px;
}

.panel__title,
.table-card h3,
.chart-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.25;
}

.table-wrap {
  overflow: auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.045);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

th {
  color: #c9d1eb;
  font-weight: 600;
  background: rgba(255,255,255,0.04);
}

tr:last-child td {
  border-bottom: none;
}

.list {
  display: grid;
  gap: 0;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item strong {
  font-size: 13px;
}

.list-item span,
.list-item small {
  font-size: 12px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.active { background: rgba(110,168,143,0.14); color: #a6dbc0; }
.badge.warning { background: rgba(215,180,93,0.16); color: #f0d289; }
.badge.info { background: rgba(143,183,255,0.16); color: #b7d2ff; }
.badge.capex { background: rgba(215,180,93,0.16); color: #f0d289; }
.badge.opex { background: rgba(143,183,255,0.16); color: #b7d2ff; }

.status-badge.status-active {
  background: rgba(110,168,143,0.16);
  color: #9fe0b8;
}

.status-badge.status-expired {
  background: rgba(205,105,105,0.18);
  color: #ffb2b2;
}

.status-badge.status-pending {
  background: rgba(215,180,93,0.18);
  color: #f3d57f;
}

.status-badge.status-suspended {
  background: rgba(160,122,228,0.18);
  color: #d4bcff;
}

.status-badge.status-cancelled {
  background: rgba(146,156,170,0.18);
  color: #d3d9e1;
}

.status-badge.status-in_stock {
  background: rgba(143,183,255,0.16);
  color: #b7d2ff;
}

.status-badge.status-broken {
  background: rgba(205,105,105,0.18);
  color: #ffb2b2;
}

/* Sorti du parc : volontairement eteint, pour qu'il ne tire pas l'oeil dans une liste d'actifs. */
.status-badge.status-decommissioned {
  background: rgba(120,128,140,0.16);
  color: #99a2ae;
}

.progress-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.12);
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5ca57e, #d9b35f);
}

.section-stack {
  display: grid;
  gap: 10px;
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .toolbar-row,
  .stats-grid,
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .main { padding: 12px; }
  .hero-shell { padding: 12px; }
  .toolbar-row,
  .stats-grid,
  .dashboard-grid { grid-template-columns: 1fr; }
}

.app-shell.is-collapsed .brand-copy,
.app-shell.is-collapsed .nav-link span:last-child,
.app-shell.is-collapsed .sidebar-card {
  display: none;
}

.app-shell.is-collapsed .sidebar {
  padding-inline: 8px;
}

.app-shell.is-collapsed .nav-link {
  justify-content: center;
  padding-inline: 0;
}

.app-shell.is-collapsed .brand {
  justify-items: center;
}

.sidebar__toggle {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  display: grid;
  place-items: center;
}

.sidebar__top {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 1180px) {
  .app-shell, .app-shell.is-collapsed { grid-template-columns: 1fr; }
}

.nav-link {
  position: relative;
}

.nav-link .nav-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  color: #dbe3ff;
  font-size: 13px;
  line-height: 1;
  background: rgba(255,255,255,0.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
  background: rgba(110,168,143,0.18);
  color: #bce8d1;
}

.app-shell.is-collapsed .nav-link .nav-icon {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

.app-shell.is-collapsed .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 11px;
}

.app-shell.is-collapsed .brand-copy strong,
.app-shell.is-collapsed .brand-copy span,
.app-shell.is-collapsed .sidebar-card,
.app-shell.is-collapsed .nav-link span:last-child {
  display: none;
}

.app-shell.is-collapsed .nav-link {
  justify-content: center;
  padding-inline: 0;
}

.app-shell.is-collapsed .sidebar {
  padding-inline: 8px;
}

.sidebar__toggle {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  display: grid;
  place-items: center;
}

.app-shell.is-collapsed .brand {
  justify-items: center;
}

.app-shell.is-collapsed .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 11px;
}

.app-shell.is-collapsed .brand-copy,
.app-shell.is-collapsed .sidebar-card,
.app-shell.is-collapsed .nav-link span:last-child {
  display: none;
}

.app-shell.is-collapsed .nav-link {
  justify-content: center;
  padding: 0;
}

.app-shell.is-collapsed .nav-icon {
  width: 22px;
  height: 22px;
  font-size: 13px;
}

.app-shell.is-collapsed .sidebar {
  padding-inline: 8px;
}

.app-shell.is-collapsed .brand {
  gap: 6px;
}

.sidebar__toggle {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  display: grid;
  place-items: center;
}

.app-shell.is-collapsed .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.app-shell.is-collapsed .brand-mark svg {
  width: 20px;
  height: 20px;
}

.app-shell.is-collapsed .brand-copy,
.app-shell.is-collapsed .sidebar-card,
.app-shell.is-collapsed .nav-link span:last-child {
  display: none;
}

.app-shell.is-collapsed .brand {
  justify-items: center;
}

.app-shell.is-collapsed .nav-link {
  justify-content: center;
  padding: 0;
}

.app-shell.is-collapsed .sidebar {
  padding-inline: 8px;
}

.app-shell.is-collapsed .nav-icon {
  width: 24px;
  height: 24px;
  font-size: 14px;
  border-radius: 8px;
}

.main .view {
  margin-top: 2px;
}

.panel,
.table-card,
.chart-card {
  margin-top: 0;
}

.section-stack,
.dashboard-grid,
.stats-grid,
.toolbar-row {
  margin: 0;
}

.view.active > * + * {
  margin-top: 0;
}


.import-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel__text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.import-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-action {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(121,179,154,0.92), rgba(94,143,120,0.92));
  color: #fff;
}

.primary-action:disabled {
  opacity: 0.55;
  cursor: default;
}

.import-feedback {
  /* Surtout pas flex : ces encarts contiennent du texte avec du <strong> et du <em>,
     et un conteneur flex supprime les espaces entre elements inline — les mots se collent. */
  min-height: 44px;
  display: block;
  padding: 12px 14px;
  line-height: 1.5;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--muted-cool);
  font-size: 13px;
}


.muted {
  color: var(--text-tertiary, rgba(255,255,255,0.5));
}

.table-card--enhanced {
  display: grid;
  gap: 12px;
}

.table-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.table-card__meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(236, 232, 223, 0.62);
}

.table-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-heading-label { vertical-align: middle; }
.column-filter-trigger { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 4px; border: 1px solid transparent; border-radius: 999px; color: var(--muted-cool); background: transparent; font-size: 16px; line-height: 1; }
.column-filter-trigger:hover, .column-filter-trigger:focus-visible, .column-filter-trigger.is-active { color: #fff; border-color: rgba(10,132,255,.42); background: rgba(10,132,255,.16); }
.table-card th { position: relative; white-space: nowrap; }
.column-filter-popover { position: absolute; z-index: 20; top: calc(100% + 6px); left: 8px; min-width: 190px; padding: 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(18,22,38,.96); box-shadow: 0 16px 36px rgba(0,0,0,.42); backdrop-filter: blur(18px); }
.column-filter-popover label { display: grid; gap: 6px; color: var(--muted-cool); font-size: 12px; white-space: normal; }
.column-filter-popover select { width: 100%; }

.table-filters { display: none; }

.table-filter {
  display: grid;
  gap: 6px;
}

.table-filter span {
  font-size: 12px;
  color: var(--muted-cool);
}

.table-bulkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
}

.table-bulkbar.is-active {
  border-color: rgba(110,168,143,0.32);
  background: rgba(110,168,143,0.08);
}

.table-bulkbar__text {
  font-size: 12px;
  color: #dbe8df;
}

.table-bulkbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ghost-action--sm,
.danger-action {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 600;
}

.danger-action {
  color: #ffd0d0;
  background: rgba(180, 72, 72, 0.16);
  border-color: rgba(180, 72, 72, 0.32);
}

.danger-action:disabled,
.ghost-action--sm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.table-select-col {
  width: 52px;
  min-width: 52px;
  text-align: center;
}

.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  position: relative;
}

.checkbox-wrap input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.checkbox-wrap span {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(10,16,24,0.16);
}

.checkbox-wrap input:checked + span {
  background: rgba(110,168,143,0.9);
  border-color: rgba(110,168,143,0.9);
  box-shadow: inset 0 0 0 3px rgba(16,28,24,0.42);
}

tr.is-selected td {
  background: rgba(110,168,143,0.08);
}

@media (max-width: 860px) {
  .table-card__header,
  .table-bulkbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-card__actions,
  .table-bulkbar__actions {
    width: 100%;
    justify-content: stretch;
  }

  .ghost-action--sm,
  .danger-action {
    width: 100%;
  }
}

.table-search {
  display: grid;
  gap: 8px;
}

.table-filter--search {
  max-width: 380px;
}

.filter-input {
  appearance: none;
}

.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1300;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(22, 31, 43, 0.96);
  color: #eef4ee;
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
  font-size: 13px;
  line-height: 1.4;
  animation: toast-in 180ms ease-out;
}

.toast--success {
  border-color: rgba(110,168,143,0.42);
}

.toast--error {
  border-color: rgba(205,105,105,0.52);
  color: #ffdede;
}

.modal-host {
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 14, 20, 0.68);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  background: #17222e;
  color: #edf3ef;
  box-shadow: 0 24px 70px rgba(0,0,0,0.38);
}

.modal-card.is-invalid {
  border-color: rgba(205,105,105,0.58);
  animation: modal-shake 220ms ease-in-out 0s 1;
}

.modal-card--danger { border-color: rgba(205,105,105,0.42); }
.modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.modal-kicker { margin:0 0 4px; color:#91b8a4; font-size:12px; text-transform:uppercase; letter-spacing:.08em; }
.modal-head h2 { margin:0; font-size:24px; line-height:1.15; }
.modal-close { width:40px; height:40px; border:1px solid rgba(255,255,255,.12); border-radius:10px; color:#dce8e0; font-size:24px; }
.modal-close:hover { background:rgba(255,255,255,.08); }
.modal-text { color:#b8c8bf; }
.modal-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.modal-field { display:grid; gap:6px; color:#b8c8bf; font-size:12px; }
.modal-field input,
.modal-field select,
.modal-field textarea { width:100%; min-height:42px; padding:10px 12px; border:1px solid rgba(255,255,255,.18); border-radius:9px; background:#0f1923; color:#f4f8f5; color-scheme:dark; }
.modal-field select option { background:#17222e; color:#f4f8f5; }
.modal-field textarea { resize:vertical; }
.modal-field input::placeholder,
.modal-field textarea::placeholder { color:#91a49a; opacity:1; }
.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus { outline:2px solid #75aa8f; outline-offset:1px; }
.modal-field.is-invalid span { color:#ffdede; }
.modal-field.is-invalid input,
.modal-field.is-invalid select,
.modal-field.is-invalid textarea {
  border-color: rgba(205,105,105,0.72);
  outline: 2px solid rgba(205,105,105,0.25);
  outline-offset: 1px;
}
.modal-field-error {
  min-height: 16px;
  color: #ffdede;
  font-size: 11px;
  line-height: 1.3;
}
.modal-section-title { grid-column:1 / -1; margin:4px 0 -2px; padding-top:10px; border-top:1px solid rgba(255,255,255,.1); color:#edf3ef; font-size:16px; font-weight:700; line-height:1.2; }
.modal-dynamic-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; grid-column:1 / -1; }
.modal-dynamic-fields .modal-field--full { grid-column:1 / -1; }
.modal-actions { display:flex; justify-content:flex-end; align-items:center; gap:10px; margin-top:22px; }
.modal-actions .primary-action,
.modal-actions .ghost-action { min-height:36px; padding:8px 12px; border-radius:8px; font-size:13px; }
.modal-actions .primary-action { font-weight:600; }
.delete-list { display:grid; gap:8px; max-height:280px; overflow:auto; padding:0; margin:14px 0 0; list-style:none; }
.delete-list li { display:flex; justify-content:space-between; gap:12px; padding:11px 12px; border:1px solid rgba(255,255,255,.09); border-radius:9px; background:rgba(255,255,255,.035); }
.delete-list span { color:#9fb1a5; text-align:right; }
.danger-action { background:#a94f52; color:#fff; border:0; border-radius:9px; padding:10px 14px; }
.danger-action:hover { background:#c25f62; }
.table-action-col { width:112px; text-align:center; }
.row-actions { display:flex; align-items:center; justify-content:center; gap:.4rem; flex-wrap:wrap; }
.icon-action { min-width:36px; min-height:36px; border:1px solid rgba(255,255,255,.1); border-radius:8px; color:#b9d2c1 !important; }
.icon-action.edit-action { color:#8fb7ff !important; border-color:rgba(143,183,255,.55) !important; }
.icon-action.receive-action { color:#6ed09c !important; border-color:rgba(110,208,156,.55) !important; }
.icon-action.edit-action:hover { background:rgba(143,183,255,.18) !important; color:#cfe0ff !important; }
.icon-action.receive-action:hover { background:rgba(110,208,156,.18) !important; color:#d2ffe5 !important; }
.need-type { font-weight:600; }
.need-type-equipment { color:#8fb7ff; }
.need-type-license { color:#c8a6ff; }
.need-type-subscription_pack { color:#f0d289; }
.need-type-support_contract { color:#6ed09c; }
.badge.status-planned { color:#f0d289; border-color:rgba(240,210,137,.32); background:rgba(240,210,137,.12); }
.badge.status-ordered { color:#8fb7ff; border-color:rgba(143,183,255,.32); background:rgba(143,183,255,.12); }
.badge.status-received { color:#6ed09c; border-color:rgba(110,208,156,.32); background:rgba(110,208,156,.12); }
.badge.status-cancelled { color:#ff8f9a; border-color:rgba(255,143,154,.32); background:rgba(255,143,154,.12); }

@media (max-width: 640px) {
  .modal-backdrop { padding:12px; }
  .modal-card { padding:18px; max-height:calc(100vh - 24px); }
  .modal-grid { grid-template-columns:1fr; }
  .modal-dynamic-fields { grid-template-columns:1fr; }
  .modal-actions { flex-direction:column-reverse; }
  .modal-actions button { width:100%; }
  .delete-list li { display:grid; gap:4px; }
  .delete-list span { text-align:left; }
}

@keyframes modal-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

#view-dashboard .section-stack {
  gap: 28px;
}

#view-dashboard .toolbar-row {
  margin-bottom: 2px;
}

#view-dashboard .end-of-support-alert-card .renewal-list,
#view-dashboard .renewals-card .renewal-list {
  display: grid;
  gap: 8px;
  max-height: 382px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  margin-top: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.24) transparent;
}

#view-dashboard .end-of-support-alert-card .renewal-list::-webkit-scrollbar,
#view-dashboard .renewals-card .renewal-list::-webkit-scrollbar {
  width: 6px;
}

#view-dashboard .end-of-support-alert-card .renewal-list::-webkit-scrollbar-track,
#view-dashboard .renewals-card .renewal-list::-webkit-scrollbar-track {
  background: transparent;
}

#view-dashboard .end-of-support-alert-card .renewal-list::-webkit-scrollbar-thumb,
#view-dashboard .renewals-card .renewal-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,.24);
}

#view-dashboard .end-of-support-alert-card .renewal-item,
#view-dashboard .renewals-card .renewal-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}

#view-dashboard .end-of-support-alert-card .renewal-item > div:first-child,
#view-dashboard .renewals-card .renewal-item > div:first-child,
#view-dashboard .end-of-support-alert-card .renewal-item__date,
#view-dashboard .renewals-card .renewal-item__date {
  display: grid;
  gap: 4px;
  min-width: 0;
}

#view-dashboard .end-of-support-alert-card .renewal-item strong,
#view-dashboard .end-of-support-alert-card .renewal-item span,
#view-dashboard .renewals-card .renewal-item strong,
#view-dashboard .renewals-card .renewal-item span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

#view-dashboard .end-of-support-alert-card .renewal-item > div:first-child span,
#view-dashboard .end-of-support-alert-card .renewal-item__date span,
#view-dashboard .renewals-card .renewal-item > div:first-child span,
#view-dashboard .renewals-card .renewal-item__date span {
  color: var(--muted-cool);
  font-size: 12px;
}

#view-dashboard .end-of-support-alert-card .renewal-item__date,
#view-dashboard .renewals-card .renewal-item__date {
  min-width: 138px;
  text-align: right;
}

#view-dashboard .renewals-card .renewal-item > .badge {
  min-width: max-content;
  width: fit-content;
  justify-self: end;
  text-align: center;
  white-space: nowrap;
}

#view-dashboard .renewal-item--warning { border-color: rgba(255, 178, 0, .28); }
#view-dashboard .renewal-item--info { border-color: rgba(10, 132, 255, .22); }
#view-dashboard .renewal-item--success { border-color: rgba(48, 209, 88, .16); }

@media (max-width: 640px) {
  #view-dashboard .end-of-support-alert-card .renewal-item,
  #view-dashboard .renewals-card .renewal-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #view-dashboard .end-of-support-alert-card .renewal-item__date,
  #view-dashboard .renewals-card .renewal-item__date {
    min-width: 0;
    text-align: left;
  }

  #view-dashboard .renewals-card .renewal-item > .badge {
    justify-self: start;
  }
}

  align-items: stretch;
  gap: 16px;
}

#view-dashboard .stats-grid > .stat-card {
  min-width: 0;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 18px;
  overflow: hidden;
}

#view-dashboard .stats-grid > .stat-card .stat-label,
#view-dashboard .stats-grid > .stat-card .stat-meta {
  overflow-wrap: anywhere;
}

#view-dashboard .stats-grid > .stat-card .stat-value {
  min-width: 0;
  font-size: clamp(1.35rem, 1rem + 1vw, 2rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

#view-dashboard .stats-grid > .stat-card:nth-child(4),
#view-dashboard .stats-grid > .stat-card:nth-child(5) {
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
}

#view-dashboard .stats-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

#view-dashboard .stats-grid--compact .stat-card {
  min-height: 112px;
  padding: 16px;
}

#view-dashboard .stats-grid--compact .stat-value {
  font-size: clamp(1.15rem, .95rem + .6vw, 1.5rem);
}

@media (max-width: 1100px) {
  #view-dashboard .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  #view-dashboard .stats-grid,
  #view-dashboard .stats-grid--compact,
  #view-dashboard .content-grid--dashboard > .chart-card:last-child .stats-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  #view-dashboard .stats-grid > .stat-card,
  #view-dashboard .stats-grid--compact .stat-card {
    min-height: 108px;
    padding: 14px;
  }
}

@media (max-width: 480px) {
  #view-dashboard .stats-grid,
  #view-dashboard .stats-grid--compact,
  #view-dashboard .content-grid--dashboard > .chart-card:last-child .stats-grid--compact {
    grid-template-columns: 1fr;
  }
}

#view-dashboard .import-panel {
  margin-block: 2px;
}

#view-dashboard .chart-card {
  min-height: 0;
  padding: 14px;
}

#view-dashboard .dashboard-stack {
  display: grid;
  gap: 28px;
}

#view-dashboard .content-grid--dashboard {
  align-items: start;
  gap: 28px;
  margin-top: 0;
}

#view-dashboard .content-grid--dashboard + .content-grid--dashboard {
  margin-top: 28px;
}

#view-dashboard .stats-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

#view-dashboard .stats-grid--compact .stat-card {
  min-height: 0;
  padding: 12px;
}

#view-dashboard .stats-grid--compact .stat-value {
  font-size: 1.5rem;
}

#view-dashboard .content-grid--dashboard > .chart-card:last-child .stats-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-dashboard .list {
  gap: 0;
}

#view-dashboard .list-item {
  min-height: 42px;
  padding: 9px 0;
}

#view-dashboard .list-item > div:first-child {
  min-width: 0;
}

#view-dashboard .list-item strong,
#view-dashboard .list-item span {
  display: block;
}

#view-dashboard .list-item strong {
  line-height: 1.25;
}

#view-dashboard .list-item span {
  margin-top: 3px;
  line-height: 1.25;
}

@media (max-width: 720px) {
  #view-dashboard .stats-grid--compact,
  #view-dashboard .content-grid--dashboard > .chart-card:last-child .stats-grid--compact {
    grid-template-columns: 1fr;
  }

  #view-dashboard .content-grid--dashboard,
  #view-dashboard .stats-grid {
    gap: 18px;
  }

  #view-dashboard .section-stack,
  #view-dashboard .content-grid--dashboard + .content-grid--dashboard {
    gap: 18px;
    margin-top: 18px;
  }
}


    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}


.import-panel--refined {
  gap: 18px;
}

.import-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(9, 14, 34, 0.94), rgba(17, 27, 60, 0.88));
  border: 1px solid rgba(108, 132, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.import-hero__meta {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: 180px;
}

.import-hero__hint {
  color: rgba(231, 236, 255, 0.7);
  font-size: 12px;
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.import-sidebar,
.import-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.import-sidebar__head,
.import-workspace-card__head {
  display: grid;
  gap: 6px;
}

.import-profile-list {
  display: grid;
  gap: 12px;
}

.import-profile-card {
  display: grid;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.07);
  background: linear-gradient(180deg, rgba(76, 88, 136, 0.28), rgba(48, 56, 92, 0.3));
  color: inherit;
}

.import-profile-card:hover {
  border-color: rgba(143, 164, 255, 0.22);
  transform: translateY(-1px);
}

.import-profile-card.is-active {
  border-color: rgba(138, 195, 171, 0.34);
  background: linear-gradient(180deg, rgba(82, 100, 167, 0.44), rgba(46, 58, 104, 0.42));
  box-shadow: 0 12px 30px rgba(5, 10, 25, 0.22);
}

.import-profile-card__vendor {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(220, 226, 255, 0.62);
}

.import-profile-card__title {
  font-size: 17px;
  font-weight: 700;
}

.import-profile-card__text,
.import-profile-card__helper {
  color: rgba(226, 231, 246, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.import-profile-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}


.import-preview {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  min-width: 0;
  overflow: visible;
}

.import-preview__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  font-size: 13px;
  color: rgba(225, 230, 247, 0.84);
}

.import-preview__summary strong {
  color: #e5e9f7;
  font-weight: 600;
}

.import-sample {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.import-sample .eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(220, 226, 255, 0.62);
  margin: 0;
}

.import-sample .table-wrap {
  max-height: min(60vh, 520px);
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
}

.import-sample table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.import-sample th,
.import-sample td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
  background-clip: padding-box;
  white-space: nowrap;
}

.import-sample th {
  color: #e5e9f7;
  font-weight: 600;
  background: rgba(30, 34, 54, 0.92);
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}

.import-sample tr:last-child td {
  border-bottom: none;
}

.import-preview[data-aruba-preview-panel] {
  display: grid;
  gap: 12px;
  min-width: 0;
}

/* Le defilement des apercus d'import valait pour le seul profil Aruba : les autres heritaient d'un
   overflow sans hauteur, donc rien ne defilait et le tableau se comprimait au lieu de deborder.
   Regle commune a tous les apercus — ils doivent converger, pas diverger. */
.import-preview .import-sample {
  min-width: 0;
  overflow: hidden;
}

.import-preview .table-wrap {
  display: block;
  width: 100%;
  min-width: 0;
  max-height: 420px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.import-preview table {
  width: max-content;
  min-width: 100%;
}

.import-preview th,
.import-preview td {
  white-space: nowrap;
}

/* Sur 28 lignes on perd vite le nom des colonnes : l'en-tete reste visible pendant le defilement. */
.import-preview thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #16202c;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.12);
}

.import-workspace-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(74, 83, 126, 0.34), rgba(47, 54, 88, 0.38));
  border: 1px solid rgba(255,255,255,0.06);
}

.import-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.import-profile-select--inline {
  min-width: min(340px, 100%);
}

.import-actions--workspace {
  justify-content: flex-end;
}

.import-feedback--subtle {
  background: rgba(255,255,255,0.02);
}

.import-dropzone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.import-dropzone-grid--fortinet {
  margin-top: 18px;
}

.import-dropzone {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(149, 164, 223, 0.28);
  background: rgba(18, 23, 43, 0.42);
}

.import-dropzone input[type="file"],
.import-dropzone select {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(149, 164, 223, 0.22);
  background: rgba(7, 13, 28, 0.92);
  color: rgba(240, 244, 255, 0.92);
  padding: 10px 12px;
}

.import-dropzone small {
  color: rgba(225, 230, 247, 0.64);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .import-layout {
    grid-template-columns: 1fr;
  }

  .import-hero {
    grid-template-columns: 1fr;
  }

  .import-hero,
  .import-toolbar,
  .import-profile-card__footer {
    align-items: stretch;
  }

  .import-hero__meta {
    justify-items: start;
  }
}


.import-catalogue {
  padding: var(--space-6);
  background: var(--color-surface-offset);
  border-bottom: 1px solid var(--color-border);
}
.import-catalogue .import-profile-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.import-catalogue .import-profile-card { min-height: 150px; text-align: left; }
.import-main { padding: var(--space-6); }
@media (max-width: 760px) {
  .import-catalogue, .import-main { padding: var(--space-4); }
  .import-catalogue .import-profile-list { grid-template-columns: 1fr; }
}



.import-catalogue .import-profile-list {
  gap: 18px;
}

.import-catalogue .import-profile-card {
  min-height: 164px;
  padding: 14px;
}

.import-catalogue .import-profile-card__vendor {
  font-size: 10px;
}

.import-catalogue .import-profile-card__title {
  font-size: 15px;
}

.import-catalogue .import-profile-card__text,
.import-catalogue .import-profile-card__helper {
  font-size: 12px;
  line-height: 1.4;
}

.import-catalogue .import-profile-card__footer {
  gap: 8px;
}

/* Liquid Glass DA — applied after the existing application styles to preserve behavior */
:root,
[data-theme='dark'],
[data-theme='light'] {
  --bg: #05060c;
  --bg-elevated: rgba(18, 22, 38, .82);
  --surface: rgba(255,255,255,.06);
  --surface-soft: rgba(255,255,255,.04);
  --panel-top: rgba(255,255,255,.09);
  --panel-bottom: rgba(255,255,255,.055);
  --panel-border: rgba(255,255,255,.12);
  --sidebar: rgba(10,12,22,.76);
  --hero-top: rgba(24,27,42,.90);
  --hero-bottom: rgba(15,17,30,.82);
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --muted-cool: #b8c1d4;
  --primary: #0a84ff;
  --primary-soft: rgba(10,132,255,.16);
  --warning: #ffc857;
  --info: #3aa0ff;
  --success: #34d27b;
  --danger: #ff5a6a;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
}

html { background: #05060c; }
body {
  position: relative;
  isolation: isolate;
  background: #05060c;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 16%, rgba(10,132,255,.16), transparent 25%),
    radial-gradient(circle at 88% 18%, rgba(155,92,255,.13), transparent 24%),
    radial-gradient(circle at 44% 100%, rgba(0,212,200,.08), transparent 25%);
  filter: blur(28px);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5,6,12,.18), rgba(5,6,12,.72));
}

.sidebar,
.hero-shell,
.table-card,
.stat-card,
.sidebar-card,
.modal-card,
.toast {
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 12px 40px rgba(0,0,0,.45);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}
.sidebar { background: rgba(10,12,22,.72); }
.hero-shell { background: linear-gradient(180deg, rgba(24,27,42,.92), rgba(15,17,30,.84)); }
.table-card,
.stat-card,
.sidebar-card,
.modal-card { background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.055)); }

.primary-action,
.primary-button,
button[data-table-select-all]:checked,
.nav-link.active { background: #0a84ff; }
.primary-action:hover,
.primary-button:hover { background: #3aa0ff; }
.ghost-action,
.filter-select,
.filter-input,
.modal-field input,
.modal-field select,
.modal-field textarea { border-color: rgba(255,255,255,.12); background: rgba(0,0,0,.28); }
.ghost-action:hover { border-color: rgba(58,160,255,.56); color: #f4f6fb; background: rgba(10,132,255,.14); }
.badge.status-active,
.badge.success { color: #34d27b; border-color: rgba(52,210,123,.32); background: rgba(52,210,123,.12); }
.badge.warning { color: #ffc857; border-color: rgba(255,200,87,.30); background: rgba(255,200,87,.12); }
.badge.status-expired,
.badge.error { color: #ff5a6a; border-color: rgba(255,90,106,.32); background: rgba(255,90,106,.12); }

.table-card table thead th { background: rgba(24,27,42,.96); border-color: rgba(255,255,255,.10); }
.table-card table tbody tr:hover { background: rgba(10,132,255,.08); }
.table-card table tbody tr:has(input[type='checkbox']:checked) { background: rgba(10,132,255,.12); }
input[type='checkbox'] { accent-color: #0a84ff; }

@media (prefers-reduced-motion: reduce) {
  body::before { filter: blur(28px); }
}

/* Equipment table: compact site column, readable status pills */
.status-col { width: 10%; white-space: nowrap; }
.status-col .status-badge { display: inline-flex; align-items: center; gap: .4rem; }
.status-col .status-badge::before { content: ''; width: .48rem; height: .48rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 .18rem color-mix(in srgb, currentColor 18%, transparent); }

.equipment-site-col { width: 12%; max-width: 12rem; }
.equipment-status-col { width: 10%; white-space: nowrap; }
.equipment-status-col .status-badge { display: inline-flex; align-items: center; gap: .4rem; }
.equipment-status-col .status-badge::before { content: ''; width: .48rem; height: .48rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 .18rem color-mix(in srgb, currentColor 18%, transparent); }
@media (max-width: 900px) {
  .equipment-site-col { width: 10%; max-width: 8rem; }
  .equipment-status-col { width: 9%; }
}

.primary-action:disabled,
.primary-action.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: saturate(.35);
  pointer-events: none;
}

/* Référentiels : séparation visuelle entre les tableaux */
#view-references .table-grid {
  row-gap: 18px;
}

/* Référentiels : espacement entre les blocs complets contenant chaque tableau */
#view-references .table-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

#view-references .table-grid > [id^='references-'] {
  margin: 0;
}

/* Provision modal — derived (locked) fields and hints */
.modal-field--derived input[readonly] { opacity: 0.75; cursor: not-allowed; border-style: dashed; }
.modal-field--derived input[readonly]:focus { outline: none; box-shadow: none; }
.modal-text--hint { font-size: 12px; margin-top: 12px; opacity: 0.8; }

/* History view */
.badge.danger { color: #ff7b7b; border-color: rgba(255,123,123,.32); background: rgba(255,123,123,.12); }
.history-wrapper { overflow: auto; max-height: 70vh; }
.history-wrapper table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.history-wrapper th, .history-wrapper td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.06); white-space: nowrap; }
.history-wrapper th:nth-child(4), .history-wrapper td:nth-child(4) { max-width: 360px; white-space: normal; overflow-wrap: break-word; word-break: break-word; }
.history-wrapper td:last-child { white-space: normal; min-width: 220px; }
.history-wrapper thead th { position: sticky; top: 0; background: rgba(24,27,42,.96); z-index: 1; }

/* ------------------------------------------------------------------ */
/* Système de boutons unifié — s'applique aux <button>, <a> et <label> */
/* ------------------------------------------------------------------ */
.primary-action,
.ghost-action,
.danger-action,
a.primary-action,
a.ghost-action,
label.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 36px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  vertical-align: middle;
  transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}
.primary-action--sm,
.ghost-action--sm,
.danger-action--sm {
  /* Taille unique sur toute l'application : les variantes --sm sont conservées pour compatibilité. */
  min-height: 36px;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 10px;
}
.primary-action { background: #0a84ff; border-color: rgba(10,132,255,.55); color: #fff; }
.primary-action:hover { background: #3aa0ff; border-color: rgba(58,160,255,.7); color: #fff; }
.ghost-action { background: rgba(0,0,0,.28); border-color: rgba(255,255,255,.12); color: var(--text, #e6ecf5); }
.ghost-action:hover { background: rgba(10,132,255,.14); border-color: rgba(58,160,255,.56); color: #f4f6fb; }
.danger-action { background: rgba(180,72,72,.16); border-color: rgba(180,72,72,.38); color: #ffd0d0; }
.danger-action:hover { background: rgba(200,80,80,.28); border-color: rgba(220,90,90,.6); color: #fff; }
.primary-action:disabled, .primary-action.is-disabled,
.ghost-action:disabled, .ghost-action.is-disabled,
.danger-action:disabled, .danger-action.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: none;
}
.primary-action:focus-visible, .ghost-action:focus-visible, .danger-action:focus-visible {
  outline: 2px solid rgba(58,160,255,.8);
  outline-offset: 2px;
}
/* Barres d'actions : même hauteur que les champs voisins */
.table-card__actions, .budget-toolbar, .hero-actions, .modal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-card__actions .table-filter--inline, .budget-toolbar .table-filter--inline { display: flex; flex-direction: column; gap: 4px; }
.budget-toolbar .filter-select, .budget-toolbar .filter-input, .table-card__actions .filter-select { height: 36px; box-sizing: border-box; }
.modal-actions .primary-action, .modal-actions .ghost-action, .modal-actions .danger-action { min-height: 36px; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px; }

/* ------------------------------------------------------------ */
/* Tableaux : lecture dense, scroll horizontal propre, colonnes */
/* sélection et actions toujours visibles (sticky).             */
/* ------------------------------------------------------------ */
.table-card .table-wrap { overflow: auto; max-width: 100%; scrollbar-gutter: stable; }
.table-card .table-wrap table { width: max-content; min-width: 100%; }
.table-card .table-wrap th, .table-card .table-wrap td { padding: 9px 10px; white-space: nowrap; }
.table-card .table-wrap td:first-child, .table-card .table-wrap th:first-child { position: sticky; left: 0; z-index: 2; background: rgba(18,21,34,.98); }
.table-card .table-wrap td:last-child, .table-card .table-wrap th:last-child { position: sticky; right: 0; z-index: 2; background: rgba(18,21,34,.98); box-shadow: -8px 0 12px -10px rgba(0,0,0,.8); }
.table-card .table-wrap thead th { z-index: 3; }
.table-card .table-wrap thead th:first-child, .table-card .table-wrap thead th:last-child { z-index: 4; background: rgba(24,27,42,.98); }
.table-card .table-wrap tbody tr:hover td:first-child, .table-card .table-wrap tbody tr:hover td:last-child { background: rgba(22,34,52,.98); }
.table-card .table-wrap tbody tr:has(input[type='checkbox']:checked) td:first-child,
.table-card .table-wrap tbody tr:has(input[type='checkbox']:checked) td:last-child { background: rgba(20,38,62,.98); }
.table-action-col { width: auto; min-width: 0; }
.row-actions { flex-wrap: nowrap; }
/* Les deux premières colonnes de données (libellé / équipement) peuvent passer à la ligne pour éviter le scroll horizontal. */
.table-card .table-wrap td:nth-child(2), .table-card .table-wrap td:nth-child(3) { white-space: normal; max-width: 260px; overflow-wrap: anywhere; line-height: 1.3; }
.table-card .table-wrap .status-col, .table-card .table-wrap .equipment-status-col, .table-card .table-wrap .equipment-site-col { width: auto; max-width: none; }
.table-card .table-wrap td.equipment-site-col { white-space: normal; max-width: 160px; overflow-wrap: anywhere; }
.table-card .table-wrap td.notes-col { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }


.finance-expand-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: .35rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(226,232,240,.58);
  font-size: .95rem;
  line-height: 1;
  vertical-align: middle;
  transition: color .18s ease, background-color .18s ease, transform .18s ease;
}
/* Le chevron pivote en CSS plutot que de changer de caractere : meme animation que les blocs
   depliables des apercus d'import, et un seul vocabulaire visuel dans toute l'application. */
.finance-expand-toggle[aria-expanded="true"] {
  transform: rotate(90deg);
  color: rgba(148,163,184,.96);
}

.finance-expand-toggle:hover {
  color: var(--accent);
  background: rgba(255,255,255,.05);
}
.finance-expand-toggle:focus-visible {
  outline: 1px solid rgba(96,165,250,.75);
  outline-offset: 2px;
  color: rgba(255,255,255,.95);
}
.finance-child-row td:nth-child(2) {
  color: rgba(226,232,240,.82);
}
.finance-child-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  margin-right: .35rem;
  color: rgba(148,163,184,.5);
}

/* Import : grille de correspondance des colonnes (CSV générique et Switchs) */
.import-mapping { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; margin: 14px 0; }
.import-mapping .eyebrow { grid-column: 1 / -1; margin: 0; }

/* Modale de provision : large, 3 colonnes, tient à l'écran sans scroll interne sur un écran standard */
.modal-card--wide { width: min(1080px, 100%); max-height: calc(100vh - 32px); padding: 20px 24px; }
.modal-card--wide .modal-head { margin-bottom: 10px; }
.modal-card--wide .modal-head h2 { font-size: 20px; }
.modal-card--wide > .modal-text { margin: 0 0 10px; font-size: 13px; }
.modal-card--wide .modal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.modal-card--wide .modal-dynamic-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.modal-card--wide .modal-section-title { margin: 8px 0 0; padding-top: 8px; }
.modal-card--wide .modal-field textarea { min-height: 56px; }
.modal-card--wide .modal-field--full { grid-column: 1 / -1; }
.modal-card--wide .modal-text--hint { margin: 10px 0 0; }
.modal-card--wide .modal-actions { margin-top: 12px; }
@media (max-width: 1100px) {
  .modal-card--wide .modal-grid, .modal-card--wide .modal-dynamic-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Retour en haut de page — bouton flottant, visible seulement une fois la page defilee. */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  background: var(--surface-2, #1b2233);
  color: var(--text, #e8edf7);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 900;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections du menu — le Tableau de bord reste seul en tete, hors section. */
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.nav-section__label {
  margin: 0 0 2px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-cool, rgba(255, 255, 255, 0.42));
}

/* Blocs de detail des apercus d'import : replies par defaut, deplies au chevron.
   Le resume est en flex avec un `gap` explicite — pas d'espaces inline a preserver ici. */
.import-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  user-select: none;
}
.import-details > summary::-webkit-details-marker { display: none; }
.import-details > summary::before {
  content: '›';
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  color: var(--muted-cool, rgba(255, 255, 255, 0.5));
  transition: transform 150ms ease;
}
.import-details[open] > summary::before { transform: rotate(90deg); }
.import-details > summary:hover::before { color: var(--accent); }
.import-details > summary .eyebrow { margin: 0; }
.import-details__hint {
  font-size: 11px;
  color: var(--muted-cool, rgba(255, 255, 255, 0.42));
}
.import-details[open] .import-details__hint { display: none; }
.import-details > .table-wrap { margin-top: 10px; }

/* Pastille « a renseigner » : signale une donnee manquante sans crier plus fort qu'un statut reel. */
.badge--todo {
  font-weight: 500;
  opacity: 0.9;
}
.table-card__meta .badge--todo {
  margin-left: 4px;
  vertical-align: middle;
}

/* KPI de section : meme vocabulaire que le tableau de bord, mais places au-dessus du tableau concerne. */
.stats-grid--section {
  margin-bottom: 14px;
}

/* Une ligne de transfert : le contrat a gauche, sa destination a droite. L'italique porte le
   contexte (coût, échéance, boîtier libéré) sans concurrencer le libellé. */
.transfer-row > span { display: flex; flex-direction: column; gap: .15rem; }
.transfer-row > span em {
  font-style: normal;
  font-size: .78rem;
  color: var(--muted, #98a2b3);
}

/* Couche de confirmation empilee par-dessus une modale deja ouverte. Fond plus dense que le
   backdrop d'origine pour que la modale du dessous s'efface sans disparaitre : on doit sentir
   qu'elle est toujours la, et qu'annuler y ramene. */
.modal-backdrop--stacked {
  background: rgba(4, 8, 12, 0.74);
  backdrop-filter: blur(3px);
}

.modal-card--confirm {
  width: min(560px, 100%);
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
}

.confirm-list {
  margin: 4px 0 18px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.confirm-list li {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.035);
  /* Le liseré porte la lecture : on voit d'un coup d'oeil combien d'effets sont en jeu. */
  border-left: 3px solid var(--accent, #3b82f6);
}

.confirm-list li strong { font-size: .95rem; font-weight: 600; }
.confirm-list li span { font-size: .82rem; color: var(--muted, #9aa3b5); line-height: 1.45; }

/* Liste de noms (nouveaux / disparus) : elle peut compter des dizaines d'entrees. On la borne en
   hauteur et on la fait defiler plutot que de la tronquer — un rapport d'ecarts tronque ne sert a rien. */
.import-name-list {
  max-height: 140px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  line-height: 1.6;
}

/* Colonnes de quantite : deux ou trois chiffres, parfois une pastille de depassement. Elles
   n'ont aucune raison d'etre larges — c'est le libelle « en depassement » qui les etirait, il est
   passe en infobulle. */
.qty-col {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

/* Colonnes de texte long : « Bundle FortiGuard UTP 24x7 (950) » est identique sur 144 packs et
   poussait la table 340 px au-dela de l'ecran. On borne, on coupe a l'ellipse, et la valeur
   complete reste accessible au survol. */
/* Specificite volontairement elevee : une regle generique `td:nth-child(2), td:nth-child(3)`
   impose 260px et `white-space: normal` aux deux premieres colonnes de texte de tous les tableaux.
   Sans ces selecteurs plus specifiques, la borne serait ignoree sur exactement ces colonnes-la. */
.table-card .table-wrap td.ellipsis-col,
td.ellipsis-col { max-width: 116px; white-space: nowrap; }
.table-card .table-wrap td.ellipsis-col--wide,
td.ellipsis-col--wide { max-width: 168px; }
.ellipsis-col > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Session et droits ------------------------------------------------------------------- */
.sidebar-compte {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.03);
}
/* Le nom est devenu un bouton (il ouvre « mon compte ») : sans ces remises a zero, il
   heriterait de l'apparence par defaut d'un <button> et jurerait dans la barre laterale. */
.sidebar-compte__nom {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--muted-cool, #c8cfe6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.sidebar-compte__nom:hover { color: var(--text, #edf3ef); text-decoration: underline; }
.sidebar-compte__sortie {
  flex: none;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #9aa3b5);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
}
.sidebar-compte__sortie:hover { color: #ffb2b2; border-color: rgba(255,143,154,.35); background: rgba(255,143,154,.1); }

/* Une section en LECTURE SEULE garde ses tableaux, ses filtres et ses exports — mais perd tout
   ce qui ecrit. Le serveur refuse de toute facon ; masquer evite de proposer un geste voue a
   l'echec, ce qui est plus honnete qu'un message d'erreur apres coup. */
.view[data-niveau="read"] [data-table-add],
.view[data-niveau="read"] [data-table-bulk-edit],
.view[data-niveau="read"] [data-table-delete],
.view[data-niveau="read"] [data-table-edit],
.view[data-niveau="read"] [data-table-select-row],
.view[data-niveau="read"] [data-table-select-all],
.view[data-niveau="read"] [data-table-clear-selection],
.view[data-niveau="read"] [data-table-receive-finance],
.view[data-niveau="read"] [data-finance-add],
.view[data-niveau="read"] [data-pricing-apply],
.view[data-niveau="read"] [data-pricing-import],
.view[data-niveau="read"] .table-selection {
  display: none !important;
}

/* `display: flex` sur .nav-link et .nav-section ecrase le display:none implicite de [hidden] :
   sans cette regle, masquer une entree de menu par droits n'aurait aucun effet visible. */
.nav-link[hidden],
.nav-section[hidden],
[hidden] { display: none !important; }

/* --- Administration des comptes et des profils ----------------------------------------------- */
.admin-sous { margin-top: 2px; font-size: 12px; color: var(--muted, #9aa3b5); }

/* Reperer sa propre ligne evite de se desactiver soi-meme par megarde. */
.admin-moi {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(59,130,246,.18);
  color: #7fb2ff;
}

.admin-role { font-size: 13px; }
.admin-role--admin { color: #7fb2ff; font-weight: 600; }

.admin-etat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.admin-etat--ok      { background: rgba(16,185,129,.15); color: #6ee7b7; }
.admin-etat--attente { background: rgba(245,158,11,.15); color: #fcd34d; }
.admin-etat--alerte  { background: rgba(239,68,68,.15);  color: #fca5a5; }
.admin-etat--off     { background: rgba(148,163,184,.14); color: #cbd5e1; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ghost-action--danger { border-color: rgba(239,68,68,.35); color: #fca5a5; }
.ghost-action--danger:hover { background: rgba(239,68,68,.12); }

.admin-profil {
  padding: 18px 20px;
  border-top: 1px solid var(--border, rgba(255,255,255,.08));
}
.admin-profil header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.admin-profil h3 { margin: 0; font-size: 15px; }
.admin-profil header p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted, #9aa3b5); }

/* La grille se lit d'un bloc : on voit ce qui est ouvert sans dérouler onze lignes. */
.admin-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.admin-droit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  font-size: 12.5px;
}
.admin-droit span { color: var(--muted, #9aa3b5); }
.admin-droit strong { font-weight: 600; font-size: 12px; }
.admin-droit--none  { opacity: .5; }
.admin-droit--none strong  { color: #94a3b8; }
.admin-droit--read  { border-color: rgba(59,130,246,.3);  background: rgba(59,130,246,.08); }
.admin-droit--read strong  { color: #93c5fd; }
.admin-droit--write { border-color: rgba(16,185,129,.32); background: rgba(16,185,129,.09); }
.admin-droit--write strong { color: #6ee7b7; }

.admin-choix-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin: 6px 0 20px;
}
.admin-choix { display: flex; flex-direction: column; gap: 5px; }
.admin-choix > span { font-size: 12.5px; color: var(--muted, #9aa3b5); }

.modal-bascule {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 14px;
  font-size: 13px;
  line-height: 1.45;
}
.modal-bascule input { width: auto; margin-top: 2px; flex: none; }
.modal-bascule strong { font-weight: 600; }

.modal-card--large { max-width: 760px; }

/* Le mot de passe provisoire doit se lire caractere par caractere pour etre dicte sans erreur. */
.admin-secret {
  display: block;
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(59,130,246,.3);
  background: rgba(10,15,22,.7);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 19px;
  letter-spacing: 2px;
  text-align: center;
  color: #b7d2ff;
  user-select: all;
  word-break: break-all;
}

/* --- Etats vides ------------------------------------------------------------------------------ */
/* Utilise depuis longtemps par les vues Historique et Import sans avoir jamais ete style :
   le titre et l'explication se retrouvaient colles l'un a l'autre sur une seule ligne. */
.empty-state {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  text-align: center;
  padding: 34px 20px;
  color: var(--muted, #9aa3b5);
}
.empty-state strong { font-size: 14px; font-weight: 600; color: var(--text, #edf3ef); }
.empty-state span { font-size: 12.5px; line-height: 1.5; max-width: 46ch; }
.empty-state--compact { padding: 22px 18px; }
