/*
 * Pacific Tech Imports — PTI Business OS
 * Refonte visuelle complète, inspirée des interfaces premium natives.
 * Cette couche ne modifie aucun identifiant, champ, endpoint ou comportement JS.
 */

:root {
  --pti-bg: #f5f5f7;
  --pti-bg-deep: #e9e9ee;
  --pti-surface: rgba(255, 255, 255, .84);
  --pti-surface-solid: #ffffff;
  --pti-surface-soft: rgba(255, 255, 255, .62);
  --pti-ink: #1d1d1f;
  --pti-ink-soft: #3a3a3c;
  --pti-muted: #6e6e73;
  --pti-faint: #8e8e93;
  --pti-line: rgba(60, 60, 67, .14);
  --pti-line-strong: rgba(60, 60, 67, .24);
  --pti-blue: #59595f;
  --pti-blue-hover: #3a3a3c;
  --pti-blue-soft: rgba(60, 60, 67, .10);
  --pti-green: #248a3d;
  --pti-green-soft: rgba(52, 199, 89, .12);
  --pti-orange: #b25000;
  --pti-orange-soft: rgba(255, 159, 10, .14);
  --pti-red: #d70015;
  --pti-red-soft: rgba(255, 59, 48, .12);
  --pti-violet: #5856d6;
  --pti-radius-sm: 12px;
  --pti-radius: 18px;
  --pti-radius-lg: 26px;
  --pti-radius-xl: 34px;
  --pti-shadow-sm: 0 2px 8px rgba(0, 0, 0, .04), 0 12px 28px rgba(0, 0, 0, .035);
  --pti-shadow: 0 18px 50px rgba(0, 0, 0, .075), 0 2px 8px rgba(0, 0, 0, .035);
  --pti-shadow-float: 0 28px 80px rgba(0, 0, 0, .16), 0 6px 20px rgba(0, 0, 0, .06);
  --pti-font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", sans-serif;
  --pti-ease: cubic-bezier(.22, 1, .36, 1);
}

* {
  -webkit-tap-highlight-color: transparent;
}

body.pti-brand-page {
  font-family: var(--pti-font) !important;
  color: var(--pti-ink) !important;
  background:
    radial-gradient(circle at 82% -18%, rgba(99, 99, 105, .13), transparent 35%),
    radial-gradient(circle at 18% 105%, rgba(142, 142, 147, .09), transparent 28%),
    var(--pti-bg) !important;
  accent-color: var(--pti-blue);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.pti-brand-page.theme-light {
  --bg-1: var(--pti-bg);
  --bg-2: var(--pti-bg);
  --card: var(--pti-surface-solid);
  --card-border: var(--pti-line);
  --text: var(--pti-ink);
  --muted: var(--pti-muted);
  --line: var(--pti-line);
  --primary-top: var(--pti-blue);
  --primary-bottom: var(--pti-blue);
  --primary: var(--pti-blue);
  --surface: var(--pti-surface-solid);
  --surface-soft: #fafafa;
  --surface-muted: #f1f1f4;
  --shell-bg: rgba(255, 255, 255, .72);
  --shell-border: var(--pti-line);
  --brand-accent: var(--pti-blue);
  --table-head: #f5f5f7;
  --input-bg: rgba(255, 255, 255, .92);
  --input-bg-2: #ffffff;
  --svg-bg: #ffffff;
  --svg-grid: #e2e2e7;
  --svg-text: #86868b;
  --shadow-card: var(--pti-shadow-sm);
  --blue: var(--pti-blue);
  --blue-bg: var(--pti-blue-soft);
  --green: var(--pti-green);
  --green-bg: var(--pti-green-soft);
  --amber: var(--pti-orange);
  --amber-bg: var(--pti-orange-soft);
  --red: var(--pti-red);
  --red-bg: var(--pti-red-soft);
}

body.pti-brand-page.theme-dark,
body.pti-generator-page.generator-dark {
  --bg-1: #09090b;
  --bg-2: #111114;
  --card: rgba(30, 30, 32, .90);
  --card-border: rgba(255, 255, 255, .10);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --line: rgba(255, 255, 255, .10);
  --primary-top: #8e8e93;
  --primary-bottom: #636366;
  --primary: #8e8e93;
  --surface: #1c1c1e;
  --surface-soft: #242426;
  --surface-muted: #2c2c2e;
  --shell-bg: rgba(22, 22, 24, .82);
  --shell-border: rgba(255, 255, 255, .10);
  --brand-accent: #aeaeb2;
  --table-head: #252527;
  --input-bg: rgba(44, 44, 46, .86);
  --input-bg-2: #2c2c2e;
  --svg-bg: #1c1c1e;
  --svg-grid: #3a3a3c;
  --svg-text: #a1a1a6;
  --shadow-card: 0 18px 52px rgba(0, 0, 0, .30);
  --blue: #aeaeb2;
  --blue-bg: rgba(174, 174, 178, .16);
  --green: #30d158;
  --green-bg: rgba(48, 209, 88, .15);
  --amber: #ffd60a;
  --amber-bg: rgba(255, 214, 10, .14);
  --red: #ff453a;
  --red-bg: rgba(255, 69, 58, .15);
  color: #f5f5f7 !important;
  background:
    radial-gradient(circle at 85% -10%, rgba(174, 174, 178, .14), transparent 32%),
    #09090b !important;
}

.pti-brand-logo,
.pti-mobile-brand-logo,
.pti-history-logo,
.pti-generator-logo,
.pti-login-logo,
.pti-setup-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

body.pti-brand-page button,
body.pti-brand-page a,
body.pti-brand-page input,
body.pti-brand-page select,
body.pti-brand-page textarea,
body.pti-brand-page details,
body.pti-brand-page .card {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease,
    box-shadow .32s var(--pti-ease), transform .32s var(--pti-ease), opacity .2s ease;
}

body.pti-brand-page button:focus-visible,
body.pti-brand-page a:focus-visible,
body.pti-brand-page input:focus-visible,
body.pti-brand-page select:focus-visible,
body.pti-brand-page textarea:focus-visible {
  outline: 3px solid rgba(99, 99, 105, .28) !important;
  outline-offset: 2px !important;
}

/* ========================================================================== */
/* Tableau de bord — véritable application de gestion                         */
/* ========================================================================== */

body.pti-dashboard-page {
  overflow: hidden !important;
}

body.pti-dashboard-page .page {
  width: 100% !important;
  max-width: none !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.pti-dashboard-page .shell {
  width: 100% !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.pti-dashboard-page .pti-brand-logo {
  width: 176px;
}

body.pti-dashboard-page.theme-dark .pti-brand-logo,
body.pti-dashboard-page.theme-dark .pti-mobile-brand-logo {
  filter: invert(1);
}

body.pti-dashboard-page .brand > small,
body.pti-dashboard-page .brand > h1 {
  display: none !important;
}

body.pti-dashboard-page .brand .meta {
  margin-top: 12px !important;
  color: var(--muted) !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
  font-weight: 650 !important;
  letter-spacing: .04em !important;
  text-transform: none !important;
}

.pti-workspace-heading {
  min-width: 0;
  align-self: center;
}

.pti-workspace-heading small {
  display: block;
  margin-bottom: 3px;
  color: var(--pti-blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.pti-workspace-heading strong {
  display: block;
  color: var(--text);
  font-size: clamp(23px, 2vw, 31px);
  line-height: 1.05;
  font-weight: 720;
  letter-spacing: -.035em;
}

.pti-workspace-heading span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: -.005em;
}

body.pti-dashboard-page .top-primary-actions,
body.pti-dashboard-page .top-secondary-actions,
body.pti-dashboard-page .top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.pti-dashboard-page .top-actions {
  justify-content: flex-end;
}

body.pti-dashboard-page .top-actions .btn-link,
body.pti-dashboard-page .top-actions button {
  min-height: 40px !important;
  padding: 9px 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  color: var(--text) !important;
  background: rgba(255, 255, 255, .70) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025) !important;
  clip-path: none !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
}

body.pti-dashboard-page.theme-dark .top-actions .btn-link,
body.pti-dashboard-page.theme-dark .top-actions button {
  background: rgba(44, 44, 46, .78) !important;
}

body.pti-dashboard-page .top-actions .btn-link:hover,
body.pti-dashboard-page .top-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .08) !important;
}

body.pti-dashboard-page .top-actions .primary,
body.pti-dashboard-page .top-actions .scanner-launch-action {
  border-color: transparent !important;
  color: #ffffff !important;
  background: var(--pti-blue) !important;
  box-shadow: 0 8px 20px rgba(60, 60, 67, .18) !important;
}

body.pti-dashboard-page .top-actions .scanner-launch-action {
  color: #ffffff !important;
  background: #1d1d1f !important;
  box-shadow: 0 8px 20px rgba(29, 29, 31, .16) !important;
}

body.pti-dashboard-page .top-actions .danger {
  color: var(--red) !important;
}

body.pti-dashboard-page .content {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: transparent !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 60, 67, .26) transparent;
}

body.pti-dashboard-page .content::-webkit-scrollbar {
  width: 8px;
}

body.pti-dashboard-page .content::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(60, 60, 67, .25);
  background-clip: padding-box;
}

body.pti-dashboard-page .alerts {
  margin-bottom: 14px;
}

body.pti-dashboard-page .alert {
  border: 1px solid var(--line) !important;
  border-radius: var(--pti-radius) !important;
  box-shadow: var(--pti-shadow-sm) !important;
}

body.pti-dashboard-page .card,
body.pti-dashboard-page .utility-details,
body.pti-dashboard-page .order-accordion,
body.pti-dashboard-page .entity-accordion,
body.pti-dashboard-page .request-card,
body.pti-dashboard-page .client-doc-card {
  border: 1px solid var(--line) !important;
  border-radius: var(--pti-radius-lg) !important;
  background: var(--card) !important;
  box-shadow: var(--pti-shadow-sm) !important;
  backdrop-filter: blur(24px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
  clip-path: none !important;
}

body.pti-dashboard-page .card:hover,
body.pti-dashboard-page .request-card:hover,
body.pti-dashboard-page .client-doc-card:hover {
  border-color: var(--pti-line-strong) !important;
  box-shadow: var(--pti-shadow) !important;
}

body.pti-dashboard-page .section-head {
  padding-bottom: 0 !important;
  border: 0 !important;
  margin-bottom: 16px !important;
}

body.pti-dashboard-page .section-head h2,
body.pti-dashboard-page .section-head h3,
body.pti-dashboard-page .form-subsection-label,
body.pti-dashboard-page .quick-actions-title {
  font-weight: 720 !important;
  letter-spacing: -.025em !important;
  text-transform: none !important;
}

body.pti-dashboard-page .section-head h2 {
  font-size: clamp(20px, 1.8vw, 28px) !important;
}

body.pti-dashboard-page .stat,
body.pti-dashboard-page .mini-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: 22px !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .72)) !important;
  box-shadow: var(--pti-shadow-sm) !important;
  clip-path: none !important;
}

body.pti-dashboard-page.theme-dark .stat,
body.pti-dashboard-page.theme-dark .mini-card {
  background: linear-gradient(145deg, rgba(44, 44, 46, .95), rgba(28, 28, 30, .86)) !important;
}

body.pti-dashboard-page .stat::after,
body.pti-dashboard-page .mini-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -52px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 99, 105, .12), transparent 68%);
  pointer-events: none;
}

body.pti-dashboard-page .stat span,
body.pti-dashboard-page .mini-card .title {
  color: var(--muted) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: -.005em !important;
  text-transform: none !important;
}

body.pti-dashboard-page .stat strong,
body.pti-dashboard-page .mini-card .value {
  color: var(--text) !important;
  font-weight: 720 !important;
  letter-spacing: -.035em !important;
}

body.pti-dashboard-page .stat small,
body.pti-dashboard-page .mini-card small {
  color: var(--muted) !important;
}

body.pti-dashboard-page .pilotage-card {
  position: relative;
  overflow: hidden;
  padding: 26px !important;
  border: 0 !important;
  border-radius: 30px !important;
  color: #ffffff !important;
  background:
    radial-gradient(circle at 91% 8%, rgba(142, 142, 147, .42), transparent 30%),
    radial-gradient(circle at 18% 118%, rgba(72, 72, 76, .34), transparent 35%),
    linear-gradient(135deg, #17171a 0%, #050506 72%) !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .20) !important;
  clip-path: none !important;
}

body.pti-dashboard-page .pilotage-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, .10), transparent 28%);
  pointer-events: none;
}

body.pti-dashboard-page .pilotage-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -125px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(255, 255, 255, .025), 0 0 0 72px rgba(255, 255, 255, .018);
  pointer-events: none;
}

body.pti-dashboard-page .pilotage-card .section-head {
  position: relative;
  z-index: 1;
}

body.pti-dashboard-page .pilotage-card .section-head h2 {
  color: #ffffff !important;
  font-size: clamp(25px, 2.2vw, 34px) !important;
  letter-spacing: -.04em !important;
}

body.pti-dashboard-page .pilotage-card .section-head .meta {
  color: rgba(255, 255, 255, .64) !important;
}

body.pti-dashboard-page .pilotage-card .pilotage-tile,
body.pti-dashboard-page .pilotage-card .pilotage-row {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  border-radius: 19px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, .085) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08) !important;
  backdrop-filter: blur(18px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(135%) !important;
  clip-path: none !important;
}

body.pti-dashboard-page .pilotage-card .pilotage-tile:hover,
body.pti-dashboard-page .pilotage-card .pilotage-row:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, .13) !important;
}

body.pti-dashboard-page .pilotage-card .pilotage-tile *,
body.pti-dashboard-page .pilotage-card .pilotage-row * {
  color: inherit;
}

body.pti-dashboard-page .pilotage-card .pilotage-tile .value,
body.pti-dashboard-page .pilotage-card .pilotage-row .value {
  font-weight: 720 !important;
  letter-spacing: -.04em !important;
}

body.pti-dashboard-page .pilotage-card .pilotage-tile.warn,
body.pti-dashboard-page .pilotage-card .pilotage-row.warn {
  border-color: rgba(255, 214, 10, .32) !important;
  background: linear-gradient(145deg, rgba(255, 214, 10, .13), rgba(255, 255, 255, .07)) !important;
}

body.pti-dashboard-page .pilotage-card .pilotage-tile.danger,
body.pti-dashboard-page .pilotage-card .pilotage-row.danger {
  border-color: rgba(255, 69, 58, .34) !important;
  background: linear-gradient(145deg, rgba(255, 69, 58, .14), rgba(255, 255, 255, .07)) !important;
}

body.pti-dashboard-page input,
body.pti-dashboard-page select,
body.pti-dashboard-page textarea,
body.pti-dashboard-page .field input,
body.pti-dashboard-page .field select,
body.pti-dashboard-page .field textarea {
  border: 1px solid var(--line) !important;
  border-radius: 13px !important;
  color: var(--text) !important;
  background: var(--input-bg) !important;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .025) !important;
  clip-path: none !important;
}

body.pti-dashboard-page input:focus,
body.pti-dashboard-page select:focus,
body.pti-dashboard-page textarea:focus {
  border-color: var(--pti-blue) !important;
  box-shadow: 0 0 0 4px rgba(99, 99, 105, .12) !important;
}

body.pti-dashboard-page table,
body.pti-dashboard-page .table-wrap {
  border-radius: var(--pti-radius) !important;
  overflow: hidden;
}

body.pti-dashboard-page table thead th,
body.pti-dashboard-page .table-wrap thead th {
  border-bottom: 1px solid var(--line) !important;
  color: var(--muted) !important;
  background: var(--table-head) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase;
}

body.pti-dashboard-page table tbody tr:hover {
  background: var(--pti-blue-soft) !important;
}

body.pti-dashboard-page .badge,
body.pti-dashboard-page .status-badge,
body.pti-dashboard-page .invoice-status-badge,
body.pti-dashboard-page .tracking-status {
  border-radius: 999px !important;
  box-shadow: none !important;
}

body.pti-dashboard-page .stock-summary-thumb,
body.pti-dashboard-page .stock-thumb,
body.pti-dashboard-page .product-image {
  border-radius: 16px !important;
  background: #f2f2f5 !important;
  box-shadow: inset 0 0 0 1px var(--line) !important;
}

body.pti-dashboard-page .analysis-subtab,
body.pti-dashboard-page .tab,
body.pti-dashboard-page .chip-btn,
body.pti-dashboard-page .quick .btn-link {
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  color: var(--text) !important;
  background: rgba(255, 255, 255, .76) !important;
  box-shadow: none !important;
  clip-path: none !important;
}

body.pti-dashboard-page.theme-dark .analysis-subtab,
body.pti-dashboard-page.theme-dark .tab,
body.pti-dashboard-page.theme-dark .chip-btn,
body.pti-dashboard-page.theme-dark .quick .btn-link {
  background: rgba(44, 44, 46, .84) !important;
}

body.pti-dashboard-page .analysis-subtab.active,
body.pti-dashboard-page .tab.active,
body.pti-dashboard-page .chip-btn.active,
body.pti-dashboard-page .quick .btn-link.primary {
  border-color: transparent !important;
  color: #ffffff !important;
  background: var(--pti-blue) !important;
  box-shadow: 0 7px 18px rgba(60, 60, 67, .17) !important;
}

body.pti-dashboard-page .btn-link,
body.pti-dashboard-page .btn,
body.pti-dashboard-page button[type="submit"] {
  border-radius: 999px !important;
  clip-path: none !important;
}

body.pti-dashboard-page .scanner-modal-dialog,
body.pti-dashboard-page .movement-journal-dialog,
body.pti-dashboard-page .push-dialog {
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: 30px !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: var(--pti-shadow-float) !important;
  backdrop-filter: blur(36px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(36px) saturate(150%) !important;
  clip-path: none !important;
}

body.pti-dashboard-page.theme-dark .scanner-modal-dialog,
body.pti-dashboard-page.theme-dark .movement-journal-dialog,
body.pti-dashboard-page.theme-dark .push-dialog {
  background: rgba(28, 28, 30, .95) !important;
}

body.pti-dashboard-page .scanner-modal-head,
body.pti-dashboard-page .movement-journal-head,
body.pti-dashboard-page .push-head {
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  color: var(--text) !important;
  background: transparent !important;
}

body.pti-dashboard-page .scanner-modal-head *,
body.pti-dashboard-page .movement-journal-head *,
body.pti-dashboard-page .push-head * {
  color: inherit !important;
}

body.pti-dashboard-page .scanner-camera-stage,
body.pti-dashboard-page .scanner-reader-shell,
body.pti-dashboard-page .scanner-camera-wrap,
body.pti-dashboard-page .scanner-frame,
body.pti-dashboard-page .scanner-shell,
body.pti-dashboard-page .scanner-result-card,
body.pti-dashboard-page .movement-journal-card,
body.pti-dashboard-page .movement-journal-row,
body.pti-dashboard-page .push-status,
body.pti-dashboard-page .push-preference {
  border-radius: var(--pti-radius) !important;
  box-shadow: none !important;
}

body.pti-dashboard-page .scanner-camera-wrap,
body.pti-dashboard-page .scanner-frame {
  border-color: rgba(255, 255, 255, .14) !important;
  background: #050506 !important;
}

body.pti-dashboard-page .scanner-btn,
body.pti-dashboard-page .movement-journal-reset,
body.pti-dashboard-page .push-actions button {
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  color: var(--text) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  clip-path: none !important;
}

body.pti-dashboard-page .scanner-btn-primary,
body.pti-dashboard-page .scanner-sale,
body.pti-dashboard-page .push-actions .primary {
  border-color: transparent !important;
  color: #ffffff !important;
  background: var(--pti-blue) !important;
}

@media (min-width: 1181px) {
  body.pti-dashboard-page {
    padding: 16px !important;
  }

  body.pti-dashboard-page .page {
    height: calc(100dvh - 32px) !important;
    min-height: calc(100dvh - 32px) !important;
  }

  body.pti-dashboard-page .shell {
    display: grid !important;
    grid-template-columns: 254px minmax(0, 1fr) !important;
    grid-template-rows: 94px minmax(0, 1fr) !important;
    height: calc(100dvh - 32px) !important;
    min-height: calc(100dvh - 32px) !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, .72) !important;
    border-radius: 32px !important;
    background: rgba(255, 255, 255, .58) !important;
    box-shadow: 0 32px 90px rgba(37, 37, 48, .13), 0 2px 12px rgba(0, 0, 0, .04) !important;
    backdrop-filter: blur(34px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(34px) saturate(145%) !important;
  }

  body.pti-dashboard-page.theme-dark .shell {
    border-color: rgba(255, 255, 255, .08) !important;
    background: rgba(20, 20, 22, .82) !important;
  }

  body.pti-dashboard-page .topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid !important;
    grid-template-columns: 254px minmax(250px, 1fr) auto !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    background: rgba(255, 255, 255, .54) !important;
    backdrop-filter: blur(32px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(150%) !important;
  }

  body.pti-dashboard-page.theme-dark .topbar {
    background: rgba(22, 22, 24, .72) !important;
  }

  body.pti-dashboard-page .brand {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 18px 24px !important;
    border-right: 1px solid var(--line);
    color: var(--text) !important;
    background: transparent !important;
  }

  body.pti-dashboard-page .brand .meta {
    display: none !important;
  }

  body.pti-dashboard-page .pti-workspace-heading {
    padding: 17px 28px;
  }

  body.pti-dashboard-page .top-actions {
    padding: 16px 24px 16px 12px;
  }

  body.pti-dashboard-page .top-actions .top-action-label {
    display: inline !important;
  }

  body.pti-dashboard-page .top-actions .top-utility-action .top-action-label,
  body.pti-dashboard-page .top-actions .session-logout-action .top-action-label {
    display: none !important;
  }

  body.pti-dashboard-page .tabs {
    grid-column: 1;
    grid-row: 2;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 5px !important;
    min-height: 0;
    padding: 18px 13px 24px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border-right: 1px solid var(--line) !important;
    background: rgba(255, 255, 255, .34) !important;
  }

  body.pti-dashboard-page.theme-dark .tabs {
    background: rgba(20, 20, 22, .48) !important;
  }

  body.pti-dashboard-page .tabs::before {
    content: "Espace de travail";
    display: block;
    padding: 2px 12px 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
  }

  body.pti-dashboard-page .tabs .tab-btn,
  body.pti-dashboard-page .tabs .nav-folder-btn {
    display: flex !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 43px !important;
    padding: 9px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 13px !important;
    color: var(--muted) !important;
    background: transparent !important;
    box-shadow: none !important;
    clip-path: none !important;
  }

  body.pti-dashboard-page .tabs .tab-btn:hover,
  body.pti-dashboard-page .tabs .nav-folder-btn:hover {
    color: var(--text) !important;
    background: rgba(118, 118, 128, .09) !important;
  }

  body.pti-dashboard-page .tabs .tab-btn.active,
  body.pti-dashboard-page .tabs .nav-dropdown.active > .nav-folder-btn,
  body.pti-dashboard-page .tabs .nav-dropdown.open > .nav-folder-btn {
    border-color: rgba(255, 255, 255, .76) !important;
    color: var(--text) !important;
    background: rgba(255, 255, 255, .88) !important;
    box-shadow: 0 7px 22px rgba(0, 0, 0, .07) !important;
  }

  body.pti-dashboard-page.theme-dark .tabs .tab-btn.active,
  body.pti-dashboard-page.theme-dark .tabs .nav-dropdown.active > .nav-folder-btn,
  body.pti-dashboard-page.theme-dark .tabs .nav-dropdown.open > .nav-folder-btn {
    border-color: rgba(255, 255, 255, .08) !important;
    background: rgba(58, 58, 60, .88) !important;
  }

  body.pti-dashboard-page .tabs .tab-btn.active .tab-icon,
  body.pti-dashboard-page .tabs .nav-dropdown.active .tab-icon {
    color: var(--pti-blue) !important;
  }

  body.pti-dashboard-page .tabs .tab-icon,
  body.pti-dashboard-page .tabs .nav-folder-btn .tab-icon {
    width: 20px !important;
    height: 20px !important;
    margin-right: 10px !important;
  }

  body.pti-dashboard-page .tabs .tab-label {
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: -.005em !important;
    text-transform: none !important;
  }

  body.pti-dashboard-page .nav-dropdown {
    width: 100% !important;
  }

  body.pti-dashboard-page .nav-dropdown-menu {
    position: static !important;
    width: 100%;
    min-width: 0 !important;
    margin-top: 5px;
    padding: 4px 0 4px 14px !important;
    border: 0 !important;
    border-left: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  body.pti-dashboard-page .nav-dropdown-menu .nav-dropdown-item {
    min-height: 36px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
  }

  body.pti-dashboard-page .content {
    grid-column: 2;
    grid-row: 2;
    padding: 24px 28px 34px !important;
  }

  body.pti-dashboard-page .pti-mobile-header,
  body.pti-dashboard-page .mobile-bottom-nav {
    display: none !important;
  }
}

@media (min-width: 721px) and (max-width: 1180px) {
  body.pti-dashboard-page {
    overflow: auto !important;
  }

  body.pti-dashboard-page .page,
  body.pti-dashboard-page .shell {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
  }

  body.pti-dashboard-page .shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.pti-dashboard-page .topbar {
    position: sticky !important;
    top: 0;
    z-index: 50;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 12px 16px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    background: rgba(245, 245, 247, .80) !important;
    backdrop-filter: blur(28px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(160%) !important;
  }

  body.pti-dashboard-page.theme-dark .topbar {
    background: rgba(9, 9, 11, .82) !important;
  }

  body.pti-dashboard-page .brand {
    min-width: 190px;
  }

  body.pti-dashboard-page .pti-brand-logo {
    width: 172px;
  }

  body.pti-dashboard-page .brand .meta,
  body.pti-dashboard-page .pti-workspace-heading {
    display: none !important;
  }

  body.pti-dashboard-page .tabs {
    position: sticky !important;
    top: 65px;
    z-index: 45;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 9px 14px 11px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    background: rgba(245, 245, 247, .82) !important;
    backdrop-filter: blur(28px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(160%) !important;
    scrollbar-width: none;
  }

  body.pti-dashboard-page.theme-dark .tabs {
    background: rgba(9, 9, 11, .84) !important;
  }

  body.pti-dashboard-page .tabs::-webkit-scrollbar {
    display: none;
  }

  body.pti-dashboard-page .tabs .tab-btn,
  body.pti-dashboard-page .tabs .nav-folder-btn {
    border: 0 !important;
    border-radius: 999px !important;
    color: var(--muted) !important;
    background: transparent !important;
    box-shadow: none !important;
    clip-path: none !important;
  }

  body.pti-dashboard-page .tabs .tab-btn.active,
  body.pti-dashboard-page .tabs .nav-dropdown.active > .nav-folder-btn {
    color: var(--text) !important;
    background: rgba(118, 118, 128, .13) !important;
  }

  body.pti-dashboard-page .content {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 22px !important;
  }
}

@media (max-width: 720px) {
  body.pti-dashboard-page {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background:
      radial-gradient(circle at 100% 0, rgba(99, 99, 105, .10), transparent 28%),
      var(--pti-bg) !important;
  }

  body.pti-dashboard-page.theme-dark {
    background: #09090b !important;
  }

  body.pti-dashboard-page .page,
  body.pti-dashboard-page .shell {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }

  body.pti-dashboard-page .topbar,
  body.pti-dashboard-page > .topbar,
  body.pti-dashboard-page .tabs {
    display: none !important;
  }

  body.pti-dashboard-page .pti-mobile-header {
    display: block !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    margin: 0 !important;
    padding: calc(11px + env(safe-area-inset-top)) 14px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(60, 60, 67, .10) !important;
    border-radius: 0 !important;
    background: rgba(245, 245, 247, .78) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .04) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
  }

  body.pti-dashboard-page.theme-dark .pti-mobile-header {
    border-color: rgba(255, 255, 255, .08) !important;
    background: rgba(9, 9, 11, .80) !important;
  }

  body.pti-dashboard-page .pti-mobile-header-main {
    min-height: 58px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.pti-dashboard-page .pti-mobile-brand {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 0 !important;
  }

  body.pti-dashboard-page .pti-mobile-brand-logo {
    width: min(205px, 59vw);
  }

  body.pti-dashboard-page .pti-mobile-brand > small,
  body.pti-dashboard-page .pti-mobile-brand > strong {
    display: none !important;
  }

  body.pti-dashboard-page .pti-mobile-brand > span {
    margin-top: 5px !important;
    color: var(--muted) !important;
    font-size: 10px !important;
    font-weight: 550 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  body.pti-dashboard-page .pti-mobile-header-tools {
    gap: 7px !important;
  }

  body.pti-dashboard-page .pti-mobile-options-toggle,
  body.pti-dashboard-page .pti-mobile-logout {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border: 1px solid var(--line) !important;
    border-radius: 50% !important;
    color: var(--text) !important;
    background: rgba(255, 255, 255, .76) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .05) !important;
    clip-path: none !important;
  }

  body.pti-dashboard-page.theme-dark .pti-mobile-options-toggle,
  body.pti-dashboard-page.theme-dark .pti-mobile-logout {
    background: rgba(44, 44, 46, .82) !important;
  }

  body.pti-dashboard-page .pti-mobile-logout {
    color: var(--pti-red) !important;
  }

  body.pti-dashboard-page .pti-mobile-options-menu {
    overflow: hidden;
    border: 1px solid var(--line) !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: var(--pti-shadow-float) !important;
    backdrop-filter: blur(28px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(160%) !important;
    clip-path: none !important;
  }

  body.pti-dashboard-page.theme-dark .pti-mobile-options-menu {
    background: rgba(28, 28, 30, .96) !important;
  }

  body.pti-dashboard-page .pti-mobile-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 11px !important;
    padding: 0 !important;
  }

  body.pti-dashboard-page .pti-mobile-action {
    min-height: 62px !important;
    border: 1px solid var(--line) !important;
    border-radius: 17px !important;
    color: var(--text) !important;
    background: rgba(255, 255, 255, .74) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .035) !important;
    clip-path: none !important;
  }

  body.pti-dashboard-page.theme-dark .pti-mobile-action {
    background: rgba(44, 44, 46, .78) !important;
  }

  body.pti-dashboard-page .pti-mobile-action.is-primary {
    border-color: transparent !important;
    color: #ffffff !important;
    background: var(--pti-blue) !important;
    box-shadow: 0 10px 24px rgba(60, 60, 67, .20) !important;
  }

  body.pti-dashboard-page .content {
    padding: 16px 12px calc(98px + env(safe-area-inset-bottom)) !important;
  }

  body.pti-dashboard-page .card {
    margin-bottom: 12px !important;
    padding: 15px !important;
    border-radius: 22px !important;
  }

  body.pti-dashboard-page .pilotage-card {
    padding: 20px !important;
    border-radius: 26px !important;
  }

  body.pti-dashboard-page .pilotage-card .pilotage-tile,
  body.pti-dashboard-page .pilotage-card .pilotage-row {
    border-radius: 17px !important;
  }

  body.pti-dashboard-page .stat,
  body.pti-dashboard-page .mini-card {
    border-radius: 19px !important;
  }

  body.pti-dashboard-page .mobile-bottom-nav {
    display: grid !important;
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    z-index: 2147483000 !important;
    gap: 2px !important;
    padding: 7px !important;
    border: 1px solid rgba(255, 255, 255, .72) !important;
    border-radius: 24px !important;
    color: var(--text) !important;
    background: rgba(250, 250, 252, .86) !important;
    box-shadow: 0 20px 54px rgba(0, 0, 0, .17) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
    clip-path: none !important;
  }

  body.pti-dashboard-page.theme-dark .mobile-bottom-nav {
    border-color: rgba(255, 255, 255, .10) !important;
    background: rgba(30, 30, 32, .88) !important;
  }

  body.pti-dashboard-page .mobile-nav-btn {
    min-height: 50px !important;
    border: 0 !important;
    border-radius: 17px !important;
    color: var(--muted) !important;
    background: transparent !important;
    box-shadow: none !important;
    clip-path: none !important;
  }

  body.pti-dashboard-page .mobile-nav-btn.active,
  body.pti-dashboard-page .mobile-nav-dropdown.active .mobile-nav-folder-btn {
    color: var(--pti-blue) !important;
    background: var(--pti-blue-soft) !important;
  }

  body.pti-dashboard-page .mobile-nav-menu {
    overflow: hidden;
    border: 1px solid var(--line) !important;
    border-radius: 22px !important;
    color: var(--text) !important;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: var(--pti-shadow-float) !important;
    backdrop-filter: blur(28px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(160%) !important;
  }

  body.pti-dashboard-page.theme-dark .mobile-nav-menu {
    background: rgba(28, 28, 30, .96) !important;
  }

  body.pti-dashboard-page .mobile-nav-menu-btn {
    color: var(--text) !important;
    background: transparent !important;
  }
}

/* ========================================================================== */
/* Générateur — interface uniquement, sorties A4 et ticket intactes           */
/* ========================================================================== */

body.pti-generator-page {
  background:
    radial-gradient(circle at 8% 0, rgba(88, 86, 214, .10), transparent 28%),
    radial-gradient(circle at 95% 15%, rgba(99, 99, 105, .11), transparent 31%),
    var(--pti-bg) !important;
}

body.pti-generator-page.generator-dark {
  background: #09090b !important;
}

body.pti-generator-page .app {
  gap: 16px !important;
  padding: 16px !important;
  background: transparent !important;
}

body.pti-generator-page .form-shell,
body.pti-generator-page .preview-shell {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .74) !important;
  border-radius: 30px !important;
  background: rgba(255, 255, 255, .78) !important;
  box-shadow: var(--pti-shadow) !important;
  backdrop-filter: blur(30px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(30px) saturate(150%) !important;
  clip-path: none !important;
}

body.pti-generator-page.generator-dark .form-shell,
body.pti-generator-page.generator-dark .preview-shell {
  border-color: rgba(255, 255, 255, .09) !important;
  background: rgba(28, 28, 30, .88) !important;
}

body.pti-generator-page .form-panel {
  color: var(--pti-ink) !important;
}

body.pti-generator-page.generator-dark .form-panel {
  color: #f5f5f7 !important;
}

body.pti-generator-page .form-head {
  padding: 9px 6px 18px !important;
  border: 0 !important;
}

body.pti-generator-page .pti-generator-logo {
  width: 176px;
  margin-bottom: 16px;
}

body.pti-generator-page.generator-dark .pti-generator-logo {
  filter: invert(1);
}

body.pti-generator-page .panel-title {
  color: inherit !important;
  font-size: clamp(25px, 2vw, 34px) !important;
  line-height: 1.05 !important;
  font-weight: 720 !important;
  letter-spacing: -.04em !important;
}

body.pti-generator-page .panel-subtitle {
  color: var(--pti-muted) !important;
  font-size: 12px !important;
}

body.pti-generator-page.generator-dark .panel-subtitle {
  color: #a1a1a6 !important;
}

body.pti-generator-page .back-to-dashboard,
body.pti-generator-page .theme-mini-toggle,
body.pti-generator-page .top-logout-btn,
body.pti-generator-page .doc-action-btn,
body.pti-generator-page .preview-action-btn,
body.pti-generator-page .btn {
  border: 1px solid var(--pti-line) !important;
  border-radius: 999px !important;
  color: var(--pti-ink) !important;
  background: rgba(255, 255, 255, .78) !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .04) !important;
  clip-path: none !important;
}

body.pti-generator-page.generator-dark .back-to-dashboard,
body.pti-generator-page.generator-dark .theme-mini-toggle,
body.pti-generator-page.generator-dark .top-logout-btn,
body.pti-generator-page.generator-dark .doc-action-btn,
body.pti-generator-page.generator-dark .preview-action-btn,
body.pti-generator-page.generator-dark .btn {
  border-color: rgba(255, 255, 255, .10) !important;
  color: #f5f5f7 !important;
  background: rgba(44, 44, 46, .86) !important;
}

body.pti-generator-page .doc-action-btn.primary,
body.pti-generator-page .preview-action-btn.primary,
body.pti-generator-page .btn-main {
  border-color: transparent !important;
  color: #ffffff !important;
  background: var(--pti-blue) !important;
  box-shadow: 0 9px 22px rgba(60, 60, 67, .18) !important;
}

body.pti-generator-page .document-quick-actions,
body.pti-generator-page .preview-toolbar {
  gap: 8px !important;
}

body.pti-generator-page .form-section,
body.pti-generator-page .form-subsection {
  border: 1px solid var(--pti-line) !important;
  border-radius: 21px !important;
  background: rgba(255, 255, 255, .66) !important;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .035) !important;
  clip-path: none !important;
}

body.pti-generator-page.generator-dark .form-section,
body.pti-generator-page.generator-dark .form-subsection {
  border-color: rgba(255, 255, 255, .09) !important;
  background: rgba(44, 44, 46, .62) !important;
}

body.pti-generator-page .form-section > h2,
body.pti-generator-page .form-subsection-label {
  color: inherit !important;
  font-weight: 700 !important;
  letter-spacing: -.02em !important;
  text-transform: none !important;
}

body.pti-generator-page .form-subsection-label {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--pti-line);
}

body.pti-generator-page .form-shell input,
body.pti-generator-page .form-shell select,
body.pti-generator-page .form-shell textarea {
  border: 1px solid var(--pti-line) !important;
  border-radius: 13px !important;
  color: var(--pti-ink) !important;
  background: rgba(255, 255, 255, .92) !important;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .025) !important;
}

body.pti-generator-page.generator-dark .form-shell input,
body.pti-generator-page.generator-dark .form-shell select,
body.pti-generator-page.generator-dark .form-shell textarea {
  border-color: rgba(255, 255, 255, .11) !important;
  color: #f5f5f7 !important;
  background: rgba(28, 28, 30, .88) !important;
}

body.pti-generator-page .form-shell input:focus,
body.pti-generator-page .form-shell select:focus,
body.pti-generator-page .form-shell textarea:focus {
  border-color: var(--pti-blue) !important;
  box-shadow: 0 0 0 4px rgba(99, 99, 105, .12) !important;
}

body.pti-generator-page #formTabs.generator-bottom-nav {
  border: 1px solid rgba(255, 255, 255, .70) !important;
  border-radius: 23px !important;
  color: var(--pti-ink) !important;
  background: rgba(250, 250, 252, .88) !important;
  box-shadow: 0 20px 52px rgba(0, 0, 0, .16) !important;
  backdrop-filter: blur(30px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
  clip-path: none !important;
}

body.pti-generator-page #formTabs.generator-bottom-nav .tab-btn {
  border: 0 !important;
  border-radius: 16px !important;
  color: var(--pti-muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  clip-path: none !important;
}

body.pti-generator-page #formTabs.generator-bottom-nav .tab-btn.is-active {
  color: var(--pti-blue) !important;
  background: var(--pti-blue-soft) !important;
}

body.pti-generator-page #formTabs.generator-bottom-nav .tab-btn.is-disabled {
  opacity: .36;
}

body.pti-generator-page .preview-shell {
  background: rgba(232, 232, 237, .78) !important;
}

body.pti-generator-page.generator-dark .preview-shell {
  background: rgba(18, 18, 20, .92) !important;
}

@media (max-width: 760px) {
  body.pti-generator-page .app {
    padding: 8px !important;
  }

  body.pti-generator-page .form-shell,
  body.pti-generator-page .preview-shell {
    border-radius: 24px !important;
  }

  body.pti-generator-page .pti-generator-logo {
    width: 150px;
    margin-bottom: 10px;
  }

  body.pti-generator-page .panel-title {
    font-size: 24px !important;
  }
}

/* ========================================================================== */
/* Historique — bibliothèque de documents                                     */
/* ========================================================================== */

body.pti-history-page {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 90% 0, rgba(99, 99, 105, .12), transparent 32%),
    var(--pti-bg) !important;
}

body.pti-history-page.theme-dark {
  background: #09090b !important;
}

body.pti-history-page .wrap {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px !important;
}

body.pti-history-page .shell {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}

body.pti-history-page .topbar {
  position: relative;
  overflow: hidden;
  margin: 0 0 16px !important;
  padding: 34px 36px !important;
  border: 0 !important;
  border-radius: 30px !important;
  color: #ffffff !important;
  background:
    radial-gradient(circle at 90% 10%, rgba(142, 142, 147, .42), transparent 33%),
    linear-gradient(135deg, #202024, #050506 72%) !important;
  box-shadow: 0 28px 74px rgba(0, 0, 0, .18) !important;
}

body.pti-history-page .pti-history-logo {
  width: 210px;
  margin-bottom: 24px;
  filter: invert(1);
}

body.pti-history-page .brand-kicker {
  color: rgba(255, 255, 255, .58) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body.pti-history-page .topbar h1 {
  color: #ffffff !important;
  font-size: clamp(30px, 4vw, 54px) !important;
  font-weight: 720 !important;
  letter-spacing: -.05em !important;
}

body.pti-history-page .topbar .subtitle {
  color: rgba(255, 255, 255, .64) !important;
}

body.pti-history-page .topbar .btn,
body.pti-history-page .topbar .theme-mini-toggle {
  border: 1px solid rgba(255, 255, 255, .15) !important;
  border-radius: 999px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, .10) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  clip-path: none !important;
}

body.pti-history-page .topbar .btn-main {
  border-color: transparent !important;
  background: var(--pti-blue) !important;
}

body.pti-history-page .filters {
  margin: 0 0 16px !important;
  padding: 18px 20px !important;
  border: 1px solid rgba(255, 255, 255, .72) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, .74) !important;
  box-shadow: var(--pti-shadow-sm) !important;
  backdrop-filter: blur(24px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
}

body.pti-history-page.theme-dark .filters {
  border-color: rgba(255, 255, 255, .09) !important;
  background: rgba(28, 28, 30, .86) !important;
}

body.pti-history-page .filters input,
body.pti-history-page .quick-actions-grid select {
  border: 1px solid var(--pti-line) !important;
  border-radius: 13px !important;
  color: var(--pti-ink) !important;
  background: rgba(255, 255, 255, .90) !important;
  box-shadow: none !important;
}

body.pti-history-page.theme-dark .filters input,
body.pti-history-page.theme-dark .quick-actions-grid select {
  border-color: rgba(255, 255, 255, .10) !important;
  color: #f5f5f7 !important;
  background: rgba(44, 44, 46, .88) !important;
}

body.pti-history-page .tab,
body.pti-history-page .btn,
body.pti-history-page .quick-actions-grid button {
  border: 1px solid var(--pti-line) !important;
  border-radius: 999px !important;
  color: var(--pti-ink) !important;
  background: rgba(255, 255, 255, .76) !important;
  box-shadow: none !important;
  clip-path: none !important;
}

body.pti-history-page .tab.active,
body.pti-history-page .btn-main {
  border-color: transparent !important;
  color: #ffffff !important;
  background: var(--pti-blue) !important;
}

body.pti-history-page .history-list {
  gap: 12px !important;
}

body.pti-history-page .history-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, .82) !important;
  box-shadow: var(--pti-shadow-sm) !important;
  backdrop-filter: blur(22px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
}

body.pti-history-page.theme-dark .history-card {
  border-color: rgba(255, 255, 255, .09) !important;
  background: rgba(28, 28, 30, .88) !important;
}

body.pti-history-page .history-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--pti-shadow) !important;
}

body.pti-history-page .history-card[open] {
  border-color: rgba(99, 99, 105, .28) !important;
  box-shadow: 0 0 0 4px rgba(99, 99, 105, .07), var(--pti-shadow) !important;
}

body.pti-history-page .history-chevron,
body.pti-history-page .history-detail,
body.pti-history-page .quick-actions-box {
  border-radius: 16px !important;
  box-shadow: none !important;
}

body.pti-history-page .history-body {
  background: rgba(245, 245, 247, .70) !important;
}

body.pti-history-page.theme-dark .history-body {
  background: rgba(9, 9, 11, .56) !important;
}

body.pti-history-page .modal-card {
  overflow: hidden;
  border: 1px solid var(--pti-line) !important;
  border-radius: 30px !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: var(--pti-shadow-float) !important;
  backdrop-filter: blur(34px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(34px) saturate(150%) !important;
  clip-path: none !important;
}

@media (max-width: 760px) {
  body.pti-history-page .wrap {
    padding: 10px !important;
  }

  body.pti-history-page .topbar {
    padding: calc(24px + env(safe-area-inset-top)) 20px 24px !important;
    border-radius: 24px !important;
  }

  body.pti-history-page .pti-history-logo {
    width: 185px;
    margin-bottom: 18px;
  }

  body.pti-history-page .filters {
    padding: 14px !important;
    border-radius: 20px !important;
  }
}

/* ========================================================================== */
/* Connexion et configuration — écran d’accueil premium                       */
/* ========================================================================== */

body.pti-login-page,
body.pti-setup-page {
  position: relative;
  min-height: 100dvh !important;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 18%, rgba(174, 174, 178, .34), transparent 30%),
    radial-gradient(circle at 84% 82%, rgba(99, 99, 105, .30), transparent 32%),
    linear-gradient(145deg, #08080a, #202026 52%, #09090b) !important;
}

body.pti-login-page::before,
body.pti-setup-page::before {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(circle at 30% 45%, rgba(255, 255, 255, .075), transparent 21%),
    radial-gradient(circle at 68% 30%, rgba(174, 174, 178, .12), transparent 18%);
  filter: blur(24px);
  pointer-events: none;
}

html[data-theme="dark"] body.pti-login-page {
  background:
    radial-gradient(circle at 16% 18%, rgba(174, 174, 178, .26), transparent 30%),
    #050506 !important;
}

body.pti-login-page .page,
body.pti-setup-page .card {
  width: 100%;
  max-width: 470px !important;
}

body.pti-login-page .card,
body.pti-setup-page .card {
  position: relative;
  overflow: hidden;
  padding: 34px !important;
  border: 1px solid rgba(255, 255, 255, .20) !important;
  border-radius: 34px !important;
  color: #1d1d1f !important;
  background: rgba(255, 255, 255, .88) !important;
  box-shadow: 0 42px 120px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .62) !important;
  backdrop-filter: blur(34px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(34px) saturate(160%) !important;
  clip-path: none !important;
}

html[data-theme="dark"] body.pti-login-page .card {
  border-color: rgba(255, 255, 255, .11) !important;
  color: #f5f5f7 !important;
  background: rgba(28, 28, 30, .88) !important;
}

body.pti-login-page .card::after,
body.pti-setup-page .card::after {
  content: "";
  position: absolute;
  right: -76px;
  top: -86px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 99, 105, .12), transparent 67%);
  pointer-events: none;
}

body.pti-login-page .pti-login-logo,
body.pti-setup-page .pti-setup-logo {
  width: min(280px, 82%);
  margin: 0 auto 30px;
}

html[data-theme="dark"] body.pti-login-page .pti-login-logo {
  filter: invert(1);
}

body.pti-login-page .eyebrow,
body.pti-setup-page .eyebrow {
  color: var(--pti-blue) !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body.pti-login-page h1,
body.pti-setup-page h1 {
  font-size: clamp(28px, 5vw, 38px) !important;
  line-height: 1.05 !important;
  font-weight: 720 !important;
  letter-spacing: -.045em !important;
}

body.pti-login-page .sub,
body.pti-setup-page .sub {
  color: var(--pti-muted) !important;
}

body.pti-login-page .hr,
body.pti-setup-page .hr {
  border-color: var(--pti-line) !important;
}

body.pti-login-page input,
body.pti-setup-page input {
  min-height: 50px !important;
  border: 1px solid var(--pti-line) !important;
  border-radius: 14px !important;
  color: #1d1d1f !important;
  background: rgba(255, 255, 255, .88) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .025) !important;
}

html[data-theme="dark"] body.pti-login-page input {
  border-color: rgba(255, 255, 255, .11) !important;
  color: #f5f5f7 !important;
  background: rgba(44, 44, 46, .82) !important;
}

body.pti-login-page input:focus,
body.pti-setup-page input:focus {
  border-color: var(--pti-blue) !important;
  box-shadow: 0 0 0 4px rgba(99, 99, 105, .12) !important;
}

body.pti-login-page .btn,
body.pti-setup-page button,
body.pti-setup-page .link {
  min-height: 48px !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  clip-path: none !important;
}

body.pti-login-page .btn,
body.pti-setup-page button {
  color: #ffffff !important;
  background: var(--pti-blue) !important;
  box-shadow: 0 12px 28px rgba(60, 60, 67, .24) !important;
}

body.pti-login-page .btn:hover,
body.pti-setup-page button:hover {
  transform: translateY(-2px);
  background: var(--pti-blue-hover) !important;
}

body.pti-setup-page .link {
  border-color: var(--pti-line) !important;
  color: #1d1d1f !important;
  background: rgba(255, 255, 255, .72) !important;
}

body.pti-login-page .theme-mini-toggle {
  width: 42px !important;
  height: 42px !important;
  border: 1px solid rgba(255, 255, 255, .17) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, .10) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  clip-path: none !important;
}

/* ========================================================================== */
/* Finitions responsive et alignements                                        */
/* ========================================================================== */

body.pti-dashboard-page :where(
  .card,
  .stat,
  .mini-card,
  .pilotage-card,
  .pilotage-grid,
  .pilotage-tile,
  .section-head,
  .order-accordion,
  .order-summary-row,
  .order-main-info,
  .order-details-panel,
  .order-detail-grid,
  .order-detail-card,
  .order-products-panel,
  .order-item,
  .entity-accordion,
  .entity-summary-row,
  .request-card,
  .client-doc-card
) {
  min-width: 0 !important;
}

body.pti-dashboard-page :where(
  .card,
  .stat,
  .mini-card,
  .pilotage-tile,
  .order-detail-card,
  .order-products-panel,
  .request-card,
  .client-doc-card
) :where(h1, h2, h3, h4, p, strong, small, span) {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

body.pti-dashboard-page .section-head {
  align-items: flex-start !important;
  gap: 12px !important;
}

body.pti-dashboard-page .section-head > :first-child {
  min-width: 0;
}

body.pti-dashboard-page .section-head .meta {
  flex: 0 1 auto;
  min-width: 0;
  line-height: 1.3;
  text-align: right;
  overflow-wrap: anywhere;
}

body.pti-dashboard-page .stat strong,
body.pti-dashboard-page .mini-card .value {
  display: block;
  max-width: 100%;
  font-size: clamp(20px, 2.1vw, 28px) !important;
  line-height: 1.04 !important;
}

body.pti-dashboard-page .order-detail-card,
body.pti-dashboard-page .order-products-panel {
  padding: 15px !important;
}

body.pti-dashboard-page .order-detail-card > *,
body.pti-dashboard-page .order-item > * {
  min-width: 0;
}

body.pti-dashboard-page .order-item-name,
body.pti-dashboard-page .order-item-meta,
body.pti-dashboard-page .order-detail-card small {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

body.pti-dashboard-page .barcode-print-link {
  border-color: var(--line) !important;
  color: var(--text) !important;
  background: rgba(99, 99, 105, .08) !important;
}

body.pti-dashboard-page .barcode-print-link:hover,
body.pti-dashboard-page .inventory-row.is-highlighted {
  border-color: rgba(99, 99, 105, .40) !important;
  background: rgba(99, 99, 105, .11) !important;
  box-shadow: 0 0 0 3px rgba(99, 99, 105, .10) !important;
}

body.pti-dashboard-page .variant-barcode-link,
body.pti-dashboard-page .scanner-modal-kicker,
body.pti-dashboard-page .inventory-modal-kicker,
body.pti-dashboard-page .push-head small {
  color: var(--pti-blue) !important;
}

body.pti-dashboard-page .push-preference input {
  accent-color: var(--pti-blue) !important;
}

body.pti-dashboard-page .order-shipping-ticket-link {
  border-color: transparent !important;
  color: #ffffff !important;
  background: var(--pti-blue) !important;
  box-shadow: 0 8px 20px rgba(60, 60, 67, .16) !important;
  white-space: nowrap !important;
}

body.pti-dashboard-page .order-online-invoice-link {
  border-color: rgba(60, 60, 67, .28) !important;
  color: #1d1d1f !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 8px 20px rgba(60, 60, 67, .08) !important;
  white-space: nowrap !important;
}

body.pti-dashboard-page.theme-dark .order-online-invoice-link {
  border-color: rgba(142, 142, 147, .5) !important;
  color: #f5f5f7 !important;
  background: rgba(44, 44, 46, .96) !important;
}

body.pti-dashboard-page .order-action-row {
  grid-template-columns: minmax(330px, 1fr) auto auto auto auto !important;
  align-items: end !important;
}

@media (max-width: 1050px) {
  body.pti-dashboard-page .order-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.pti-dashboard-page .order-action-row .order-status-form-wide {
    grid-column: 1 / -1;
  }

  body.pti-dashboard-page .order-action-row .btn-link {
    width: 100%;
    justify-content: center;
  }
}

body.pti-generator-page .form-panel,
body.pti-generator-page .form-panel * {
  box-sizing: border-box;
}

body.pti-generator-page .form-panel {
  line-height: 1.35 !important;
}

body.pti-generator-page .form-section {
  min-width: 0 !important;
  padding: 18px !important;
}

body.pti-generator-page .form-section > h2 {
  margin: 0 0 16px !important;
  padding: 0 2px !important;
  font-size: 19px !important;
  line-height: 1.2 !important;
}

body.pti-generator-page .form-subsection {
  min-width: 0 !important;
  margin-top: 14px !important;
  padding: 16px !important;
}

body.pti-generator-page .form-subsection:first-of-type {
  margin-top: 0 !important;
}

body.pti-generator-page .form-subsection-label {
  display: flex !important;
  align-items: center !important;
  min-height: 22px !important;
  margin: 0 0 14px !important;
  padding: 0 2px 11px !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  overflow-wrap: anywhere;
}

body.pti-generator-page .form-panel .grid2,
body.pti-generator-page .form-panel .grid3,
body.pti-generator-page .form-panel .line-item {
  min-width: 0 !important;
  gap: 12px !important;
}

body.pti-generator-page .form-panel .field,
body.pti-generator-page .form-panel .line-item > div {
  min-width: 0 !important;
}

body.pti-generator-page .form-panel .field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

body.pti-generator-page .form-panel label {
  display: block !important;
  min-height: 0 !important;
  margin: 0 0 7px !important;
  padding: 0 2px !important;
  font-size: 12px !important;
  line-height: 1.32 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

body.pti-generator-page .form-panel input,
body.pti-generator-page .form-panel select,
body.pti-generator-page .form-panel textarea {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 43px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  font-size: 12.5px !important;
  line-height: 1.3 !important;
}

body.pti-generator-page .form-panel textarea {
  min-height: 82px !important;
  resize: vertical;
}

body.pti-generator-page .form-panel .field-hint {
  margin: 7px 2px 0 !important;
  font-size: 10.5px !important;
  line-height: 1.45 !important;
  overflow-wrap: anywhere;
}

body.pti-generator-page .form-panel .offered-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  min-height: 43px !important;
  margin: 0 !important;
  padding: 7px 6px !important;
  font-size: 9px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
}

body.pti-generator-page .form-panel .offered-toggle input {
  width: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  margin-right: 0 !important;
  padding: 0 !important;
}

body.pti-generator-page .form-panel .offered-toggle span {
  min-width: 0;
  font-size: 9px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

body.pti-generator-page .form-panel .line-item {
  padding: 13px !important;
}

body.pti-generator-page .form-panel .line-item .btn-del {
  align-self: end !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 43px !important;
  min-height: 43px !important;
  padding: 0 !important;
}

@media (max-width: 720px) {
  body.pti-dashboard-page .section-head h2,
  body.pti-dashboard-page .section-head h3 {
    max-width: 70%;
  }

  body.pti-dashboard-page .section-head .meta {
    max-width: 42%;
    font-size: 11px !important;
  }

  body.pti-dashboard-page .stat strong,
  body.pti-dashboard-page .mini-card .value {
    font-size: clamp(19px, 6.2vw, 25px) !important;
  }

  body.pti-dashboard-page .order-summary-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 9px !important;
  }

  body.pti-dashboard-page .order-main-info small {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  body.pti-dashboard-page .order-desktop-right {
    min-width: 0 !important;
  }

  body.pti-dashboard-page .order-action-row {
    grid-template-columns: 1fr !important;
  }

  body.pti-dashboard-page .order-action-row .order-status-form-wide,
  body.pti-dashboard-page .order-action-row .order-total-box {
    grid-column: auto !important;
  }

  body.pti-generator-page .form-section {
    padding: 14px !important;
  }

  body.pti-generator-page .form-subsection {
    padding: 13px !important;
  }

  body.pti-generator-page .form-section > h2 {
    font-size: 17px !important;
  }
}

@media (max-width: 620px) {
  body.pti-login-page,
  body.pti-setup-page {
    align-items: stretch !important;
    padding: 0 !important;
  }

  body.pti-login-page .page,
  body.pti-setup-page .card {
    max-width: none !important;
  }

  body.pti-login-page .page {
    display: flex;
    align-items: center;
    min-height: 100dvh;
    padding: calc(70px + env(safe-area-inset-top)) 12px 18px;
  }

  body.pti-login-page .card,
  body.pti-setup-page .card {
    padding: 28px 22px !important;
    border-radius: 28px !important;
  }
}

@media (hover: hover) and (pointer: fine) {
  body.pti-brand-page button:hover,
  body.pti-brand-page a.btn:hover,
  body.pti-brand-page a.btn-link:hover {
    filter: brightness(1.015);
  }
}

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

/* Rend moins coûteuses les longues listes sur téléphone sans modifier leur aspect. */
@media (max-width: 820px) {
  body.pti-dashboard-page :where(
    .card,
    .order-accordion,
    .entity-accordion,
    .request-card,
    .client-doc-card,
    .pilotage-tile
  ) {
    content-visibility: auto;
    contain-intrinsic-size: auto 128px;
  }

  body.pti-dashboard-page :where(
    .card,
    .utility-details,
    .order-accordion,
    .entity-accordion,
    .request-card,
    .client-doc-card
  ) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* Navigation finances : contenu strictement contenu dans le bouton et son rail. */
body.pti-dashboard-page .tabs .nav-dropdown {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.pti-dashboard-page .tabs .nav-dropdown > .nav-folder-btn {
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow: hidden !important;
  gap: 0 !important;
}

body.pti-dashboard-page .tabs .nav-dropdown > .nav-folder-btn .tab-icon {
  flex: 0 0 auto !important;
}

body.pti-dashboard-page .tabs .nav-dropdown > .nav-folder-btn .tab-label {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  line-height: 1.2 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.pti-dashboard-page .tabs .nav-dropdown > .nav-folder-btn .nav-caret {
  flex: 0 0 auto !important;
  margin-left: auto !important;
  padding-left: 8px !important;
  line-height: 1 !important;
}

body.pti-dashboard-page .tabs .nav-dropdown-menu {
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body.pti-dashboard-page .tabs .nav-dropdown-menu .nav-dropdown-item,
body.pti-dashboard-page .tabs .nav-dropdown-menu .nav-dropdown-item .tab-label {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (min-width: 1181px) {
  body.pti-dashboard-page .tabs .nav-dropdown {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
  }

  body.pti-dashboard-page .tabs .nav-dropdown > .nav-folder-btn,
  body.pti-dashboard-page .tabs .nav-dropdown > .nav-dropdown-menu {
    flex: 0 0 auto !important;
    width: 100% !important;
  }
}

@media (min-width: 1101px) and (max-width: 1180px) {
  body.pti-dashboard-page .tabs .nav-dropdown {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 190px !important;
  }

  body.pti-dashboard-page .tabs .nav-dropdown > .nav-folder-btn {
    width: auto !important;
    min-width: 0 !important;
    max-width: 190px !important;
    padding: 9px 11px !important;
  }
}

/* Les sorties imprimables existantes restent strictement inchangées. */
@media print {
  body.pti-dashboard-page,
  body.pti-history-page,
  body.pti-login-page,
  body.pti-setup-page {
    background: #ffffff !important;
  }
}
