/*
 * Concordance — interface autonome, sans police ni ressource externe.
 * Modifier les variables ci-dessous suffit pour adapter la direction visuelle.
 * Les composants restent volontairement simples : cartes, tableaux, formulaires.
 */
:root {
  color-scheme: light;
  --ink: #18333c;
  --ink-strong: #102a33;
  --muted: #627781;
  --quiet: #788c94;
  --teal: #0c4654;
  --teal-hover: #073947;
  --teal-soft: #e9f3f3;
  --mint: #cce4bf;
  --mint-soft: #f0f7eb;
  --blue: #406f9d;
  --blue-soft: #eaf2fa;
  --orange: #a16b2d;
  --orange-soft: #fff2df;
  --red: #ad4d4a;
  --red-soft: #fbedeb;
  --green: #397356;
  --green-soft: #eaf4ec;
  --canvas: #f4f7f9;
  --surface: #fff;
  --line: #e0e8eb;
  --line-strong: #cbd8dd;
  --radius: 17px;
  --radius-small: 11px;
  --shadow: 0 4px 20px #1e3b4506;
  --shadow-lift: 0 12px 32px #16384412;
  --sidebar: 236px;
  --focus: 0 0 0 3px #0c687b28;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open, body.drawer-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #18758b;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
svg { flex: 0 0 auto; vertical-align: middle; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink-strong); font-weight: 650; letter-spacing: -.025em; line-height: 1.2; }
h1 { font-size: 1.95rem; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.06rem; }
p:last-child { margin-bottom: 0; }
hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
small, .small-text { font-size: .875rem; }
code { font-size: .875rem; background: var(--canvas); padding: 2px 5px; border-radius: 4px; overflow-wrap: anywhere; }
::selection { color: var(--teal); background: var(--mint); }

/* Cadre principal : navigation fixe sur ordinateur, tiroir sur téléphone. */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 29px 17px 20px;
  z-index: 60;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink-strong); padding: 0 11px 28px; text-decoration: none !important; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 41px; color: #fff; background: var(--teal); border-radius: 10px 10px 10px 3px; }
.brand-name { font-size: 1.18rem; font-weight: 720; letter-spacing: -.035em; }
.brand-subtitle { font-size: .875rem; color: var(--muted); margin-top: 1px; font-weight: 400; letter-spacing: 0; }
.nav-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 22px; }
.nav-label, .sidebar-label { padding: 0 14px 9px; font-size: .875rem; font-weight: 550; color: var(--quiet); }
.nav-item {
  width: 100%;
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  color: #58717b;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: .925rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  transition: background .15s, color .15s;
  text-decoration: none !important;
}
.nav-item:hover { color: var(--teal); background: #f2f7f7; }
.nav-item.active { background: var(--teal); color: #fff; box-shadow: 0 4px 9px #0c465410; }
.nav-count { margin-left: auto; min-width: 23px; padding: 1px 7px; font-size: .875rem; line-height: 1.5; text-align: center; border-radius: 6px; color: var(--teal); background: #e6f0ed; }
.nav-item.active .nav-count { background: #ffffff22; color: #fff; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.sidebar-note { margin: 10px 8px; padding: 14px; border-radius: var(--radius-small); background: var(--mint-soft); color: #496342; font-size: .875rem; }
.sidebar-note strong { display: block; font-size: .9rem; margin-bottom: 3px; color: #365933; }
.profile { display: flex; gap: 10px; align-items: center; margin: 19px 7px 0; padding-top: 17px; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; font-size: .875rem; font-weight: 650; color: var(--teal); background: #e8f0f1; }
.profile-name { font-weight: 600; font-size: .9rem; }
.profile-meta { font-size: .875rem; color: var(--muted); }
.profile .icon-button { margin-left: auto; }
.main { margin-left: var(--sidebar); min-width: 0; }
.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 36px;
  border-bottom: 1px solid var(--line);
  background: #ffffffeb;
}
.topbar-title { display: flex; align-items: center; gap: 11px; color: #5c727b; font-size: .9rem; }
.topbar-actions, .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar .search-field { max-width: 350px; width: 100%; }
.search-field { position: relative; display: flex; align-items: center; gap: 9px; }
.search-field > svg { position: absolute; left: 13px; color: #7c929a; pointer-events: none; }
.search-field input { width: 100%; padding-left: 41px; background: #f6f8fa; border-color: transparent; }
.topbar-divider { width: 1px; height: 25px; background: var(--line); }
.page-content { max-width: 1680px; margin: 0 auto; padding: 33px 36px 48px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; margin-bottom: 26px; }
.eyebrow { margin-bottom: 7px; color: var(--teal); font-size: .875rem; font-weight: 650; letter-spacing: .065em; text-transform: uppercase; }
.page-title { margin: 0 0 8px; font-size: 1.9rem; font-weight: 680; }
.page-subtitle { color: var(--muted); margin: 0; max-width: 780px; font-size: .96rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 28px 0 15px; }
.section-heading h2 { margin: 0; }
.mobile-menu, .sidebar-overlay, .mobile-bottom-nav { display: none; }

/* Boutons : tous les contrôles courants gardent une cible tactile confortable. */
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 41px; border: 1px solid transparent; border-radius: 9px;
  padding: 9px 15px; background: #fff; color: var(--ink); font-size: .9rem;
  font-weight: 600; line-height: 1.35; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.button.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.button.primary:hover { background: var(--teal-hover); box-shadow: 0 4px 12px #0c465419; }
.button.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.button.secondary:hover { background: #f7fafb; border-color: #a4bbc4; }
.button.ghost { color: var(--muted); background: transparent; }
.button.ghost:hover { background: #eaf0f3; color: var(--teal); }
.button.danger { color: var(--red); border-color: #e7bdb8; background: #fff; }
.button.danger:hover { background: var(--red-soft); }
.button.small { min-height: 34px; font-size: .875rem; padding: 6px 11px; }
.button.full { width: 100%; }
.button.mint { color: #2b5533; background: var(--mint); }
.button:active:not(:disabled) { transform: translateY(1px); }
.icon-button { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 8px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; }
.icon-button:hover { color: var(--teal); background: #edf3f5; }
.icon-button.danger:hover { color: var(--red); background: var(--red-soft); }
.icon-button.active { color: var(--teal); background: var(--teal-soft); }
.link-button { background: transparent; color: var(--teal); border: 0; padding: 0; font: inherit; font-size: .9rem; font-weight: 600; }
.link-button:hover { text-decoration: underline; }

/* Grilles et cartes. */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.dashboard { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px 17px; }
.card-header h2, .card-header h3 { margin: 0; }
.card-header + .card-body { padding-top: 0; }
.card-body { padding: 21px 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfcfd; }
.card-title { display: flex; align-items: center; gap: 10px; }
.card-title > svg { color: var(--muted); }
.card-interactive { transition: border-color .15s, box-shadow .15s; }
.card-interactive:hover { border-color: #a9c5cc; box-shadow: var(--shadow-lift); }
.stat-card { position: relative; min-width: 0; padding: 21px 23px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.stat-label { font-size: .9rem; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.stat-value { font-size: 2rem; font-weight: 680; color: var(--ink-strong); line-height: 1.15; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 1rem; color: var(--muted); font-weight: 450; letter-spacing: 0; margin-left: 3px; }
.stat-foot { margin-top: 12px; font-size: .875rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-icon { position: absolute; top: 19px; right: 20px; width: 34px; height: 34px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); border-radius: 10px; }
.stat-card.accent { background: var(--teal); border-color: var(--teal); }
.stat-card.accent .stat-value { color: #fff; }
.stat-card.accent .stat-label, .stat-card.accent .stat-foot { color: #d2e4e7; }
.stat-card.accent .stat-icon { color: var(--mint); background: #ffffff14; }
.stat-card.green .stat-icon { color: var(--green); background: var(--green-soft); }
.stat-card.orange .stat-icon { color: var(--orange); background: var(--orange-soft); }
.stat-card.blue .stat-icon { color: var(--blue); background: var(--blue-soft); }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; padding: 3px 8px; color: var(--muted); background: #eef2f4; font-size: .875rem; font-weight: 500; white-space: nowrap; line-height: 1.5; }
.badge.todo { color: #5a707c; background: #edf2f5; }
.badge.doing { color: #31658e; background: var(--blue-soft); }
.badge.blocked, .badge.warning { color: #946226; background: var(--orange-soft); }
.badge.done, .badge.success { color: var(--green); background: var(--green-soft); }
.badge.danger, .badge.high { color: #9e4e48; background: var(--red-soft); }
.badge.muted { color: var(--muted); background: #f1f4f6; }
.badge.outline { border: 1px solid var(--line); background: #fff; }
.badge.project { color: var(--teal); background: var(--teal-soft); }
.progress-track { overflow: hidden; background: #edf2f4; height: 6px; border-radius: 10px; min-width: 45px; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--teal); transition: width .25s; min-width: 0; }
.progress-fill.mint { background: #97c382; }
.progress-fill.blue { background: #7aa4c6; }
.progress-fill.orange { background: #d5a15e; }
.progress-label { display: flex; align-items: center; gap: 9px; font-size: .875rem; color: var(--muted); }
.progress-label .progress-track { flex: 1; }

/* Barres de filtres et tableaux. */
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 13px; margin-bottom: 20px; }
.toolbar .search-field { min-width: 220px; flex: 0 1 330px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.filters select { width: auto; min-width: 150px; max-width: 260px; background-color: #fff; }
.filters input[type="date"] { width: auto; min-width: 155px; }
.filter-label { font-size: .875rem; color: var(--muted); }
.pill-tabs { display: inline-flex; align-items: center; gap: 3px; padding: 4px; border-radius: 10px; background: #eaf0f3; }
.pill { min-height: 33px; padding: 6px 13px; border: 0; background: transparent; color: var(--muted); font-size: .875rem; font-weight: 550; border-radius: 7px; }
.pill.active { color: var(--teal); background: #fff; box-shadow: 0 1px 4px #18333c10; }
.table-wrap { width: 100%; overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; text-align: left; }
.data-table th { padding: 12px 19px; font-size: .875rem; font-weight: 550; color: var(--muted); white-space: nowrap; background: #f8fafb; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-table td { padding: 15px 19px; border-bottom: 1px solid #edf1f3; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcfd; }
.data-table .task-title { font-weight: 550; color: var(--ink); }
.data-table .task-subtitle { display: block; font-size: .875rem; color: var(--muted); margin-top: 3px; }
.data-table .actions { flex-wrap: nowrap; }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .row-clickable { cursor: pointer; }
.data-table .row-clickable:hover { background: #f2f8f8; }
.table-summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 15px 20px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.empty-state { min-height: 210px; padding: 35px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; color: var(--muted); }
.empty-state > svg { color: #92abb4; }
.empty-state h2, .empty-state h3 { margin: 0; }
.empty-state p { max-width: 480px; margin: 0; }
.empty-state.compact { min-height: 140px; padding: 24px; }

/* Cartes de projet et listes courantes. */
.project-card { padding: 21px; display: flex; flex-direction: column; gap: 17px; }
.project-card-heading { display: flex; align-items: flex-start; gap: 12px; }
.project-avatar { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 12px; background: var(--teal-soft); color: var(--teal); font-weight: 650; }
.project-card h3 { margin: 2px 0 5px; }
.project-card .project-meta { color: var(--muted); font-size: .875rem; }
.project-card .actions { margin-left: auto; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .875rem; color: var(--muted); }
.project-subprojects { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.subproject-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: .9rem; }
.subproject-row .actions { margin-left: auto; }
.task-list, .activity-list { display: flex; flex-direction: column; }
.task-list-item, .activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid #edf1f3; }
.task-list-item:last-child, .activity-item:last-child { border-bottom: 0; }
.task-list-item .task-check { margin-top: 3px; }
.task-list-item .task-main, .activity-item .task-main { flex: 1; min-width: 0; }
.task-list-item .task-main strong { font-size: .925rem; font-weight: 550; }
.task-list-item .task-meta, .activity-item .task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; font-size: .875rem; color: var(--muted); }
.date-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .875rem; color: var(--muted); }
.date-chip.overdue { color: var(--red); }
.color-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 auto; border-radius: 3px; background: var(--teal); }

/* Le Kanban garde ses colonnes sur mobile, avec défilement et ancrage tactile. */
.kanban-board { display: flex; align-items: flex-start; gap: 17px; overflow-x: auto; padding-bottom: 20px; min-height: 500px; scroll-snap-type: x proximity; }
.kanban-column { flex: 1 0 270px; min-width: 270px; max-width: 440px; border-radius: 14px; background: #edf2f5; border: 1px solid #e4ecef; padding: 13px; scroll-snap-align: start; }
.kanban-heading { display: flex; align-items: center; gap: 9px; padding: 3px 3px 15px; font-size: .925rem; font-weight: 650; color: var(--ink); }
.kanban-heading .icon-button { margin-left: auto; min-height: 29px; min-width: 29px; padding: 5px; }
.kanban-count { display: inline-grid; place-items: center; min-width: 23px; height: 23px; border-radius: 6px; padding: 1px 5px; background: #fff; color: var(--muted); font-size: .875rem; font-weight: 500; }
.kanban-cards { min-height: 130px; display: flex; flex-direction: column; gap: 12px; }
.kanban-card { padding: 17px 16px 14px; border: 1px solid #e2e9ed; border-radius: 11px; background: #fff; box-shadow: 0 2px 5px #203c4705; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.kanban-card:hover { border-color: #b8cfd6; box-shadow: 0 5px 14px #1b3d490a; }
.kanban-card.dragging { opacity: .45; }
.kanban-column.drag-over { outline: 2px dashed #73a6af; outline-offset: -3px; background: #e5f0f0; }
.kanban-card h3 { margin: 11px 0 12px; font-size: .975rem; font-weight: 600; line-height: 1.5; letter-spacing: -.012em; }
.kanban-card .description { color: var(--muted); font-size: .875rem; margin-bottom: 13px; overflow-wrap: anywhere; }
.kanban-card-top, .kanban-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kanban-card-bottom { margin-top: 15px; padding-top: 12px; border-top: 1px solid #edf1f3; }
.kanban-card select { width: auto; max-width: 150px; min-height: 33px; padding-top: 5px; padding-bottom: 5px; font-size: .875rem; background-color: #f8fafb; }
.kanban-empty { padding: 25px 10px; text-align: center; color: var(--muted); font-size: .875rem; border: 1px dashed #ccd9de; border-radius: 10px; }

/* Gantt : colonne descriptive fixe, zone chronologique défilante. */
.gantt { display: flex; overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.gantt-labels { width: 285px; flex: 0 0 285px; position: relative; z-index: 3; border-right: 1px solid var(--line-strong); box-shadow: 5px 0 10px #18333c04; background: #fff; }
.gantt-chart { flex: 1; overflow-x: auto; min-width: 0; position: relative; }
.gantt-header { height: 62px; display: flex; align-items: center; border-bottom: 1px solid var(--line); background: #f8fafb; font-size: .875rem; color: var(--muted); font-weight: 550; }
.gantt-labels .gantt-header { padding: 0 18px; }
.gantt-period { flex: 0 0 var(--period-width, 42px); min-width: var(--period-width, 42px); text-align: center; padding: 8px 3px; border-right: 1px solid #edf1f3; }
.gantt-period.today { color: var(--teal); background: #e2f0e9; font-weight: 650; }
.gantt-period.weekend { color: #91a1a8; background: #f0f4f6; }
.gantt-row { position: relative; height: 49px; border-bottom: 1px solid #edf1f3; }
.gantt-row:last-child { border-bottom: 0; }
.gantt-labels .gantt-row { display: flex; align-items: center; gap: 9px; padding: 0 18px; font-size: .875rem; overflow: hidden; }
.gantt-labels .gantt-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-row.project { height: 42px; background: #f1f6f7; color: var(--teal); font-weight: 650; }
.gantt-row.subproject { height: 40px; background: #f8fafb; color: #536e78; font-weight: 550; }
.gantt-labels .gantt-row.task { padding-left: 30px; cursor: pointer; }
.gantt-labels .gantt-row.task:hover { background: #f3f8f8; }
.gantt-chart .gantt-row { background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--period-width, 42px) - 1px), #eef2f4 calc(var(--period-width, 42px) - 1px), #eef2f4 var(--period-width, 42px)); }
.gantt-chart .gantt-row.project { background-color: #f1f6f7; }
.gantt-chart .gantt-row.subproject { background-color: #f8fafb; }
.gantt-bar { position: absolute; top: 13px; height: 23px; min-width: 6px; border-radius: 6px; background: #b9d3da; border: 1px solid #a4c5ce; overflow: hidden; cursor: pointer; }
.gantt-bar.doing { background: #d8e6f3; border-color: #b9d1e5; }
.gantt-bar.blocked { background: #f4dfbd; border-color: #dec393; }
.gantt-bar.done { background: #cce4d2; border-color: #abd0b6; }
.gantt-bar > .progress, .gantt-bar > .gantt-progress { display: block; height: 100%; background: #6097a4; opacity: .6; }
.gantt-bar.done > .progress { background: #5b9b71; }
.gantt-bar.project { background: var(--teal); border-color: var(--teal); height: 12px; top: 15px; border-radius: 3px; }
.gantt-bar.milestone { width: 15px !important; min-width: 15px; height: 15px; top: 17px; border-radius: 3px; transform: rotate(45deg); background: var(--teal); }
.gantt-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #d9a552; opacity: .65; pointer-events: none; z-index: 2; }
.gantt-no-date { padding: 14px 18px; font-size: .875rem; color: var(--muted); }

/* Agenda et planning. */
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); background: #f8fafb; border-bottom: 1px solid var(--line); }
.calendar-weekdays > div { text-align: center; padding: 13px 4px; font-size: .875rem; color: var(--muted); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-day { min-height: 135px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; min-width: 0; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { background: #f8fafb; color: #a1b0b7; }
.calendar-day.today { background: #f5faf6; }
.calendar-day-number { display: inline-grid; place-items: center; min-width: 28px; height: 28px; margin-bottom: 8px; font-size: .875rem; font-weight: 600; }
.calendar-day.today .calendar-day-number { background: var(--teal); color: #fff; border-radius: 50%; }
.calendar-event { display: block; width: 100%; margin: 5px 0; padding: 5px 7px; font-size: .875rem; line-height: 1.35; text-align: left; color: var(--teal); background: #e9f2f3; border: 0; border-left: 3px solid #70a2ac; border-radius: 5px; overflow-wrap: anywhere; cursor: pointer; }
.calendar-event.google { color: #3c648e; background: #edf3fa; border-left-color: #80a6cc; }
.calendar-event.overlap { color: #8e5c22; background: #fff2df; border-left-color: #d6ac69; }
.calendar-event-time { display: block; font-weight: 600; }
.calendar-agenda { display: flex; flex-direction: column; gap: 20px; }
.agenda-date { margin: 0 0 11px; font-size: .95rem; font-weight: 650; }
.agenda-event { display: flex; gap: 15px; padding: 15px 17px; border: 1px solid var(--line); background: #fff; border-radius: 12px; margin-bottom: 8px; }
.agenda-time { color: var(--teal); font-size: .9rem; min-width: 90px; font-variant-numeric: tabular-nums; }
.agenda-event-content { flex: 1; min-width: 0; }
.agenda-event-content h3 { margin: 0 0 4px; }

/* Dépôt et vérification des photos. */
.scan-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.scan-list { display: flex; flex-direction: column; gap: 11px; }
.scan-list-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 11px; text-align: left; color: var(--ink); }
.scan-list-item.active { border-color: #89b2bc; background: #f1f8f8; box-shadow: inset 3px 0 0 var(--teal); }
.scan-list-item > img { width: 44px; height: 58px; object-fit: cover; border-radius: 5px; background: var(--canvas); }
.scan-list-item .scan-name { font-size: .9rem; font-weight: 550; overflow-wrap: anywhere; }
.scan-list-item .scan-meta { display: block; font-size: .875rem; color: var(--muted); margin-top: 4px; }
.scan-review { min-width: 0; }
.scan-review-header { padding: 19px 21px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.scan-review-header h2 { margin: 0 0 4px; }
.scan-review-grid { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); gap: 20px; align-items: start; padding: 21px; }
.image-preview { position: relative; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #eef2f4; overflow: hidden; min-height: 160px; }
.image-preview img { max-height: 630px; width: 100%; object-fit: contain; }
.image-preview.clickable { cursor: zoom-in; }
.image-preview .image-actions { position: absolute; top: 9px; right: 9px; display: flex; gap: 5px; }
.image-preview .image-actions button { background: #fffffff0; }
.dropzone { position: relative; min-height: 180px; padding: 26px 20px; border: 1.5px dashed #9fbdc6; border-radius: 13px; background: #f5fafa; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; text-align: center; color: var(--muted); }
.dropzone > svg { color: var(--teal); }
.dropzone strong { color: var(--ink); font-weight: 600; }
.dropzone.drag-over { background: #e7f4ed; border-color: var(--teal); }
.dropzone p { margin: 0; font-size: .9rem; max-width: 500px; }
.dropzone input[type="file"] { max-width: 100%; font-size: .875rem; margin-top: 8px; }
.scan-candidate { border: 1px solid var(--line); border-radius: 11px; padding: 16px; margin-bottom: 13px; background: #fff; }
.scan-candidate.excluded { opacity: .6; background: #f8fafb; }
.scan-candidate.needs-review { border-left: 3px solid #d3a560; }
.candidate-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.candidate-header label { display: flex; align-items: center; gap: 9px; font-weight: 550; font-size: .9rem; }
.candidate-source { font-size: .875rem; color: var(--muted); padding: 10px 12px; background: #f6f8fa; border-radius: 7px; margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.scan-progress { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: 10px; color: var(--teal); background: var(--teal-soft); font-size: .9rem; margin-bottom: 16px; }
.scan-summary { padding: 15px 20px; display: flex; gap: 14px; align-items: center; justify-content: space-between; background: #f6faf7; border-top: 1px solid var(--line); }
.scan-candidate .form-grid { gap: 11px 12px; }
.scan-candidate textarea { min-height: 64px; }

/* Formulaires et modales ; pas de dépendance à un framework de composants. */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field-label { color: #4c6570; font-weight: 550; font-size: .875rem; }
.field .hint, .field-help { font-size: .875rem; color: var(--muted); font-weight: 400; }
.field-error { font-size: .875rem; color: var(--red); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]), select, textarea {
  width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; font-size: .95rem; line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #8b9ba3; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #adbec6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #6c9ca8; box-shadow: var(--focus); }
input[readonly], textarea[readonly] { background: #f4f7f9; color: var(--muted); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4.5 6 3.5 3.5L11.5 6' stroke='%23627781' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 16px; background-position: right 11px center; }
textarea { resize: vertical; min-height: 105px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--teal); margin: 0; flex: 0 0 auto; cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--teal); }
input[type="color"] { min-height: 42px; width: 55px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px; background: #fff; }
input[type="file"]::file-selector-button { border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 11px; margin-right: 10px; color: var(--teal); background: #fff; cursor: pointer; font: inherit; }
.checkbox-row { display: flex; gap: 9px; align-items: center; font-size: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full, .field.full, .span-full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.form-section { margin-bottom: 26px; }
.form-section-title { margin-bottom: 15px; padding-bottom: 11px; border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 650; }
.modal-backdrop { position: fixed; inset: 0; display: flex; justify-content: center; align-items: center; background: #102a3359; backdrop-filter: blur(3px); padding: 28px; z-index: 200; overflow-y: auto; animation: fade-in .15s ease; }
.modal { background: #fff; width: min(100%, 640px); max-height: calc(100dvh - 56px); border-radius: 18px; box-shadow: 0 24px 100px #0a252b40; display: flex; flex-direction: column; overflow: hidden; animation: modal-in .18s ease; }
.modal.wide, .modal-backdrop.wide > .modal { width: min(100%, 1000px); }
.modal.small { width: min(100%, 450px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 23px 25px 19px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0 0 4px; font-size: 1.3rem; }
.modal-header p { margin: 0; color: var(--muted); font-size: .9rem; }
.modal-header .icon-button { margin: -5px -7px 0 0; }
.modal-body { padding: 23px 25px; overflow-y: auto; overscroll-behavior: contain; }
.modal-footer { padding: 17px 25px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; align-items: center; gap: 10px; background: #fbfcfd; }
.modal-footer .left { margin-right: auto; }
.modal-image { width: min(100%, 1050px); background: #1d3038; }
.modal-image img { width: 100%; max-height: 85vh; object-fit: contain; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-item-label { color: var(--muted); font-size: .875rem; margin-bottom: 4px; }

/* Graphiques SVG et suivis personnels : les axes conservent une vraie taille de texte. */
.chart { width: 100%; min-width: 0; }
.chart svg { width: 100%; height: auto; overflow: visible; display: block; }
.chart text { font-family: inherit; font-size: 14px; fill: var(--muted); }
.chart .gridline { stroke: #e6edef; stroke-width: 1; }
.chart .bar { fill: var(--teal); }
.chart .bar.alt { fill: #91b9a1; }
.chart .bar.warning { fill: #d8b172; }
.chart .line { stroke: var(--teal); stroke-width: 2.5; fill: none; }
.chart .area { fill: #dcece9; opacity: .65; }
.chart .goal-line { stroke: #bd924d; stroke-width: 1.5; stroke-dasharray: 5 5; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; font-size: .875rem; color: var(--muted); margin-top: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { height: 8px; width: 18px; border-radius: 3px; background: var(--teal); }
.goal-card { display: flex; align-items: center; gap: 22px; }
.goal-ring { position: relative; width: 110px; height: 110px; flex: 0 0 110px; }
.goal-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.goal-ring .value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 650; color: var(--ink-strong); }
.goal-ring .value small { font-size: .875rem; font-weight: 400; color: var(--muted); }
.goal-copy { min-width: 0; }
.goal-copy h3 { margin: 0 0 6px; }
.goal-copy p { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.metric-entry { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #edf1f3; }
.metric-entry:last-child { border-bottom: 0; }
.metric-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); border-radius: 10px; }
.metric-main { flex: 1; min-width: 0; }
.metric-title { font-size: .925rem; font-weight: 550; }
.metric-meta { font-size: .875rem; color: var(--muted); margin-top: 3px; }
.metric-value { font-size: 1.05rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.meal-grid { display: grid; grid-template-columns: 85px repeat(7, minmax(90px, 1fr)); min-width: 800px; }
.meal-grid > div { padding: 12px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .875rem; min-height: 70px; }
.meal-grid .meal-header { min-height: auto; font-weight: 550; color: var(--muted); background: #f8fafb; }
.note-card { padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; min-height: 170px; display: flex; flex-direction: column; gap: 13px; }
.note-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.4; }
.note-card .note-text { flex: 1; color: #5c747e; font-size: .925rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-card .note-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .875rem; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }

/* Retours d'état, chargement et premiers écrans. */
.status-line { display: flex; align-items: center; gap: 7px; font-size: .875rem; color: var(--muted); }
.status-line.success { color: var(--green); }
.status-line.error { color: var(--red); }
.status-line.busy { color: var(--teal); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #6f9d79; }
.status-dot.error { background: #c6756b; }
.toast-container { position: fixed; bottom: 24px; right: 26px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; z-index: 400; pointer-events: none; max-width: min(480px, calc(100vw - 32px)); }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 15px 17px; border-radius: 11px; background: #fff; color: var(--ink); border: 1px solid var(--line-strong); box-shadow: 0 10px 40px #102a3326; font-size: .9rem; animation: toast-in .2s ease; }
.toast.success { border-left: 4px solid #6aa17b; }
.toast.error { border-left: 4px solid #c77e72; }
.toast.info { border-left: 4px solid #76a7b1; }
.toast .icon-button { margin: -5px -7px -5px 5px; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; margin-bottom: 20px; border: 1px solid #cbdfe5; background: #eff7f9; color: #476e7b; border-radius: 10px; font-size: .9rem; }
.notice.warning { color: #8a622d; background: var(--orange-soft); border-color: #ead7b8; }
.notice.error { color: #9d514b; background: var(--red-soft); border-color: #eccac4; }
.notice.success { color: #46734e; background: var(--green-soft); border-color: #cce0ce; }
.spinner { width: 18px; height: 18px; display: inline-block; flex: 0 0 auto; border: 2px solid #9fb8bf55; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
.button.primary .spinner { border-color: #ffffff44; border-top-color: #fff; }
.loading-state { padding: 70px 24px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, #e9eff2 0%, #f4f7f9 50%, #e9eff2 100%); background-size: 200% 100%; animation: shimmer 1.5s ease infinite; border-radius: 7px; }
.skeleton.text { height: 16px; width: 65%; margin: 12px 0; }
.skeleton.title { height: 28px; width: 45%; }
.skeleton.block { height: 150px; }
.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 30px 20px; background: #f0f5f6; }
.auth-card { width: min(100%, 470px); padding: 37px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lift); }
.auth-card .brand { padding: 0 0 27px; }
.auth-card h1 { margin-bottom: 11px; font-size: 1.65rem; }
.auth-card .field { margin-top: 17px; }
.auth-card .button.full { margin-top: 23px; }
.setup-intro { color: var(--muted); font-size: .95rem; margin-bottom: 22px; }
.setup-features { padding: 15px; background: #f4f9f4; border-radius: 10px; font-size: .875rem; color: #4f7252; }
.settings-section { margin-bottom: 23px; }
.settings-section h3 { margin-bottom: 10px; }
.settings-row { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; padding: 19px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row-copy { min-width: 0; }
.settings-row-copy strong { display: block; font-size: .95rem; margin-bottom: 5px; font-weight: 600; }
.settings-row-copy p { font-size: .9rem; color: var(--muted); max-width: 650px; }
.settings-row-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }

/* Utilitaires limités pour conserver un balisage lisible. */
.muted { color: var(--muted); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wrap { overflow-wrap: anywhere; white-space: normal; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.align-start { align-items: flex-start; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.padded { padding: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1700px) {
  .page-content { padding-top: 39px; }
  .stat-card { padding: 24px; }
}
@media (max-width: 1250px) {
  .topbar { padding-left: 26px; padding-right: 26px; }
  .page-content { padding: 28px 26px 40px; }
  .grid.four { gap: 14px; }
  .stat-card { padding: 19px; }
  .stat-icon { top: 17px; right: 16px; width: 29px; height: 29px; }
  .scan-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .scan-review-grid { grid-template-columns: 1fr; }
  .scan-review-grid .image-preview { max-height: 320px; }
  .scan-review-grid .image-preview img { max-height: 320px; }
}
@media (max-width: 1100px) {
  :root { --sidebar: 215px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand { padding-left: 9px; padding-right: 5px; gap: 9px; }
  .brand-name { font-size: 1.1rem; }
  .brand-subtitle { font-size: .875rem; }
  .nav-item { padding: 11px 12px; }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.dashboard { grid-template-columns: minmax(0, 1fr); }
  .page-heading { align-items: flex-start; }
  .page-heading > .actions { justify-content: flex-end; }
  .page-title { font-size: 1.7rem; }
  .topbar-title { max-width: 210px; }
  .topbar .search-field { max-width: 250px; }
  .gantt-labels { flex-basis: 230px; width: 230px; }
  .calendar-day { min-height: 116px; padding: 7px; }
  .scan-layout { grid-template-columns: 1fr; }
  .scan-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scan-review-grid { grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); }
  .scan-review-grid .image-preview { max-height: none; }
  .scan-review-grid .image-preview img { max-height: 630px; }
}
@media (max-width: 760px) {
  :root { --sidebar: 250px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; padding: 25px 17px 24px; }
  .sidebar.open, .sidebar.is-open, .app-shell.sidebar-open .sidebar { transform: translateX(0); box-shadow: 14px 0 40px #112f3a22; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 50; background: #102a334d; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-overlay.visible, .sidebar-overlay.open, .app-shell.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { min-height: 65px; padding: 12px 20px; gap: 12px; }
  .topbar-title { flex: 1; max-width: none; font-size: .875rem; }
  .topbar .search-field { display: none; }
  .topbar .status-line { font-size: .875rem; }
  .topbar-divider { display: none; }
  .page-content { padding: 25px 20px 38px; }
  .page-heading { display: flex; flex-wrap: wrap; gap: 17px; margin-bottom: 23px; }
  .page-heading > .actions { justify-content: flex-start; }
  .page-title { font-size: 1.7rem; }
  .page-subtitle { font-size: .925rem; }
  .grid { gap: 16px; }
  .grid.two, .grid.three, .grid.dashboard { grid-template-columns: minmax(0, 1fr); }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card { padding: 17px; }
  .stat-label { padding-right: 23px; font-size: .875rem; margin-bottom: 10px; }
  .stat-value { font-size: 1.7rem; }
  .stat-foot { margin-top: 10px; font-size: .875rem; }
  .stat-icon { width: 25px; height: 25px; right: 12px; top: 14px; }
  .stat-icon svg { width: 17px; height: 17px; }
  .card-header { padding: 18px 18px 15px; }
  .card-body { padding: 18px; }
  .card-header + .card-body { padding-top: 0; }
  .card-footer { padding: 13px 18px; }
  .toolbar { align-items: stretch; }
  .toolbar .search-field { flex: 1 0 100%; }
  .filters { width: 100%; }
  .filters select { flex: 1 1 145px; max-width: none; min-width: 0; }
  .filters .pill-tabs { flex-shrink: 0; }
  .data-table th { padding: 12px 15px; }
  .data-table td { padding: 14px 15px; }
  .table-summary { padding: 13px 15px; }
  .kanban-board { gap: 14px; margin-right: -20px; padding-right: 20px; scroll-padding-left: 0; }
  .kanban-column { flex: 0 0 min(310px, calc(100vw - 55px)); min-width: 280px; max-width: none; }
  .kanban-card { padding: 17px; }
  .kanban-card h3 { font-size: 1rem; }
  .gantt-labels { flex-basis: 165px; width: 165px; }
  .gantt-labels .gantt-row { padding-left: 11px; padding-right: 9px; }
  .gantt-labels .gantt-row.task { padding-left: 18px; }
  .gantt-labels .gantt-header { padding-left: 11px; }
  .gantt-period { font-size: .875rem; }
  .calendar-grid { min-width: 650px; }
  .calendar-weekdays { min-width: 650px; }
  .calendar-day { min-height: 105px; }
  .calendar-mobile-list { display: block; }
  .scan-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scan-list-item { align-items: flex-start; padding: 11px; gap: 9px; }
  .scan-list-item > img { width: 34px; height: 45px; }
  .scan-review-grid { grid-template-columns: minmax(0, 1fr); padding: 17px; }
  .scan-review-grid .image-preview { max-height: 380px; }
  .scan-review-grid .image-preview img { max-height: 380px; }
  .scan-review-header { padding: 18px; }
  .scan-summary { flex-wrap: wrap; padding: 14px 17px; }
  .scan-summary .button { width: 100%; }
  .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .modal-backdrop { padding: 12px; align-items: center; }
  .modal { max-height: calc(100dvh - 24px); border-radius: 14px; }
  .modal-header { padding: 20px; }
  .modal-body { padding: 20px; }
  .modal-footer { padding: 15px 20px; flex-wrap: wrap; }
  .modal-footer .button { min-height: 42px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-row { flex-direction: column; gap: 13px; }
  .settings-row-actions { width: 100%; }
  .toast-container { right: 16px; bottom: 18px; }
  .goal-card { gap: 18px; }
}
@media (max-width: 480px) {
  .page-content { padding-left: 16px; padding-right: 16px; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .topbar-title .long-label, .topbar .status-line .long-label { display: none; }
  .page-title { font-size: 1.55rem; }
  .eyebrow { font-size: .875rem; }
  .page-heading > .actions { width: 100%; }
  .page-heading > .actions > .button.primary { flex: 1; }
  .stat-card { padding: 16px 14px; }
  .stat-value { font-size: 1.6rem; }
  .stat-foot { min-height: 21px; flex-wrap: wrap; }
  .kanban-board { margin-right: -16px; padding-right: 16px; }
  .kanban-column { flex-basis: calc(100vw - 50px); }
  .scan-list { grid-template-columns: 1fr; }
  .scan-list-item > img { width: 40px; height: 50px; }
  .button { padding-left: 12px; padding-right: 12px; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100dvh - 16px); }
  .modal-header, .modal-body { padding: 18px; }
  .modal-footer { padding: 14px 18px; }
  .modal-footer .button { flex: 1; }
  .auth-card { padding: 27px 23px; }
  .agenda-event { gap: 10px; padding: 13px; }
  .agenda-time { min-width: 72px; font-size: .875rem; }
  .goal-ring { width: 95px; height: 95px; flex-basis: 95px; }
  .goal-ring .value { font-size: 1.35rem; }
  .gantt-labels { width: 145px; flex-basis: 145px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-heading .actions, .toolbar, .toast-container, .modal-backdrop, .icon-button { display: none !important; }
  .main { margin-left: 0; }
  .page-content { padding: 0; max-width: none; }
  .card, .stat-card { box-shadow: none; break-inside: avoid; }
  .kanban-board { overflow: visible; flex-wrap: wrap; }
  .kanban-column { flex-basis: 45%; }
}
