:root {
  --ink: #10233f;
  --ink-soft: #4d5f75;
  --navy: #09284f;
  --navy-light: #123d70;
  --paper: #f4f1ea;
  --surface: #fffefa;
  --line: #dfe3e2;
  --mint: #bfe4d0;
  --green: #19855b;
  --green-soft: #e3f5ea;
  --orange: #df7c36;
  --orange-soft: #fff0df;
  --red: #c54b4b;
  --red-soft: #fde8e5;
  --blue-soft: #e6eff9;
  --shadow: 0 18px 46px rgba(23, 42, 65, 0.09);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

/* Une regle de classe qui porte `display` l'emporte sur le `display: none`
   que le navigateur applique a [hidden] : sans ceci, masquer l'ecran de
   connexion en JavaScript ne le ferait pas disparaitre. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 88% 12%, rgba(191, 228, 208, 0.38), transparent 24rem),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 20px 20px;
  color: white;
  background:
    linear-gradient(165deg, rgba(19, 62, 111, 0.75), transparent 40%),
    var(--navy);
  z-index: 20;
}

.brand,
.profile,
.system-mini {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  padding: 0 8px 30px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--navy);
  font-size: 22px;
  font-weight: 800;
  background: var(--mint);
  border-radius: 13px 4px 13px 4px;
}

.brand strong,
.brand small,
.profile strong,
.profile small,
.system-mini strong,
.system-mini small {
  display: block;
}

.brand strong {
  letter-spacing: 0.08em;
}

.brand small,
.profile small,
.system-mini small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

.main-nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  width: 100%;
  padding: 13px 14px;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.11);
}

.nav-item.active {
  box-shadow: inset 3px 0 var(--mint);
}

.nav-icon {
  color: var(--mint);
  font-family: "IBM Plex Mono", monospace;
}

.nav-count {
  min-width: 23px;
  padding: 2px 7px;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  background: var(--mint);
  border-radius: 20px;
}

.nav-count.warning {
  color: #723614;
  background: #ffd5a7;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.system-mini {
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
}

.system-mini strong {
  font-size: 11px;
}

.status-dot,
.pulse {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: #64d397;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(100, 211, 151, 0.14);
}

.status-dot.offline {
  background: #a9b0b8;
  box-shadow: 0 0 0 4px rgba(169, 176, 184, 0.14);
}

.profile {
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  background: var(--mint);
  border-radius: 50%;
}

.profile strong {
  font-size: 12px;
}

.profile button {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.7);
  border: 0;
  background: transparent;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 36px;
  background: rgba(244, 241, 234, 0.88);
  border-bottom: 1px solid rgba(16, 35, 63, 0.08);
  backdrop-filter: blur(16px);
  z-index: 15;
}

.environment {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.top-actions,
.global-search {
  display: flex;
  align-items: center;
}

.top-actions {
  gap: 12px;
}

.global-search {
  gap: 8px;
  width: min(330px, 30vw);
  padding: 9px 13px;
  background: rgba(255, 254, 250, 0.8);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.global-search input {
  width: 100%;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
}

.icon-button,
.menu-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.icon-button span {
  color: var(--orange);
}

.icon-button b {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: white;
  font-size: 9px;
  background: var(--red);
  border-radius: 50%;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.content {
  max-width: 1500px;
  margin: 0 auto;
  padding: 42px 38px 70px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 18px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.muted {
  color: var(--ink-soft);
}

.page-head .muted {
  margin: 0;
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  transition: 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

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

.button.secondary {
  color: var(--navy);
  background: var(--surface);
  border-color: var(--line);
}

.button.orange {
  color: white;
  background: var(--orange);
}

.button.full {
  width: 100%;
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 13px 17px;
  color: #62401f;
  font-size: 12px;
  background: #fff4df;
  border: 1px solid #f3d6a8;
  border-radius: 12px;
}

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

.metric-card,
.panel,
.detail-card {
  background: rgba(255, 254, 250, 0.92);
  border: 1px solid rgba(16, 35, 63, 0.09);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius);
  cursor: pointer;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -34px;
  width: 92px;
  height: 92px;
  background: var(--metric-color, var(--mint));
  border-radius: 50%;
  opacity: 0.25;
}

.metric-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.metric-value {
  display: block;
  margin: 12px 0 5px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.metric-trend {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 20px;
}

.panel {
  padding: 22px;
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
}

.text-button {
  padding: 0;
  color: var(--navy-light);
  font-size: 11px;
  font-weight: 800;
  border: 0;
  background: transparent;
  cursor: pointer;
}

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

.priority-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  cursor: pointer;
}

.priority-row:hover {
  border-color: #afbbc6;
}

.order-code,
.code {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
}

.priority-row strong,
.priority-row small {
  display: block;
}

.priority-row strong {
  font-size: 12px;
}

.priority-row small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  border-radius: 20px;
}

.badge.manual {
  color: #8b4819;
  background: var(--orange-soft);
}

.badge.ready,
.badge.planned {
  color: #146944;
  background: var(--green-soft);
}

.badge.error,
.badge.urgent {
  color: #8f3030;
  background: var(--red-soft);
}

.badge.new {
  color: #275988;
  background: var(--blue-soft);
}

.service-list {
  display: grid;
  gap: 7px;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

.service-row:last-child {
  border: 0;
}

.service-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.service-state {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.service-state.offline {
  color: var(--ink-soft);
}

.activity-panel {
  grid-column: 1 / -1;
}

.compact-grid {
  margin: 0;
}

.history-stat {
  display: grid;
  gap: 5px;
  padding: 16px;
  background: #f8f7f2;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.history-stat span,
.history-stat small {
  color: var(--ink-soft);
  font-size: 10px;
}

.history-stat strong {
  font-size: 22px;
  letter-spacing: -0.04em;
}

.connector-note {
  margin: 16px 0 0;
  padding-top: 14px;
  font-size: 10px;
  line-height: 1.6;
  border-top: 1px solid var(--line);
}

.chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 12px;
  height: 190px;
  padding-top: 20px;
  border-bottom: 1px solid var(--line);
}

.chart-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 8px;
  height: 100%;
  color: var(--ink-soft);
  font-size: 9px;
}

.bars {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 140px;
}

.bar {
  width: 12px;
  height: var(--height);
  background: var(--navy-light);
  border-radius: 5px 5px 0 0;
}

.bar.alt {
  background: var(--mint);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.filter-button {
  padding: 8px 12px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  cursor: pointer;
}

.filter-button.active {
  color: white;
  background: var(--navy);
  border-color: var(--navy);
}

.table-panel {
  overflow: hidden;
  padding: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 15px 18px;
  color: var(--ink-soft);
  font-size: 9px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #f8f7f2;
}

.data-table td {
  padding: 17px 18px;
  font-size: 11px;
  border-top: 1px solid var(--line);
}

.data-table tbody tr {
  cursor: pointer;
  transition: 120ms ease;
}

.data-table tbody tr:hover {
  background: #f7faf8;
}

.cell-main,
.cell-sub {
  display: block;
}

.cell-main {
  font-weight: 700;
}

.cell-sub {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.empty-state {
  padding: 50px;
  color: var(--ink-soft);
  text-align: center;
}

.detail-head {
  align-items: center;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.detail-stack {
  display: grid;
  gap: 18px;
}

.detail-card {
  padding: 24px;
  border-radius: var(--radius);
}

.detail-section + .detail-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

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

.info-item label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.info-item strong {
  display: block;
  font-size: 12px;
  line-height: 1.5;
}

.phone-highlight {
  color: var(--green);
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px !important;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  padding: 11px 4px;
  margin-right: 18px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
}

.tab-button.active {
  color: var(--navy);
  border-bottom-color: var(--orange);
}

.mail-preview,
.technical-preview {
  padding: 18px;
  font-size: 11px;
  line-height: 1.7;
  background: #f7f5ef;
  border-radius: 12px;
}

.technical-preview {
  overflow-x: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  white-space: pre-wrap;
}

.action-card {
  position: sticky;
  top: 94px;
  border-top: 5px solid var(--orange);
}

.action-card .alert-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  color: #8b4819;
  font-size: 20px;
  background: var(--orange-soft);
  border-radius: 12px;
}

.action-card p {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.action-buttons {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  padding-bottom: 20px;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: var(--line);
}

.timeline-dot {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  background: var(--green);
  border: 4px solid var(--green-soft);
  border-radius: 50%;
}

.timeline-dot.pending {
  background: var(--orange);
  border-color: var(--orange-soft);
}

.timeline-item strong,
.timeline-item small {
  display: block;
}

.timeline-item strong {
  font-size: 10px;
}

.timeline-item small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.drawer {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 480px);
  background: rgba(8, 27, 50, 0.45);
  z-index: 50;
}

.drawer[hidden] {
  display: none;
}

.drawer-backdrop {
  cursor: pointer;
}

.drawer-panel {
  overflow-y: auto;
  padding: 32px;
  background: var(--surface);
  box-shadow: -18px 0 50px rgba(8, 27, 50, 0.2);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.drawer-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
}

.form-field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.form-field label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: white;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--navy-light);
}

.candidate-card {
  margin: 20px 0;
  padding: 16px;
  border: 1px dashed #c6a474;
  border-radius: 12px;
  background: #fffaf0;
}

.candidate-card p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.live-banner {
  color: #174d38;
  background: #edf8f1;
  border-color: #bfe4d0;
}

.upload-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 22px;
  padding: 30px;
  background:
    linear-gradient(120deg, rgba(191, 228, 208, 0.42), transparent 55%),
    var(--surface);
  border: 2px dashed #aabfba;
  border-radius: var(--radius);
  transition: 160ms ease;
}

.upload-card.compact {
  padding: 22px 26px;
}

.upload-card.dragging {
  background: #e6f5ec;
  border-color: var(--green);
  transform: translateY(-2px);
}

.upload-card h2,
.upload-card p {
  margin-bottom: 5px;
}

.upload-card p:not(.eyebrow) {
  color: var(--ink-soft);
  font-size: 11px;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 66px;
  color: white;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  background: var(--navy);
  border-radius: 8px 8px 14px 8px;
}

.compact-empty {
  padding: 28px;
}

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

.edit-grid label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.edit-grid label.wide {
  grid-column: 1 / -1;
}

.edit-grid input {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.candidate-stack,
.message-list,
.slot-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.candidate-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 0;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.slot-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.slot-row.selected {
  background: var(--green-soft);
  border-color: var(--green);
}

.slot-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: white;
  font-weight: 800;
  background: var(--navy);
  border-radius: 50%;
}

.slot-row strong,
.slot-row small {
  display: block;
}

.slot-row small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.message {
  max-width: 82%;
  padding: 13px 15px;
  background: #f4f5f3;
  border-radius: 14px 14px 14px 4px;
}

.message.outbound {
  margin-left: auto;
  color: white;
  background: var(--navy-light);
  border-radius: 14px 14px 4px 14px;
}

.message p {
  margin: 6px 0;
  font-size: 11px;
  white-space: pre-line;
}

.message small,
.small-note {
  font-size: 9px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.toast.error {
  background: var(--red);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 380px;
  padding: 14px 18px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  background: var(--navy);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 180ms ease;
  z-index: 80;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1050px) {
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .action-card {
    position: static;
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    width: 260px;
    transition: 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    padding: 0 18px;
  }

  .environment {
    display: none;
  }

  .global-search {
    width: min(62vw, 330px);
  }

  .content {
    padding: 28px 18px 55px;
  }

  .page-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .data-table th:nth-child(3),
  .data-table td:nth-child(3),
  .data-table th:nth-child(4),
  .data-table td:nth-child(4) {
    display: none;
  }

  .upload-card {
    grid-template-columns: 1fr;
  }

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

  .edit-grid label.wide {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .metric-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .top-actions {
    flex: 1;
  }

  .global-search {
    width: 100%;
  }

  .icon-button {
    display: none;
  }

  .priority-row {
    grid-template-columns: 66px 1fr;
  }

  .priority-row .badge {
    grid-column: 2;
  }

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

  .drawer-backdrop {
    display: none;
  }
}

/* Echeance : le retard doit se voir sans avoir a lire la date. */
.info-item.overdue strong {
  color: var(--red);
}

.info-item.overdue .cell-sub {
  color: var(--red);
  font-weight: 700;
}

.info-item.due-soon strong {
  color: var(--orange);
}

.info-item.due-soon .cell-sub {
  color: var(--orange);
  font-weight: 700;
}

/* Reprise en main manuelle dans Praxedo, en attendant l'ecriture automatique. */
.candidate-card.todo {
  border: 1px solid var(--red);
  background: var(--red-soft);
}

.candidate-card.done {
  border: 1px solid var(--green);
  background: var(--green-soft);
}

.candidate-card.todo .button {
  margin-top: 12px;
}

/* Justification du choix des creneaux, destinee a l'operateur. */
.rationale {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 2px solid var(--ink-soft);
  background: #f7f8fa;
  border-radius: 0 8px 8px 0;
}

.rationale strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rationale p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
}

.ia-tag {
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #275988;
  background: var(--blue-soft);
  border-radius: 20px;
}

/* Distinguer les creneaux reellement envoyes au locataire des autres. */
.slot-row.unoffered {
  opacity: 0.55;
}

.slot-row.unoffered .slot-index {
  color: var(--ink-soft);
}

/* Relevage automatique des reponses : signaler que l'attente est prise en charge. */
.small-note.auto-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
}

.small-note.auto-sync::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pouls 2s ease-in-out infinite;
}

@keyframes pouls {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
  .small-note.auto-sync::before { animation: none; }
}

/* Redirection des SMS vers un numero de test : doit sauter aux yeux. */
.small-note.redirection {
  padding: 8px 12px;
  color: #8b4819;
  background: var(--orange-soft);
  border-radius: 8px;
  font-weight: 600;
}

/* ---------- Retours visuels pendant les actions longues ---------- */

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.85;
  animation: rotation 720ms linear infinite;
  flex: none;
}

@keyframes rotation {
  to { transform: rotate(360deg); }
}

.button.is-busy {
  cursor: progress;
  opacity: 0.9;
}

.button.is-busy:hover {
  transform: none;
}

/* Silhouette de chargement : donner la forme de ce qui arrive. */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skeleton-line {
  height: 13px;
  border-radius: 7px;
  background: linear-gradient(90deg, #eef1f5 25%, #e2e7ee 37%, #eef1f5 63%);
  background-size: 400% 100%;
  animation: balayage 1400ms ease infinite;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.skeleton-card {
  height: 84px;
  border-radius: 14px;
  background: linear-gradient(90deg, #eef1f5 25%, #e2e7ee 37%, #eef1f5 63%);
  background-size: 400% 100%;
  animation: balayage 1400ms ease infinite;
}

@keyframes balayage {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Apparition du contenu : eviter le changement sec entre deux vues. */
#appContent > * {
  animation: apparition 220ms ease both;
}

@keyframes apparition {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Les creneaux arrivent en cascade : on lit d'abord le premier. */
.slot-row {
  animation: apparition 260ms ease both;
}

.slot-row:nth-child(2) { animation-delay: 45ms; }
.slot-row:nth-child(3) { animation-delay: 90ms; }
.slot-row:nth-child(4) { animation-delay: 135ms; }
.slot-row:nth-child(n+5) { animation-delay: 175ms; }

@media (prefers-reduced-motion: reduce) {
  .spinner,
  .skeleton-line,
  .skeleton-card { animation: none; }
  #appContent > *,
  .slot-row { animation: none; }
}

/* --------------------------------------------------------------------
   Écran de connexion
   -------------------------------------------------------------------- */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 82% 16%, rgba(191, 228, 208, 0.45), transparent 26rem),
    var(--paper);
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  padding: 34px 32px 30px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: auth-entree 0.35s ease both;
}

@keyframes auth-entree {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.auth-brand .brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--navy);
  color: var(--mint);
  font-weight: 800;
}

.auth-brand strong { display: block; color: var(--navy); letter-spacing: 0.02em; }
.auth-brand small { color: var(--ink-soft); }

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: var(--navy);
}

.auth-card .auth-intro {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-field { display: block; margin-bottom: 16px; }

.auth-field span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.auth-field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.auth-card .button.full { width: 100%; margin-top: 8px; }

.auth-message {
  margin: 0 0 18px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-message.erreur { background: var(--red-soft); color: var(--red); }
.auth-message.succes { background: var(--green-soft); color: var(--green); }
.auth-message.info { background: var(--blue-soft); color: var(--navy); }

.auth-liens {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.auth-liens button {
  border: none;
  background: none;
  padding: 0;
  color: var(--green);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-liens button:hover { color: var(--navy); }

.profile .deconnexion {
  margin-left: auto;
  border: none;
  background: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 1rem;
}

.profile .deconnexion:hover { opacity: 1; }

.auth-liens .auth-aide {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: left;
}

/* --------------------------------------------------------------------
   Choix manuel des créneaux
   -------------------------------------------------------------------- */

button.slot-row {
  width: 100%;
  font: inherit;
  text-align: left;
  color: inherit;
}

.slot-row.choisissable {
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}

.slot-row.choisissable:hover:not([disabled]) {
  border-color: var(--green);
  background: var(--green-soft);
}

.slot-row.choisissable:active:not([disabled]) { transform: translateY(1px); }

.slot-row.choisissable:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.slot-row.choisissable[disabled] {
  cursor: default;
  opacity: .55;
}

.choix-barre {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.choix-barre .small-note { margin: 0; flex: 1 1 14rem; }

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

/* --------------------------------------------------------------------
   Aperçu de l'intervention Praxedo
   -------------------------------------------------------------------- */

/* La garantie « rien n'est envoyé » est ce qu'il faut lire en premier sur
   cette carte : elle ne peut pas être la ligne la plus discrète. */
.avertissement-lecture {
  margin: 0 0 18px;
  padding: 12px 15px;
  border-left: 3px solid var(--green);
  border-radius: 0 10px 10px 0;
  background: var(--green-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.avertissement-lecture strong {
  color: var(--green);
}

/* La requête ne tient pas dans la colonne d'action : le libellé y tombe
   en colonne d'un caractère. Elle occupe donc les deux colonnes. */
.detail-card.pleine-largeur {
  grid-column: 1 / -1;
}

.apercu {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.apercu-ligne {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr);
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.apercu-ligne:last-child { border-bottom: none; }
.apercu-ligne:nth-child(odd) { background: var(--paper); }

.apercu-ligne span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  align-self: center;
}

.apercu-ligne strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.apercu-ligne .doute {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.apercu-brut { margin-top: 14px; }

.apercu-brut summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
}

.apercu-brut summary:hover { color: var(--navy); }

.apercu-brut pre {
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 12px;
  background: var(--navy);
  color: #e6efe9;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  line-height: 1.6;
  overflow-x: auto;
}
