:root {
  --bg: #f4f1eb;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #23211e;
  --muted: #756f67;
  --subtle: #ddd6ca;
  --line: #e7dfd2;
  --blue: #315d7d;
  --blue-soft: #e7f0f5;
  --green: #557464;
  --green-soft: #e7efe9;
  --amber: #a56d28;
  --amber-soft: #f5ead9;
  --red: #9d4d47;
  --red-soft: #f2e1df;
  --shadow: 0 18px 45px rgba(52, 45, 35, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  padding: 28px 20px;
  background: #242923;
  color: #fff9ee;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-slot {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #d9b474;
  color: #23211e;
  font-weight: 800;
  overflow: hidden;
}

.brand-logo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-logo-slot span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.brand-title,
.brand-subtitle,
.eyebrow,
.section-kicker {
  margin: 0;
}

.brand-title {
  font-weight: 750;
}

.brand-subtitle {
  color: rgba(255, 249, 238, 0.68);
  font-size: 0.86rem;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(255, 249, 238, 0.8);
  background: transparent;
  text-align: left;
}

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

.sync-panel {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

.status-muted,
.source-pill,
.count-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-muted {
  color: #241f18;
  background: #d9b474;
}

.status-muted.is-connected {
  color: #173f2b;
  background: #bfe2ca;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar,
.view-header,
.panel-header,
.dialog-header,
.topbar-actions,
.dialog-actions,
.panel-actions,
.connection-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow,
.section-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 4px 0 0;
  font-size: 2rem;
  line-height: 1.05;
}

.daily-zen {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.45;
}

h2 {
  margin: 3px 0 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

.assistant-button,
.ghost-button,
.mini-button,
.icon-button,
.quick-capture button,
.item-action {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 750;
}

.assistant-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fffdf8;
  background: var(--blue);
  text-decoration: none;
}

.assistant-button:hover {
  background: #254c68;
}

.assistant-button.small {
  min-height: 34px;
  font-size: 0.88rem;
}

.bell-icon {
  position: relative;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 10px 10px 3px 3px;
}

.bell-icon::before,
.bell-icon::after {
  position: absolute;
  content: "";
  left: 50%;
  transform: translateX(-50%);
  background: currentColor;
}

.bell-icon::before {
  bottom: -3px;
  width: 18px;
  height: 2px;
}

.bell-icon::after {
  bottom: -7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.ghost-button {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.mini-button,
.item-action {
  min-height: 30px;
  padding: 0 10px;
  color: var(--blue);
  background: var(--blue-soft);
}

.item-action-primary {
  color: #fffdf8;
  background: var(--blue);
}

.panel-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.time-input {
  width: 112px;
  min-height: 30px;
  padding: 5px 8px;
  font-size: 0.82rem;
}

.icon-button {
  display: grid;
  width: 34px;
  padding: 0;
  place-items: center;
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
  font-size: 1.35rem;
  line-height: 1;
}

.quick-capture {
  margin-bottom: 20px;
}

.quick-capture form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quick-capture input,
.quick-capture button,
textarea,
select,
.time-input,
.form-grid input {
  border-radius: 8px;
}

.quick-capture input,
textarea,
select,
.time-input,
.form-grid input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 11px 12px;
  color: var(--ink);
  background: var(--surface-strong);
}

.quick-capture input {
  border-color: transparent;
}

.quick-capture button {
  border: 0;
  color: #fffdf8;
  background: var(--green);
  padding: 0 18px;
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.priority-band,
.panel,
.management-view {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.priority-band {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  background: #fffaf0;
}

.priority-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  grid-column: span 4;
  min-height: 260px;
  padding: 16px;
}

.dashboard-main {
  grid-column: span 7;
}

.dashboard-side {
  grid-column: span 5;
}

.morning-panel {
  grid-column: 1 / -1;
  min-height: 0;
  background: #fbfdff;
}

.progress-panel {
  grid-column: 1 / -1;
  min-height: 0;
  background: #f8fbf8;
}

.morning-brief {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.morning-headline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #c9d9e5;
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.morning-headline p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.morning-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.morning-metrics span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.84rem;
}

.morning-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

.morning-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.morning-grid section,
.morning-routine {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.morning-grid ul,
.morning-routine ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.4;
}

.morning-grid li strong {
  display: block;
  color: var(--ink);
}

.morning-grid li span {
  display: block;
  margin-top: 2px;
  font-size: 0.84rem;
}

.item-list,
.wide-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.item-list.compact {
  margin-top: 0;
}

.task-card,
.inbox-card,
.note-card,
.list-card,
.priority-card,
.timeline-item,
.mail-card,
.document-card,
.report-card,
.request-card,
.connection-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.priority-card {
  min-height: 116px;
  border-color: #ead7b5;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  margin: 0;
  font-weight: 760;
  line-height: 1.3;
}

.card-meta,
.empty-state,
.assistant-preview {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.card-meta {
  margin: 7px 0 0;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag.urgent,
.tag.important {
  color: #6c2f2b;
  background: var(--red-soft);
}

.tag.normal {
  color: #2f5470;
  background: var(--blue-soft);
}

.tag.low {
  color: #44604f;
  background: var(--green-soft);
}

.tag.waiting {
  color: #7d511f;
  background: var(--amber-soft);
}

.source-pill,
.count-pill {
  color: var(--muted);
  background: #f1ece4;
}

.connection-card.needs-reconnect {
  border-color: #d6a049;
  background: #fffaf1;
}

.connection-warning,
.connection-missing {
  margin: 10px 0 0;
  color: #7d511f;
  font-size: 0.86rem;
  line-height: 1.4;
}

.connection-missing {
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
}

.timeline-time {
  color: var(--blue);
  font-weight: 850;
}

.timeline-item.is-task {
  border-color: #d6c08f;
  background: #fffaf0;
}

.timeline-item.is-event {
  border-color: #c9d9e5;
  background: #fbfdff;
}

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

.quick-lists {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.quick-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.quick-list-row:last-child {
  border-bottom: 0;
}

.reports-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.recent-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.progress-day {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: var(--surface-strong);
}

.progress-day.has-progress {
  border-color: #b8d7c1;
  background: #f3faf5;
}

.progress-day strong,
.progress-day span {
  display: block;
}

.progress-day strong {
  color: var(--ink);
  text-transform: capitalize;
}

.progress-day span,
.progress-day p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-day ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 16px;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.request-summary,
.usage-summary,
.memory-summary,
.knowledge-summary,
.task-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.request-summary article,
.usage-summary article,
.memory-summary article,
.knowledge-summary article,
.task-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.request-summary strong,
.usage-summary strong,
.memory-summary strong,
.knowledge-summary strong,
.task-summary strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
}

.request-summary span,
.usage-summary span,
.memory-summary span,
.knowledge-summary span,
.task-summary span {
  color: var(--muted);
  font-size: 0.84rem;
}

.request-list {
  display: grid;
  gap: 12px;
}

.request-card {
  background: #fffdf8;
}

.request-card.status-en-traitement {
  border-color: #c9d9e5;
}

.request-card.status-a-valider {
  border-color: #d6c08f;
}

.request-card.status-clos {
  background: #f8fbf8;
}

.request-original {
  margin: 12px 0 0;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.45;
}

.request-report {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.request-workflow {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.request-brief,
.worker-response-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.request-brief strong,
.worker-response-card strong {
  color: var(--ink);
}

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

.worker-question {
  margin: 10px 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.worker-answer {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
}

.system-panel {
  min-height: 0;
}

.system-status,
.system-status-card {
  margin-top: 14px;
}

.system-status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.system-status-list {
  display: grid;
  gap: 9px;
}

.system-status-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.system-status-row:last-child {
  border-bottom: 0;
}

.system-status-row strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.system-status-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.system-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 999px;
  background: #a7a197;
}

.system-dot.is-ok {
  background: var(--green);
}

.system-dot.is-warning {
  background: var(--amber);
}

.system-dot.is-muted {
  background: #a7a197;
}

.progress-track {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee7dc;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.connection-notice {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #f8f4ed;
  line-height: 1.45;
}

.connection-notice code {
  color: var(--ink);
  font-weight: 750;
}

.sync-status-card {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.88rem;
}

.sync-status-card strong {
  color: var(--ink);
}

.oauth-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-strong);
}

.settings-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-strong);
}

.settings-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.preview-logo {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  color: #23211e;
}

.settings-preview strong,
.settings-preview span {
  display: block;
}

.settings-preview strong {
  font-size: 1.12rem;
}

.settings-preview span,
.settings-preview p {
  color: var(--muted);
}

.settings-preview p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.local-ai-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.oauth-form.compact {
  margin-top: 12px;
}

.connection-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.wide-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.wide-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--surface-strong);
}

.wide-field textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.scope-list {
  display: grid;
  gap: 8px;
  min-height: 76px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.management-view {
  padding: 18px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.task-toolbar {
  display: grid;
  grid-template-columns: auto 220px minmax(220px, 1fr);
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #f8f4ed;
}

.segmented-control button,
.task-toolbar select,
.task-toolbar input {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 11px;
  color: var(--ink);
  background: transparent;
}

.segmented-control button {
  font-weight: 750;
  color: var(--muted);
}

.segmented-control button.is-active {
  color: #fffdf8;
  background: var(--blue);
}

.task-toolbar select,
.task-toolbar input {
  width: 100%;
  border-color: var(--line);
  background: var(--surface-strong);
}

.task-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.task-summary article,
.memory-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8f4ed;
}

.task-summary strong,
.memory-summary strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}

.task-summary span,
.memory-summary span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.task-filter-note,
.task-more-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.task-more-note {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfdff;
}

.late-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid #e5c6a0;
  border-radius: 8px;
  padding: 8px;
  background: #fff7ea;
}

.late-task-actions::before {
  content: "Rattraper :";
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: #7d511f;
  font-size: 0.82rem;
  font-weight: 800;
}

.memory-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 10px;
  margin-top: 14px;
}

.agent-panel,
.knowledge-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.agent-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.agent-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.agent-form select {
  max-width: 280px;
}

.agent-form textarea {
  min-height: 190px;
}

.knowledge-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.knowledge-upload input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface-strong);
}

.knowledge-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.knowledge-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8f4ed;
}

.knowledge-summary strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1;
}

.knowledge-summary span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.usage-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffaf0;
}

.usage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.usage-summary article {
  border: 1px solid #ead7b5;
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.usage-summary strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1;
}

.usage-summary span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.usage-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.usage-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.memory-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.memory-card,
.knowledge-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-strong);
}

.knowledge-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.commercial-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.commercial-summary.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.commercial-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.commercial-summary strong {
  display: block;
  color: var(--ink);
  font-size: 1.25rem;
}

.commercial-summary span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.commercial-wide {
  grid-column: 1 / -1;
}

.order-card {
  border-left: 4px solid #b8c2bd;
}

.order-card.status-en-commande {
  border-left-color: #8aa2b0;
}

.order-card.status-prete-pour-expedition {
  border-left-color: #c59b4a;
}

.order-card.status-en-livraison {
  border-left-color: #5d8b72;
}

.order-card.status-expedie {
  border-left-color: #8ca491;
  opacity: 0.82;
}

.order-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.order-flow span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.78rem;
}

.order-flow span.is-current {
  border-color: #597469;
  color: #23352d;
  background: #e8f0eb;
  font-weight: 700;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.timeclock-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.timeclock-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.timeclock-summary strong {
  display: block;
  color: var(--ink);
  font-size: 1.25rem;
}

.timeclock-summary span {
  color: var(--muted);
  font-size: 0.82rem;
}

.timeclock-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-top: 18px;
}

.timeclock-panel {
  min-height: 0;
}

.timeclock-link-box,
.employee-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.employee-form {
  grid-template-columns: minmax(160px, 1fr) 130px auto;
}

.timeclock-link-box input,
.employee-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--surface-strong);
}

.timeclock-qr {
  display: block;
  width: min(260px, 100%);
  height: auto;
  margin: 16px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.memory-label {
  margin: 12px 0 0;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.task-section {
  border-radius: 8px;
  padding: 12px;
  background: #f8f4ed;
}

.task-section h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.task-card.is-late {
  border-color: #e4b5ae;
  background: #fff9f8;
}

.task-card.is-today {
  border-color: #d6c08f;
  background: #fffaf0;
}

.notes-grid,
.list-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.note-card p,
.note-body,
.list-card p,
.list-card li {
  color: var(--muted);
  line-height: 1.45;
}

.note-card p,
.note-body {
  white-space: pre-line;
}

.note-actions {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.list-card ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.assistant-dialog {
  width: min(620px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.assistant-dialog::backdrop {
  background: rgba(22, 24, 21, 0.45);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

textarea {
  min-height: 132px;
  resize: vertical;
}

.mail-reader-dialog {
  width: min(900px, calc(100vw - 28px));
}

.mail-dialog-card {
  max-height: min(86vh, 860px);
  grid-template-rows: auto auto minmax(220px, 1fr) auto auto auto;
}

.mail-dialog-meta,
.mail-send-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.mail-body {
  overflow: auto;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffdf8;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
}

.mail-reply-label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 750;
}

.mail-reply-label textarea {
  min-height: 130px;
  font-weight: 500;
}

.assistant-preview {
  min-height: 54px;
  border-radius: 8px;
  padding: 12px;
  background: #f6f1e8;
}

.assistant-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.assistant-thread {
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbf8f1;
}

.assistant-message {
  display: grid;
  gap: 7px;
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
}

.assistant-message.is-user {
  justify-self: end;
  border-color: #c6d9e8;
  background: #eef7ff;
}

.assistant-message.is-error {
  border-color: #e6b8b0;
  background: #fff4f1;
}

.assistant-message-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.assistant-message-top strong {
  color: var(--ink);
}

.assistant-message-body {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.5;
}

.formatted-answer {
  display: grid;
  gap: 8px;
}

.formatted-answer h3,
.formatted-answer p {
  margin: 0;
}

.formatted-answer h3 {
  color: var(--ink);
  font-size: 0.98rem;
}

.formatted-answer ul,
.formatted-answer ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
}

.formatted-answer code {
  border-radius: 6px;
  padding: 1px 5px;
  background: #efe8dc;
}

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

.assistant-mode button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.assistant-mode button.is-active {
  color: #fffdf8;
  border-color: var(--blue);
  background: var(--blue);
}

.worker-menu {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.worker-menu button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.worker-menu button:hover {
  border-color: var(--line);
  background: var(--surface);
}

.worker-menu span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  transform: translateY(20px);
  opacity: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: #fffdf8;
  background: #242923;
  box-shadow: var(--shadow);
  transition: 180ms ease;
  pointer-events: none;
}

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

.mobile-action-dock {
  display: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .panel,
  .dashboard-main,
  .dashboard-side {
    grid-column: span 6;
  }

  .priority-list,
  .notes-grid,
  .list-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    gap: 12px;
    padding: 12px 12px 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo-slot {
    width: 38px;
    height: 38px;
  }

  .brand-subtitle {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 0 12px;
    text-align: center;
    white-space: nowrap;
  }

  .sync-panel {
    display: none;
  }

  .workspace {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
    padding: 18px 14px 24px;
  }

  .topbar,
  .view-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
    gap: 8px;
    overflow-x: auto;
  }

  .topbar-actions > button,
  .connection-actions > button {
    flex: 1 1 0;
    min-width: 0;
  }

  #resetDemo {
    display: none;
  }

  h1 {
    font-size: 1.72rem;
  }

  .daily-zen {
    margin-top: 6px;
    font-size: 0.9rem;
  }

  .quick-capture form,
  .priority-band,
  .split-list,
  .settings-preview,
  .timeclock-link-box,
  .employee-form,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .settings-preview {
    align-items: flex-start;
  }

  .panel,
  .dashboard-main,
  .dashboard-side {
    grid-column: 1 / -1;
  }

  .priority-list,
  .morning-metrics,
  .morning-grid,
  .recent-progress,
  .timeclock-summary,
  .timeclock-admin-grid,
  .notes-grid,
  .list-columns,
  .commercial-summary,
  .commercial-grid,
  .connections-grid {
    grid-template-columns: 1fr;
  }

  .task-toolbar,
  .task-summary,
  .kanban {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .priority-band,
  .panel,
  .management-view {
    box-shadow: 0 10px 26px rgba(52, 45, 35, 0.08);
  }

  .quick-capture {
    position: sticky;
    top: 116px;
    z-index: 2;
    margin-bottom: 14px;
  }

  .quick-capture form {
    gap: 8px;
    padding: 8px;
    box-shadow: 0 10px 24px rgba(52, 45, 35, 0.12);
  }

  .quick-capture input,
  .quick-capture button {
    min-height: 44px;
  }

  .dashboard-grid {
    gap: 12px;
  }

  .panel,
  .priority-band,
  .management-view {
    padding: 14px;
  }

  .priority-card,
  .task-card,
  .inbox-card,
  .mail-card,
  .timeline-item,
  .report-card,
  .request-card,
  .note-card,
  .document-card,
  .connection-card {
    padding: 13px;
  }

  .assistant-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .dialog-card {
    min-height: 100%;
    border-radius: 0;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    min-height: 46px;
  }

  #assistantText,
  #quickNoteText,
  #mailReplyText {
    min-height: 180px;
    font-size: 1rem;
  }

  .mail-dialog-card {
    max-height: none;
    grid-template-rows: auto auto minmax(200px, 1fr) auto auto auto;
  }

  .mail-body {
    min-height: 220px;
  }

  .assistant-thread {
    max-height: 32vh;
  }

  .assistant-message {
    max-width: 100%;
  }

  .assistant-mode {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-action-dock {
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(36, 41, 35, 0.12);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 16px 42px rgba(36, 41, 35, 0.2);
    backdrop-filter: blur(12px);
  }

  .mobile-action-dock button {
    display: grid;
    min-width: 0;
    min-height: 48px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    padding: 0 6px;
    color: var(--muted);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 800;
  }

  .mobile-action-dock button.is-active {
    color: var(--ink);
    background: var(--green-soft);
  }

  .mobile-action-dock .dock-primary {
    color: #fffdf8;
    background: var(--blue);
  }
}
