/* Ductis — feuille de style de l'application (v2.8)
   Aucune règle inline : la CSP interdit style="" et <style>. */
:root {
  --navy-900: #041128;
  --navy-800: #05193a;
  --navy-700: #0c2a55;
  --navy-600: #12386f;
  --ink: #12293d;
  --ink-2: #3f5568;
  --muted: #6b7f90;
  --line: #e2e9ef;
  --line-2: #eef3f6;
  --bg: #f4f7fa;
  --card: #ffffff;
  --accent: #0a6cf1;
  --accent-600: #0857c8;
  --accent-50: #eaf2ff;
  --blue: #3c8fc4;
  --blue-50: #eaf3fa;
  --amber: #b7791f;
  --amber-50: #fdf5e6;
  --red: #b54040;
  --red-50: #fbeeee;
  --green: #2f8a57;
  --green-50: #e9f6ee;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(5, 25, 58, 0.04), 0 6px 24px rgba(5, 25, 58, 0.05);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.25;
}
h1 {
  font-size: 26px;
  letter-spacing: -0.6px;
  margin: 2px 0 4px;
}
h2 {
  font-size: 17px;
  margin: 0 0 14px;
}
h3 {
  font-size: 15px;
  margin: 22px 0 10px;
}
p {
  color: var(--ink-2);
  margin: 0 0 12px;
}
a {
  color: var(--accent-600);
}
small,
.muted {
  color: var(--muted);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.hidden {
  display: none !important;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  padding: 9px 15px;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.btn:hover:not(:disabled) {
  background: var(--accent-600);
}
.btn.alt {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn.alt:hover:not(:disabled) {
  border-color: #c9d6df;
  background: #fbfcfd;
}
.btn.soft {
  background: var(--accent-50);
  color: #0a4fb3;
}
.btn.soft:hover:not(:disabled) {
  background: #d9e8ff;
}
.btn.danger {
  background: #fff;
  color: var(--red);
  border-color: #efcfcf;
}
.btn.danger:hover:not(:disabled) {
  background: var(--red-50);
}
.btn.ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: transparent;
}
.btn.ghost:hover:not(:disabled) {
  background: var(--line-2);
}
.btn.small {
  padding: 6px 10px;
  font-size: 13px;
}
.btn.block {
  width: 100%;
}
.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.link {
  background: none;
  border: 0;
  color: var(--accent-600);
  font-weight: 650;
  padding: 0;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.actions.end {
  justify-content: flex-end;
}

/* ---------- Structure ---------- */
.shell {
  display: flex;
  min-height: 100vh;
}
.side {
  width: 248px;
  flex-shrink: 0;
  background: var(--navy-800);
  color: #fff;
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 8px;
  color: #fff;
  text-decoration: none;
}
.brand img {
  width: 34px;
  height: 34px;
}
.brand span {
  font-weight: 800;
  font-size: 25px;
  letter-spacing: -1.2px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #7f98b8;
  font-weight: 700;
  padding: 14px 12px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: 9px;
  color: #c6d3e6;
  text-decoration: none;
  font-weight: 550;
  font-size: 14px;
}
.nav a svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
  flex-shrink: 0;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav a.active {
  background: var(--navy-600);
  color: #fff;
}
.nav a.active svg {
  opacity: 1;
  color: #3fd0f7;
}
.nav .count {
  margin-left: auto;
  background: #c94b4b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 7px;
}
.sidefoot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 10px 0;
  font-size: 12px;
  color: #8ea6c4;
}
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.org small {
  display: block;
  font-size: 12px;
}
.org strong {
  font-size: 15px;
}
.user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-50);
  color: #0a4fb3;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: 13px;
}
.user-meta {
  text-align: right;
  line-height: 1.25;
}
.user-meta small {
  display: block;
  font-size: 12px;
}
.content {
  padding: 26px 32px 60px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head p {
  margin: 0;
}
.eyebrow {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--accent-600);
  font-weight: 750;
}
.crumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
.crumb a {
  color: var(--muted);
  text-decoration: none;
}
.crumb a:hover {
  color: var(--accent-600);
}

/* ---------- Cartes, panneaux ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.panel.flush {
  padding: 0;
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.panel-head h2 {
  margin: 0;
}
.panel-body {
  padding: 18px 20px;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid.k4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid.k3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.k2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.main-aside {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.kpi span {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi strong {
  display: block;
  font-size: 25px;
  letter-spacing: -0.8px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi small {
  display: block;
  margin-top: 2px;
}
.kpi.warn strong {
  color: var(--red);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--accent);
}
.dot.blue {
  background: var(--blue);
}
.dot.amber {
  background: var(--amber);
}
.dot.red {
  background: var(--red);
}

/* ---------- Tableaux ---------- */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafcfd;
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tr.clickable {
  cursor: pointer;
}
tr.clickable:hover td {
  background: #f8fbfc;
}
.n,
td.n,
th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td .sub {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.strong {
  font-weight: 650;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* ---------- Pastilles de statut ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 99px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 650;
  background: var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.teal {
  background: var(--accent-50);
  color: #0a4fb3;
}
.pill.blue {
  background: var(--blue-50);
  color: #1e5f8a;
}
.pill.green {
  background: var(--green-50);
  color: var(--green);
}
.pill.amber {
  background: var(--amber-50);
  color: var(--amber);
}
.pill.red {
  background: var(--red-50);
  color: var(--red);
}

/* ---------- Onglets / filtres ---------- */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 9px 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: -1px;
}
.tabs button.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.tabs button .n {
  font-size: 12px;
  background: var(--line-2);
  border-radius: 99px;
  padding: 0 7px;
  margin-left: 4px;
}
.panel-head .tabs {
  border: 0;
  margin: 0;
}

/* ---------- Formulaires ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
  min-width: 0;
}
.field label,
.label {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
}
.field small {
  font-size: 12px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #d3dde5;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: #fff;
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(10, 108, 241, 0.15);
}
textarea {
  min-height: 84px;
  resize: vertical;
}
input[type="checkbox"] {
  width: auto;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.form-grid .span2 {
  grid-column: span 2;
}
.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.inline-form .field {
  margin: 0;
  flex: 1 1 160px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 550;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px 2px;
  margin: 0 0 16px;
}
legend {
  font-weight: 700;
  font-size: 13px;
  padding: 0 6px;
  color: var(--ink-2);
}

/* ---------- Éditeur de lignes ---------- */
.lines-editor {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.lines-editor th {
  background: #f6f9fb;
}
.lines-editor td {
  padding: 6px 6px;
  vertical-align: top;
}
.lines-editor input,
.lines-editor select {
  padding: 7px 8px;
  font-size: 14px;
}
.lines-editor .c-desc {
  min-width: 220px;
}
.lines-editor .c-qty {
  width: 74px;
}
.lines-editor .c-price {
  width: 110px;
}
.lines-editor .c-disc {
  width: 80px;
}
.lines-editor .c-vat {
  width: 92px;
}
.lines-editor .c-total {
  width: 110px;
  padding-top: 14px;
}
.lines-editor .c-del {
  width: 40px;
}
.lines-editor .desc {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-2);
}
.totals {
  margin-left: auto;
  width: 320px;
  max-width: 100%;
}
.totals div {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-variant-numeric: tabular-nums;
}
.totals .grand {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 800;
  font-size: 17px;
}

/* ---------- Description / fiches ---------- */
.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  margin: 0;
}
.kv dt {
  color: var(--muted);
  font-size: 13px;
}
.kv dd {
  margin: 0;
  font-weight: 550;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline li {
  padding: 8px 0 8px 18px;
  border-left: 2px solid var(--line);
  position: relative;
  font-size: 14px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 13px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Notices ---------- */
.notice {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  background: var(--blue-50);
  color: #1e4f72;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notice.warn {
  background: var(--amber-50);
  color: #7a5413;
}
.notice.danger {
  background: var(--red-50);
  color: #8d2f2f;
}
.notice svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.notice p {
  color: inherit;
  margin: 0;
}
.empty {
  text-align: center;
  padding: 34px 20px;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 4px;
}
.empty .btn {
  margin-top: 12px;
}
.todo {
  list-style: none;
  margin: 0;
  padding: 0;
}
.todo li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.todo li:last-child {
  border: 0;
}
.todo .grow {
  flex: 1;
  min-width: 0;
}
.checklist li.done .grow {
  color: var(--muted);
  text-decoration: line-through;
}
.tick {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #c8d5de;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.done .tick {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tick svg {
  width: 12px;
  height: 12px;
}

/* ---------- Graphique ---------- */
.chart svg {
  width: 100%;
  height: 190px;
  display: block;
}
.chart .bar {
  fill: var(--accent);
}
.chart .bar.current {
  fill: var(--navy-600);
}
.chart text {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}
.chart .val {
  fill: var(--ink-2);
  font-weight: 650;
}
.chart .axis {
  stroke: var(--line);
}

/* ---------- Kanban ---------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.lane {
  background: #edf2f6;
  border-radius: var(--radius);
  padding: 10px;
  min-height: 160px;
}
.lane h3 {
  margin: 2px 4px 10px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}
.lane h3 small {
  font-weight: 600;
}
.deal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(5, 25, 58, 0.04);
}
.deal strong {
  display: block;
  font-size: 14px;
}
.deal .amount {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  font-size: 13px;
  margin: 2px 0 8px;
}
.deal select {
  padding: 5px 7px;
  font-size: 13px;
}

/* ---------- Dialogue & toasts ---------- */
.dialogback {
  position: fixed;
  inset: 0;
  background: rgba(4, 17, 40, 0.42);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}
.dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 24px 70px rgba(4, 17, 40, 0.3);
}
.dialog.wide {
  width: min(1080px, 100%);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
}
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
}
.toast {
  background: var(--navy-800);
  color: #fff;
  padding: 11px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(4, 17, 40, 0.25);
  font-size: 14px;
  max-width: 380px;
  animation: toast-in 0.18s ease-out;
}
.toast.error {
  background: #8d2f2f;
}
@keyframes toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  background: var(--line-2);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace;
}

/* ---------- Authentification ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.authvisual {
  background: radial-gradient(1200px 600px at 10% 110%, #0a3f8f 0%, transparent 60%), linear-gradient(160deg, var(--navy-900), #0a2a5c);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.authvisual .brand span {
  font-size: 30px;
}
.authvisual .brand img {
  width: 44px;
  height: 44px;
}
.authvisual h1 {
  color: #fff;
  font-size: 44px;
  letter-spacing: -1.6px;
  margin: 0 0 14px;
  max-width: 520px;
}
.authvisual p {
  color: #bccde6;
  font-size: 17px;
  max-width: 470px;
}
.pillars {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: #a4c3ec;
  font-size: 12px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 650;
}
.authbox {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.authform {
  width: min(420px, 100%);
}
.authform h1 {
  font-size: 28px;
}
.authform .btn {
  width: 100%;
  padding: 11px;
  margin-top: 4px;
}
.authform .switch {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.footerhint {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Connect ---------- */
.connect-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  min-height: 460px;
}
.connect-grid aside {
  border-right: 1px solid var(--line-2);
  padding: 14px;
}
.connect-grid section {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
}
.conv {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 550;
}
.conv:hover {
  background: var(--line-2);
}
.conv.active {
  background: var(--accent-50);
  color: #0a4fb3;
}
.connect-messages {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0 12px;
}
.connect-message {
  background: #f6f9fb;
  border-radius: 10px;
  padding: 9px 12px;
}
.connect-message p {
  margin: 3px 0 0;
  color: var(--ink);
  white-space: pre-wrap;
}
.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  border-top: 1px solid var(--line-2);
  padding-top: 12px;
}
.composer textarea {
  min-height: 44px;
  height: 44px;
}
.ductis-call-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 17, 40, 0.6);
  display: grid;
  place-items: center;
  z-index: 50;
}
.ductis-call-overlay[hidden] {
  display: none;
}
.ductis-call-modal {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  width: min(820px, 94vw);
}
.ductis-call-video {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.ductis-call-video video {
  width: 100%;
  background: #05193a;
  border-radius: 10px;
  aspect-ratio: 4 / 3;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---------- Modules ---------- */
.module {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
}
.module h3 {
  margin: 6px 0 8px;
}
.module ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid.k4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.main-aside {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 820px) {
  .shell {
    flex-direction: column;
  }
  .side {
    width: 100%;
    height: auto;
    position: static;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-group {
    display: none;
  }
  .content,
  .top {
    padding-left: 16px;
    padding-right: 16px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .authvisual {
    padding: 32px;
  }
  .authvisual h1 {
    font-size: 32px;
  }
  .grid.k3,
  .grid.k2,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span2 {
    grid-column: auto;
  }
  .connect-grid {
    grid-template-columns: 1fr;
  }
}
.search {
  max-width: 260px;
}
.grid + .grid,
.grid + .panel,
.panel + .grid {
  margin-top: 18px;
}
@media (max-width: 820px) {
  .side {
    padding: 12px;
    gap: 8px;
  }
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav a {
    flex-shrink: 0;
  }
  .sidefoot {
    display: none;
  }
  .user-meta {
    display: none;
  }
}
.grid + .notice {
  margin-top: 18px;
}

/* ---------- Démonstration ---------- */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 32px;
  background: #fff7e6;
  color: #7a5413;
  border-bottom: 1px solid #f1dfb8;
  font-size: 13.5px;
}
.demo-banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.demo-banner span {
  flex: 1;
}
.demo-accounts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 14px;
}
.demo-account {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition:
    border-color 0.12s,
    transform 0.12s;
}
.demo-account:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.demo-account .grow {
  flex: 1;
  min-width: 0;
}
.demo-account strong {
  display: block;
  font-size: 14.5px;
}
.demo-account small {
  color: var(--muted);
}
.demo-account svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  transform: rotate(180deg);
}
.demo-account .avatar {
  flex-shrink: 0;
}
.demo-manual {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}
.demo-manual summary {
  cursor: pointer;
  font-weight: 600;
}
.demo-manual form {
  margin-top: 12px;
}
.small {
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 820px) {
  .demo-banner {
    padding: 8px 16px;
  }
}

/* ---------- Identité Ductis ---------- */
.brand {
  padding: 6px 12px 12px;
}
.brand img {
  height: 24px;
  width: auto;
  display: block;
}
.authvisual .brand img {
  height: 38px;
  width: auto;
}
.nav a.active {
  box-shadow: inset 3px 0 0 #18d2f2;
}
.link-copy {
  margin-top: 8px;
  font-size: 12.5px;
  background: #fff;
}
.notice .btn {
  flex-shrink: 0;
  align-self: center;
}
