:root {
  /* Couleurs de marque */
  --ink: #172033;
  --muted: #607085;
  --line: #dce4ef;
  --soft: #f3f7fb;
  --brand: #087cc6;
  --brand-2: #f5a02a;
  --accent: #163462;
  --white: #ffffff;
  --success: #0c8f6a;
  --danger: #9f1d1d;

  /* Typographie */
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Poppins", var(--font-body);

  /* Échelle d'espacement */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Rayons */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(23, 32, 51, 0.06);
  --shadow-md: 0 16px 40px rgba(23, 32, 51, 0.08);
  --shadow-lg: 0 20px 45px rgba(23, 32, 51, 0.14);

  /* Bordures */
  --border: 1px solid var(--line);

  color-scheme: light;
  font-family: var(--font-body);
}

/*
 * Points de rupture standard du site public (phase 1 de la refonte) :
 * 480px (mobile) · 768px (tablette) · 1024px (petit ordinateur) · 1280px (grand écran)
 * Les composants encore hérités (cartes, formulaires de pages non refaites) gardent
 * leurs propres seuils jusqu'à leur refonte individuelle.
 */

.public-space h1,
.public-space h2,
.public-space h3,
.public-space h4,
.public-space h5,
.public-space h6 {
  font-family: var(--font-display);
  font-weight: 600;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
}

body.nav-locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-3) clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: var(--border);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 800;
  flex: none;
}

.brand img {
  width: 116px;
  height: 48px;
  object-fit: contain;
}

.brand span {
  color: var(--muted);
  font-size: 0.92rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
}

.main-nav a {
  border-radius: var(--radius-sm);
  padding: 9px 9px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}

.main-nav a.active,
.main-nav a:hover {
  background: var(--soft);
  color: var(--brand);
}

.nav-side {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

.header-cta {
  flex: none;
  white-space: nowrap;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
  min-height: 40px;
}

.menu-button {
  display: none;
  flex: none;
  width: 44px;
  height: 44px;
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  background: var(--white);
  cursor: pointer;
  position: relative;
}

.menu-button-icon,
.menu-button-icon::before,
.menu-button-icon::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--ink);
  border-radius: var(--radius-full);
  transition: transform 220ms ease, opacity 220ms ease, top 220ms ease;
}

.menu-button-icon {
  top: 21px;
}

.menu-button-icon::before {
  top: -7px;
}

.menu-button-icon::after {
  top: 7px;
}

.menu-button[aria-expanded="true"] .menu-button-icon {
  background: transparent;
}

.menu-button[aria-expanded="true"] .menu-button-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-button[aria-expanded="true"] .menu-button-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 51, 0.32);
  z-index: 25;
}

/*
 * Depuis la réorganisation du menu (6 rubriques de premier niveau au lieu
 * de 8), le contenu tient sur une seule ligne dès ~1100px (mesuré en réel).
 * Le menu mobile en tiroir reste actif jusqu'à 1199px et la navigation
 * horizontale prend le relais à partir de 1200px, avec une marge de
 * sécurité confortable sur la largeur réellement nécessaire.
 */
@media (max-width: 1199px) {
  .menu-button {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    left: var(--space-4);
    right: var(--space-4);
    top: 100%;
    margin-top: var(--space-2);
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
    border: var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: max-height 320ms ease, opacity 220ms ease, transform 220ms ease, visibility 0s linear 320ms;
  }

  .main-nav.open {
    max-height: 800px;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: max-height 320ms ease, opacity 220ms ease, transform 220ms ease;
  }

  .main-nav .nav-item > a,
  .main-nav > a {
    width: 100%;
  }

  .nav-side {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    margin: var(--space-2) 0 0;
    padding-top: var(--space-3);
    border-top: var(--border);
  }

  .header-cta {
    width: 100%;
  }

  .nav-backdrop:not([hidden]) {
    display: block;
  }
}

@media (min-width: 1200px) {
  .menu-button {
    display: none;
  }

  .nav-backdrop {
    display: none;
  }
}

.flash {
  margin: 18px clamp(18px, 4vw, 56px) 0;
  border: 1px solid rgba(12, 143, 106, 0.25);
  border-radius: 8px;
  padding: 14px 16px;
  color: #075b45;
  background: #e9fbf5;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.65fr);
  gap: 28px;
  align-items: center;
  padding: clamp(40px, 4vw + 28px, 80px) clamp(20px, 4vw, 56px);
  background:
    linear-gradient(110deg, rgba(8, 124, 198, 0.08), rgba(245, 160, 42, 0.08)),
    var(--white);
}

.hero h1,
.page-head h1,
.section-heading h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(1.85rem, 5vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.actions.compact {
  margin-top: 18px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 900;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button.primary {
  border-color: var(--brand);
  color: var(--white);
  background: var(--brand);
}

.button.ghost,
.button.secondary {
  color: var(--accent);
  background: var(--white);
}

.hero-panel,
.card,
.metric,
.module-card,
.contact-card,
.form {
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.hero-panel {
  padding: 20px;
}

.hero-panel > strong {
  display: block;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.lot-row {
  display: grid;
  grid-template-columns: 58px minmax(80px, 1fr) 92px;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.lot-row b {
  color: var(--brand);
}

.lot-row small {
  color: var(--muted);
  text-align: right;
}

.section,
.page-head,
.cards,
.contact-layout {
  padding: clamp(40px, 4vw + 28px, 80px) clamp(20px, 4vw, 56px);
}

.section.no-pad {
  padding: 0 0 34px;
}

.section-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.section-heading h2,
.page-head h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3.6vw, 2.65rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.feature-grid,
.cards,
.metric-grid,
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

/* Public grids auto-balance to their real item count instead of forcing
   4 fixed columns, so a 3- or 5-item collection never leaves an
   awkward half-empty row. */
.public-space .feature-grid:not(.why-us-grid) {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Card tracks get a max width too (unlike the feature-grid rule above):
   a row with very few cards (as little as one, e.g. a single-product
   category) must not stretch a card edge-to-edge across the container. */
.public-space .cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 380px));
}

.feature-grid article,
.card,
.metric,
.module-card {
  padding: 20px;
}

.feature-grid article {
  border-top: 3px solid var(--brand-2);
  background: var(--soft);
}

.feature-grid span,
.module-card span,
.tag {
  color: var(--brand);
  font-weight: 900;
}

.public-filterbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(160px, 240px)) auto auto;
  gap: 12px;
  align-items: end;
  width: 100%;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.06);
}

.public-filterbar label {
  color: var(--ink);
  font-size: 0.9rem;
}

.readable-content {
  max-width: 920px;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.8;
}

.card h2,
.module-card h3,
.feature-grid h3 {
  margin: 10px 0;
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.25;
}

.card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 14px;
}

.card p,
.module-card p,
.feature-grid p,
.contact-card p,
.split p {
  color: var(--muted);
  line-height: 1.65;
}

.icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--accent);
  font-weight: 900;
}

dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.product strong {
  display: block;
  margin: 14px 0 6px;
  font-size: 1.4rem;
}

.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 78px);
}

.sidebar {
  position: sticky;
  top: 78px;
  height: calc(100vh - 78px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #f9fbfd;
}

.sidebar img {
  width: 150px;
  margin-bottom: 18px;
}

.sidebar a {
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  font-weight: 800;
}

.sidebar a.active,
.sidebar a:hover {
  color: var(--brand);
  background: var(--white);
}

.erp-content {
  padding: clamp(22px, 4vw, 42px);
}

.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 10px 0;
  font-size: 1.55rem;
}

.module-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.livewire-panel {
  display: grid;
  gap: 18px;
}

.module-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px);
  gap: 14px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--white);
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.06);
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: 24px;
  align-items: start;
}

.checklist {
  display: grid;
  gap: 10px;
}

.checklist span {
  border-left: 4px solid var(--success);
  padding: 12px 14px;
  background: #eefaf6;
  font-weight: 800;
}

.split.reverse > :first-child {
  order: 2;
}

.split.reverse > :last-child {
  order: 1;
}

.checklist-large {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.checklist-large span {
  border-left-color: var(--brand-2);
  background: var(--soft);
  color: var(--ink);
  text-align: center;
  padding: 18px 14px;
  border-radius: var(--radius-md, 10px);
  font-size: 1rem;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.profile-summary img,
.profile-summary > span {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: var(--white);
  font-weight: 900;
  object-fit: cover;
}

.profile-summary strong,
.profile-summary small {
  display: block;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.5fr);
  gap: 22px;
}

.form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.contact-card {
  padding: 22px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 980px) {
  .hero,
  .workspace,
  .contact-layout,
  .split {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .cards,
  .metric-grid,
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 760px) {
  .feature-grid,
  .cards,
  .metric-grid,
  .module-grid,
  .module-toolbar,
  dl {
    grid-template-columns: 1fr;
  }

  .lot-row {
    grid-template-columns: 52px 1fr;
  }

  .lot-row small {
    grid-column: 2;
    text-align: left;
  }

footer {
    flex-direction: column;
  }
}

.nav-item {
  position: relative;
}

.nav-item > a,
.main-nav > a {
  display: inline-flex;
  align-items: center;
}

.nav-item:hover > a,
.nav-item:focus-within > a {
  background: var(--soft);
  color: var(--brand);
}

.submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  display: none;
  min-width: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--white);
  box-shadow: 0 18px 42px rgba(23, 32, 51, 0.12);
}

.submenu .nav-item {
  width: 100%;
}

.submenu a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 10px;
  white-space: nowrap;
}

.submenu-heading {
  padding: 6px 10px 8px;
  color: #64758a;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reservation-submenu,
.formation-submenu,
.service-submenu {
  min-width: 230px;
}

.formation-submenu,
.service-submenu {
  min-width: 260px;
}

.reservation-submenu .nav-item > a,
.formation-submenu .nav-item > a,
.service-submenu .nav-item > a {
  border-radius: 8px;
  padding: 11px 12px;
}

.reservation-submenu .nav-item > a::before,
.formation-submenu .nav-item > a::before,
.service-submenu .nav-item > a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #c9d8e8;
  flex: 0 0 auto;
  margin-top: 7px;
}

.reservation-submenu .nav-item > a:hover,
.formation-submenu .nav-item > a:hover,
.service-submenu .nav-item > a:hover,
.reservation-submenu .active-reservation-choice > a,
.formation-submenu .active-formation-choice > a,
.service-submenu .active-service-choice > a,
.reservation-submenu .nav-item > a[aria-current="page"],
.formation-submenu .nav-item > a[aria-current="page"],
.service-submenu .nav-item > a[aria-current="page"] {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, white);
}

.reservation-submenu .active-reservation-choice > a::before,
.formation-submenu .active-formation-choice > a::before,
.service-submenu .active-service-choice > a::before,
.reservation-submenu .nav-item > a[aria-current="page"]::before,
.formation-submenu .nav-item > a[aria-current="page"]::before,
.service-submenu .nav-item > a[aria-current="page"]::before {
  background: var(--brand);
}

.submenu .submenu {
  top: -8px;
  left: calc(100% + 8px);
}

.has-menu > a::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.submenu .has-menu > a::after {
  margin-left: auto;
  transform: rotate(-45deg);
}

.has-menu:hover > .submenu,
.has-menu:focus-within > .submenu {
  display: grid;
}

.erp-link {
  border: 1px solid rgba(8, 124, 198, 0.22);
  background: #edf7ff;
}

.image-hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background-image:
    linear-gradient(90deg, rgba(10, 23, 44, 0.92), rgba(10, 23, 44, 0.56), rgba(10, 23, 44, 0.18)),
    var(--hero-image);
  background-position: center;
  background-size: cover;
}

.image-hero .hero-copy p {
  color: rgba(255, 255, 255, 0.88);
}

.image-hero .eyebrow {
  color: #ffbf62;
}

.image-hero .hero-panel {
  color: var(--ink);
}

.media-head {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: center;
}

.media-head img,
.login-visual img,
.erp-hero img {
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  box-shadow: 0 16px 40px rgba(23, 32, 51, 0.10);
}

.erp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.6fr);
  gap: 22px;
  align-items: center;
}

.erp-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 3.4vw, 2.45rem);
  line-height: 1.12;
}

.erp-hero p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.dashboard-workspace {
  gap: 20px;
}

.dashboard-header,
.dashboard-panel,
.dashboard-kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.07);
}

.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: clamp(18px, 3vw, 28px);
}

.dashboard-header h1,
.dashboard-panel h2 {
  margin: 0;
  color: #10223d;
  line-height: 1.1;
  letter-spacing: 0;
}

.dashboard-header h1 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.dashboard-header p:not(.eyebrow) {
  max-width: 760px;
  margin: 10px 0 0;
  color: #536981;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: end;
}

.dashboard-actions label {
  display: grid;
  gap: 6px;
  color: #5c6f86;
  font-size: 0.82rem;
  font-weight: 900;
}

.dashboard-actions select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: #10223d;
  font-weight: 900;
  background: #fff;
}

.dashboard-actions small {
  width: 100%;
  color: #6b7e93;
  text-align: right;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.dashboard-kpi {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  min-height: 96px;
  padding: 16px 18px;
  color: #132843;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--kpi-color) 10%, transparent), transparent 62%),
    #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-kpi:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.08);
}

.kpi-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--kpi-color);
}

.kpi-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.kpi-copy small,
.kpi-copy em {
  color: #60748d;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 800;
}

.kpi-copy strong {
  color: #0b1f3a;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  line-height: 1.15;
}

.kpi-trend {
  grid-column: 1 / -1;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.75);
}

.trend-up {
  color: #15803d;
}

.trend-down {
  color: #b91c1c;
}

.trend-flat {
  color: #566a82;
}

.tone-blue { --kpi-color: #087cc6; }
.tone-green { --kpi-color: #22c55e; }
.tone-orange { --kpi-color: #f59e0b; }
.tone-red { --kpi-color: #ef4444; }
.tone-violet { --kpi-color: #8b5cf6; }
.tone-teal { --kpi-color: #06b6d4; }
.tone-indigo { --kpi-color: #4f46e5; }

.dashboard-panels {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chart-panel {
  min-height: 330px;
}

.chart-export {
  border: 1px solid #d8e8f6;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--brand);
  background: #eef7ff;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.chart-panel .panel-heading small {
  display: block;
  margin-top: 5px;
  color: #64758a;
  font-weight: 800;
}

.line-chart {
  display: grid;
  gap: 10px;
}

.line-chart svg {
  width: 100%;
  min-height: 190px;
  overflow: visible;
}

.line-chart line {
  stroke: #d8e8f6;
  stroke-width: 2;
}

.line-chart polyline {
  fill: none;
  stroke: var(--brand);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.line-chart {
  color: var(--brand);
}

.line-chart.line-orange {
  color: #f59e0b;
}

.line-chart.line-orange polyline,
.line-chart.line-orange circle {
  stroke: #f59e0b;
}

.line-chart.line-blue polyline,
.line-chart.line-blue circle {
  stroke: var(--brand);
}

.line-chart circle {
  fill: #ffffff;
  stroke: var(--brand);
  stroke-width: 3;
}

.line-chart text {
  fill: #64758a;
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

.chart-gridline {
  stroke: #edf2f8;
  stroke-width: 1;
}

.chart-gridline-label {
  fill: #97a5b6;
  font-size: 10px;
  font-weight: 700;
  text-anchor: start;
  dominant-baseline: middle;
}

.line-chart strong {
  color: #10223d;
  font-size: 1.15rem;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.72fr) minmax(120px, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

a.bar-row:hover span {
  color: var(--brand);
}

.bar-row span,
.bar-row strong {
  color: #40536d;
  font-size: 0.88rem;
  font-weight: 900;
}

.bar-row div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf4fb;
}

.bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #06b6d4);
}

.compact-bars {
  margin-top: 14px;
}

.stock-healthy b {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

.stock-warning b {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stock-danger b {
  background: linear-gradient(90deg, #ef4444, #fb7185);
}

.pie-chart {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.pie-visual {
  position: relative;
  display: grid;
  width: min(220px, 70vw);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--pie-gradient));
  box-shadow: 0 18px 36px rgba(23, 32, 51, 0.10);
}

.pie-chart.is-doughnut .pie-visual::before,
.pie-visual::before {
  content: "";
  position: absolute;
  inset: 54px;
  border-radius: 50%;
  background: #ffffff;
}

.pie-chart:not(.is-doughnut) .pie-visual::before {
  inset: 72px;
}

.pie-visual strong,
.pie-visual small {
  position: relative;
  z-index: 1;
  text-align: center;
}

.pie-visual strong {
  color: #10223d;
  font-size: 1.1rem;
}

.pie-visual small {
  margin-top: 26px;
  color: #64758a;
  font-weight: 900;
}

.heatmap-chart {
  display: grid;
  gap: 7px;
  overflow-x: auto;
}

.heatmap-hours,
.heatmap-row {
  display: grid;
  grid-template-columns: 44px repeat(11, minmax(32px, 1fr));
  gap: 5px;
  align-items: center;
  min-width: 640px;
}

.heatmap-hours span,
.heatmap-row strong {
  color: #64758a;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.heatmap-row span {
  height: 28px;
  border: 1px solid #d8e8f6;
  border-radius: 7px;
  background: rgba(8, 124, 198, var(--heat-alpha));
}

.heatmap-row span:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(8, 124, 198, 0.12);
}

.stock-gauge {
  display: grid;
  justify-items: center;
  padding: 8px 0 18px;
}

.gauge-track {
  position: relative;
  display: grid;
  width: min(210px, 72vw);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#22c55e 0 var(--stock-percent), #e7eef7 var(--stock-percent) 100%);
  box-shadow: inset 0 0 0 1px rgba(23, 32, 51, 0.06), 0 16px 34px rgba(23, 32, 51, 0.08);
}

.gauge-track span {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #e7eef7;
}

.stock-gauge strong {
  position: relative;
  color: #10223d;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1;
}

.stock-gauge small {
  position: relative;
  color: #64758a;
  font-weight: 900;
}

.chart-legend {
  display: grid;
  gap: 8px;
  color: #40536d;
  font-size: 0.9rem;
  font-weight: 900;
}

.chart-legend.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
}

.dot.healthy { background: #22c55e; }
.dot.warning { background: #f59e0b; }
.dot.danger { background: #ef4444; }

.dashboard-panels-small {
  grid-template-columns: 1fr 1fr;
}

.dashboard-panel {
  padding: 18px;
}

.training-program-list {
  display: grid;
  gap: 10px;
}

.training-program-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
}

.training-program-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.training-program-card-head strong {
  color: #14253d;
  font-size: 1rem;
}

.training-program-tag {
  border-radius: 999px;
  padding: 3px 10px;
  color: #40536d;
  background: #eef3f8;
  font-size: 0.76rem;
  font-weight: 800;
}

.training-program-rating {
  margin-left: auto;
  color: #b8860b;
  font-weight: 800;
  font-size: 0.85rem;
}

.training-program-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  color: #64758a;
  font-size: 0.86rem;
}

.training-program-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.training-program-card-actions form {
  margin: 0;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.dashboard-panel h2 {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.alert-list,
.activity-list,
.quick-stat-grid,
.dashboard-shortcuts {
  display: grid;
  gap: 10px;
}

.dashboard-alert,
.activity-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 0.55fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
}

.dashboard-alert span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--alert-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--alert-color) 16%, transparent);
}

.dashboard-alert strong,
.activity-item strong,
.quick-stat strong {
  color: #132843;
}

.activity-item strong em {
  display: inline-flex;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  color: #0877c9;
  background: #eef7ff;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.dashboard-alert small,
.activity-item small,
.quick-stat small {
  color: #64758a;
}

.alert-critical { --alert-color: #ef4444; }
.alert-warning { --alert-color: #f59e0b; }
.alert-info { --alert-color: #087cc6; }
.alert-success { --alert-color: #22c55e; }

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
}

.quick-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 4px 12px;
}

.quick-action summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 0;
  font-weight: 900;
  color: #132843;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-action summary::-webkit-details-marker {
  display: none;
}

.quick-action summary::before {
  content: '▸';
  color: var(--brand);
  transition: transform 0.15s ease;
}

.quick-action[open] summary::before {
  transform: rotate(90deg);
}

.quick-action .compact-form {
  padding-bottom: 14px;
  display: grid;
  gap: 10px;
}

.quick-action-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
  background: var(--white);
}

.quick-action-link:hover,
.quick-action-link:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
}

.activity-item {
  grid-template-columns: 42px minmax(0, 1fr);
}

.dashboard-alert {
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  padding-top: 14px;
}

.dashboard-alert > span {
  margin-top: 4px;
}

.dashboard-alert > div {
  display: grid;
  gap: 2px;
}

.dashboard-alert em {
  color: #8a97a8;
  font-size: 0.74rem;
  font-style: normal;
}

.activity-item > span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef7ff;
}

.activity-item.is-new {
  border-color: #b7dcf8;
  background: #eef7ff;
  animation: activity-highlight 900ms ease;
}

@keyframes activity-highlight {
  from { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(8, 124, 198, 0.18); }
  to { transform: translateY(0); box-shadow: none; }
}

.activity-livebar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  border: 1px solid #cfe5f8;
  border-radius: 8px;
  padding: 12px 14px;
  color: #075985;
  background: #eef7ff;
  font-weight: 900;
}

.activities-workspace .activity-list {
  margin-top: 16px;
}

.activities-workspace .activity-item {
  grid-template-columns: 48px minmax(0, 1fr);
}

.activities-workspace .activity-item > span {
  width: 48px;
  height: 48px;
}

.quick-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-stat {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbff;
}

.dashboard-shortcuts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-shortcuts a {
  border: 1px solid #d8e8f6;
  border-radius: 8px;
  padding: 12px;
  color: var(--brand);
  font-weight: 900;
  background: #eef7ff;
}

.sidebar strong {
  margin-top: 6px;
  color: var(--ink);
}

.sidebar small {
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.module-card.locked {
  background: #f7f8fa;
  opacity: 0.72;
}

.module-card small {
  display: inline-flex;
  margin-top: 12px;
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--brand);
  background: #edf7ff;
  font-weight: 900;
}

.module-action {
  width: fit-content;
  margin-top: 14px;
}

.module-card.locked small {
  color: #7b8794;
  background: #eceff3;
}

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.6fr);
  gap: 28px;
  min-height: calc(100vh - 78px);
  align-items: center;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 56px);
  background: var(--soft);
}

.login-page-centered {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.login-form {
  align-content: start;
  width: 100%;
  max-width: 420px;
}

.login-form img {
  width: 154px;
  margin: 0 auto 8px;
  display: block;
}

.login-form h1 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.12;
}

.login-tagline {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
}

.login-locale-switcher {
  justify-self: center;
  margin-top: 4px;
}

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.demo-users {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.flash.error {
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 6%, white);
}

.erp-space {
  background: #f5f7fb;
}

.erp-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.erp-topbar form {
  margin: 0;
}

.erp-space .workspace {
  min-height: calc(100vh - 77px);
}

.erp-space .sidebar {
  top: 77px;
  height: calc(100vh - 77px);
}

@media (max-width: 980px) {
  .media-head,
  .login-page,
  .erp-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-item {
    width: 100%;
  }

  .nav-item > a,
  .main-nav > a {
    width: 100%;
  }

  .submenu {
    position: static;
    display: none;
    width: 100%;
    margin: 2px 0 8px;
    box-shadow: none;
  }
}

/* Navigation stability and responsive overrides */
.topbar {
  z-index: 80;
}

.main-nav {
  min-width: 0;
}

.nav-item.has-menu {
  padding-bottom: 8px;
  margin-bottom: -8px;
}

.submenu {
  top: 100%;
  z-index: 120;
  padding: 10px;
}

.submenu .nav-item.has-menu {
  padding-bottom: 0;
  margin-bottom: 0;
}

.submenu .submenu {
  top: -10px;
  left: 100%;
}

.has-menu:hover > .submenu,
.has-menu:focus-within > .submenu {
  display: grid;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
}

.language-switcher select {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 28px 7px 10px;
  color: var(--ink);
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

[dir="rtl"] .language-switcher select {
  padding: 7px 10px 7px 28px;
}

.cms-workspace {
  display: grid;
  gap: 28px;
  padding: clamp(22px, 4vw, 42px);
}

.cms-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cms-nav a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--muted);
  background: var(--white);
  font-weight: 900;
}

.cms-nav a.active,
.cms-nav a:hover {
  border-color: var(--brand);
  color: var(--white);
  background: var(--brand);
}

.cms-hero {
  align-items: stretch;
}

.cms-seed-panel,
.cms-panel,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

.cms-seed-panel {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 24px;
}

.cms-seed-panel p,
.cms-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.cms-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cms-heading-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.invoice-cards {
  display: none;
}

@media (max-width: 639px) {
  .invoices-table-wrap {
    display: none;
  }

  .invoice-cards {
    display: grid;
    gap: 12px;
  }

  .invoice-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: var(--white);
    box-shadow: 0 10px 26px rgba(23, 32, 51, 0.06);
  }

  .invoice-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
  }

  .invoice-card-client {
    margin: 0 0 10px;
    color: var(--muted);
    font-weight: 700;
  }

  .invoice-card-figures {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0 0 12px;
  }

  .invoice-card-figures dt {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 0.7rem;
    text-transform: uppercase;
  }

  .invoice-card-figures dd {
    margin: 0;
    font-weight: 900;
  }

  .invoice-card-actions {
    display: flex;
    gap: 8px;
  }

  .invoice-card-actions .button {
    flex: 1;
  }

  .invoice-card-actions .button.icon-only {
    flex: 0 0 auto;
  }
}

.erp-space.dark-mode .invoice-card {
  border-color: #4A5568;
  background: #2D3748;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  background: var(--soft);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status.success {
  color: #075b45;
  background: #dff8ee;
}

.status.muted {
  color: #667085;
  background: #eef2f6;
}

.button.danger {
  border-color: #f4c7c7;
  color: #9f1d1d;
  background: #fff5f5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Honeypot field on the public auth forms — deliberately NOT display:none
   (some bots skip hidden inputs but still fill positioned-off-screen
   ones); a real visitor never sees or tabs into it. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.icon-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.share-buttons-label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.share-buttons .button.icon-only[data-share-copy].is-copied {
  border-color: var(--success);
  color: var(--success);
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: -100px;
  left: 12px;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--white);
  background: var(--accent);
  font-weight: 700;
  transition: top 140ms ease;
}

.skip-link:focus {
  top: 12px;
}

/* RTL (Arabic): the browser mirrors flow/flex layout automatically from
   the html[dir] attribute, but absolutely-positioned menus and one-sided
   margins use physical left/right and need an explicit flip. */
[dir="rtl"] .submenu {
  left: auto;
  right: 0;
}

[dir="rtl"] .submenu .submenu {
  left: auto;
  right: calc(100% + 8px);
}

[dir="rtl"] .has-menu > a::after {
  margin-left: 0;
  margin-right: 7px;
  transform: rotate(-135deg);
}

[dir="rtl"] .nav-side {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .summary-list span {
  border-left: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.button.icon-only {
  width: 36px;
  min-height: 36px;
  padding: 0;
  gap: 0;
  flex-shrink: 0;
}

.button.icon-only svg {
  width: 18px;
  height: 18px;
}

.cms-form {
  display: grid;
  gap: 16px;
  max-width: 980px;
}

.cms-form h3,
.cms-panel h3 {
  margin: 0;
}

.cms-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 900;
}

.cms-form input,
.cms-form select,
.cms-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-weight: 600;
}

.cms-form textarea {
  resize: vertical;
}

.cms-form small {
  color: #9f1d1d;
}

.setting-image-preview {
  width: min(180px, 100%);
  max-height: 96px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.checkbox-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px !important;
}

.checkbox-row input {
  width: auto;
}

.form-row,
.cms-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.form-panel .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
  align-items: start;
}

.learner-photo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: var(--white);
  overflow: hidden;
}

.learner-photo-preview:empty::after {
  content: '\1F464';
  font-size: 2rem;
  opacity: 0.35;
}

.learner-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-field {
  gap: 8px !important;
}

.document-lines-panel {
  max-width: 1120px;
}

.document-line-head,
.document-line {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 90px minmax(170px, 1fr) 80px 120px 100px minmax(130px, .8fr) 120px 70px;
  gap: 10px;
  align-items: center;
}

.document-line-head {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.delivery-line-head,
.delivery-line {
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) 70px 100px 100px 90px minmax(140px, 1fr) 110px 44px;
}

.delivery-line output {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 900;
}

.document-lines {
  display: grid;
  gap: 10px;
}

.document-line output {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 900;
}

.icon-only {
  min-width: 44px;
  padding-inline: 12px;
  font-size: 1.2rem;
}

.document-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
}

.document-summary strong {
  color: var(--ink);
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
}

.input-action-row {
  align-items: stretch;
  display: flex;
  gap: 8px;
}

.input-action-row input {
  flex: 1;
  min-width: 0;
}

.button.mini {
  min-height: 34px;
  padding: 7px 10px;
  font-size: .78rem;
}

.cms-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 20px;
}

.menu-tree {
  display: grid;
  gap: 10px;
}

.menu-tree-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.menu-tree-item.level-1 {
  margin-left: 20px;
}

.menu-tree-item.level-2 {
  margin-left: 40px;
}

.menu-tree-item summary {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
}

.menu-tree-item summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.compact-form {
  display: grid;
  gap: 12px;
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 14px;
  box-shadow: none;
}

.menu-tree-item details > form:last-child {
  margin: 0;
  padding: 0 14px 14px;
}

.pagination-wrap {
  margin-top: 18px;
}

.invoice-recap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 700;
}

.invoice-recap strong {
  color: var(--ink);
  font-weight: 900;
}

.erp-space.dark-mode .invoice-recap {
  border-color: #4A5568;
}

.erp-space.dark-mode .invoice-recap strong {
  color: #F7FAFC;
}

.pagination-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pagination-summary {
  color: var(--muted, #5d6d83);
  font-size: 0.85rem;
  margin: 0;
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination-links .button {
  min-height: 36px;
  padding: 6px 12px;
}

.pagination-links .button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-current {
  cursor: default;
}

.pagination-dots {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  color: var(--muted, #5d6d83);
}

.erp-filterbar {
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 220px)) auto;
  margin-bottom: 18px;
}

.detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-grid div {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.detail-grid div.wide {
  grid-column: 1 / -1;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

@media (max-width: 980px) {
  .public-topbar {
    flex-wrap: wrap;
  }

  .main-nav {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .main-nav.open .submenu {
    position: static;
    display: grid;
    width: 100%;
    margin: 2px 0 8px;
    box-shadow: none;
  }

  .main-nav.open .submenu .submenu {
    position: static;
    margin-left: 12px;
    border-left: 3px solid var(--line);
  }

  .has-menu > a::after,
  .submenu .has-menu > a::after {
    margin-left: auto;
    transform: rotate(45deg);
  }

  .hero {
    min-height: auto;
  }

  .hero h1,
  .page-head h1,
  .section-heading h1 {
    font-size: clamp(1.65rem, 9vw, 2.35rem);
    line-height: 1.1;
  }

  .button {
    width: 100%;
  }

  .media-head img,
  .login-visual img,
  .erp-hero img {
    aspect-ratio: 4 / 3;
  }

  .language-switcher {
    width: 100%;
    justify-content: center;
  }

  .cms-metrics,
  .cms-heading-row,
  .form-row,
  .cms-grid.two,
  .document-line-head,
  .document-line,
  .erp-filterbar,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .document-line-head {
    display: none;
  }

  .document-line {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
  }

  .document-line output {
    justify-content: flex-start;
  }

  .cms-workspace {
    padding: 18px;
  }

  .menu-tree-item.level-1,
  .menu-tree-item.level-2 {
    margin-left: 0;
  }
}

/* Professional interface refresh */
html {
  font-size: 16px;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  max-width: 100vw;
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
}

p,
li,
label,
input,
select,
textarea,
button,
.button,
.main-nav a,
.sidebar a,
.data-table {
  font-size: 1rem;
}

.public-space main {
  min-height: 56vh;
}

.public-topbar,
.erp-topbar {
  min-height: 78px;
}

.public-topbar .brand img,
.erp-topbar .brand img {
  width: 160px;
  height: 62px;
}

.public-nav {
  gap: 6px;
}

.main-nav a {
  min-height: 42px;
  align-items: center;
  color: var(--muted);
}

.hero {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 460px);
}

/* Below 1024px the second column's 300px floor leaves almost nothing for
   the copy column (as little as ~110px on a phone) — stack instead. */
@media (max-width: 1023px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.hero h1,
.page-head h1,
.section-heading h1 {
  font-size: clamp(1.8rem, 4.2vw, 3.25rem);
  line-height: 1.08;
}

.section-heading h2,
.page-head h1,
.erp-hero h1 {
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.14;
}

.hero p,
.page-head p,
.section-heading p,
.card p,
.module-card p,
.feature-grid p,
.contact-card p,
.split p {
  font-size: 1.02rem;
}

.image-hero {
  min-height: clamp(440px, 58vh, 620px);
}

.public-summary {
  display: grid;
  gap: 14px;
  align-self: center;
  padding: clamp(22px, 3vw, 28px);
  border-top: 3px solid var(--brand-2);
}

.public-summary-intro {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.4;
}

.public-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.summary-list {
  display: grid;
  gap: 8px;
}

.summary-list span {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--accent);
  background: var(--soft);
  font-weight: 700;
  font-size: 0.94rem;
}

.summary-list span svg {
  flex: none;
  color: var(--brand);
}

.public-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 22px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.public-stats article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--soft);
}

.public-stats strong {
  color: var(--brand);
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1;
}

.public-stats span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.home-showcase {
  display: grid;
  gap: 20px;
}

.muted-band {
  background: var(--soft);
}

.testimonials-band {
  background: var(--white);
}

.home-product-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.home-product-strip article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(23, 32, 51, 0.06);
}

.home-product-strip span {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-product-strip strong {
  color: var(--ink);
  font-size: 1rem;
}

.home-product-strip small {
  color: var(--muted);
  font-weight: 900;
}

.testimonial-card p {
  color: var(--muted);
  font-style: italic;
}

.feature-grid article,
.card,
.metric,
.module-card,
.contact-card,
.form,
.cms-panel,
.cms-seed-panel,
.table-wrap {
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.07);
}

.feature-grid article,
.module-card,
.metric {
  min-height: 150px;
}

.button {
  gap: 8px;
  min-height: 46px;
  padding: 11px 17px;
  font-size: 0.98rem;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(23, 32, 51, 0.10);
}

.public-footer {
  display: block;
  padding: 0;
  color: #d9e5f2;
  background: var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) repeat(3, minmax(160px, 1fr));
  gap: clamp(24px, 4vw, 48px);
  padding: var(--space-8) clamp(18px, 4vw, 56px) var(--space-6);
}

.footer-grid section {
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.footer-about img {
  width: auto;
  height: 44px;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: var(--space-2);
}

.footer-slogan {
  color: var(--white);
  font-weight: 600;
}

.footer-description {
  color: #b9cbe0;
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 38ch;
}

.footer-grid h2 {
  margin: 0 0 var(--space-2);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
}

.footer-grid p,
.footer-grid a {
  margin: 0;
  color: #b9cbe0;
  font-size: 0.94rem;
}

.footer-grid a {
  transition: color 140ms ease;
}

.footer-grid a:hover,
.footer-grid a:focus-visible {
  color: var(--brand-2);
}

.footer-hours {
  margin-top: var(--space-1);
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 7px 12px;
  color: var(--white);
  font-size: 0.92rem;
  font-weight: 700;
  transition: background 140ms ease, border-color 140ms ease;
}

.footer-socials a:hover,
.footer-socials a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--white);
}

.footer-partners {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
  padding: 0 clamp(18px, 4vw, 56px) var(--space-5);
}

.footer-partners img {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.75;
  transition: opacity 140ms ease;
}

.footer-partners a:hover img,
.footer-partners a:focus-visible img {
  opacity: 1;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: var(--space-4) clamp(18px, 4vw, 56px);
  color: #a9bdd4;
  font-size: 0.86rem;
}

.footer-tagline {
  color: #a9bdd4;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-legal a {
  color: #a9bdd4;
  font-size: 0.86rem;
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--white);
}

.erp-space {
  color: #1c2a3e;
  background: #eef3f8;
}

.erp-space.dark-mode {
  color: #F7FAFC;
  background: #1A202C;
  --surface: #2D3748;
  --surface-2: #1A202C;
  --text-soft: #E2E8F0;
  --soft: #2D3748;
  --muted: #A0AEC0;
}

.erp-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid rgba(216, 232, 246, 0.9);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.06);
}

.erp-topbar .brand span {
  color: #243853;
  font-size: 1rem;
}

.erp-search {
  display: grid;
  gap: 5px;
  min-width: min(340px, 28vw);
  margin-left: auto;
  color: #5d6f86;
  font-size: 0.75rem;
  font-weight: 900;
}

.erp-search input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: #17263b;
  background: #f8fbff;
}

.theme-toggle {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #1f3656;
  font-size: 1.05rem;
  font-weight: 900;
  background: #ffffff;
  cursor: pointer;
}

.erp-user-pill {
  display: grid;
  min-width: 150px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #f8fbff;
}

.erp-user-pill strong {
  color: #18304f;
  font-size: 0.9rem;
}

.erp-user-pill small {
  color: #64758a;
  font-size: 0.75rem;
  font-weight: 800;
}

.workspace {
  grid-template-columns: 280px minmax(0, 1fr);
}

.erp-shell {
  align-items: start;
}

.erp-shell-main {
  min-width: 0;
}

.sidebar {
  gap: 6px;
  overflow-y: auto;
  background: #ffffff;
}

.sidebar img {
  width: 138px;
  margin-bottom: 10px;
}

.erp-sidebar {
  position: sticky;
  top: 98px;
  height: calc(100vh - 98px);
  padding-bottom: 18px;
}

.sidebar-group {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.sidebar-group > span {
  padding: 14px 10px 5px;
  color: #7a8da3;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar a {
  display: flex;
  min-height: 42px;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  padding: 10px 12px;
  color: #40536d;
  font-size: 0.96rem;
}

.sidebar a i {
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--brand);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
  background: #eef7ff;
}

.sidebar a.active,
.sidebar a:hover {
  border-color: #d8e8f6;
  color: var(--brand);
  background: #eef7ff;
}

.sidebar a.active i,
.sidebar a:hover i {
  color: #ffffff;
  background: var(--brand);
}

.erp-content {
  display: grid;
  gap: 26px;
  padding: clamp(20px, 3vw, 34px);
  min-width: 0;
}

.erp-content > * {
  min-width: 0;
}

.erp-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 3vw, 30px);
  background: var(--white);
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.07);
}

.metric-grid {
  gap: 16px;
}

.metric strong {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
}

.module-toolbar,
.livewire-panel,
.cms-form {
  max-width: none;
}

.data-table th {
  font-size: 0.86rem;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.06);
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  color: #40536d;
  background: #f4f8fc;
}

.data-table tr:hover td {
  background: #fbfdff;
}

.erp-space.dark-mode .data-table tr:hover td {
  background: #1A202C;
}

.data-table td {
  font-size: 0.96rem;
}

.erp-filterbar,
.cms-form,
.cms-panel,
.livewire-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.06);
}

.erp-filterbar {
  align-items: end;
}

.cms-nav a,
.status {
  font-size: 0.94rem;
}

.erp-space.dark-mode .erp-topbar,
.erp-space.dark-mode .sidebar,
.erp-space.dark-mode .dashboard-header,
.erp-space.dark-mode .dashboard-panel,
.erp-space.dark-mode .dashboard-kpi,
.erp-space.dark-mode .table-wrap,
.erp-space.dark-mode .cms-form,
.erp-space.dark-mode .cms-panel,
.erp-space.dark-mode .livewire-panel,
.erp-space.dark-mode .erp-filterbar,
.erp-space.dark-mode .form,
.erp-space.dark-mode .module-card,
.erp-space.dark-mode .card,
.erp-space.dark-mode .hero-panel,
.erp-space.dark-mode .metric,
.erp-space.dark-mode .contact-card,
.erp-space.dark-mode .training-program-card {
  border-color: #4A5568;
  background: #2D3748;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.erp-space.dark-mode .button.ghost {
  color: #F7FAFC;
  background: #2D3748;
  border-color: #4A5568;
}

.erp-space.dark-mode input,
.erp-space.dark-mode select,
.erp-space.dark-mode textarea,
.erp-space.dark-mode .form input,
.erp-space.dark-mode .form select,
.erp-space.dark-mode .form textarea,
.erp-space.dark-mode .document-line output,
.erp-space.dark-mode .delivery-line output {
  color: #F7FAFC;
  background: #1A202C;
  border-color: #4A5568;
}

.erp-space.dark-mode .erp-topbar .brand span,
.erp-space.dark-mode .dashboard-header h1,
.erp-space.dark-mode .dashboard-panel h2,
.erp-space.dark-mode .kpi-copy strong,
.erp-space.dark-mode .dashboard-alert strong,
.erp-space.dark-mode .activity-item strong,
.erp-space.dark-mode .quick-stat strong,
.erp-space.dark-mode .sidebar strong,
.erp-space.dark-mode .section-heading h2,
.erp-space.dark-mode .data-table td,
.erp-space.dark-mode .cms-panel,
.erp-space.dark-mode .training-program-card-head strong,
.erp-space.dark-mode label {
  color: #edf5ff;
}

.erp-space.dark-mode .activity-item strong em {
  color: #8bd3ff;
  background: rgba(14, 165, 233, 0.12);
}

.erp-space.dark-mode .erp-search input,
.erp-space.dark-mode .theme-toggle,
.erp-space.dark-mode .erp-user-pill,
.erp-space.dark-mode .quick-stat,
.erp-space.dark-mode .dashboard-alert,
.erp-space.dark-mode .activity-item,
.erp-space.dark-mode .dashboard-shortcuts a,
.erp-space.dark-mode .quick-action,
.erp-space.dark-mode .quick-action-link,
.erp-space.dark-mode .data-table th {
  border-color: #4A5568;
  color: #F7FAFC;
  background: #1A202C;
}

.erp-space.dark-mode .quick-action summary {
  color: #F7FAFC;
}

.erp-space.dark-mode .sidebar a,
.erp-space.dark-mode .sidebar small,
.erp-space.dark-mode .sidebar-group > span,
.erp-space.dark-mode .dashboard-header p,
.erp-space.dark-mode .dashboard-panel small,
.erp-space.dark-mode .kpi-copy small,
.erp-space.dark-mode .kpi-copy em,
.erp-space.dark-mode .activity-item small,
.erp-space.dark-mode .dashboard-alert small {
  color: #E2E8F0;
}

.erp-space.dark-mode .sidebar a.active,
.erp-space.dark-mode .sidebar a:hover {
  border-color: rgba(8, 124, 198, 0.45);
  color: #7dd3fc;
  background: #102c46;
}

.erp-space.dark-mode .gauge-track {
  background: conic-gradient(#22c55e 0 var(--stock-percent), #243249 var(--stock-percent) 100%);
}

.erp-space.dark-mode .gauge-track span {
  background: #2D3748;
  box-shadow: inset 0 0 0 1px #4A5568;
}

.erp-space.dark-mode .pie-visual::before {
  background: #2D3748;
}

.erp-space.dark-mode .pie-visual strong,
.erp-space.dark-mode .pie-visual small,
.erp-space.dark-mode .chart-export {
  color: #F7FAFC;
}

.erp-space.dark-mode .chart-export {
  border-color: #4A5568;
  background: #1A202C;
}

.erp-space.dark-mode .heatmap-row span {
  border-color: #4A5568;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .erp-topbar {
    align-items: stretch;
  }

  .erp-search {
    order: 5;
    width: 100%;
    min-width: 100%;
    margin-left: 0;
  }

  .erp-space .sidebar,
  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .erp-sidebar {
    top: auto;
  }

  .sidebar-group {
    align-content: start;
  }

  .dashboard-header,
  .dashboard-chart-grid,
  .dashboard-panels,
  .dashboard-panels-small {
    grid-template-columns: 1fr;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-stats,
  .home-product-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-actions {
    justify-content: flex-start;
  }

  .dashboard-actions small {
    text-align: left;
  }

  .sidebar img,
  .sidebar strong,
  .sidebar small {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  html {
    font-size: 16px;
  }

  .public-topbar,
  .erp-topbar {
    min-height: 70px;
    align-items: center;
  }

  .erp-topbar {
    gap: 8px;
  }

  .erp-user-pill {
    display: none;
  }

  .public-topbar .brand img,
  .erp-topbar .brand img {
    width: 118px;
    height: 46px;
  }

  .main-nav {
    top: 70px;
  }

  .hero {
    gap: 20px;
    padding: 28px 18px;
  }

  .hero h1,
  .page-head h1,
  .section-heading h1 {
    font-size: clamp(1.65rem, 9vw, 2.35rem);
  }

  .section-heading h2,
  .page-head h1,
  .erp-hero h1 {
    font-size: clamp(1.35rem, 6.5vw, 1.9rem);
  }

  .hero p,
  .page-head p,
  .section-heading p,
  .card p,
  .module-card p,
  .feature-grid p,
  .contact-card p,
  .split p {
    font-size: 1rem;
  }

  .public-summary {
    padding: 18px;
  }

  .button {
    width: 100%;
    min-height: 48px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    padding: 30px 18px;
  }

  .footer-bottom {
    display: grid;
    padding: 16px 18px;
  }

  .sidebar {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .sidebar-group > span {
    padding-top: 10px;
  }

  .dashboard-kpi-grid,
  .quick-stat-grid,
  .dashboard-shortcuts,
  .public-stats,
  .home-product-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-alert {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .chart-legend.three {
    grid-template-columns: 1fr;
  }

  .pie-chart {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .dashboard-alert small {
    grid-column: 2;
  }

  .dashboard-actions .button {
    width: auto;
  }

  .erp-content,
  .cms-workspace {
    padding: 16px;
  }

  .erp-topbar {
    flex-wrap: wrap;
  }

  .erp-topbar .language-switcher {
    width: auto;
  }

  .data-table {
    min-width: 720px;
  }
}

/* EGUIFEP expert visual direction — aliased onto the canonical tokens above
   so "navy"/"soft surface"/"muted text" resolve to one color everywhere,
   including through CMS-configurable --brand/--accent overrides. */
:root {
  --surface: var(--white);
  --surface-2: var(--soft);
  --navy: var(--accent);
  --text-soft: var(--muted);
}

body {
  font-size: 0.96rem;
}

.topbar,
.erp-topbar {
  padding-top: 10px;
  padding-bottom: 10px;
}

.main-nav a,
.sidebar a,
.button,
label,
input,
select,
textarea {
  font-size: 0.94rem;
}

.eyebrow {
  font-size: 0.74rem;
}

.page-hero-pro {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(8, 124, 198, 0.08), rgba(245, 160, 42, 0.08)),
    var(--surface);
}

.page-hero-pro > div {
  display: grid;
  gap: 14px;
  align-content: center;
}

.page-hero-pro h1 {
  max-width: 820px;
  font-size: clamp(1.75rem, 3.8vw, 2.75rem);
  line-height: 1.1;
}

.page-hero-pro p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.72;
}

.page-hero-pro img {
  min-height: 340px;
  border: 1px solid rgba(220, 228, 239, 0.8);
}

.pro-band {
  background: var(--surface-2);
}

.compact-heading {
  max-width: 920px;
}

.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-grid article {
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: 8px;
  background: var(--surface);
}

.compact-grid article:nth-child(2n) {
  border-top-color: var(--brand-2);
}

.pro-cards {
  align-items: stretch;
}

.pro-cards .card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.pro-cards .card > *:last-child {
  margin-top: auto;
  padding-top: 4px;
}

.card-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-topline small,
.product small {
  color: var(--text-soft);
  font-weight: 850;
}

.pro-cards .card h2 {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 1.2;
}

.pro-cards .card p {
  margin: 0;
  font-size: 0.96rem;
}

.pro-cards .card .button {
  align-self: end;
  margin-top: 4px;
}

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

.timeline-card {
  position: relative;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.06);
}

.timeline-card span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy);
  font-weight: 900;
}

.timeline-card h2 {
  margin: 16px 0 8px;
  font-size: 1.02rem;
}

.timeline-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.65;
}

.pro-side-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.compact-list span {
  padding: 10px 12px;
  font-size: 0.94rem;
}

.form {
  gap: 12px;
}

.form input,
.form textarea,
.form select {
  min-height: 44px;
  background: #fbfdff;
}

.form textarea {
  min-height: 124px;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted, #607085);
  font-size: 0.82rem;
}

.form-recap {
  border: 1px solid var(--line, #dce4ef);
  border-radius: 12px;
  background: var(--soft, #f3f7fb);
  padding: 16px 18px;
  margin: 6px 0;
}

.form-recap dl {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 6px 16px;
  margin: 10px 0 0;
}

.form-recap dt {
  font-weight: 700;
  color: var(--ink, #172033);
}

.form-recap dd {
  margin: 0;
  color: var(--text-soft, #52657d);
}

.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  color: #075b99;
  background: #eaf6ff;
  font-size: 0.82rem;
  font-weight: 900;
}

@media (max-width: 980px) {
  .compact-grid,
  .timeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    font-size: 0.96rem;
  }

  .main-nav a,
  .sidebar a,
  .button,
  label,
  input,
  select,
  textarea {
    font-size: 0.96rem;
  }

  .page-hero-pro img {
    min-height: 220px;
  }

  .compact-grid,
  .timeline-grid,
  .public-filterbar {
    grid-template-columns: 1fr;
  }

  .timeline-card {
    min-height: auto;
  }
}

/* ERP base layout - Lot structure et layout */
.erp-layout {
  display: block;
  min-height: 100vh;
  color: #18263a;
  background: #eef3f8;
}

body.erp-sidebar-locked {
  overflow: hidden;
}

.erp-sidebar-v2 {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 110;
  display: flex;
  width: 292px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-color: #9db4cb #edf4fb;
  scrollbar-width: thin;
  border-right: 1px solid #d8e3ef;
  background: #ffffff;
  box-shadow: 12px 0 30px rgba(23, 32, 51, 0.06);
}

.erp-sidebar-v2::-webkit-scrollbar {
  width: 8px;
}

.erp-sidebar-v2::-webkit-scrollbar-track {
  background: #edf4fb;
}

.erp-sidebar-v2::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #9db4cb;
}

.erp-sidebar-brand {
  display: flex;
  min-height: 78px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #e0e8f2;
}

.erp-sidebar-brand img {
  width: 126px;
  height: 48px;
  object-fit: contain;
}

@media (min-width: 761px) {
  .erp-sidebar-brand img {
    width: 152px;
    height: 58px;
  }
}

.erp-icon-button {
  display: inline-flex;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  color: #18304f;
  background: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.sidebar-close {
  display: none;
}

.erp-sidebar-profile {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  margin: 16px;
  border: 1px solid #e0e8f2;
  border-radius: 8px;
  padding: 12px;
  background: #f7fafd;
}

.erp-sidebar-profile > span,
.erp-user-menu > span {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  background: #087cc6;
  font-size: 0.78rem;
  font-weight: 900;
}

.erp-sidebar-profile strong,
.erp-user-menu strong {
  display: block;
  color: #162841;
  font-size: 0.9rem;
  line-height: 1.15;
}

.erp-sidebar-profile small,
.erp-user-menu small {
  display: block;
  margin-top: 3px;
  color: #66788d;
  font-size: 0.76rem;
  font-weight: 800;
}

.erp-sidebar-nav {
  display: flex;
  height: auto;
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 14px 16px;
  scrollbar-color: #9db4cb #edf4fb;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.erp-sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.erp-sidebar-nav::-webkit-scrollbar-track {
  background: #edf4fb;
}

.erp-sidebar-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #9db4cb;
}

.erp-nav-group {
  display: grid;
  overflow: hidden;
  border: 1px solid #dbe8f5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 39, 64, 0.04);
}

.erp-nav-group.settings-group {
  margin-top: 8px;
}

.erp-nav-group-toggle {
  display: grid;
  width: 100%;
  min-height: 42px;
  grid-template-columns: 28px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 8px 8px;
  color: #233854;
  background: #f7fbff;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
}

.erp-nav-group-toggle span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-nav-group-toggle b {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #087cc6;
  background: #e8f4fd;
  font-size: 0.9rem;
  line-height: 1;
}

.erp-nav-group.is-open .erp-nav-group-toggle {
  color: #06254a;
  background: #eef7ff;
}

.erp-nav-group.is-open .erp-nav-group-toggle b {
  color: #ffffff;
  background: #087cc6;
}

.erp-nav-group-icon,
.erp-nav-group a i {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #087cc6;
  background: #e8f4fd;
  font-style: normal;
}

.erp-menu-svg {
  width: 15px;
  height: 15px;
}

.erp-nav-group-items {
  display: grid;
  gap: 3px;
  padding: 6px;
}

.erp-nav-group:not(.is-open) .erp-nav-group-items {
  display: none !important;
}

.erp-nav-group.is-open .erp-nav-group-items {
  display: grid !important;
}

.erp-nav-group a {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px 8px;
  color: #40536d;
  font-size: 0.8rem;
  font-weight: 850;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.erp-nav-group a:hover,
.erp-nav-group a.active {
  border-color: #cfe5f8;
  color: #087cc6;
  background: #eef7ff;
}

.erp-nav-group a.active i,
.erp-nav-group a:hover i {
  color: #ffffff;
  background: #087cc6;
}

.erp-sidebar-footer {
  margin: auto 10px 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.erp-space.dark-mode .erp-sidebar-footer {
  border-color: #4A5568;
}

.erp-space.dark-mode .erp-sidebar-footer button,
.erp-space.dark-mode .erp-sidebar-footer button i {
  color: #fca5a1;
}

.erp-space.dark-mode .erp-sidebar-footer button i {
  background: rgba(163, 39, 31, 0.25);
}

.erp-space.dark-mode .erp-sidebar-footer button:hover {
  border-color: rgba(163, 39, 31, 0.4);
  background: rgba(163, 39, 31, 0.14);
}

.erp-space.dark-mode .language-switcher {
  background: #2D3748;
  border-color: #4A5568;
}

.erp-space.dark-mode .widget-gallery {
  border-color: #4A5568;
  background: #2D3748;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.erp-space.dark-mode .widget-gallery-grid article {
  border-color: #4A5568;
  background: #1A202C;
}

.erp-space.dark-mode .widget-gallery-grid strong {
  color: #F7FAFC;
}

.erp-space.dark-mode .widget-gallery-grid small {
  color: #E2E8F0;
}

.erp-space.dark-mode .activity-item > span {
  color: #0877c9;
}

.erp-space.dark-mode .chart-legend,
.erp-space.dark-mode .chart-legend span,
.erp-space.dark-mode .bar-row span {
  color: #E2E8F0;
}

.erp-space.dark-mode .chart-legend strong,
.erp-space.dark-mode .bar-row strong {
  color: #F7FAFC;
}

.erp-space.dark-mode .line-chart strong,
.erp-space.dark-mode .stock-gauge strong {
  color: #F7FAFC;
}

.erp-space.dark-mode .erp-table th,
.erp-space.dark-mode .erp-table td {
  border-color: #4A5568;
}

.erp-space.dark-mode .erp-table th {
  color: #E2E8F0;
  background: #1A202C;
}

.erp-sidebar-footer button {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px 8px;
  color: #a3271f;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 850;
  cursor: pointer;
}

.erp-sidebar-footer button:hover {
  border-color: #f3c6c1;
  background: #fdf1f0;
}

.erp-sidebar-footer button i {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #a3271f;
  background: #fdf1f0;
  font-style: normal;
}

.erp-main-v2 {
  display: grid;
  margin-left: 292px;
  min-width: 0;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
}

.erp-app-header {
  position: sticky;
  top: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: auto minmax(170px, 260px) minmax(220px, 1fr) 150px auto auto auto auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid #d8e3ef;
  padding: 10px 18px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.06);
}

.sidebar-open {
  display: none;
}

.erp-page-title {
  display: grid;
  gap: 2px;
}

.erp-page-title span,
.erp-global-search label,
.erp-period-form label {
  color: #6b7d92;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.erp-page-title h1 {
  margin: 0;
  color: #14253d;
  font-size: clamp(1.02rem, 1.6vw, 1.28rem);
  line-height: 1.15;
}

.erp-global-search,
.erp-period-form {
  display: grid;
  gap: 5px;
}

.erp-global-search {
  position: relative;
}

.erp-search-icon {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #6b7d92;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.erp-global-search input,
.erp-period-form select {
  min-height: 40px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 0 12px;
  color: #17263b;
  background: #f8fbff;
  font-size: 0.9rem;
}

.erp-global-search input {
  padding-left: 34px;
}

.erp-notification {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfe0f2;
  border-radius: 12px;
  color: #0877c9;
  background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(12, 84, 145, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.erp-notification:hover,
.erp-notification:focus-visible {
  border-color: #0877c9;
  color: #ffffff;
  background: linear-gradient(135deg, #0877c9 0%, #0ea5e9 100%);
  box-shadow: 0 14px 30px rgba(8, 119, 201, 0.24);
  transform: translateY(-1px);
}

.erp-notification svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.erp-notification b {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 21px;
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid #ffffff;
  padding: 2px 6px;
  color: #ffffff;
  background: #ef4444;
  font-size: 0.67rem;
  line-height: 1;
  text-align: center;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.34);
}

.erp-user-menu {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  border: 1px solid #d8e3ef;
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  background: #f8fbff;
}

.erp-user-menu strong {
  font-size: 0.85rem;
  white-space: nowrap;
}

.theme-toggle {
  display: inline-flex;
  width: 40px;
  min-width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.erp-logout {
  min-height: 40px;
  white-space: nowrap;
}

.erp-content-v2 {
  min-width: 0;
  padding: clamp(16px, 2.4vw, 28px);
}

.erp-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.erp-grid > [id] {
  scroll-margin-top: 96px;
}

.dashboard-workspace.is-filtered > section:not([hidden]) {
  grid-column: 1 / -1;
}

.erp-grid > *,
.widget-size-full {
  grid-column: span 12;
}

.widget-size-quarter {
  grid-column: span 3;
}

.widget-size-half {
  grid-column: span 6;
}

.widget-size-three-quarter {
  grid-column: span 9;
}

.erp-footer-v2 {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #d8e3ef;
  padding: 14px 20px;
  color: #64758a;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
}

.erp-footer-v2 a {
  color: #087cc6;
}

.erp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  opacity: 0;
  background: rgba(15, 23, 42, 0.46);
  pointer-events: none;
  transition: opacity 300ms ease;
}

.erp-space.dark-mode .erp-layout {
  color: #F7FAFC;
  background: #1A202C;
}

.erp-space.dark-mode .erp-sidebar-v2,
.erp-space.dark-mode .erp-app-header,
.erp-space.dark-mode .erp-footer-v2,
.erp-space.dark-mode .erp-sidebar-profile,
.erp-space.dark-mode .erp-user-menu,
.erp-space.dark-mode .erp-icon-button,
.erp-space.dark-mode .erp-notification {
  border-color: #4A5568;
  color: #8bd3ff;
  background: #2D3748;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.erp-space.dark-mode .erp-app-header {
  background: #1A202C;
}

.erp-space.dark-mode .erp-page-title h1,
.erp-space.dark-mode .erp-sidebar-profile strong,
.erp-space.dark-mode .erp-user-menu strong {
  color: #F7FAFC;
}

.erp-space.dark-mode .erp-page-title span,
.erp-space.dark-mode .erp-global-search label,
.erp-space.dark-mode .erp-period-form label,
.erp-space.dark-mode .erp-sidebar-profile small,
.erp-space.dark-mode .erp-user-menu small,
.erp-space.dark-mode .erp-footer-v2 {
  color: #E2E8F0;
}

.erp-space.dark-mode .erp-nav-group {
  border-color: #4A5568;
  background: #1A202C;
}

.erp-space.dark-mode .erp-nav-group-toggle {
  color: #F7FAFC;
  background: #2D3748;
}

.erp-space.dark-mode .erp-nav-group.is-open .erp-nav-group-toggle {
  color: #F7FAFC;
  background: #102c46;
}

.erp-space.dark-mode .erp-nav-group-icon,
.erp-space.dark-mode .erp-nav-group a i,
.erp-space.dark-mode .erp-nav-group-toggle b {
  color: #7dd3fc;
  background: rgba(8, 124, 198, 0.18);
}

.erp-space.dark-mode .erp-nav-group.is-open .erp-nav-group-toggle b {
  color: #071527;
  background: #7dd3fc;
}

.erp-space.dark-mode .erp-nav-group a {
  color: #E2E8F0;
}

.erp-space.dark-mode .erp-nav-group a:hover,
.erp-space.dark-mode .erp-nav-group a.active {
  border-color: rgba(8, 124, 198, 0.5);
  color: #7dd3fc;
  background: #102c46;
}

.erp-space.dark-mode .erp-global-search input,
.erp-space.dark-mode .erp-period-form select,
.erp-space.dark-mode .theme-toggle {
  border-color: #4A5568;
  color: #F7FAFC;
  background: #1A202C;
}

@media (max-width: 1023px) {
  .erp-layout {
    display: block;
  }

  .erp-sidebar-v2 {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    height: 100dvh;
    max-height: 100dvh;
    transform: translateX(-105%);
    box-shadow: 18px 0 42px rgba(15, 23, 42, 0.22);
    transition: transform 300ms ease;
  }

  .erp-main-v2 {
    margin-left: 0;
  }

  .erp-layout.sidebar-open .erp-sidebar-v2 {
    transform: translateX(0);
  }

  .erp-backdrop {
    display: block;
  }

  .erp-layout.sidebar-open .erp-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-open,
  .sidebar-close {
    display: inline-flex;
  }

  .erp-app-header {
    grid-template-columns: auto minmax(160px, 1fr) minmax(220px, 1.2fr) 140px auto auto;
  }

  .erp-user-menu,
  .erp-logout,
  .language-switcher {
    display: none;
  }
}

@media (max-width: 900px) {
  .erp-app-header {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .erp-global-search,
  .erp-period-form {
    grid-column: 1 / -1;
  }

  .erp-notification-wrap {
    grid-row: 1;
    grid-column: 3;
  }

  .theme-toggle {
    grid-row: 1;
    grid-column: 4;
    width: auto;
  }

  .widget-size-quarter,
  .widget-size-half,
  .widget-size-three-quarter {
    grid-column: span 12;
  }
}

@media (min-width: 901px) and (max-width: 1023px) {
  .widget-size-quarter {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .erp-content-v2 {
    padding: 14px;
  }

  .erp-app-header {
    gap: 9px;
    padding: 10px 12px;
  }

  .erp-page-title h1 {
    font-size: 1rem;
  }

  .erp-notification,
  .theme-toggle {
    min-width: auto;
    width: 40px;
    padding: 0;
  }

  .theme-toggle span {
    font-size: 0;
  }

  .theme-toggle span::before {
    content: "T";
    font-size: 0.82rem;
  }

  .erp-grid {
    grid-template-columns: 1fr;
  }

  .erp-grid > *,
  .widget-size-full,
  .widget-size-quarter,
  .widget-size-half,
  .widget-size-three-quarter {
    grid-column: 1;
  }
}

/* ERP alerts and notifications */
.erp-notification-wrap {
  position: relative;
  /* Extends the wrapper's own hoverable box down past the trigger button
     so the mouse never crosses a "dead" gap on its way to the panel below
     — without this, :hover is lost mid-gap and the panel closes before
     the pointer arrives. */
  padding-bottom: 14px;
  margin-bottom: -14px;
}

.notification-menu {
  position: absolute;
  top: calc(100% - 4px);
  right: 0;
  z-index: 120;
  display: none;
  width: min(340px, 88vw);
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(23, 32, 51, 0.16);
}

.erp-notification-wrap:hover .notification-menu,
.erp-notification-wrap:focus-within .notification-menu {
  display: grid;
  gap: 8px;
}

.notification-menu > strong {
  padding: 6px 8px;
  color: #14253d;
}

.notification-menu a {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border-radius: 8px;
  padding: 9px;
  background: #f7fbff;
}

.notification-menu a:hover {
  background: #eef7ff;
}

.notification-menu b {
  color: #17263b;
  font-size: 0.86rem;
}

.notification-menu small,
.notification-menu p {
  margin: 0;
  color: #64758a;
  font-size: 0.78rem;
  font-weight: 800;
}

.notification-all {
  grid-template-columns: 1fr !important;
  color: var(--brand);
  font-weight: 900;
  text-align: center;
}

.alert-dot {
  display: inline-block;
  width: 9px;
  height: 30px;
  border-radius: 999px;
  background: #087cc6;
}

.alert-dot.alert-critique { background: #ef4444; }
.alert-dot.alert-important { background: #f59e0b; }
.alert-dot.alert-info { background: #087cc6; }
.alert-dot.alert-succes { background: #22c55e; }

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

.alert-stat {
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.07);
}

.alert-stat small {
  color: #64758a;
  font-weight: 900;
}

.alert-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--kpi-color, #087cc6);
  font-size: 1.8rem;
  line-height: 1;
}

.alert-trend {
  display: grid;
  grid-template-columns: repeat(14, minmax(32px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 170px;
}

.alert-trend span {
  display: grid;
  height: 150px;
  align-items: end;
  gap: 6px;
}

.alert-trend b {
  min-height: 8px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #087cc6, #06b6d4);
}

.alert-trend small {
  color: #64758a;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
}

.bulk-actions select {
  max-width: 240px;
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  width: 100%;
}

.filter-panel label {
  min-width: 0;
}

.filter-panel input,
.filter-panel select {
  min-height: 40px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.dashboard-filter-form {
  min-width: min(100%, 860px);
}

.exports-workspace .cms-form {
  gap: 16px;
}

.exports-workspace .form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-editbar {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 10px;
  justify-content: flex-end;
}

.dashboard-editbar select {
  max-width: 220px;
  min-height: 40px;
}

.widget-tools {
  display: none;
  grid-column: 1 / -1;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.dashboard-editing .widget-tools {
  display: flex;
}

.widget-tools button,
.widget-tools select {
  min-height: 32px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 5px 8px;
  color: #18304f;
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
}

.dashboard-editing [data-widget-id] {
  outline: 2px dashed rgba(8, 124, 198, 0.28);
  outline-offset: 4px;
  cursor: grab;
}

[data-widget-id].dragging {
  opacity: 0.55;
}

.widget-gallery {
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.07);
}

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

.widget-gallery-grid article {
  display: grid;
  gap: 9px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 14px;
  background: #f8fbff;
}

.widget-gallery-grid strong {
  color: #14253d;
}

.widget-gallery-grid small {
  color: #64758a;
  line-height: 1.45;
}

.widget-size-quarter { grid-column: span 3; }
.widget-size-half { grid-column: span 6; }
.widget-size-three-quarter { grid-column: span 9; }
.widget-size-full { grid-column: span 12; }

.alert-status-critique {
  color: #991b1b;
  background: #fee2e2;
}

.alert-status-important {
  color: #92400e;
  background: #fef3c7;
}

.alert-status-info {
  color: #075985;
  background: #e0f2fe;
}

.alert-status-succes {
  color: #166534;
  background: #dcfce7;
}

.erp-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 160;
  max-width: 340px;
  border: 1px solid #cfe5f8;
  border-radius: 8px;
  padding: 14px 16px;
  color: #10223d;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(23, 32, 51, 0.18);
  font-weight: 900;
  animation: toast-in 180ms ease;
}

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

.erp-space.dark-mode .notification-menu,
.erp-space.dark-mode .alert-stat,
.erp-space.dark-mode .erp-toast {
  border-color: #4A5568;
  background: #2D3748;
}

.erp-space.dark-mode .notification-menu a {
  background: #1A202C;
}

.erp-space.dark-mode .notification-menu > strong,
.erp-space.dark-mode .notification-menu b,
.erp-space.dark-mode .erp-toast {
  color: #F7FAFC;
}

@media (max-width: 760px) {
  .alert-stat-grid {
    grid-template-columns: 1fr;
  }

  .filter-panel,
  .exports-workspace .form-row,
  .widget-gallery-grid {
    grid-template-columns: 1fr;
  }

  .alert-trend {
    overflow-x: auto;
    grid-template-columns: repeat(14, 46px);
  }
}

/* ERP dashboard refinement */
.dashboard-workspace {
  align-items: start;
}

.dashboard-header.dashboard-customizer {
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 14px 18px;
  min-width: 0;
  padding: 22px;
}

.dashboard-intro {
  min-width: 0;
}

.dashboard-intro h1 {
  max-width: 760px;
}

.dashboard-intro p:not(.eyebrow) {
  max-width: 760px;
  line-height: 1.55;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.dashboard-actions small {
  flex-basis: 100%;
  text-align: right;
  color: #64758a;
}

.dashboard-filter-drawer {
  position: relative;
}

.dashboard-filter-drawer summary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
  color: #153257;
  background: #ffffff;
}

.dashboard-filter-drawer[open] summary {
  border-color: #087cc6;
  color: #087cc6;
}

.dashboard-filter-form {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: min(860px, calc(100vw - 48px));
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 32, 55, 0.18);
}

.dashboard-editbar {
  align-items: center;
}

.dashboard-editbar .button,
.dashboard-editbar select {
  min-height: 38px;
}

.erp-modules-heading h2 {
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
}

.erp-modules-heading p:not(.eyebrow) {
  max-width: 760px;
  color: #64758a;
}

.module-console {
  display: grid;
  gap: 14px;
}

.module-console .module-toolbar {
  grid-template-columns: minmax(240px, 1fr) minmax(190px, 260px) minmax(180px, 240px);
  gap: 12px;
  padding: 12px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  background: #ffffff;
}

.module-toolbar-clean {
  grid-template-columns: 1fr;
}

.module-search-field {
  position: relative;
}

.module-search-field input {
  max-width: 420px;
  padding-left: 38px;
  padding-right: 52px;
}

.module-search-icon {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

.module-search-icon svg {
  width: 17px;
  height: 17px;
}

.module-search-kbd {
  position: absolute;
  right: 10px;
  bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.72rem;
  font-weight: 800;
  font-family: inherit;
  pointer-events: none;
}

.module-header-modern {
  display: flex;
  align-items: center;
  gap: 14px;
}

.module-header-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  background: #eef6ff;
  color: #087cc6;
}

.module-header-icon svg {
  width: 22px;
  height: 22px;
}

.module-header-modern h2 {
  margin: 0;
}

.module-header-modern p {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.module-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 2px;
}

.module-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.module-stat-badge svg {
  width: 14px;
  height: 14px;
}

.module-stat-badge.tone-neutral {
  color: #087cc6;
  background: #eef6ff;
}

.module-stat-badge.tone-success {
  color: #087443;
  background: #ecfdf3;
}

.module-stat-badge.tone-danger {
  color: #be123c;
  background: #fff1f2;
}

.module-pill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.module-pill-row-secondary {
  padding-bottom: 4px;
  border-bottom: 1px solid #eef3f8;
}

.module-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: #14253d;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.module-pill svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.module-pill.is-active {
  border-color: var(--brand);
  color: #087cc6;
  background: #eef8ff;
}

.module-pill-ghost {
  min-height: 28px;
  font-size: 0.78rem;
}

.module-pill-ghost svg {
  width: 13px;
  height: 13px;
}

.module-pill.tone-blue.is-active { border-color: #1A3E7A; color: #1A3E7A; background: rgba(26, 62, 122, 0.1); }
.module-pill.tone-green.is-active { border-color: #27AE60; color: #1e8449; background: rgba(39, 174, 96, 0.1); }
.module-pill.tone-orange.is-active { border-color: #F39C12; color: #b9770e; background: rgba(243, 156, 18, 0.12); }
.module-pill.tone-teal.is-active { border-color: #00A3B2; color: #007a85; background: rgba(0, 163, 178, 0.1); }
.module-pill.tone-purple.is-active { border-color: #6C63FF; color: #4a41e0; background: rgba(108, 99, 255, 0.1); }
.module-pill.tone-amber.is-active { border-color: #F5A623; color: #b9791a; background: rgba(245, 166, 35, 0.12); }

.module-card-icon.domain-formation, .module-group-icon.domain-formation { color: #1A3E7A; background: rgba(26, 62, 122, 0.1); }
.module-card-icon.domain-vente, .module-group-icon.domain-vente { color: #27AE60; background: rgba(39, 174, 96, 0.1); }
.module-card-icon.domain-stock, .module-group-icon.domain-stock { color: #F39C12; background: rgba(243, 156, 18, 0.12); }
.module-card-icon.domain-finance, .module-group-icon.domain-finance { color: #00A3B2; background: rgba(0, 163, 178, 0.1); }
.module-card-icon.domain-administration, .module-group-icon.domain-administration { color: #6C63FF; background: rgba(108, 99, 255, 0.1); }
.module-card-icon.domain-site_public, .module-group-icon.domain-site_public { color: #F5A623; background: rgba(245, 166, 35, 0.12); }

.module-group-list {
  display: grid;
  gap: 14px;
}

.module-group {
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(23, 32, 51, 0.06);
  overflow: hidden;
}

.module-group > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #e7eef7;
  background: #f8fbff;
  cursor: pointer;
  list-style: none;
}

.module-group > summary::-webkit-details-marker {
  display: none;
}

.module-group > summary::before {
  content: '▸';
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 1.1rem;
  transition: transform 0.15s ease;
}

.module-group[open] > summary::before {
  transform: rotate(90deg);
}

.module-group-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  color: #087cc6;
  background: #eef8ff;
}

.module-group-icon svg {
  width: 18px;
  height: 18px;
}

.module-group-heading {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.module-group-heading strong {
  color: #14253d;
  font-size: 1rem;
  line-height: 1.25;
}

.module-group-heading small {
  color: #64758a;
  font-size: 0.8rem;
  line-height: 1.35;
}

.module-group-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.module-group-counter svg {
  width: 13px;
  height: 13px;
}

.module-group-counters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-group-counter.tone-success {
  color: #087443;
  background: #ecfdf3;
}

.module-group-counter.tone-danger {
  color: #be123c;
  background: #fff1f2;
}

.module-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  padding: 12px;
}

.module-group.is-animating > .module-card-grid {
  overflow: hidden;
  transition: height 0.22s ease;
}

.module-console .module-card {
  display: grid;
  gap: 4px;
  border: none;
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(23, 32, 51, 0.08), 0 1px 2px rgba(23, 32, 51, 0.05);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.module-console .module-card:hover {
  box-shadow: 0 6px 16px rgba(23, 32, 51, 0.1);
  transform: translateY(-1px);
}

.module-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.module-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 6px;
  color: #087cc6;
  background: #eef8ff;
}

.module-card-icon svg {
  width: 15px;
  height: 15px;
}

.module-card.locked .module-card-icon {
  color: #64758a;
  background: #eef1f4;
}

.module-card strong {
  color: #14253d;
  font-size: 0.85rem;
  line-height: 1.25;
}

.module-console .module-card small {
  display: block;
  margin-top: 0;
  border-radius: 0;
  padding: 0;
  color: #64758a;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .module-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .module-pill {
    font-size: 0.76rem;
    min-height: 28px;
    padding: 0 11px;
  }
}

@media (max-width: 480px) {
  .module-card-grid {
    grid-template-columns: 1fr;
  }
}

.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.module-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  white-space: nowrap;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 900;
}

.module-status svg {
  width: 11px;
  height: 11px;
}

.module-status.is-allowed {
  color: #087443;
  background: #ecfdf3;
}

.module-status.is-locked {
  color: #be123c;
  background: #fff1f2;
}

.module-card-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 3px;
  margin: 2px 0 0;
  color: #64758a;
  font-size: 0.75rem;
  font-weight: 700;
}

.module-card-metric-segment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.module-card-metric-segment + .module-card-metric-segment::before {
  content: '·';
  margin: 0 6px;
  font-weight: 900;
}

.module-card-metric svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.module-card.locked {
  opacity: 0.68;
  background: #fbfcfe;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.download-card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
}

.download-card span {
  color: #087cc6;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.download-card h3 {
  margin: 8px 0 8px;
  color: #14253d;
  font-size: 1rem;
  line-height: 1.25;
}

.download-card p {
  margin: 0;
  color: #64758a;
  font-size: 0.92rem;
  line-height: 1.55;
}

.download-card .button {
  width: fit-content;
}

.form-hint {
  display: block;
  margin: 6px 0 8px;
  color: #64758a;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

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

.schedule-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.schedule-card span {
  color: #087cc6;
  font-weight: 900;
  font-size: 0.82rem;
}

.schedule-card strong {
  color: #14253d;
  font-size: 1.1rem;
}

.schedule-card small {
  color: #64758a;
  line-height: 1.4;
}

.module-empty {
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
}

.dashboard-kpi-grid,
.dashboard-chart-grid,
.dashboard-panels {
  min-width: 0;
}

.widget-size-quarter {
  grid-column: span 6;
}

.erp-space.dark-mode .dashboard-filter-form,
.erp-space.dark-mode .dashboard-filter-drawer summary,
.erp-space.dark-mode .module-console .module-toolbar,
.erp-space.dark-mode .module-group,
.erp-space.dark-mode .module-empty {
  border-color: #4A5568;
  background: #2D3748;
}

.erp-space.dark-mode .module-group > summary {
  border-color: #4A5568;
  background: #2D3748;
}

.erp-space.dark-mode .module-group-heading strong,
.erp-space.dark-mode .module-card strong,
.erp-space.dark-mode .dashboard-filter-drawer summary {
  color: #F7FAFC;
}

.erp-space.dark-mode .module-group-heading small,
.erp-space.dark-mode .module-card-metric {
  color: #A0AEC0;
}

.erp-space.dark-mode .module-card,
.erp-space.dark-mode .module-pill {
  border-color: #4A5568;
  background: #2D3748;
  color: #F7FAFC;
}

.erp-space.dark-mode .download-card,
.erp-space.dark-mode .schedule-card {
  border-color: #4A5568;
  background: #2D3748;
}

.erp-space.dark-mode .download-card h3,
.erp-space.dark-mode .schedule-card strong {
  color: #F7FAFC;
}

.dashboard-grid.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.compact-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.compact-kpis .kpi-card {
  border: 1px solid #d8e3ef;
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.compact-kpis .kpi-card span {
  display: block;
  color: #64758a;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-kpis .kpi-card strong {
  display: block;
  color: #0b1f3a;
  font-size: 1rem;
  margin-top: 5px;
}

.mini-chart {
  align-items: end;
  display: grid;
  grid-template-columns: repeat(6, minmax(26px, 1fr));
  gap: 10px;
  min-height: 160px;
  padding-top: 16px;
}

.mini-chart div {
  align-items: center;
  display: grid;
  gap: 6px;
  height: 145px;
}

.mini-chart span {
  align-self: end;
  background: linear-gradient(180deg, #0d7fc4, #1fbf75);
  border-radius: 5px 5px 0 0;
  min-height: 6px;
  width: 100%;
}

.mini-chart small {
  color: #64758a;
  font-size: 0.7rem;
  text-align: center;
}

.report-bars {
  display: grid;
  gap: 10px;
}

.report-bars p {
  display: grid;
  grid-template-columns: 140px 1fr 100px;
  gap: 10px;
  align-items: center;
  margin: 0;
}

.report-bars span {
  background: #eaf2f8;
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.report-bars i {
  background: #0d7fc4;
  display: block;
  height: 100%;
}

.report-bars em {
  color: #52657d;
  font-style: normal;
  font-size: 0.78rem;
  text-align: right;
}

.compact-table .data-table th,
.compact-table .data-table td {
  font-size: 0.78rem;
  padding: 8px;
}

.erp-space.dark-mode .compact-kpis .kpi-card {
  background: #2D3748;
  border-color: #4A5568;
}

.erp-space.dark-mode .compact-kpis .kpi-card strong {
  color: #F7FAFC;
}

@media (max-width: 1180px) {
  .compact-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid.two-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .compact-kpis,
  .mini-chart {
    grid-template-columns: 1fr;
  }

  .mini-chart {
    min-height: auto;
  }

  .mini-chart div {
    grid-template-columns: 1fr 70px;
    height: auto;
  }

  .mini-chart span {
    height: 9px !important;
    width: 100%;
  }

  .report-bars p {
    grid-template-columns: 1fr;
  }

  .report-bars em {
    text-align: left;
  }
}

@media (max-width: 1180px) {
  .dashboard-header.dashboard-customizer {
    grid-template-columns: 1fr;
  }

  .dashboard-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .dashboard-actions small {
    text-align: left;
  }

  .dashboard-filter-form {
    left: 0;
    right: auto;
  }

  .module-console .module-toolbar {
    grid-template-columns: 1fr;
  }

  .download-grid,
  .schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-header.dashboard-customizer {
    padding: 16px;
  }

  .dashboard-filter-form {
    position: static;
    min-width: 0;
    margin-top: 8px;
    box-shadow: none;
  }

  .module-group > header {
    align-items: flex-start;
  }

  .module-card-grid {
    grid-template-columns: 1fr;
  }

  .download-grid,
  .schedule-grid {
    grid-template-columns: 1fr;
  }
}

.virtual-room {
  display: grid;
  gap: 1rem;
}

.virtual-stage {
  align-items: center;
  aspect-ratio: 16 / 8;
  background:
    linear-gradient(135deg, rgba(0, 118, 191, .88), rgba(10, 34, 64, .95)),
    radial-gradient(circle at 20% 20%, rgba(255, 149, 23, .35), transparent 28%);
  border-radius: 8px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
  padding: 1.5rem;
  text-align: center;
}

.virtual-stage strong {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.virtual-stage small {
  color: rgba(255, 255, 255, .82);
  max-width: 620px;
}

.discussion-reply {
  background: #f6f9fc;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  margin-top: .75rem;
  padding: .85rem;
}

.discussion-reply p {
  margin: 0 0 .35rem;
}

.compact-form {
  margin-top: 1rem;
}

.inline-form {
  display: inline-flex;
  margin: .35rem .35rem .35rem 0;
}

.activity-item.wide {
  align-items: flex-start;
}

.sales-request-panel {
  margin-top: 18px;
}

.quote-panel {
  gap: 18px;
  margin-top: 18px;
}

.quote-head,
.quote-actions,
.quote-bottom-grid,
.quote-history-grid {
  display: flex;
  gap: 14px;
}

.quote-head {
  align-items: flex-start;
  justify-content: space-between;
}

.quote-head h2 {
  margin-bottom: 6px;
}

.quote-status,
.quote-actions {
  align-items: center;
  flex-wrap: wrap;
}

.quote-meta-grid,
.quote-history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.quote-meta-grid article,
.quote-history-grid article,
.quote-bottom-grid > div,
.quote-totals {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.quote-meta-grid span {
  color: var(--brand);
  display: block;
  font-size: .76rem;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.quote-meta-grid strong,
.quote-meta-grid small {
  display: block;
}

.quote-table-wrap {
  overflow-x: auto;
}

.quote-lines-table {
  border-collapse: collapse;
  min-width: 820px;
  width: 100%;
}

.quote-lines-table th,
.quote-lines-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.quote-lines-table th {
  color: var(--brand);
  font-size: .76rem;
  text-transform: uppercase;
}

.quote-line-thumb {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-width: 86px;
  object-fit: cover;
  width: 86px;
}

.quote-bottom-grid {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.quote-totals {
  display: grid;
  gap: 8px;
  margin: 0;
}

.quote-totals div {
  display: flex;
  justify-content: space-between;
}

.quote-totals dt {
  color: var(--muted);
  font-weight: 800;
}

.quote-totals dd {
  color: var(--ink);
  font-weight: 900;
  margin: 0;
}

.quote-totals .grand-total {
  border-top: 1px solid var(--line);
  color: var(--brand);
  padding-top: 10px;
}

.quote-actions form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.quote-actions select {
  min-height: 44px;
  min-width: 170px;
}

.sales-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.sales-actions-grid .wide {
  grid-column: 1 / -1;
}

.sales-transform-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 760px) {
  .sales-actions-grid {
    grid-template-columns: 1fr;
  }

  .quote-head,
  .quote-actions form {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-meta-grid,
  .quote-bottom-grid,
  .quote-history-grid {
    grid-template-columns: 1fr;
  }

  .quote-actions,
  .quote-actions form,
  .quote-actions .button {
    width: 100%;
  }

  .input-action-row {
    flex-direction: column;
  }
}

.module-card-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.module-card-header small {
  color: #66758a;
  font-weight: 800;
}

.certificate-print-page {
  background: #eef3f8;
  margin: 0;
  padding: 20px;
}

.certificate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 0 auto 18px;
}

.certificate-sheet {
  aspect-ratio: 297 / 210;
  background: #fff;
  box-shadow: 0 20px 60px rgba(20, 40, 70, .18);
  container-name: cert;
  container-type: inline-size;
  height: auto;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  width: min(1123px, calc(100vw - 32px));
}

.certificate-template-bg {
  background: #fff url("/assets/images/certificate-eguifep-template.png") center / 100% 100% no-repeat;
}

/* Content wrapper: a single flex column keeps every section in normal
   document flow, so longer names/text push siblings down instead of
   overlapping them. Percent padding keeps clear of the printed border
   and corner ribbons baked into the background artwork. */
.cert-border {
  display: flex;
  flex-direction: column;
  inset: 0;
  padding: 6.6% 7.4% 6.9%;
  position: absolute;
  z-index: 2;
}

.cert-header {
  align-items: flex-start;
  display: flex;
  flex: 0 0 auto;
  gap: clamp(14px, 2.4cqw, 32px);
}

.cert-brand,
.cert-brand-spacer {
  flex: 0 0 auto;
  width: clamp(128px, 18%, 200px);
}

.cert-brand img {
  display: block;
  height: auto;
  width: 100%;
}

.cert-company {
  flex: 1 1 auto;
  text-align: center;
}

.cert-company h2 {
  color: #0b1524;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(14px, 1.85cqw, 23px);
  font-weight: 800;
  letter-spacing: .3px;
  line-height: 1.22;
  margin: 0;
  text-transform: uppercase;
}

.cert-company p {
  color: #155ea6;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(10px, 1.18cqw, 15px);
  font-style: italic;
  font-weight: 700;
  line-height: 1.25;
  margin: clamp(2px, .35cqw, 5px) 0 0;
}

/* Vertically centered body: everything between the header and footer
   sizes to its own content and stays centered as a group, so a two-line
   name or a longer training sentence never collides with a neighbour. */
.cert-body {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: clamp(3px, .55cqw, 9px);
  justify-content: center;
  min-height: 0;
  padding: 0 4%;
  text-align: center;
}

.cert-body h1 {
  color: var(--cert-primary);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(28px, 4.3cqw, 52px);
  font-weight: 400;
  letter-spacing: clamp(5px, .95cqw, 11px);
  line-height: 1.05;
  margin: 0;
  text-transform: uppercase;
}

.cert-title-rule {
  border-top: 5px dotted var(--cert-accent);
  height: 0;
  margin: 0 0 clamp(4px, .6cqw, 10px);
  width: clamp(120px, 22%, 260px);
}

.cert-intro {
  color: #0b1524;
  font-size: clamp(14px, 1.65cqw, 20px);
  line-height: 1.4;
  margin: 0;
  max-width: 850px;
}

.cert-recipient {
  color: var(--cert-primary);
  font-family: "Brush Script MT", "Segoe Script", "Lucida Handwriting", cursive;
  font-size: clamp(32px, 5cqw, 58px);
  font-weight: 400;
  line-height: 1.15;
  margin: clamp(4px, .8cqw, 10px) 0 0;
  max-width: 92%;
}

.cert-line {
  border-top: 3px solid #6c8796;
  height: 0;
  margin: 0;
  width: clamp(160px, 40%, 420px);
}

.cert-training {
  color: #0b1524;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(13px, 1.45cqw, 18px);
  font-style: italic;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  max-width: 780px;
}

.cert-score {
  color: #0b1524;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(11px, 1.2cqw, 14px);
  line-height: 1.2;
  margin: 0;
}

.cert-note,
.cert-warning {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.3;
  margin: 0;
  max-width: 700px;
}

.cert-note {
  color: #0b1524;
  font-size: clamp(11px, 1.2cqw, 14px);
}

.cert-warning {
  color: #47546b;
  font-size: clamp(9px, 1cqw, 12px);
}

.cert-date {
  align-self: flex-end;
  color: #0b1524;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12px, 1.35cqw, 17px);
  font-style: italic;
  font-weight: 700;
  line-height: 1.15;
  margin: clamp(2px, .5cqw, 6px) 0 0;
}

.cert-footer {
  align-items: end;
  display: grid;
  flex: 0 0 auto;
  gap: clamp(10px, 2cqw, 24px);
  grid-template-columns: minmax(150px, 24%) minmax(0, 1fr) minmax(150px, 24%);
}

.cert-qr {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cert-qr-number {
  background: #fff36a;
  color: #0b1524;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(11px, 1.2cqw, 15px);
  font-weight: 800;
  line-height: 1.2;
  padding: 2px 8px;
  white-space: nowrap;
}

.qr-image,
.qr-fake {
  background: #fff;
  border: 2px solid #0b1524;
  display: block;
  height: clamp(70px, 8cqw, 96px);
  object-fit: contain;
  width: clamp(70px, 8cqw, 96px);
}

.qr-fake {
  align-items: center;
  background:
    linear-gradient(90deg, #000 12%, transparent 12% 24%, #000 24% 36%, transparent 36% 48%, #000 48% 60%, transparent 60% 72%, #000 72% 84%, transparent 84%),
    linear-gradient(#000 12%, transparent 12% 24%, #000 24% 36%, transparent 36% 48%, #000 48% 60%, transparent 60% 72%, #000 72% 84%, transparent 84%);
  color: transparent;
  display: flex;
  font-size: 1px;
  justify-content: center;
}

.cert-signature {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.cert-signature > strong {
  border-bottom: 3px solid #0b1524;
  color: #0b1524;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(11px, 1.3cqw, 16px);
  font-weight: 800;
  line-height: 1.2;
  padding: 0 clamp(16px, 2cqw, 26px) 3px;
}

.cert-signature-media {
  display: grid;
  height: clamp(44px, 5.8cqw, 66px);
  margin: 1px 0;
  place-items: center;
  position: relative;
  width: clamp(98px, 12.4cqw, 144px);
}

.cert-cachet-img,
.cert-signature-img {
  display: block;
  max-width: 100%;
  object-fit: contain;
  position: absolute;
}

.cert-cachet-img {
  height: clamp(40px, 5.2cqw, 60px);
  opacity: .92;
  width: clamp(40px, 5.2cqw, 60px);
  z-index: 1;
}

.cert-signature-img {
  height: clamp(28px, 3.7cqw, 44px);
  transform: translateY(-8%);
  width: clamp(57px, 7.5cqw, 89px);
  z-index: 2;
}

.cert-signature b {
  color: #0b1524;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(11px, 1.3cqw, 16px);
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

/* ERP KPI responsive grid: column count is handled by auto-fit/minmax
   on the base rule above; this block only tunes card density/typography
   per breakpoint. */
.dashboard-kpi-grid {
  align-items: stretch;
}

.dashboard-kpi {
  grid-template-columns: 50px minmax(0, 1fr);
  min-height: 132px;
  gap: 14px;
  padding: 20px;
}

.kpi-icon {
  width: 50px;
  height: 50px;
  font-size: 1.875rem;
  line-height: 1;
}

.kpi-copy small,
.kpi-copy em,
.kpi-trend {
  font-size: 0.875rem;
}

.kpi-copy strong {
  font-size: 1.75rem;
  word-break: break-word;
}

.kpi-more-toggle {
  display: none;
  grid-column: 1 / -1;
  min-height: 44px;
  border: 1px solid #cfe0f2;
  border-radius: 8px;
  color: #087cc6;
  background: #ffffff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

@media (max-width: 1023px) and (min-width: 768px) {
  .dashboard-kpi-grid {
    gap: 12px;
  }

  .dashboard-kpi {
    min-height: 92px;
    padding: 16px;
  }
}

@media (max-width: 767px) and (min-width: 640px) {
  .dashboard-kpi-grid {
    gap: 12px;
  }

  .dashboard-kpi {
    min-height: 88px;
    padding: 15px;
  }
}

@media (max-width: 639px) {
  .dashboard-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .dashboard-kpi {
    min-height: 84px;
    padding: 12px;
  }

  .kpi-copy small,
  .kpi-copy em,
  .kpi-trend {
    font-size: 0.75rem;
  }

  .kpi-copy strong {
    font-size: 1.25rem;
  }

}

/* Show only the first 4 "hero" KPIs by default, on every screen size —
   the rest stay one click away behind "Voir plus d'indicateurs" so the
   dashboard opens on a handful of headline numbers, not a wall of tiles. */
.dashboard-kpi-grid:not(.show-all-kpis) .dashboard-kpi:nth-of-type(n+9) {
  display: none;
}

.kpi-more-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ERP chart responsive layout: auto-fit lets charts reflow to 1-3 columns
   depending on available width instead of a fixed 2-column breakpoint list. */
.dashboard-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.chart-panel {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  gap: 14px;
}

.chart-panel .panel-heading {
  flex: 0 0 auto;
}

.line-chart,
.pie-chart,
.bar-chart,
.stock-gauge,
.heatmap-chart {
  min-height: 300px;
}

.line-chart {
  align-content: stretch;
}

.line-chart svg {
  min-height: 260px;
  height: 300px;
}

.bar-chart {
  align-content: center;
}

.bar-row div {
  background: #edf4fb;
}

.bar-row div b {
  background: linear-gradient(90deg, #087cc6, #22c55e);
}

.pie-chart {
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr);
}

.pie-visual {
  width: min(220px, 100%);
}

.chart-legend {
  align-content: center;
  font-size: 0.86rem;
  line-height: 1.35;
}

.line-chart text,
.heatmap-hours span,
.heatmap-row strong {
  font-size: 0.75rem;
}

.line-chart circle {
  r: 4;
}

.chart-more-toggle {
  display: none;
  grid-column: 1 / -1;
  min-height: 44px;
  border: 1px solid #cfe0f2;
  border-radius: 8px;
  color: #087cc6;
  background: #ffffff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

@media (max-width: 1023px) {
  .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel {
    min-height: 280px;
    padding: 16px;
  }

  .line-chart,
  .pie-chart,
  .bar-chart,
  .stock-gauge,
  .heatmap-chart {
    min-height: 250px;
  }

  .line-chart svg {
    min-height: 230px;
    height: 260px;
  }

  .pie-chart {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .pie-visual,
  .gauge-track {
    width: min(210px, 68vw);
  }
}

@media (max-width: 639px) {
  .chart-panel {
    min-height: 240px;
    gap: 10px;
    padding: 12px;
  }

  .chart-panel .panel-heading {
    gap: 8px;
  }

  .chart-export {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 0.74rem;
  }

  .line-chart,
  .pie-chart,
  .bar-chart,
  .stock-gauge,
  .heatmap-chart {
    min-height: 200px;
  }

  .line-chart svg {
    min-height: 200px;
    height: 220px;
  }

  .line-chart text,
  .heatmap-hours span,
  .heatmap-row strong,
  .chart-legend {
    font-size: 0.72rem;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pie-visual,
  .gauge-track {
    width: min(188px, 66vw);
  }

  .pie-chart.is-doughnut .pie-visual::before,
  .pie-visual::before {
    inset: 42px;
  }

  .pie-chart:not(.is-doughnut) .pie-visual::before {
    inset: 58px;
  }

  .dashboard-chart-grid:not(.show-all-charts) .chart-panel:nth-of-type(n+3) {
    display: none;
  }

  .chart-more-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ERP responsive data tables */
.table-wrap,
.erp-table-wrap,
.table-responsive,
.quote-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  scrollbar-color: #9db4cb #edf4fb;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.table-wrap::-webkit-scrollbar,
.erp-table-wrap::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.quote-table-wrap::-webkit-scrollbar {
  height: 9px;
}

.table-wrap::-webkit-scrollbar-track,
.erp-table-wrap::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.quote-table-wrap::-webkit-scrollbar-track {
  background: #edf4fb;
}

.table-wrap::-webkit-scrollbar-thumb,
.erp-table-wrap::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.quote-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #9db4cb;
}

.data-table,
.erp-table,
.quote-lines-table,
.table-responsive table {
  min-width: 860px;
  font-size: 0.875rem;
}

.data-table th,
.data-table td,
.erp-table th,
.erp-table td,
.quote-lines-table th,
.quote-lines-table td,
.table-responsive table th,
.table-responsive table td {
  padding: 0.78rem 0.85rem;
  font-size: 0.875rem;
  line-height: 1.35;
}

.data-table th,
.erp-table th,
.quote-lines-table th,
.table-responsive table th {
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.table-actions,
.actions.compact {
  align-items: center;
  gap: 0.45rem;
}

.table-actions a,
.table-actions button,
.actions.compact a,
.actions.compact button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0.52rem 0.7rem;
  white-space: nowrap;
  font-size: 0.8rem;
}

@media (max-width: 1023px) {
  .data-table,
  .erp-table,
  .quote-lines-table,
  .table-responsive table {
    min-width: 760px;
  }

  .data-table th,
  .data-table td,
  .erp-table th,
  .erp-table td,
  .quote-lines-table th,
  .quote-lines-table td,
  .table-responsive table th,
  .table-responsive table td {
    padding: 0.68rem 0.72rem;
    font-size: 0.82rem;
  }

  .table-actions a,
  .table-actions button,
  .actions.compact a,
  .actions.compact button {
    min-height: 34px;
    padding: 0.48rem 0.6rem;
    font-size: 0.76rem;
  }
}

@media (max-width: 639px) {
  .table-wrap,
  .erp-table-wrap,
  .table-responsive,
  .quote-table-wrap {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .responsive-data-table,
  .responsive-data-table thead,
  .responsive-data-table tbody,
  .responsive-data-table tr,
  .responsive-data-table th,
  .responsive-data-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .responsive-data-table {
    border-collapse: separate;
    border-spacing: 0 0.8rem;
    min-width: 0;
  }

  .responsive-data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .responsive-data-table tbody tr {
    border: 1px solid #d8e3ef;
    border-radius: 8px;
    padding: 0.7rem;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(23, 32, 51, 0.06);
  }

  .erp-space.dark-mode .responsive-data-table tbody tr {
    border-color: #4A5568;
    background: #2D3748;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  }

  .erp-space.dark-mode .responsive-data-table td {
    border-bottom-color: #4A5568;
  }

  .erp-space.dark-mode .responsive-data-table td::before {
    color: #A0AEC0;
  }

  .responsive-data-table td {
    display: grid;
    grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
    border-bottom: 1px solid #edf2f7;
    padding: 0.58rem 0;
    font-size: 0.75rem;
  }

  .responsive-data-table td:last-child {
    border-bottom: 0;
  }

  .responsive-data-table td::before {
    content: attr(data-label);
    color: #60748d;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .responsive-data-table td.table-actions,
  .responsive-data-table td:has(.table-actions),
  .responsive-data-table td:has(.actions.compact) {
    grid-template-columns: 1fr;
  }

  .responsive-data-table td.table-actions::before,
  .responsive-data-table td:has(.table-actions)::before,
  .responsive-data-table td:has(.actions.compact)::before {
    margin-bottom: 0.2rem;
  }

  .table-actions,
  .actions.compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
  }

  .table-actions a,
  .table-actions button,
  .actions.compact a,
  .actions.compact button {
    min-width: 44px;
    min-height: 36px;
    padding: 0.42rem 0.48rem;
    font-size: 0;
  }

  .table-actions a::before,
  .table-actions button::before,
  .actions.compact a::before,
  .actions.compact button::before {
    content: attr(data-action-short);
    font-size: 0.72rem;
    font-weight: 900;
  }

  .pagination-wrap {
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
}

/* ERP/public responsive interactive elements */
button,
.button,
input,
select,
textarea,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent);
  outline-offset: 2px;
}

.button,
button.button,
a.button,
.chart-export,
.kpi-more-toggle,
.chart-more-toggle,
.theme-toggle,
.erp-icon-button,
.erp-notification,
.widget-tools button {
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
  text-align: center;
  touch-action: manipulation;
}

.button,
button.button,
a.button {
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.button.primary:hover,
.button.primary:focus-visible {
  border-color: color-mix(in srgb, var(--brand) 85%, black);
  background: color-mix(in srgb, var(--brand) 85%, black);
}

.button.ghost:hover,
.button.ghost:focus-visible,
.button.secondary:hover,
.button.secondary:focus-visible,
.chart-export:hover,
.chart-export:focus-visible,
.kpi-more-toggle:hover,
.kpi-more-toggle:focus-visible,
.chart-more-toggle:hover,
.chart-more-toggle:focus-visible {
  color: color-mix(in srgb, var(--brand) 85%, black);
  background: color-mix(in srgb, var(--brand) 8%, white);
  box-shadow: 0 10px 22px rgba(23, 32, 51, 0.1);
}

.button.danger:hover,
.button.danger:focus-visible {
  border-color: #b91c1c;
  background: #b91c1c;
}

.button[disabled],
button[disabled],
.button.disabled,
button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.actions,
.actions.compact,
.dashboard-actions,
.header-actions,
.filter-actions,
.quote-actions,
.sales-transform-actions,
.certificate-actions,
.input-action-row,
.dashboard-editbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.form-grid,
.filter-panel,
.sales-actions-grid,
.cms-form,
.form {
  min-width: 0;
}

input,
select,
textarea,
.filter-panel input,
.filter-panel select,
.erp-global-search input,
.erp-period-form select,
.dashboard-editbar select,
.widget-tools select,
.quote-actions select,
.cms-form input,
.cms-form select,
.cms-form textarea,
.form input,
.form textarea,
.form select {
  max-width: 100%;
  min-height: 44px;
  border-radius: 8px;
  font-size: 0.95rem;
}

textarea {
  min-height: 112px;
}

.input-action-row {
  align-items: stretch;
}

.input-action-row input,
.input-action-row select {
  flex: 1 1 220px;
}

.input-action-row .button,
.input-action-row button {
  flex: 0 0 auto;
}

.submenu,
.notification-menu,
.dropdown,
.dropdown-menu,
[role="menu"] {
  max-width: min(92vw, 360px);
}

.modal,
.modal-dialog,
.dialog,
[role="dialog"] {
  width: min(100% - 2rem, 34rem);
  max-width: 34rem;
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  border-radius: 8px;
}

@media (max-width: 1023px) {
  .button,
  button.button,
  a.button,
  .chart-export,
  .kpi-more-toggle,
  .chart-more-toggle {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
  }

  .actions,
  .actions.compact,
  .dashboard-actions,
  .header-actions,
  .filter-actions,
  .quote-actions,
  .sales-transform-actions,
  .certificate-actions,
  .dashboard-editbar {
    gap: 0.6rem;
  }

  .modal,
  .modal-dialog,
  .dialog,
  [role="dialog"] {
    width: min(100% - 1.5rem, 28rem);
    max-width: 28rem;
  }
}

@media (max-width: 639px) {
  .button,
  button.button,
  a.button,
  .chart-export,
  .kpi-more-toggle,
  .chart-more-toggle {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .actions,
  .actions.compact,
  .dashboard-actions,
  .header-actions,
  .filter-actions,
  .quote-actions,
  .sales-transform-actions,
  .certificate-actions,
  .input-action-row,
  .dashboard-editbar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .table-actions,
  .actions.compact {
    flex-direction: row;
    align-items: center;
  }

  .table-actions .button,
  .table-actions button,
  .table-actions a,
  .actions.compact .button,
  .actions.compact button,
  .actions.compact a {
    width: auto;
  }

  input,
  select,
  textarea,
  .filter-panel input,
  .filter-panel select,
  .erp-global-search input,
  .erp-period-form select,
  .dashboard-editbar select,
  .widget-tools select,
  .quote-actions select,
  .cms-form input,
  .cms-form select,
  .cms-form textarea,
  .form input,
  .form textarea,
  .form select {
    width: 100%;
    min-height: 44px;
    font-size: 0.875rem;
  }

  .input-action-row input,
  .input-action-row select,
  .input-action-row .button,
  .input-action-row button {
    flex: 1 1 auto;
    width: 100%;
  }

  .submenu,
  .notification-menu,
  .dropdown,
  .dropdown-menu,
  [role="menu"] {
    width: min(100vw - 1rem, 360px);
    max-width: calc(100vw - 1rem);
  }

  .notification-menu {
    right: 0;
    left: auto;
  }

  .modal,
  .modal-dialog,
  .dialog,
  [role="dialog"] {
    inset: 0;
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
}

/* ERP/public responsive typography */
html {
  font-size: 16px;
}

body,
.public-space,
.erp-space {
  font-size: 1rem;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
}

.public-space h1,
.erp-space h1,
.hero h1,
.page-head h1,
.section-heading h1,
.dashboard-header h1,
.dashboard-intro h1,
.erp-page-title h1,
.erp-hero h1 {
  font-size: 2rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.public-space h2,
.erp-space h2,
.section-heading h2,
.dashboard-panel h2,
.erp-modules-heading h2,
.quote-head h2 {
  font-size: 1.55rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.public-space h3,
.erp-space h3,
.card h2,
.module-card h3,
.feature-grid h3,
.module-group-heading strong,
.download-card h3,
.timeline-card h2,
.cms-form h3,
.cms-panel h3 {
  font-size: 1.15rem;
  line-height: 1.28;
  letter-spacing: 0;
}

.hero p,
.page-head p,
.section-heading p,
.dashboard-intro p,
.erp-hero p,
.card p,
.module-card p,
.feature-grid p,
.contact-card p,
.split p,
.public-summary p,
.timeline-card p,
.download-card p,
.dashboard-panel p {
  font-size: 1rem;
  line-height: 1.65;
}

p,
li,
label,
input,
select,
textarea,
button,
.button,
.main-nav a,
.sidebar a,
.erp-nav-group a,
.data-table,
.erp-table {
  font-size: 1rem;
  line-height: 1.5;
}

small,
.eyebrow,
.status,
.status-pill,
.kpi-copy small,
.kpi-copy em,
.kpi-trend,
.chart-legend,
.dashboard-panel small,
.module-card small,
.download-card small,
.notification-menu small {
  font-size: 0.875rem;
  line-height: 1.38;
}

.public-summary,
.dashboard-header,
.dashboard-panel,
.card,
.module-card,
.feature-grid article,
.cms-panel,
.cms-form,
.livewire-panel,
.form {
  gap: 1rem;
}

@media (max-width: 1023px) {
  body,
  .public-space,
  .erp-space {
    font-size: 1rem;
    line-height: 1.55;
  }

  .public-space h1,
  .erp-space h1,
  .hero h1,
  .page-head h1,
  .section-heading h1,
  .dashboard-header h1,
  .dashboard-intro h1,
  .erp-page-title h1,
  .erp-hero h1 {
    font-size: 1.5rem;
    line-height: 1.18;
  }

  .public-space h2,
  .erp-space h2,
  .section-heading h2,
  .dashboard-panel h2,
  .erp-modules-heading h2,
  .quote-head h2 {
    font-size: 1.25rem;
    line-height: 1.24;
  }

  .public-space h3,
  .erp-space h3,
  .card h2,
  .module-card h3,
  .feature-grid h3,
  .module-group-heading strong,
  .download-card h3,
  .timeline-card h2,
  .cms-form h3,
  .cms-panel h3 {
    font-size: 1.05rem;
    line-height: 1.3;
  }

  .hero p,
  .page-head p,
  .section-heading p,
  .dashboard-intro p,
  .erp-hero p,
  .card p,
  .module-card p,
  .feature-grid p,
  .contact-card p,
  .split p,
  .public-summary p,
  .timeline-card p,
  .download-card p,
  .dashboard-panel p {
    font-size: 1rem;
    line-height: 1.58;
  }

  small,
  .eyebrow,
  .status,
  .status-pill,
  .kpi-copy small,
  .kpi-copy em,
  .kpi-trend,
  .chart-legend,
  .dashboard-panel small,
  .module-card small,
  .download-card small,
  .notification-menu small {
    font-size: 0.875rem;
  }
}

@media (max-width: 639px) {
  body,
  .public-space,
  .erp-space {
    font-size: 0.875rem;
    line-height: 1.52;
  }

  .public-space h1,
  .erp-space h1,
  .hero h1,
  .page-head h1,
  .section-heading h1,
  .dashboard-header h1,
  .dashboard-intro h1,
  .erp-page-title h1,
  .erp-hero h1 {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  .public-space h2,
  .erp-space h2,
  .section-heading h2,
  .dashboard-panel h2,
  .erp-modules-heading h2,
  .quote-head h2 {
    font-size: 1.125rem;
    line-height: 1.24;
  }

  .public-space h3,
  .erp-space h3,
  .card h2,
  .module-card h3,
  .feature-grid h3,
  .module-group-heading strong,
  .download-card h3,
  .timeline-card h2,
  .cms-form h3,
  .cms-panel h3 {
    font-size: 1rem;
    line-height: 1.28;
  }

  p,
  li,
  label,
  input,
  select,
  textarea,
  button,
  .button,
  .main-nav a,
  .sidebar a,
  .erp-nav-group a,
  .data-table,
  .erp-table,
  .hero p,
  .page-head p,
  .section-heading p,
  .dashboard-intro p,
  .erp-hero p,
  .card p,
  .module-card p,
  .feature-grid p,
  .contact-card p,
  .split p,
  .public-summary p,
  .timeline-card p,
  .download-card p,
  .dashboard-panel p {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  small,
  .eyebrow,
  .status,
  .status-pill,
  .kpi-copy small,
  .kpi-copy em,
  .kpi-trend,
  .chart-legend,
  .dashboard-panel small,
  .module-card small,
  .download-card small,
  .notification-menu small,
  .responsive-data-table td::before {
    font-size: 0.75rem;
    line-height: 1.35;
  }

  .hero,
  .section,
  .page-head,
  .dashboard-header,
  .dashboard-panel,
  .card,
  .module-card,
  .feature-grid article,
  .cms-panel,
  .cms-form,
  .livewire-panel,
  .form {
    gap: 0.75rem;
  }
}

/* ERP responsive alerts and notifications */
.alert-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

/* Public compact layout + CTA contrast
   Final normalization for public pages: earlier project phases declared
   larger hero/section heights and generic .main-nav link colors several
   times. These scoped rules keep the visitor site compact while preserving
   the CMS-driven structure and the existing filemtime cache-busting. */
.public-space main {
  min-height: 0;
}

.public-space .section,
.public-space .page-head,
.public-space .cards,
.public-space .contact-layout {
  padding-block: clamp(48px, 5vw, 64px);
}

.public-space .hero,
.public-space .page-hero-pro {
  padding-block: clamp(48px, 5vw, 64px);
}

.public-space .image-hero {
  min-height: clamp(360px, 46vh, 480px);
}

.public-space .page-hero-pro img {
  min-height: clamp(240px, 32vw, 320px);
}

.public-space .section.no-pad {
  padding-block: 0 28px;
}

.public-space .section:empty,
.public-space .cards:empty,
.public-space .feature-grid:empty,
.public-space .metric-grid:empty,
.public-space .module-grid:empty,
.public-space .compact-grid:empty,
.public-space .pro-cards:empty {
  display: none;
}

.public-space .section-heading {
  margin-bottom: clamp(14px, 2vw, 22px);
}

.public-space .section-heading:has(+ .cards),
.public-space .section-heading:has(+ .feature-grid),
.public-space .section-heading:has(+ .pro-cards),
.public-space .section-heading:has(+ .compact-grid) {
  margin-bottom: 14px;
}

.public-space .feature-grid,
.public-space .cards,
.public-space .metric-grid,
.public-space .module-grid,
.public-space .compact-grid,
.public-space .pro-cards {
  align-items: start;
  gap: clamp(14px, 2vw, 20px);
}

.public-space .cards {
  justify-content: start;
}

.public-space .card,
.public-space .feature-grid article,
.public-space .module-card,
.public-space .download-card {
  height: auto;
  min-height: 0;
}

.public-space .card p,
.public-space .feature-grid p,
.public-space .module-card p,
.public-space .download-card p,
.public-space .section-heading p,
.public-space .page-head p,
.public-space .hero p {
  font-size: clamp(0.9rem, 1.1vw, 0.98rem);
  line-height: 1.55;
}

.main-nav .header-cta,
.main-nav .header-cta:link,
.main-nav .header-cta:visited,
.main-nav .header-cta:hover,
.main-nav .header-cta:focus,
.main-nav .header-cta:focus-visible,
.main-nav .header-cta:active,
.main-nav .header-cta[aria-disabled="true"],
.main-nav .header-cta.is-disabled {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}

.main-nav .header-cta:hover,
.main-nav .header-cta:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 767px) {
  .public-space .section,
  .public-space .page-head,
  .public-space .cards,
  .public-space .contact-layout,
  .public-space .hero,
  .public-space .page-hero-pro {
    padding-block: 32px 40px;
  }

  .public-space .image-hero {
    min-height: auto;
  }

  .public-space .page-hero-pro img {
    min-height: 220px;
  }

  .public-space .section.no-pad {
    padding-block: 0 22px;
  }

  .public-space .section-heading {
    margin-bottom: 12px;
  }

  .public-space .feature-grid,
  .public-space .cards,
  .public-space .metric-grid,
  .public-space .module-grid,
  .public-space .compact-grid,
  .public-space .pro-cards {
    gap: 12px;
  }
}

.dashboard-alert {
  grid-template-columns: 10px minmax(0, 1fr);
  align-content: start;
  gap: 0.65rem 0.8rem;
  min-height: 88px;
  padding: 0.9rem;
}

.dashboard-alert span {
  grid-row: 1 / span 2;
  align-self: start;
}

.dashboard-alert strong,
.dashboard-alert small {
  min-width: 0;
}

.alert-stat-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.alert-stat {
  min-height: 104px;
  padding: 1rem;
}

.alert-stat strong {
  font-size: 1.55rem;
}

.alert-trend {
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-color: #9db4cb #edf4fb;
  scrollbar-width: thin;
}

.erp-notification-wrap {
  display: inline-flex;
  align-items: center;
}

.erp-notification {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 10px;
}

.erp-notification b {
  top: -7px;
  right: -7px;
  min-width: 20px;
  min-height: 20px;
  padding: 2px 5px;
}

.notification-menu {
  width: min(360px, calc(100vw - 1.5rem));
  max-height: min(70dvh, 420px);
  overflow-y: auto;
}

.notification-menu a {
  min-height: 52px;
}

.erp-toast {
  right: 1rem;
  bottom: 1rem;
  width: min(340px, calc(100vw - 2rem));
  max-width: none;
}

@media (max-width: 1023px) {
  .alert-list,
  .alert-stat-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-alert {
    min-height: 78px;
    padding: 0.8rem;
  }

  .alert-stat {
    min-height: 86px;
    padding: 0.9rem;
  }

  .alert-stat strong {
    font-size: 1.35rem;
  }

  .alert-trend {
    grid-template-columns: repeat(14, minmax(34px, 1fr));
  }

  .notification-menu {
    position: fixed;
    top: 74px;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
}

@media (max-width: 639px) {
  .dashboard-alert {
    grid-template-columns: 8px minmax(0, 1fr);
    min-height: 70px;
    padding: 0.7rem;
  }

  .dashboard-alert span {
    width: 10px;
    height: 10px;
  }

  .alert-stat {
    min-height: 76px;
    padding: 0.75rem;
  }

  .alert-stat strong {
    font-size: 1.2rem;
  }

  .alert-trend {
    min-height: 132px;
  }

  .alert-trend span {
    height: 112px;
  }

  .erp-notification {
    display: inline-flex;
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .notification-menu {
    top: 64px;
    right: 0.5rem;
    left: 0.5rem;
    max-height: min(70dvh, 380px);
    padding: 0.55rem;
  }

  .erp-toast {
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: auto;
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
  }
}

/* ERP final responsive validation fixes */
.erp-sidebar-v2 {
  width: clamp(260px, 19vw, 292px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.erp-sidebar-nav {
  flex: 0 0 auto;
  overflow: visible;
  padding-bottom: 5rem;
}

.erp-main-v2 {
  margin-left: clamp(260px, 19vw, 292px);
}

.erp-app-header {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.5rem, 1vw, 0.85rem);
  align-items: center;
  min-height: auto;
  padding: clamp(0.65rem, 1.4vw, 1rem);
}

.erp-page-title {
  flex: 1 1 clamp(170px, 18vw, 250px);
  min-width: 170px;
}

.erp-page-title h1,
.dashboard-intro h1,
.dashboard-header h1 {
  font-size: clamp(1.15rem, 1.7vw, 1.65rem);
  line-height: 1.18;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}

.erp-global-search {
  flex: 1 1 clamp(210px, 25vw, 360px);
  min-width: 190px;
}

.erp-period-form {
  flex: 0 1 clamp(128px, 14vw, 180px);
  min-width: 128px;
}

.erp-notification-wrap,
.theme-toggle,
.language-switcher,
.erp-user-menu,
.erp-logout,
.erp-app-header > form:last-child,
.erp-app-header > .button {
  flex: 0 0 auto;
}

.erp-app-header > .button,
.erp-logout,
.theme-toggle {
  width: auto;
  min-width: 0;
  padding-inline: clamp(0.7rem, 1.2vw, 1rem);
  font-size: clamp(0.78rem, 0.95vw, 0.9rem);
}

.erp-user-menu {
  max-width: min(240px, 18vw);
}

.erp-content-v2 {
  padding: clamp(0.85rem, 1.8vw, 1.5rem);
}

.dashboard-header.dashboard-customizer {
  grid-template-columns: minmax(0, 1fr) minmax(230px, auto);
  padding: clamp(1rem, 2vw, 1.35rem);
}

.dashboard-actions,
.dashboard-editbar {
  justify-content: flex-end;
}

.dashboard-actions .button,
.dashboard-editbar .button,
.dashboard-editbar select,
.dashboard-filter-drawer summary {
  width: auto;
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  font-size: clamp(0.78rem, 0.95vw, 0.9rem);
}

.dashboard-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}

.dashboard-chart-grid,
.dashboard-panels,
.dashboard-panels-small,
.quick-stat-grid,
.widget-gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

@media (max-width: 1280px) {
  .erp-app-header {
    align-items: start;
  }

  .erp-user-menu {
    display: none;
  }
}

@media (max-width: 1023px) {
  .erp-sidebar-v2 {
    width: min(320px, 88vw);
    overflow-y: auto;
  }

  .erp-main-v2 {
    margin-left: 0;
  }

  .erp-app-header {
    position: sticky;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    align-items: center;
  }

  .erp-page-title {
    min-width: 0;
  }

  .erp-page-title h1 {
    font-size: clamp(1rem, 3vw, 1.28rem);
  }

  .erp-global-search,
  .erp-period-form {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .erp-global-search input,
  .erp-period-form select {
    width: 100%;
  }

  .dashboard-header.dashboard-customizer {
    grid-template-columns: 1fr;
  }

  .dashboard-actions,
  .dashboard-editbar {
    justify-content: flex-start;
  }
}

@media (max-width: 639px) {
  .erp-sidebar-v2 {
    width: min(300px, 92vw);
  }

  .erp-sidebar-nav {
    padding-inline: 0.75rem;
    padding-bottom: 5.5rem;
  }

  .erp-app-header {
    gap: 0.5rem;
    padding: 0.6rem;
  }

  .erp-page-title span {
    font-size: 0.64rem;
  }

  .erp-page-title h1 {
    font-size: clamp(0.98rem, 5vw, 1.15rem);
  }

  .erp-app-header > .button,
  .erp-logout,
  .theme-toggle,
  .language-switcher {
    display: none;
  }

  .dashboard-header.dashboard-customizer {
    padding: 0.85rem;
  }

  .dashboard-actions .button,
  .dashboard-editbar .button,
  .dashboard-editbar select,
  .dashboard-filter-drawer summary {
    width: 100%;
  }
}


@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  .no-print {
    display: none !important;
  }

  .certificate-print-page {
    background: #fff;
    padding: 0;
  }

  .certificate-sheet {
    box-shadow: none;
    height: 100vh;
    width: 100vw;
  }
}

.check-inline {
  align-items: center;
  display: inline-flex;
  gap: .5rem;
}

.registration-long-form {
  gap: 1.2rem;
}

.form-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .8rem;
  padding: 1rem;
}

.form-section h3 {
  font-size: 1rem;
  margin: 0 0 .85rem;
}

.choice-grid,
.module-choice-grid {
  display: grid;
  gap: .7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.module-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-grid label,
.module-choice-grid label {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: .65rem;
  display: flex;
  gap: .55rem;
  padding: .75rem;
}

.erp-table-wrap {
  overflow-x: auto;
  width: 100%;
}

.erp-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
  width: 100%;
}

.erp-table th,
.erp-table td {
  border-bottom: 1px solid var(--line);
  padding: 1rem;
  text-align: left;
  vertical-align: top;
}

.erp-table th {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}

.erp-table td small,
.erp-table td span {
  display: block;
}

.status-pill {
  align-items: center;
  background: #eef6ff;
  border-radius: 999px;
  color: #0568aa;
  display: inline-flex;
  font-size: .78rem;
  font-weight: 800;
  min-height: 1.7rem;
  padding: .25rem .65rem;
  width: fit-content;
}

.status-pill.success {
  background: #ecfdf3;
  color: #087443;
}

.status-pill.danger {
  background: #fff1f2;
  color: #be123c;
}

.status-pill.warning {
  background: #fff7ed;
  color: #b45309;
}

.progress-line {
  background: #e8eef6;
  border-radius: 999px;
  height: .45rem;
  margin-top: .55rem;
  overflow: hidden;
}

.progress-line span {
  background: linear-gradient(90deg, #0568aa, #25c16f);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.learner-course-list {
  display: grid;
  gap: 14px;
}

.learner-course-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--soft);
}

.learner-course-card .progress-line {
  margin-top: 0;
}

.course-progress-label {
  color: var(--muted);
  font-weight: 800;
}

.course-next-session {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.course-next-session.muted {
  color: var(--muted);
  font-weight: 500;
}

.learner-course-card .button {
  justify-self: start;
}

.erp-space.dark-mode .learner-course-card {
  border-color: #4A5568;
  background: #2D3748;
}

.erp-space.dark-mode .course-next-session {
  color: #F7FAFC;
}

.report-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-grid > div {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: 1rem;
}

@media (max-width: 720px) {
  .erp-table {
    min-width: 860px;
  }

  .erp-table th,
  .erp-table td {
    font-size: .9rem;
    padding: .8rem;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .choice-grid,
  .module-choice-grid {
    grid-template-columns: 1fr;
  }

  .virtual-stage {
    aspect-ratio: auto;
    min-height: 180px;
  }
}

/* ERP final typography refinement */
.erp-space,
.erp-main,
.dashboard-workspace,
.dashboard-panel,
.dashboard-header,
.dashboard-kpi,
.erp-sidebar-v2 {
  font-size: clamp(0.82rem, 0.86vw, 0.92rem);
}

.erp-page-title span,
.eyebrow,
.dashboard-actions label,
.dashboard-editbar label,
.panel-heading small,
.dashboard-panel small,
.kpi-copy small,
.kpi-copy em,
.activity-item small,
.dashboard-alert small {
  font-size: clamp(0.68rem, 0.72vw, 0.78rem);
}

.erp-page-title h1,
.dashboard-header h1,
.dashboard-intro h1,
.erp-hero h1 {
  font-size: clamp(1.05rem, 1.35vw, 1.42rem);
  line-height: 1.18;
  font-weight: 800;
}

.dashboard-panel h2,
.erp-modules-heading h2,
.quote-head h2 {
  font-size: clamp(0.98rem, 1.15vw, 1.18rem);
  line-height: 1.22;
  font-weight: 800;
}

.dashboard-intro p,
.erp-hero p,
.dashboard-panel p,
.module-card p,
.feature-grid p,
.public-summary p,
.activity-item,
.dashboard-alert,
.quick-stat,
.erp-table,
.data-table {
  font-size: clamp(0.78rem, 0.82vw, 0.9rem);
  line-height: 1.5;
}

.dashboard-kpi {
  gap: 0.75rem;
  min-height: 108px;
  padding: clamp(0.75rem, 1.2vw, 1rem);
}

.kpi-icon {
  height: clamp(38px, 2.9vw, 46px);
  width: clamp(38px, 2.9vw, 46px);
}

.kpi-copy strong {
  font-size: clamp(1.25rem, 1.65vw, 1.55rem);
  line-height: 1.05;
}

.dashboard-header,
.dashboard-panel {
  padding: clamp(0.9rem, 1.35vw, 1.15rem);
}

.dashboard-actions .button,
.dashboard-editbar .button,
.dashboard-editbar select,
.dashboard-filter-drawer summary,
.erp-topbar .button,
.theme-toggle {
  font-size: clamp(0.74rem, 0.78vw, 0.86rem);
  font-weight: 700;
  min-height: 36px;
  padding: 0.45rem 0.75rem;
}

.erp-nav-group-toggle {
  font-size: clamp(0.76rem, 0.8vw, 0.88rem);
  font-weight: 650;
}

.erp-nav-group-toggle span:not(.erp-nav-group-icon),
.erp-nav-group-items a {
  font-weight: 500;
}

.erp-nav-group-items a {
  font-size: clamp(0.75rem, 0.78vw, 0.86rem);
  line-height: 1.35;
}

.erp-nav-group-items a.active {
  font-weight: 650;
}

.erp-sidebar-profile strong {
  font-size: clamp(0.82rem, 0.88vw, 0.94rem);
  font-weight: 700;
}

.erp-sidebar-profile small {
  font-size: clamp(0.7rem, 0.74vw, 0.8rem);
  font-weight: 500;
}

@media (max-width: 720px) {
  .erp-page-title h1,
  .dashboard-header h1,
  .dashboard-intro h1,
  .erp-hero h1 {
    font-size: 1rem;
  }

  .dashboard-panel h2,
  .erp-modules-heading h2,
  .quote-head h2 {
    font-size: 0.95rem;
  }

  .dashboard-kpi {
    min-height: 92px;
  }
}

/* ERP content-wide lighter dashboard rendering */
.erp-sidebar-profile {
  display: none !important;
}

.erp-content-v2,
.erp-content-v2 input,
.erp-content-v2 select,
.erp-content-v2 textarea,
.erp-content-v2 button,
.erp-content-v2 .button,
.erp-content-v2 table,
.erp-content-v2 .card,
.erp-content-v2 .module-card,
.erp-content-v2 .livewire-panel,
.erp-content-v2 .cms-panel,
.erp-content-v2 .cms-form,
.erp-content-v2 .form-section {
  font-size: clamp(0.76rem, 0.78vw, 0.88rem);
}

.erp-content-v2 p,
.erp-content-v2 li,
.erp-content-v2 td,
.erp-content-v2 dd,
.erp-content-v2 small,
.erp-content-v2 label,
.erp-content-v2 .muted,
.erp-content-v2 .help-text,
.erp-content-v2 .module-card p,
.erp-content-v2 .dashboard-panel p,
.erp-content-v2 .activity-item,
.erp-content-v2 .dashboard-alert,
.erp-content-v2 .quick-stat {
  font-weight: 400;
}

.erp-content-v2 strong,
.erp-content-v2 th,
.erp-content-v2 .status-pill,
.erp-content-v2 .badge,
.erp-content-v2 .button,
.erp-content-v2 button {
  font-weight: 650;
}

.erp-content-v2 h1,
.erp-content-v2 h2,
.erp-content-v2 h3,
.erp-content-v2 h4,
.erp-content-v2 .module-card h3,
.erp-content-v2 .dashboard-panel h2,
.erp-content-v2 .panel-heading strong {
  font-weight: 750;
}

.erp-content-v2 h1,
.erp-content-v2 .dashboard-header h1,
.erp-content-v2 .dashboard-intro h1 {
  font-size: clamp(1rem, 1.22vw, 1.32rem);
}

.erp-content-v2 h2,
.erp-content-v2 .dashboard-panel h2 {
  font-size: clamp(0.92rem, 1.04vw, 1.12rem);
}

.erp-content-v2 h3,
.erp-content-v2 .module-card h3,
.erp-content-v2 .form-section h3 {
  font-size: clamp(0.86rem, 0.96vw, 1rem);
}

.erp-content-v2 .dashboard-header,
.erp-content-v2 .dashboard-panel,
.erp-content-v2 .module-card,
.erp-content-v2 .livewire-panel,
.erp-content-v2 .cms-panel,
.erp-content-v2 .cms-form,
.erp-content-v2 .form-section {
  padding: clamp(0.75rem, 1.05vw, 1rem);
}

.erp-content-v2 .data-table,
.erp-content-v2 .erp-table,
.erp-content-v2 .quote-lines-table,
.erp-content-v2 .table-responsive table {
  font-size: clamp(0.72rem, 0.76vw, 0.84rem);
}

.erp-content-v2 .data-table th,
.erp-content-v2 .data-table td,
.erp-content-v2 .erp-table th,
.erp-content-v2 .erp-table td,
.erp-content-v2 .quote-lines-table th,
.erp-content-v2 .quote-lines-table td {
  padding: clamp(0.55rem, 0.75vw, 0.8rem);
}

.erp-nav-group-toggle span:not(.erp-nav-group-icon),
.erp-nav-group-items a span {
  font-weight: 450;
}

.erp-nav-group-toggle {
  font-weight: 550;
}

.erp-nav-group-items a.active span {
  font-weight: 620;
}

/* ERP compact responsive charts */
.erp-content-v2 .dashboard-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.7rem, 1vw, 1rem);
}

.erp-content-v2 .chart-panel {
  min-height: clamp(230px, 28vw, 300px);
  overflow: hidden;
  gap: clamp(0.55rem, 0.8vw, 0.8rem);
}

.erp-content-v2 .chart-panel .panel-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.6rem;
}

.erp-content-v2 .chart-panel .panel-heading > div,
.erp-content-v2 .chart-panel .panel-heading h2,
.erp-content-v2 .chart-panel .panel-heading small {
  min-width: 0;
}

.erp-content-v2 .chart-panel .panel-heading h2 {
  font-size: clamp(0.82rem, 0.95vw, 1rem);
  line-height: 1.2;
}

.erp-content-v2 .chart-panel .panel-heading small {
  font-size: clamp(0.68rem, 0.72vw, 0.76rem);
  font-weight: 550;
  line-height: 1.25;
}

.erp-content-v2 .chart-export {
  min-height: 32px;
  padding: 0.38rem 0.6rem;
  font-size: clamp(0.7rem, 0.74vw, 0.8rem);
}

.erp-content-v2 .line-chart,
.erp-content-v2 .pie-chart,
.erp-content-v2 .bar-chart,
.erp-content-v2 .stock-gauge,
.erp-content-v2 .heatmap-chart {
  min-height: clamp(145px, 18vw, 210px);
}

.erp-content-v2 .line-chart svg {
  height: clamp(130px, 16vw, 185px);
  min-height: 130px;
}

.erp-content-v2 .line-chart text {
  font-size: 9px;
  font-weight: 600;
}

.erp-content-v2 .line-chart strong {
  font-size: clamp(0.9rem, 1vw, 1.05rem);
}

.erp-content-v2 .pie-chart {
  grid-template-columns: minmax(120px, 165px) minmax(0, 1fr);
  gap: 0.75rem;
}

.erp-content-v2 .pie-visual {
  width: min(160px, 45vw);
}

.erp-content-v2 .pie-chart.is-doughnut .pie-visual::before,
.erp-content-v2 .pie-visual::before {
  inset: 38px;
}

.erp-content-v2 .pie-chart:not(.is-doughnut) .pie-visual::before {
  inset: 48px;
}

.erp-content-v2 .pie-visual strong {
  font-size: clamp(0.8rem, 1vw, 1rem);
}

.erp-content-v2 .pie-visual small {
  font-size: 0.68rem;
  font-weight: 500;
  margin-top: 18px;
}

.erp-content-v2 .stock-gauge {
  padding: 0.25rem 0 0.6rem;
}

.erp-content-v2 .gauge-track {
  width: min(155px, 42vw);
}

.erp-content-v2 .gauge-track strong {
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
}

.erp-content-v2 .gauge-track small,
.erp-content-v2 .chart-legend {
  font-size: clamp(0.68rem, 0.72vw, 0.78rem);
  font-weight: 550;
  line-height: 1.3;
}

.erp-content-v2 .chart-legend {
  min-width: 0;
  overflow-wrap: anywhere;
}

.erp-content-v2 .chart-legend.three {
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
}

.erp-content-v2 .bar-chart {
  gap: 0.55rem;
}

.erp-content-v2 .bar-row {
  gap: 0.5rem;
  grid-template-columns: minmax(80px, 0.85fr) minmax(85px, 1fr) auto;
}

.erp-content-v2 .bar-row strong,
.erp-content-v2 .bar-row span {
  font-size: clamp(0.72rem, 0.76vw, 0.84rem);
  font-weight: 550;
  min-width: 0;
  overflow-wrap: anywhere;
}

.erp-content-v2 .heatmap-chart {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.erp-content-v2 .heatmap-hours,
.erp-content-v2 .heatmap-row {
  gap: 4px;
  grid-template-columns: 34px repeat(11, minmax(24px, 1fr));
  min-width: 460px;
}

.erp-content-v2 .heatmap-row span {
  border-radius: 6px;
  height: 24px;
}

.erp-content-v2 .heatmap-hours span,
.erp-content-v2 .heatmap-row strong {
  font-size: 0.66rem;
  font-weight: 650;
}

.erp-nav-group-toggle span:not(.erp-nav-group-icon) {
  color: #071529;
  font-weight: 750;
}

.erp-space.dark-mode .erp-nav-group-toggle span:not(.erp-nav-group-icon) {
  color: #F7FAFC;
}

@media (max-width: 900px) {
  .erp-content-v2 .chart-panel {
    min-height: auto;
  }

  .erp-content-v2 .pie-chart {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .erp-content-v2 .chart-legend {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .erp-content-v2 .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }

  .erp-content-v2 .chart-panel .panel-heading {
    grid-template-columns: 1fr;
  }

  .erp-content-v2 .chart-export {
    width: fit-content;
  }

  .erp-content-v2 .bar-row {
    grid-template-columns: 1fr;
  }
}


/* Global H1 responsive reduction, excluding certificate artwork */
body:not(.certificate-print-page) .public-space h1,
body:not(.certificate-print-page) .erp-space h1,
body:not(.certificate-print-page) .hero h1,
body:not(.certificate-print-page) .page-head h1,
body:not(.certificate-print-page) .section-heading h1,
body:not(.certificate-print-page) .page-hero-pro h1,
body:not(.certificate-print-page) .erp-hero h1,
body:not(.certificate-print-page) .dashboard-header h1,
body:not(.certificate-print-page) .dashboard-intro h1,
body:not(.certificate-print-page) .erp-page-title h1,
body:not(.certificate-print-page) .login-form h1 {
  font-size: clamp(1.05rem, 2.1vw, 1.85rem);
  line-height: 1.16;
  letter-spacing: 0;
}

body:not(.certificate-print-page) .hero h1 {
  font-size: clamp(1.35rem, 3.2vw, 2.35rem);
}

body:not(.certificate-print-page) .erp-page-title h1,
body:not(.certificate-print-page) .dashboard-header h1,
body:not(.certificate-print-page) .dashboard-intro h1 {
  font-size: clamp(0.98rem, 1.35vw, 1.32rem);
}

@media (max-width: 720px) {
  body:not(.certificate-print-page) .public-space h1,
  body:not(.certificate-print-page) .erp-space h1,
  body:not(.certificate-print-page) .hero h1,
  body:not(.certificate-print-page) .page-head h1,
  body:not(.certificate-print-page) .section-heading h1,
  body:not(.certificate-print-page) .page-hero-pro h1,
  body:not(.certificate-print-page) .erp-hero h1,
  body:not(.certificate-print-page) .dashboard-header h1,
  body:not(.certificate-print-page) .dashboard-intro h1,
  body:not(.certificate-print-page) .erp-page-title h1,
  body:not(.certificate-print-page) .login-form h1 {
    font-size: clamp(0.95rem, 5vw, 1.25rem);
    line-height: 1.18;
  }
}

/* ============================================================
   Compact typography & spacing pass (Facturation & devis)
   Overrides the several duplicate/legacy rules above so titles,
   tabs, buttons, filters, table and sidebar read smaller and
   denser while staying legible. Uses clamp() so sizes ease down
   automatically on tablet/mobile instead of relying on more
   fixed breakpoints. Declared !important because this stylesheet
   has many earlier same-specificity declarations for the same
   selectors (body/h1/h2 in particular) scattered across sections
   added at different times; without it the cascade outcome is
   effectively random depending on source order.
   ============================================================ */

:root {
  --font-xs: clamp(0.66rem, 0.6rem + 0.25vw, 0.72rem);
  --font-sm: clamp(0.7rem, 0.62rem + 0.28vw, 0.76rem);
  --font-base: clamp(0.76rem, 0.66rem + 0.3vw, 0.84rem);
  --font-md: clamp(0.85rem, 0.65rem + 0.5vw, 0.95rem);
  --font-lg: clamp(0.9rem, 0.6rem + 0.9vw, 1.02rem);
}

/* Scoped to .erp-space: these selectors (.button, .section-heading h2,
   .eyebrow, .data-table, .status-pill...) are shared with the public site,
   and the !important density values above previously overrode the public
   site's own (larger, correct) button/heading sizes site-wide — public
   buttons were rendering at 36px/12px instead of the intended 44px/16px. */
.erp-space .erp-page-title h1,
.erp-space .dashboard-header h1,
.erp-space .dashboard-intro h1,
.erp-space .erp-hero h1 {
  font-size: var(--font-lg) !important;
  line-height: 1.25 !important;
}

.erp-space .section-heading h2,
.erp-space .cms-panel h2 {
  font-size: var(--font-md) !important;
  line-height: 1.3 !important;
}

.erp-space .eyebrow {
  font-size: var(--font-xs) !important;
  letter-spacing: 0.06em !important;
  line-height: 1.4 !important;
}

.erp-space .cms-nav a {
  padding: 6px 11px !important;
  font-size: var(--font-sm) !important;
  font-weight: 700 !important;
}

.erp-space .button {
  min-height: 36px !important;
  padding: 7px 14px !important;
  font-size: var(--font-sm) !important;
}

.erp-space .button.icon-only {
  min-height: 32px !important;
  width: 32px !important;
  padding: 0 !important;
}

.erp-space .erp-filterbar label {
  display: block;
  font-size: var(--font-sm) !important;
  font-weight: 700 !important;
  color: var(--muted, #65748a) !important;
  margin-bottom: 4px;
}

.erp-space .erp-filterbar input,
.erp-space .erp-filterbar select {
  min-height: 36px !important;
  padding: 7px 10px !important;
  font-size: var(--font-sm) !important;
}

.erp-space .data-table th {
  font-size: var(--font-xs) !important;
  padding: 0.45rem 0.55rem !important;
  line-height: 1.2 !important;
  white-space: nowrap;
}

.erp-space .data-table td {
  font-size: var(--font-base) !important;
  padding: 0.45rem 0.55rem !important;
  line-height: 1.2 !important;
}

.erp-space .status-pill {
  font-size: var(--font-xs) !important;
  padding: 3px 7px !important;
}

.erp-space .erp-nav-group-toggle {
  min-height: 36px !important;
  font-size: var(--font-sm) !important;
}

/* Archivage */
.archive-type-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px;
}

.archive-type-tile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--tile-color, var(--line));
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  font-size: var(--font-sm, 0.9rem);
  text-decoration: none;
  white-space: nowrap;
}

.archive-type-tile.active {
  background: var(--tile-color, var(--line));
  color: #fff;
  border-color: var(--tile-color, var(--line));
}

.archive-type-tile.ghost {
  border-style: dashed;
  color: var(--muted);
  background: transparent;
}

.archive-type-count {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.78rem;
}

.archive-type-tile.active .archive-type-count {
  background: rgba(255, 255, 255, 0.25);
}

.archive-type-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.archive-document-list {
  display: grid;
  gap: 10px;
}

.archive-document-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.archive-document-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.archive-document-main small {
  display: block;
  color: var(--muted);
}

.archive-document-name {
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  word-break: break-word;
}

.archive-document-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: var(--font-sm, 0.9rem);
  white-space: nowrap;
}

.archive-dropzone {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 24px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: var(--white);
}

.archive-dropzone.dragging {
  border-color: var(--brand, #0d7fc4);
  background: rgba(13, 127, 196, 0.06);
}

.archive-inline-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  margin: 4px 0;
}

.archive-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.archive-choice-btn {
  min-width: 38px;
  min-height: 38px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
}

.archive-choice-btn.selected {
  border-color: var(--ink);
}

.archive-color-dot {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 999px;
  background: var(--dot-color, #ccc);
}

.archive-role-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt, rgba(0, 0, 0, 0.02));
}

.archive-role-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

.archive-preview-placeholder {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 40px 20px;
  text-align: center;
}

.archive-preview-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.archive-access-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.archive-access-log li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.archive-access-log li:last-child {
  border-bottom: none;
}

.archive-access-log small {
  color: var(--muted, #6b7785);
}

.badge {
  display: inline-block;
  font-size: var(--font-xs, 0.75rem);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.erp-space.dark-mode .badge.warning {
  color: #fbbf24;
}

.badge.accent {
  background: rgba(245, 160, 42, 0.16);
  color: #a3650f;
}

.product-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.wa-icon-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  margin: 4px 0;
}

.wa-inline-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

.wa-page-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 0;
}

.wa-widget {
  position: fixed;
  bottom: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.wa-widget-bas_droite {
  right: 24px;
  align-items: flex-end;
}

.wa-widget-bas_gauche {
  left: 24px;
  align-items: flex-start;
}

.wa-floating-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wa-color, #25d366);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.wa-widget-petit .wa-floating-btn {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.wa-widget-grand .wa-floating-btn {
  padding: 16px 22px;
  font-size: 1.05rem;
}

.wa-icon-emoji {
  font-size: 1.2rem;
  line-height: 1;
}

.wa-icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.wa-dropdown {
  background: var(--white, #fff);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  min-width: 260px;
  max-width: 320px;
}

.wa-dropdown-header {
  background: var(--wa-color, #25d366);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-dropdown-header small {
  opacity: 0.9;
}

.wa-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

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

.wa-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.wa-dropdown-item strong {
  display: block;
  font-size: 0.9rem;
}

.wa-dropdown-item small {
  color: #6b7785;
}

@media (max-width: 640px) {
  .wa-widget {
    bottom: 16px;
  }

  .wa-widget-bas_droite {
    right: 16px;
  }

  .wa-widget-bas_gauche {
    left: 16px;
  }

  .wa-dropdown {
    min-width: 220px;
  }
}

@media (max-width: 640px) {
  .archive-document-card {
    grid-template-columns: 1fr;
  }

  .archive-document-meta {
    flex-direction: row;
    gap: 10px;
  }
}

.erp-sidebar-v2 a {
  min-height: 30px !important;
  font-size: var(--font-xs) !important;
}

.maintenance-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 32px;
  background: var(--soft);
}

.maintenance-screen img {
  width: 120px;
  margin-bottom: 12px;
}

.maintenance-screen h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--ink);
}

.maintenance-screen p {
  margin: 0;
  max-width: 480px;
  color: var(--muted);
}

.maintenance-screen .maintenance-return {
  font-weight: 600;
  color: var(--accent);
}

.appearance-preview {
  display: block;
  max-width: 160px;
  max-height: 80px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: var(--white);
}

.appearance-preview-small {
  max-width: 48px;
  max-height: 48px;
}

.field-builder-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 12px;
}

.field-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr auto 1.5fr auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--soft);
}

.field-row .field-options {
  grid-column: 1 / -1;
}

.field-row-actions {
  display: flex;
  gap: 6px;
}

@media (max-width: 900px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ---- Équipe : section sombre ---- */

.team-section {
  background: var(--accent);
  border-radius: 16px;
  padding: clamp(28px, 5vw, 56px);
}

.team-section .section-heading .eyebrow {
  color: var(--brand-2);
}

.team-section .section-heading h2 {
  color: var(--white);
}

/* ---- Fiche principale (Direction mise en avant) ---- */

.team-hero-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  background: #0d1d34;
  border-left: 4px solid var(--brand-2);
  border-radius: 14px;
  padding: clamp(22px, 3vw, 34px);
  margin-bottom: 28px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  color: var(--white);
}

.team-hero-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-hero-avatar-placeholder {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--brand-2);
}

.team-hero-body {
  display: grid;
  align-content: center;
  gap: 6px;
}

.team-hero-eyebrow {
  margin: 0;
  color: var(--brand-2);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.team-hero-body h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.15;
  color: var(--white);
}

.team-hero-role {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
  font-size: 0.98rem;
}

.team-hero-description {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.team-hero-responsibilities {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.team-hero-responsibilities li {
  position: relative;
  padding-left: 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.94rem;
}

.team-hero-responsibilities li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-2);
}

.team-hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.team-hero-contact a,
.team-hero-contact span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.team-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* ---- Autres membres : cartes horizontales ---- */

.team-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.team-member-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  background: var(--white);
  border-left: 4px solid var(--brand-2);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.team-member-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.team-member-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: start;
}

.team-member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-member-avatar-placeholder {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand);
}

.team-member-body {
  display: grid;
  gap: 4px;
  align-content: start;
}

.team-member-body h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.team-member-role {
  margin: 0 0 4px;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.86rem;
}

.team-member-description {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.team-member-responsibilities {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 3px;
}

.team-member-responsibilities li {
  position: relative;
  padding-left: 14px;
  color: var(--muted);
  font-size: 0.84rem;
}

.team-member-responsibilities li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-2);
}

.team-member-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.team-member-contact a,
.team-member-contact span {
  color: var(--muted);
  font-size: 0.82rem;
  word-break: break-word;
}

.team-member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- Page personnelle d'un membre ---- */

.team-detail-head img {
  min-height: 0;
  width: 220px;
  height: 220px;
  border-radius: 16px;
  object-fit: cover;
  justify-self: center;
  align-self: center;
}

.team-detail-avatar-placeholder {
  width: 220px;
  height: 220px;
  border-radius: 16px;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  align-self: center;
  font-size: 3rem;
  color: var(--brand);
  font-weight: 800;
}

@media (max-width: 760px) {
  .team-hero-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .team-hero-photo {
    max-width: 220px;
    margin: 0 auto;
  }

  .team-hero-contact,
  .team-hero-actions {
    justify-content: center;
  }

  .team-members-grid {
    grid-template-columns: 1fr;
  }

  .team-member-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .team-member-photo {
    max-width: 160px;
    margin: 0 auto;
  }

  .team-member-contact {
    align-items: center;
  }

  .team-member-actions {
    justify-content: center;
  }
}

/* ---- Page d'accueil : accès rapides ---- */

.quick-access {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 0 clamp(18px, 4vw, 56px);
  margin: -28px auto 0;
  max-width: 1180px;
  position: relative;
  z-index: 2;
}

.quick-access-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border-radius: var(--radius-md, 12px);
  background: var(--white);
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.1);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.quick-access-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(23, 32, 51, 0.16);
  color: var(--brand);
}

.quick-access-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  color: var(--brand);
  background: var(--soft);
}

/* ---- Présentation (split) ---- */

.home-presentation-image {
  width: 100%;
  height: 100%;
  min-height: 260px;
  border-radius: var(--radius-lg, 16px);
  object-fit: cover;
}

/* ---- Cartes : prix, méta, actions doubles ---- */

.card-price {
  margin: 4px 0 0;
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
}

.card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.section-cta {
  justify-content: center;
  margin-top: 28px;
}

/* ---- Pourquoi choisir EGUIFEP ---- */

.why-us-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.why-us-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  color: var(--brand);
  background: var(--soft);
}

/* ---- Partenaires ---- */

.partners-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  padding: 8px clamp(18px, 4vw, 56px) 0;
}

.partners-strip-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  filter: grayscale(1);
  opacity: 0.75;
  transition: filter 160ms ease, opacity 160ms ease;
}

.partners-strip-item:hover {
  filter: grayscale(0);
  opacity: 1;
}

.partners-strip-item img {
  max-height: 100%;
  max-width: 140px;
  object-fit: contain;
}

/* ---- Appel à l'action final ---- */

.final-cta-section {
  text-align: center;
  background: var(--accent);
  border-radius: var(--radius-lg, 16px);
  padding: clamp(36px, 6vw, 64px) clamp(18px, 4vw, 56px);
  margin: clamp(34px, 6vw, 72px) clamp(18px, 4vw, 56px);
}

.final-cta-section h2 {
  color: var(--white);
  margin: 0 0 10px;
}

.final-cta-section p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 640px;
  margin: 0 auto 20px;
}

.final-cta-section .actions {
  justify-content: center;
}

@media (max-width: 1023px) {
  .quick-access {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: -20px;
  }

  .why-us-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .quick-access {
    margin-top: 0;
    padding-top: 24px;
  }

  .why-us-grid {
    grid-template-columns: 1fr;
  }

  .partners-strip {
    justify-content: center;
  }
}

/* ---- Services : icônes génériques, prix, FAQ ---- */

.service-card-icon {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(8, 124, 198, 0.1), rgba(245, 160, 42, 0.12));
  color: var(--brand);
}

.service-icon-svg {
  width: 42px;
  height: 42px;
}

.service-card {
  border-top: 3px solid var(--brand-2);
}

.card-unit {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.faq-list {
  display: grid;
  gap: 10px;
  max-width: 820px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 10px);
  padding: 14px 18px;
  background: var(--white);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--accent);
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  font-weight: 800;
  color: var(--brand);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

/* ---- Fiche détaillée d'un service ---- */

.service-detail-icon {
  width: 100%;
  min-height: 220px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(8, 124, 198, 0.1), rgba(245, 160, 42, 0.12));
  color: var(--brand);
}

.service-detail-icon .service-icon-svg {
  width: 72px;
  height: 72px;
}

.service-list {
  margin: 10px 0 20px;
}

.service-detail-sidebar {
  align-self: start;
  position: sticky;
  top: 96px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-2);
  border-radius: var(--radius-md, 12px);
  padding: 22px;
  background: var(--white);
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.08);
}

.service-detail-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

.service-detail-actions {
  flex-direction: column;
  align-items: stretch;
  margin-top: 16px;
}

.service-detail-actions .button {
  justify-content: center;
}

@media (max-width: 1023px) {
  .service-detail-sidebar {
    position: static;
  }
}

.card-meta-list {
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 0;
}

.card-meta-list dt {
  font-size: 0.72rem;
}

.card-meta-list dd {
  margin-top: 2px;
}

/* ---- Panneau de traductions (ERP, CRUD générique + pages CMS) ---- */

.translations-panel {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 24px;
}

.translation-locale-tabs {
  display: grid;
  gap: 10px;
}

.translation-locale {
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 8px);
  padding: 12px 16px;
  background: var(--white);
}

.translation-locale summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
}

.translation-locale summary::-webkit-details-marker {
  display: none;
}

.translation-locale summary::after {
  content: "+";
  margin-left: auto;
  color: var(--muted);
}

.translation-locale[open] summary::after {
  content: "\2212";
}

.translation-fields {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.translation-field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.translation-source {
  margin: 4px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.translation-source summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand);
}

.translation-status-select {
  margin-right: auto;
}

.tag.translation-status-missing {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, white);
}

.tag.translation-status-draft {
  color: var(--muted);
  background: var(--soft);
}

.tag.translation-status-to_validate {
  color: color-mix(in srgb, var(--brand-2) 70%, black);
  background: color-mix(in srgb, var(--brand-2) 14%, white);
}

.tag.translation-status-validated {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, white);
}
