:root {
  --ink: #1f2523;
  --ink-soft: #5f6a64;
  --ink-muted: #838d87;
  --line: rgba(31, 37, 35, 0.12);
  --paper: #f5f1ea;
  --paper-strong: #fffdfa;
  --panel: rgba(255, 253, 250, 0.88);
  --accent: #d06b4d;
  --accent-strong: #b9583d;
  --accent-soft: rgba(208, 107, 77, 0.12);
  --forest: #2f5a49;
  --gold: #c99032;
  --blue: #3c6679;
  --danger: #b04f47;
  --shadow-lg: 0 24px 48px rgba(31, 37, 35, 0.12);
  --shadow-md: 0 12px 24px rgba(31, 37, 35, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(208, 107, 77, 0.14), transparent 30%),
    linear-gradient(160deg, #f8f4ee 0%, #ece4d8 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 37, 35, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 37, 35, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black, transparent 74%);
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

p {
  margin: 0;
}

.shell {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 32px;
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(31, 37, 35, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.feedback {
  min-height: 24px;
  color: var(--ink-muted);
  padding: 0 6px;
}

.feedback.is-error {
  color: var(--danger);
}

.feedback.is-success {
  color: var(--forest);
}

.feedback.is-neutral {
  color: var(--blue);
}

.eyebrow,
.field span,
.compact-field span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.eyebrow {
  color: var(--accent);
  margin-bottom: 10px;
}

.intro-copy,
.login-note,
.task-card p,
.subtasks-inline,
.subtasks-empty {
  line-height: 1.6;
  color: var(--ink-soft);
}

.login-view {
  min-height: calc(100vh - 74px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(560px, 100%);
  padding: 34px;
  display: grid;
  gap: 18px;
}

.login-card h1,
.topbar h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 0.96;
}

.stacked-form,
.field,
.board,
.task-list,
.drawer-form,
.subtasks-list {
  display: grid;
  gap: 14px;
}

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

.field input,
.field select,
.compact-field select,
.field textarea,
.subtask-row input,
.subtask-row select {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.compact-field select:focus,
.field textarea:focus,
.subtask-row input:focus,
.subtask-row select:focus,
.editor-surface:focus {
  outline: none;
  border-color: rgba(208, 107, 77, 0.45);
  box-shadow: 0 0 0 4px rgba(208, 107, 77, 0.12);
}

.primary-button,
.secondary-button,
.ghost-button,
.toolbar-button {
  min-height: 48px;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.toolbar-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fffdfa;
  box-shadow: 0 16px 28px rgba(208, 107, 77, 0.22);
}

.secondary-button {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.ghost-button,
.toolbar-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.topbar {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.compact-field {
  min-width: 170px;
  display: grid;
  gap: 8px;
}

.compact-field select {
  min-height: 48px;
}

.user-pill {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 2px;
}

.user-pill small {
  color: var(--ink-muted);
}

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

.stat-box {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-md);
}

.stat-box span {
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
}

.stat-box strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.board {
  gap: 16px;
}

.group-block {
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-md);
}

.group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.group-head h2 {
  font-size: 1.4rem;
}

.group-head span {
  color: var(--ink-muted);
  font-weight: 700;
}

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

.task-card {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
  box-shadow: 0 10px 22px rgba(31, 37, 35, 0.06);
  transition: transform 140ms ease, border-color 140ms ease;
}

.task-card:hover {
  transform: translateY(-1px);
  border-color: rgba(208, 107, 77, 0.34);
}

.task-card h3 {
  font-size: 1.15rem;
  line-height: 1.08;
  margin-bottom: 8px;
}

.task-card-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.task-card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.subtasks-inline {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.tone-todo,
.tone-in-review,
.tone-approved,
.tone-printing,
.tone-delivery,
.tone-billing,
.tone-impression {
  background: rgba(201, 144, 50, 0.16);
  color: #8e6520;
}

.tone-in-progress,
.tone-site-web,
.tone-photo-video {
  background: rgba(60, 102, 121, 0.14);
  color: var(--blue);
}

.tone-creation-graphique,
.tone-reseaux-sociaux,
.tone-done {
  background: rgba(47, 90, 73, 0.14);
  color: var(--forest);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 37, 35, 0.28);
  z-index: 9;
}

.drawer {
  position: fixed;
  top: 14px;
  right: 14px;
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 22px;
  overflow: auto;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(31, 37, 35, 0.08);
  background: rgba(255, 253, 250, 0.98);
  box-shadow: 0 28px 56px rgba(31, 37, 35, 0.22);
  z-index: 10;
}

.drawer-head,
.subtasks-head,
.drawer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.drawer-head {
  margin-bottom: 18px;
}

.drawer-form {
  gap: 18px;
}

.editor-card,
.subtasks-block {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-button {
  min-height: 40px;
  padding: 0 14px;
}

.editor-surface {
  min-height: 150px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.editor-surface ul,
.editor-surface ol {
  padding-left: 22px;
}

.subtasks-list {
  gap: 10px;
}

.subtask-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 1fr 150px 160px auto;
  gap: 10px;
  align-items: center;
}

.subtasks-empty {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
}

.subtasks-block.is-hidden {
  display: none;
}

@media (max-width: 1024px) {
  .task-list,
  .stats-strip,
  .field-row,
  .subtask-row {
    grid-template-columns: 1fr;
  }

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

  .task-card-tags {
    justify-content: start;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 16px, 100%);
    padding-top: 10px;
  }

  .login-card,
  .topbar,
  .group-block,
  .drawer {
    padding: 18px;
  }

  .topbar-actions,
  .drawer-head,
  .subtasks-head,
  .drawer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-field,
  .user-pill,
  .topbar-actions .primary-button,
  .topbar-actions .secondary-button,
  .drawer-actions .primary-button,
  .drawer-actions .secondary-button {
    width: 100%;
  }

  .drawer {
    top: 8px;
    right: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }
}
