/* Design system local : thème clair/sombre, navigation et formulaires accessibles. */
:root {
  --bg: #f5f7fb;
  --surface: #fff;
  --surface-soft: #f8fafd;
  --ink: #1d2a40;
  --muted: #738096;
  --line: #e7ecf3;
  --primary: #315fe9;
  --primary-soft: #edf2ff;
  --success: #28785e;
  --success-bg: #e9f6ef;
  --amber: #9a6818;
  --amber-bg: #fff4da;
  --danger: #bd4548;
  --danger-bg: #fff0f0;
  --sidebar: #111e34;
  --shadow: 0 3px 18px #15284c04;
  --radius: 14px;
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
:root[data-theme="dark"] {
  --bg: #101724;
  --surface: #192232;
  --surface-soft: #1e2a3d;
  --ink: #e5ebf5;
  --muted: #a0afc5;
  --line: #2b374b;
  --primary: #86a8ff;
  --primary-soft: #243655;
  --success: #8dd3ad;
  --success-bg: #213a32;
  --amber: #efc47b;
  --amber-bg: #3d3322;
  --danger: #f39da2;
  --danger-bg: #412b33;
  --sidebar: #0b1220;
  --shadow: none;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #315fe9;
  color: #fff;
  padding: 11px 16px;
  min-height: 42px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:hover,
.button:hover {
  background: #244ec7;
  text-decoration: none;
  box-shadow: 0 3px 8px #15367b14;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.secondary:hover {
  background: var(--surface-soft);
}
.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--line);
}
.danger:hover {
  background: var(--danger-bg);
}
.link-danger {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--danger);
  padding: 4px 8px;
  min-height: 30px;
}
.icon-button {
  background: transparent;
  color: var(--muted);
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 9px;
  min-height: 40px;
}
.icon-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}
.full-width {
  width: 100%;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 30px 18px 20px;
  background: var(--sidebar);
  color: #c7d2e6;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #f5f8ff;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -0.5px;
  margin: 0 10px 28px;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  background: #3565ed;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
}
.brand-mark .icon {
  width: 23px;
  height: 23px;
}
.brand-sub {
  display: block;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 2.4px;
  margin-top: 5px;
  color: #9eaec8;
}
.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #2a3851;
  border-radius: 10px;
  background: #1a2941;
  padding: 11px;
  margin-bottom: 20px;
}
.workspace-avatar {
  display: grid;
  place-items: center;
  background: #344764;
  color: #fff;
  width: 31px;
  height: 31px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}
.workspace > div {
  min-width: 0;
  flex: 1;
}
.workspace > div > span {
  display: block;
  font-size: 10px;
  color: #95a6c1;
  margin-bottom: 4px;
}
.workspace strong {
  font-size: 11px;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace > .icon {
  width: 14px;
  color: #9db1d4;
}
.nav-label {
  color: #778eaf;
  font-size: 9px;
  letter-spacing: 1.5px;
  font-weight: 650;
  margin: 21px 12px 10px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 41px;
  padding: 10px 12px;
  margin: 3px 0;
  border-radius: 7px;
  color: #b6c5dd;
  font-size: 12px;
  font-weight: 500;
}
.sidebar nav a > .icon {
  width: 18px;
  height: 18px;
  color: #91a8c9;
}
.sidebar nav a:hover {
  background: #1b2d48;
  text-decoration: none;
  color: #fff;
}
.sidebar nav a[aria-current="page"] {
  background: #284a91;
  color: #fff;
}
.sidebar nav a[aria-current="page"] > .icon {
  color: #b9cfff;
}
.sidebar nav a > span:not(.count) {
  flex: 1;
}
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #315fe9;
  color: white;
  border-radius: 6px;
  font-size: 10px;
  min-width: 20px;
  height: 18px;
  padding: 0 4px;
  font-weight: 700;
}
[hidden] {
  display: none !important;
}
.sidebar-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #273650;
  padding: 20px 4px 0;
  margin-top: auto;
  gap: 8px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e6edf9;
  min-width: 0;
}
.identity > span:last-child {
  min-width: 0;
}
.identity strong {
  font-size: 11px;
  font-weight: 600;
  display: block;
  max-width: 135px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.identity small {
  display: block;
  color: #90a4c4;
  font-size: 10px;
  margin-top: 5px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dae5fa;
  color: #2a4c90;
  font-size: 11px;
  font-weight: 750;
  flex-shrink: 0;
}
.logout {
  padding: 7px;
  background: transparent;
  color: #829bbc;
  min-height: 34px;
}
.logout:hover {
  background: #263751;
}
.topbar {
  height: 76px;
  position: sticky;
  top: 0;
  z-index: 30;
  margin-left: 250px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  gap: 15px;
}
.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.breadcrumb {
  font-size: 11px;
  color: var(--muted);
}
.breadcrumb span {
  margin: 0 13px;
  color: #b7c3d7;
}
.breadcrumb strong {
  font-weight: 500;
  color: var(--ink);
}
.today {
  font-size: 11px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  padding-right: 18px;
}
.small-avatar {
  width: 32px;
  height: 32px;
}
.notification-link {
  position: relative;
}
.notification-link .count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  font-size: 9px;
}
.mobile-menu {
  display: none;
}
main {
  margin-left: 250px;
  padding: 32px 36px;
  max-width: none;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 18px;
}
.eyebrow {
  display: block;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.7px;
  color: var(--muted);
  margin: 0 0 9px;
}
h1 {
  font-size: 27px;
  letter-spacing: -0.7px;
  margin: 0;
  line-height: 1.25;
  font-weight: 700;
}
h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.2px;
  margin: 0 0 10px;
}
h3 {
  font-size: 14px;
  margin: 8px 0;
}
p {
  line-height: 1.7;
}
.scope-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 11px;
  background: var(--surface);
}
.scope-label .icon {
  width: 13px;
  height: 13px;
}
.welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
  padding: 24px 28px;
  background: var(--primary-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.welcome h2 {
  font-size: 23px;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.welcome p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.welcome .eyebrow {
  color: var(--primary);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 24px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.stat:hover {
  text-decoration: none;
  border-color: var(--primary);
}
.stat-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.stat-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 9px;
}
.stat-icon .icon {
  width: 17px;
  height: 17px;
}
.stat > strong {
  font-size: 29px;
  font-weight: 680;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat > small {
  font-size: 10px;
  color: var(--muted);
}
.stat-warning .stat-icon {
  background: var(--amber-bg);
  color: var(--amber);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}
.dashboard-grid > .panel {
  margin: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 19px;
}
.section-heading h2 {
  margin-bottom: 5px;
}
.section-heading p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.section-heading > a {
  font-size: 11px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-heading > a .icon {
  width: 14px;
}
.panel-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 10px;
}
.amber {
  background: var(--amber-bg);
  color: var(--amber);
}
.activity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.activity:hover {
  text-decoration: none;
}
.activity > div:not(.activity-amount) {
  flex: 1;
  min-width: 0;
}
.activity strong {
  font-size: 12px;
  font-weight: 600;
  display: block;
}
.activity small {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
.activity-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.activity-icon .icon {
  width: 18px;
  height: 18px;
}
.type-entree {
  background: var(--success-bg);
  color: var(--success);
}
.type-sortie {
  background: var(--amber-bg);
  color: var(--amber);
}
.activity-amount {
  text-align: right;
  flex-shrink: 0;
}
.activity-amount strong {
  margin-top: 5px;
  font-size: 11px;
}
.stock-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.stock-alert strong {
  font-size: 12px;
  display: block;
}
.stock-alert small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}
.stock-alert .quantity {
  font-size: 12px;
  white-space: nowrap;
}
.text-danger {
  color: var(--danger);
}
.quick-actions > a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.quick-actions > a > span {
  flex: 1;
}
.quick-actions > a > .icon:first-child {
  color: var(--primary);
}
.quick-actions > a > .icon:last-child {
  width: 15px;
  color: var(--muted);
}
.mini-report {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}
.mini-report > div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 11px;
}
.mini-report h3 {
  font-size: 12px;
}
.mini-report p {
  font-size: 10px;
}
.actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar {
  justify-content: space-between;
  margin: 18px 0;
}
.page-description {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 20px;
}
.toolbar .page-description {
  margin: 0;
}
.search {
  display: flex;
  gap: 8px;
  max-width: 460px;
  align-items: center;
}
.search input {
  min-width: 140px;
}
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.filter-tabs > a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
}
.filter-tabs .active {
  background: var(--surface);
  border-color: var(--line);
  color: var(--primary);
  font-weight: 600;
}
.filter-tabs .icon {
  width: 15px;
  height: 15px;
}
.table-wrap {
  overflow: auto;
  padding: 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
th {
  padding: 15px 19px;
  background: var(--surface-soft);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
td {
  padding: 17px 19px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
td > strong {
  font-size: 12px;
  font-weight: 600;
}
td small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
  max-width: 290px;
  overflow-wrap: anywhere;
}
td .inline {
  display: inline;
}
tbody tr:hover {
  background: var(--surface-soft);
}
td .quantity {
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
tfoot th {
  font-size: 12px;
}
td details {
  min-width: 140px;
  margin-top: 5px;
}
td details[open] {
  min-width: 270px;
}
td details .stack {
  padding-top: 10px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  line-height: 1.4;
  font-weight: 650;
  border-radius: 5px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  white-space: nowrap;
}
.badge-entree,
.badge-validee,
.badge-lu,
.badge-envoie,
.badge-envoye,
.badge-creation {
  color: var(--success);
  background: var(--success-bg);
}
.badge-sortie,
.badge-demandee,
.badge-non_lu,
.badge-demande {
  color: var(--amber);
  background: var(--amber-bg);
}
.badge-transfert,
.badge-modification {
  color: var(--primary);
  background: var(--primary-soft);
}
.badge-refusee,
.badge-echec,
.badge-suppression,
.badge-desactivation {
  color: var(--danger);
  background: var(--danger-bg);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 11px;
}
.pagination > div {
  display: flex;
  gap: 8px;
}
.pagination .button {
  font-size: 11px;
  min-height: 34px;
  padding: 8px 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 21px;
}
.stack {
  display: grid;
  gap: 18px;
}
.full {
  grid-column: 1/-1;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}
.required {
  color: var(--primary);
  font-size: 11px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--ink);
  margin-top: 7px;
  font-size: 13px;
  min-height: 42px;
}
input::placeholder {
  color: var(--muted);
}
input:disabled,
select:disabled {
  background: var(--surface-soft);
  color: var(--muted);
}
input[type="checkbox"] {
  display: inline-block;
  min-height: 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
  padding: 6px 0;
}
.field-hint {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}
select[multiple] {
  min-height: 145px;
}
option {
  padding: 4px;
}
fieldset {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
legend {
  font-weight: 600;
  font-size: 12px;
  padding: 0 7px;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 3px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--primary-soft);
  border-color: var(--primary);
}
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
summary {
  cursor: pointer;
  font-size: 12px;
  padding: 4px 0;
}
details[open] > summary {
  margin-bottom: 20px;
}
.create-panel > summary {
  font-size: 15px;
  font-weight: 600;
}
.create-panel > summary .icon {
  margin-right: 7px;
}
.muted {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--success-bg);
  color: var(--success);
  margin: 20px 0;
  font-size: 12px;
}
.notice .icon {
  margin-top: 1px;
  width: 18px;
  height: 18px;
}
.notice p {
  margin: 6px 0;
}
.notice small {
  font-size: 11px;
}
.notice.error {
  background: var(--danger-bg);
  color: var(--danger);
}
.notice.warning {
  background: var(--amber-bg);
  color: var(--amber);
}
.empty {
  text-align: center;
  padding: 38px 25px;
  color: var(--muted);
}
.empty > .icon {
  width: 31px;
  height: 31px;
  color: var(--muted);
  margin-bottom: 8px;
}
.empty h3 {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.empty p {
  font-size: 11px;
  max-width: 300px;
  margin: 8px auto 0;
}
.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.details dt {
  font-size: 11px;
  color: var(--muted);
}
.details dd {
  font-size: 13px;
  margin: 8px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 40px;
  font-size: 10px;
  color: var(--muted);
}
.footer > span:first-child {
  font-size: 12px;
  font-weight: 650;
}
.version {
  font-size: 8px;
  letter-spacing: 1px;
  margin-left: 9px;
  color: var(--muted);
  font-weight: 400;
}
.guest main {
  margin: 0 auto;
  max-width: 770px;
  padding: 32px 24px;
}
.guest .page-heading h1 {
  font-size: 20px;
}
.auth-card {
  margin: 40px auto;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 38px;
  box-shadow: var(--shadow);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  letter-spacing: -0.8px;
  font-weight: 750;
  margin-bottom: 32px;
}
.auth-brand > .icon {
  color: var(--primary);
  width: 28px;
  height: 28px;
}
.auth-tag {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--primary);
  font-weight: 700;
  display: block;
  margin-bottom: 12px;
}
.auth-card h2 {
  font-size: 27px;
  letter-spacing: -0.7px;
  margin-bottom: 12px;
}
.auth-card .stack {
  margin: 25px 0;
}
.auth-help {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
}
.auth-help p {
  font-size: 10px;
  margin: 0;
}
.auth-help .icon {
  width: 17px;
}
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 75px;
}
.password-toggle {
  position: absolute;
  right: 6px;
  bottom: 5px;
  min-height: 30px;
  padding: 5px 8px;
  font-size: 10px;
  background: transparent;
  color: var(--primary);
}
.password-toggle:hover {
  background: var(--primary-soft);
  box-shadow: none;
}
.step {
  display: inline-grid;
  place-items: center;
  margin-right: 9px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  width: 27px;
  height: 27px;
  font-size: 12px;
}
.order-line {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 11px;
  margin: 18px 0;
}
.line-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 12px;
}
.line-total-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  color: var(--muted);
  font-size: 10px;
}
.line-total {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 7px;
}
.order-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px;
}
.order-summary > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.order-summary span {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
}
#order-total {
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -0.8px;
}
.order-summary small {
  color: var(--muted);
  font-size: 10px;
}
.notification-panel {
  padding: 0;
  overflow: hidden;
}
.notification {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 25px;
  border-bottom: 1px solid var(--line);
}
.notification:last-child {
  border: 0;
}
.notification.unread {
  background: var(--primary-soft);
}
.notification-content {
  flex: 1;
  min-width: 0;
}
.notification-heading {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  font-size: 12px;
}
.notification-heading time {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.notification p {
  font-size: 12px;
  margin: 9px 0;
  overflow-wrap: anywhere;
}
.notification-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notification-meta small {
  font-size: 10px;
  color: var(--muted);
}
.compact {
  padding: 17px 22px;
}
.narrow {
  max-width: 820px;
}
.narrow > .panel-icon {
  margin-bottom: 20px;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 99;
  background: var(--surface);
  padding: 12px;
  border-radius: 7px;
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: #0008;
  border-radius: 0;
}
.sidebar-overlay:hover {
  background: #0008;
}
dialog {
  max-width: 440px;
  width: calc(100% - 36px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 80px #0003;
}
dialog::backdrop {
  background: #07132899;
}
dialog h2 {
  font-size: 20px;
}
dialog p {
  color: var(--muted);
  font-size: 13px;
}
.dialog-icon {
  display: grid;
  place-items: center;
  color: var(--amber);
  background: var(--amber-bg);
  width: 43px;
  height: 43px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.is-loading {
  cursor: wait;
}
.guest .footer > span:last-child {
  display: none;
}
@media (min-width: 1600px) {
  main {
    padding: 36px 48px;
  }
  .topbar {
    padding: 0 48px;
  }
}
@media (max-width: 1250px) {
  .sidebar {
    width: 220px;
    padding: 24px 14px;
  }
  .topbar {
    margin-left: 220px;
    padding: 0 25px;
  }
  main {
    margin-left: 220px;
    padding: 26px 25px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr);
  }
  .brand {
    font-size: 21px;
  }
  .scope-label {
    display: none;
  }
}
@media (max-width: 960px) {
  .sidebar {
    width: 245px;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .menu-open .sidebar {
    transform: translateX(0);
  }
  .topbar {
    margin-left: 0;
    padding: 0 20px;
    height: 64px;
  }
  .mobile-menu {
    display: inline-flex;
  }
  main {
    margin: 0;
    padding: 26px 20px;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .sidebar-bottom {
    padding-top: 15px;
    margin-top: 25px;
  }
  .menu-open {
    overflow: hidden;
  }
}
@media (max-width: 700px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .form-grid,
  .details {
    grid-template-columns: 1fr;
  }
  .welcome {
    padding: 22px;
    align-items: flex-start;
    flex-direction: column;
  }
  .welcome h2 {
    font-size: 22px;
  }
  .today,
  .breadcrumb,
  .small-avatar {
    display: none;
  }
  .topbar-actions {
    gap: 7px;
  }
  .topbar {
    height: 59px;
  }
  main {
    padding: 24px 16px;
  }
  .stats {
    gap: 12px;
  }
  .stat {
    padding: 16px;
    gap: 12px;
  }
  .stat-label {
    font-size: 10px;
  }
  .stat-icon {
    width: 26px;
    height: 26px;
  }
  .stat > strong {
    font-size: 25px;
  }
  .stat > small {
    font-size: 9px;
  }
  .page-heading {
    margin-bottom: 22px;
  }
  h1 {
    font-size: 24px;
  }
  .panel {
    padding: 20px;
  }
  .table-wrap,
  .notification-panel {
    padding: 0;
  }
  .toolbar > .search {
    width: 100%;
    max-width: none;
  }
  .toolbar > .actions {
    width: 100%;
  }
  .toolbar > .actions > * {
    flex: 1;
  }
  .search input {
    margin-top: 0;
    flex: 1;
  }
  .filter-tabs > a {
    font-size: 11px;
    padding: 7px 9px;
  }
  .footer > span:last-child {
    display: none;
  }
  .order-summary {
    align-items: stretch;
    flex-direction: column;
  }
  .order-summary .actions > * {
    flex: 1;
  }
  .notification {
    gap: 10px;
    padding: 17px;
  }
  .notification > .activity-icon {
    display: none;
  }
  .notification-heading {
    flex-direction: column;
    gap: 5px;
  }
  .guest main {
    padding: 25px 16px;
  }
  .auth-card {
    padding: 26px;
    margin: 25px auto;
  }
  .auth-card h2 {
    font-size: 25px;
  }
  .line-total-box {
    align-items: flex-start;
  }
  .panel .form-grid {
    gap: 18px;
  }
  .pagination {
    font-size: 10px;
  }
  .notification-meta {
    flex-wrap: wrap;
  }
  .line-heading {
    margin-bottom: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .sidebar,
  .topbar,
  .toolbar,
  .filter-tabs,
  button,
  .button,
  .footer,
  dialog,
  .scope-label {
    display: none !important;
  }
  main {
    margin: 0;
    padding: 0;
  }
  .panel {
    box-shadow: none;
    border-color: #ccc;
    break-inside: avoid;
  }
  .table-wrap {
    overflow: visible;
  }
  body {
    background: white;
    color: black;
  }
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Formulaires en modale : toute la largeur disponible, défilement interne et focus natif. */
body:has(dialog[open]) { overflow: hidden; }
dialog.editor-dialog {
  width: min(1040px, calc(100vw - 32px)); max-width: none;
  max-height: calc(100dvh - 32px); padding: 0;
  border: 1px solid var(--line); border-radius: 16px;
  color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px #0005;
}
dialog.editor-dialog::backdrop { background: #080f20b3; backdrop-filter: blur(3px); }
.editor-head { display:flex; gap: 16px; align-items:center; justify-content:space-between; padding:20px 24px; border-bottom:1px solid var(--line); }
.editor-head h2 { margin:0; font-size:20px; }
.editor-close { flex:none; }
.editor-body { padding:24px; overflow:auto; }
.editor-body .panel { margin:0; border:0; padding:0; }
.editor-body form.stack { min-width:0; }
.editor-body .inline-action { margin-top:16px; }
.editor-footer { display:flex; justify-content:flex-end; margin-top:20px; }
.editor-frame { display:block; width:100%; height:min(740px, calc(100dvh - 120px)); border:0; background:var(--surface); }
.embedded-form .sidebar,.embedded-form .topbar,.embedded-form .sidebar-overlay,.embedded-form .footer,.embedded-form .scope-label,.embedded-form .eyebrow { display:none !important; }
.embedded-form body { padding:0; min-height:0; }
.embedded-form main,.embedded-form .guest main { width:100%; max-width:none; margin:0; padding:20px; }
.embedded-form .page-heading { margin-bottom:16px; }
.embedded-form .page-heading h1 { font-size:21px; }
.inline-action { display:inline-block; margin:4px 4px 4px 0; }
.modal-launch { margin:4px 6px 4px 0; }
.modal-create-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
@media(max-width:700px) {
 dialog.editor-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
 .editor-head,.editor-body { padding:16px; }
 .editor-frame { height:calc(100dvh - 100px); }
}

.editor-head { position:sticky; top:0; z-index:2; background:var(--surface); }
