/* Module Imports & exports — styles propres (chargés sur toutes les pages : garder léger). */
.dio-steps { margin-bottom: 1.25rem; }
.dio-filter-select { width: auto; min-width: 11rem; max-width: 16rem; }
.dio-step-panel { min-height: 320px; }
.dio-foot { position: sticky; bottom: 0; z-index: 5; display: flex; gap: .6rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .85rem 1.3rem; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-elev) 92%, transparent); backdrop-filter: blur(8px); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.dio-foot .grow { flex: 1; }

.dio-type { display: flex; align-items: flex-start; gap: .8rem; padding: .95rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg-elev); cursor: pointer; text-align: left; transition: border-color .12s, background .12s, box-shadow .12s; min-height: 44px; color: inherit; width: 100%; font: inherit; }
.dio-type:hover { border-color: var(--text-3); }
.dio-type.is-active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.dio-type .icon-box { width: 2.5rem; height: 2.5rem; min-width: 2.5rem; display: grid; place-items: center; font-size: 1.2rem; border-radius: var(--r-sm); }
.dio-type-title { font-weight: 700; line-height: 1.25; }
.dio-type-desc { font-size: .8rem; color: var(--text-2); line-height: 1.4; margin-top: .15rem; }
.dio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; }

.dio-split { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.dio-sheet-list { display: flex; flex-direction: column; gap: .45rem; max-height: 62vh; overflow: auto; padding-right: .2rem; }
.dio-sheet { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .7rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev); }
.dio-sheet-role { grid-column: 2; }
.dio-sheet > .check { align-self: start; margin-top: .2rem; }
.dio-sheet-role .select { width: 100%; }
@media (max-width: 1100px) { .dio-split { grid-template-columns: minmax(0, 1fr); } .dio-sheet-list { max-height: 40vh; } }
.dio-sheet.is-on { border-color: var(--brand-line); background: color-mix(in srgb, var(--brand-soft) 45%, var(--bg-elev)); }
.dio-sheet.is-current { box-shadow: inset 3px 0 0 var(--brand); }
.dio-sheet-meta { font-size: .78rem; color: var(--text-2); display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.dio-sheet-meta > span { display: inline-flex; align-items: center; gap: .25rem; }

.dio-grid-preview { overflow: auto; max-height: 360px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev); }
.dio-grid-preview table { border-collapse: collapse; font-size: .78rem; min-width: 100%; }
.dio-grid-preview th, .dio-grid-preview td { border: 1px solid var(--line); padding: .3rem .5rem; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.dio-grid-preview thead th { position: sticky; top: 0; background: var(--bg-sunken); color: var(--text-3); font-weight: 700; z-index: 1; }
.dio-grid-preview tbody th { position: sticky; left: 0; background: var(--bg-sunken); color: var(--text-3); font-weight: 600; cursor: pointer; text-align: right; }
.dio-grid-preview tr.is-header td { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.dio-grid-preview tr.is-header th { background: var(--brand); color: var(--on-brand); }
.dio-grid-preview tr.is-before td { color: var(--text-3); }
.dio-grid-preview td.has-note { box-shadow: inset -6px 6px 0 -3px var(--signal); }

.dio-map { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.dio-map th { text-align: left; font-size: .76rem; color: var(--text-3); font-weight: 700; padding: .55rem .7rem; background: var(--bg-sunken); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.dio-map td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dio-map tr.is-mapped td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.dio-map tr.is-ignored td { color: var(--text-3); }
.dio-col { display: inline-grid; place-items: center; min-width: 2rem; height: 1.6rem; padding: 0 .35rem; border-radius: 6px; background: var(--bg-sunken); font-weight: 750; font-size: .75rem; color: var(--text-2); }
.dio-samples { font-size: .78rem; color: var(--text-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dio-map .select { min-height: 2.3rem; padding-top: .35rem; padding-bottom: .35rem; font-size: .86rem; }

.dio-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.dio-kpi { display: flex; align-items: center; gap: .65rem; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-elev); cursor: pointer; text-align: left; font: inherit; color: inherit; min-height: 44px; }
.dio-kpi.is-active { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.dio-kpi .icon-box { width: 2.2rem; height: 2.2rem; min-width: 2.2rem; display: grid; place-items: center; font-size: 1.05rem; border-radius: var(--r-sm); }
.dio-kpi b { display: block; font-size: 1.25rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dio-kpi small { color: var(--text-2); font-size: .76rem; }
.tone-box-success { --b-bg: var(--brand-soft); --b-fg: var(--brand-ink); background: var(--brand-soft); color: var(--brand-ink); }
.tone-box-info { --b-bg: var(--info-soft); --b-fg: var(--info); background: var(--info-soft); color: var(--info); }
.tone-box-muted { --b-bg: var(--muted-soft); --b-fg: var(--text-2); background: var(--muted-soft); color: var(--text-2); }
.tone-box-danger { --b-bg: var(--danger-soft); --b-fg: var(--danger); background: var(--danger-soft); color: var(--danger); }
.tone-box-warning { --b-bg: var(--warning-soft); --b-fg: var(--warning); background: var(--warning-soft); color: var(--warning); }
.tone-box-violet { --b-bg: var(--violet-soft); --b-fg: var(--violet); background: var(--violet-soft); color: var(--violet); }

.dio-rows { display: flex; flex-direction: column; }
.dio-row { border-bottom: 1px solid var(--line); }
.dio-row:last-child { border-bottom: 0; }
.dio-row-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .75rem; align-items: center; padding: .7rem 1rem; cursor: pointer; min-height: 48px; }
.dio-row-head:hover { background: var(--bg-hover); }
.dio-row.is-skipped .dio-row-head { opacity: .55; }
.dio-row-title { font-weight: 650; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dio-row-sub { font-size: .76rem; color: var(--text-3); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.dio-row-sub > span { display: inline-flex; align-items: center; gap: .25rem; }
.dio-row-body { padding: .2rem 1rem 1rem 3.2rem; display: grid; gap: .8rem; }
.dio-changes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .1rem 1.4rem; font-size: .84rem; margin: 0; padding: .55rem .75rem; border-radius: var(--r-sm); background: var(--bg-sunken); }
.dio-change { display: grid; grid-template-columns: minmax(110px, 42%) minmax(0, 1fr); gap: .6rem; padding: .22rem 0; border-bottom: 1px dashed var(--line); }
.dio-changes dt { color: var(--text-3); font-weight: 600; }
.dio-changes dd { margin: 0; overflow-wrap: anywhere; }
.dio-changes del { color: var(--text-3); text-decoration: line-through; margin-right: .35rem; }
.dio-msgs { display: flex; flex-direction: column; gap: .25rem; font-size: .83rem; }
.dio-msgs > div { display: flex; gap: .45rem; align-items: flex-start; }
.dio-msgs .ph { margin-top: .15rem; flex-shrink: 0; }
.dio-events { display: flex; flex-direction: column; gap: .4rem; }
.dio-event { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); font-size: .84rem; }
.dio-event.is-off { opacity: .5; }
.dio-event .icon-box { width: 2rem; height: 2rem; min-width: 2rem; display: grid; place-items: center; font-size: 1rem; border-radius: 8px; }
.dio-exit { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; padding: .7rem; border-radius: var(--r-sm); background: var(--warning-soft); }

.dio-progress { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; padding: 1.5rem 0; }
.dio-progress .progress { height: .7rem; }
.dio-big-icon { width: 4rem; height: 4rem; display: grid; place-items: center; font-size: 2rem; border-radius: var(--r-lg); margin: 0 auto .6rem; }

.dio-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .2rem .9rem; max-height: 330px; overflow: auto; padding: .2rem; }
.dio-cols .check { padding: .35rem .2rem; min-height: 36px; align-items: center; }
.dio-selected { display: flex; flex-wrap: wrap; gap: .35rem; }
.dio-selected .chip { cursor: grab; }
.dio-selected .chip button { border: 0; background: none; padding: 0; margin-left: .15rem; color: var(--text-3); cursor: pointer; display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; }
.dio-preview-table { max-height: 300px; overflow: auto; }

@media (max-width: 767px) {
  .dio-steps .stepper-item.is-current { flex: 3.2; }
  .dio-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
  .dio-kpi { flex-direction: column; align-items: flex-start; gap: .1rem; padding: .55rem .65rem; }
  .dio-kpi .icon-box { display: none; }
  .dio-kpi small { line-height: 1.25; }
  .dio-tools .btn span { display: none; }
  .dio-steps .stepper-label { white-space: nowrap; overflow: hidden; }
  .dio-row-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .dio-row-head .dio-hide-sm { display: none; }
  .dio-row-body { padding-left: 1rem; }
  .dio-changes { grid-template-columns: 1fr; }
  .dio-change { grid-template-columns: minmax(100px, 40%) minmax(0, 1fr); }
  .dio-map thead { display: none; }
  .dio-map, .dio-map tbody, .dio-map tr, .dio-map td { display: block; width: 100%; }
  .dio-map tr { padding: .6rem .2rem; border-bottom: 1px solid var(--line); }
  .dio-map td { border: 0; padding: .2rem .4rem; }
  .dio-foot { padding: .75rem 1rem; }
  .dio-foot .btn { flex: 1; min-height: 44px; }
}

/* v2.0 — écran d'export sans défilement de page, exports planifiés */
@media (min-width: 768px) {
  .dio-fill { display: flex; flex-direction: column; gap: var(--gap-page, 1rem); min-height: 0; }
  .dio-fill > * { flex-shrink: 0; }
  .dio-fill > .dio-pane { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 .15rem 1rem; }
  .dio-fill > .page-head { margin-bottom: 0; }
  .dio-fill > .tabs { margin-bottom: 0; }
}
.dio-sched { align-items: center; gap: .35rem; flex-wrap: wrap; }
.dio-sched .ph { line-height: 1; }
@media (min-width: 768px) {
  .dio-fill > .dio-wiz { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .dio-wiz > .dio-wiz-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .dio-wiz > .dio-foot { flex-shrink: 0; }
  .dio-fill > .dio-steps { margin: 0; }
}
.dio-tools .spin { animation: dio-spin 1s linear infinite; }
@keyframes dio-spin { to { transform: rotate(360deg); } }
.panel.fill > .dio-rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
