/* ============================================================
   Mandavo — CPA Mandat Tracker
   Corporate palette: slate navy + indigo accent. Inter typography.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Text */
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;

  /* Accent (indigo, corporate-serious) */
  --accent: #3730a3;
  --accent-hover: #312e81;
  --accent-soft: #eef2ff;
  --accent-border: #c7d2fe;

  /* Semantic */
  --success: #047857;
  --success-soft: #ecfdf5;
  --success-border: #a7f3d0;

  --warning: #b45309;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;

  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  --pro-from: #d97706;
  --pro-to: #b45309;

  /* Radius / shadow */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.05);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 { font-size: 1.65rem; line-height: 1.2; }
h2 { font-size: 1.2rem; }
h3 { font-size: 0.9rem; }

p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================= Brand mark ================= */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), #0f172a);
}
.brand-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-mark-hero {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.brand-logo-hero {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
}
.brand-name-hero { font-size: 1.25rem; }
.brand-name { font-size: 0.95rem; }
.brand-sub {
  color: var(--text-subtle);
  font-weight: 500;
  font-size: 0.85rem;
  margin-left: 0.15rem;
}

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-pro {
  background: linear-gradient(90deg, var(--pro-from), var(--pro-to));
  color: white;
  box-shadow: 0 1px 3px rgba(180, 83, 9, 0.35);
}
.btn-pro:hover:not(:disabled) { filter: brightness(1.05); }

.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* ================= Forms ================= */
.form-stack { display: grid; gap: 0.9rem; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-row-name-kind { grid-template-columns: 1fr 160px; }
.form-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem 0.85rem;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.form-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field { display: grid; gap: 0.35rem; }
.field-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.field-optional { color: var(--text-subtle); font-weight: 400; }
.field-req { color: var(--danger); font-weight: 700; }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
select {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  width: 100%;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(55, 48, 163, 0.15);
}
input::placeholder { color: var(--text-subtle); }

/* ================= Auth screen ================= */
.auth-screen {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 1.5rem;
  background: var(--bg);
  z-index: 40;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: min(400px, 100%);
  box-shadow: var(--shadow-lg);
}
.auth-card .brand-mark { margin-bottom: 1.5rem; }
.auth-title { font-size: 1.4rem; margin: 0 0 0.35rem; }
.auth-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
}
.auth-error {
  padding: 0.6rem 0.75rem;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.auth-notice {
  padding: 0.6rem 0.75rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.45;
}
.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.field-link {
  font-size: 0.78rem;
  font-weight: 500;
}
.field-actions {
  display: inline-flex;
  gap: 0.6rem;
}
.input-with-action {
  position: relative;
  display: block;
}
.input-with-action input { padding-right: 4.6rem; }
.input-action {
  position: absolute;
  top: 50%; right: 0.4rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.input-action:hover { color: var(--text); background: var(--surface-2); }
.password-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.password-meter-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.password-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 160ms ease, background 160ms ease;
}
.password-meter[data-score="1"] .password-meter-fill { width: 33%; background: var(--danger); }
.password-meter[data-score="2"] .password-meter-fill { width: 66%; background: #d97706; }
.password-meter[data-score="3"] .password-meter-fill { width: 100%; background: #047857; }
.password-meter[data-score="1"] .password-meter-label { color: var(--danger); }
.password-meter[data-score="3"] .password-meter-label { color: #047857; }
.auth-switch {
  text-align: center;
  margin: 1.25rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.auth-switch a { font-weight: 500; }

/* ================= App shell / topbar ================= */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar-right { display: flex; align-items: center; gap: 0.65rem; }
.user-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sub-badge {
  display: inline-flex; align-items: center;
  padding: 0.22rem 0.55rem;
  background: linear-gradient(90deg, var(--pro-from), var(--pro-to));
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
}

/* ================= Page container ================= */
.container {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}
.page-head {
  display: flex; align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.page-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}
.page-actions { display: flex; gap: 0.55rem; flex-wrap: wrap; }

/* ================= Banners ================= */
.banner {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}
.banner p { font-weight: 500; }
.banner-success {
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  color: var(--success);
}
.banner-cancel {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}
.banner-close {
  background: transparent; border: 0;
  color: inherit; opacity: 0.7;
  cursor: pointer;
  font-size: 1.3rem; line-height: 1;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}
.banner-close:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.06);
}

/* ================= Kanban (4 columns) ================= */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}
.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 120ms ease, background 120ms ease;
}
.kanban-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.15rem 0.15rem 0.15rem 0.1rem;
}
.kanban-head h3 {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.col-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.col-dot-upcoming     { background: #94a3b8; }
.col-dot-in_progress  { background: #3730a3; }
.col-dot-finalization { background: #d97706; }
.col-dot-closed       { background: #047857; }

.count {
  min-width: 1.4rem; height: 1.4rem;
  border-radius: 999px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0 0.4rem;
}
.kanban-list {
  display: flex; flex-direction: column;
  gap: 0.55rem;
  min-height: 3rem;
}
.kanban-col.drop-target {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Folded "Fermé" column: history is kept, only the header stays visible. */
.kanban.closed-collapsed {
  grid-template-columns: repeat(3, minmax(0, 1fr)) 3rem;
}
.kanban-col.is-collapsed {
  min-height: 0;
  padding: 0.6rem 0.35rem;
  align-self: stretch;
  cursor: pointer;
}
.kanban-col.is-collapsed .kanban-head {
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
}
.kanban-col.is-collapsed .kanban-head h3 {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  flex: 0 0 auto;
}
.kanban-col.is-collapsed.drop-target-sub {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.col-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  width: 1.5rem; height: 1.5rem;
  display: grid; place-items: center;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.col-toggle:hover { color: var(--text); background: var(--surface-2); }

/* ================= Task cards ================= */
.task {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.task-meta-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.task-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.task-detail {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.task-closed .task-title { color: var(--text-muted); }
.task-closed .task-title { text-decoration: line-through; text-decoration-color: rgba(15, 23, 42, 0.3); }

.task[draggable="true"] { cursor: grab; }
.task[draggable="true"]:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.task[draggable="true"]:active { cursor: grabbing; }
.task.dragging { opacity: 0.5; transform: scale(0.98); }

.task-loading,
.task-empty {
  color: var(--text-subtle);
  font-size: 0.85rem;
  font-style: italic;
  background: transparent;
  border: 1px dashed var(--border);
  box-shadow: none;
  text-align: center;
  padding: 1rem;
  gap: 0;
}

/* ================= Task tags (mandat_type) ================= */
.task-tag {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.task-tag-tax     { background: #dbeafe; color: #1e40af; }  /* T-series income tax */
.task-tag-book    { background: #fce7f3; color: #9d174d; }  /* Bookkeeping */
.task-tag-stax    { background: #ede9fe; color: #5b21b6; }  /* Sales tax */
.task-tag-audit   { background: #ccfbf1; color: #115e59; }  /* Audit / exam */
.task-tag-gov     { background: #fef3c7; color: #92400e; }  /* Government forms */
.task-tag-ops     { background: #e0e7ff; color: #3730a3; }  /* Ops / generic */
.task-tag-neutral { background: var(--surface-2); color: var(--text-muted); }

/* ================= Status pill (mandat_status) ================= */
.task-status {
  display: inline-flex; align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem 0.15rem 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
}
.task-status .status-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--text-subtle);
}
.task-status-attribuer .status-dot { background: #94a3b8; }
.task-status-encours   .status-dot { background: #3730a3; }
.task-status-attente   .status-dot { background: #d97706; }
.task-status-reviser   .status-dot { background: #7c3aed; }
.task-status-corriger  .status-dot { background: #dc2626; }
.task-status-imprimer  .status-dot { background: #0284c7; }
.task-status-livrer    .status-dot { background: #0d9488; }
.task-status-signer    .status-dot { background: #0891b2; }
.task-status-ted       .status-dot { background: #6366f1; }
.task-status-facturer  .status-dot { background: #ea580c; }
.task-status-ferme     .status-dot { background: #047857; }

/* ================= Task controls ================= */
.task-controls {
  display: flex; gap: 0.3rem;
  justify-content: flex-end;
  margin-top: 0.15rem;
}
.task-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.5rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  line-height: 1;
}
.task-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.task-btn-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}

/* ================= Modal ================= */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: grid; place-items: center;
  z-index: 50;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  width: min(520px, 100%);
  box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 1.05rem; margin-bottom: 1.1rem; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  margin-top: 0.4rem;
}

/* ================= Onboarding ================= */
.auth-card-wide { width: min(460px, 100%); }
.onboarding-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.onboarding-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.onboarding-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.field-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: -0.25rem 0 0;
}

/* ================= Filter bar ================= */
.filter-bar {
  display: flex;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.field-inline {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
}
.field-inline .field-label { margin: 0; white-space: nowrap; }
.field-inline select { min-width: 180px; }

/* ================= View toggle (Kanban / Liste) ================= */
.view-toggle {
  margin-left: auto;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  gap: 2px;
}
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.view-toggle-btn:hover { color: var(--text); }
.view-toggle-btn.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ================= List view ================= */
.mandat-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.mandat-list-header,
.mandat-list-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 1.25fr 0.9fr 90px 1.1fr 110px 110px 90px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
}
.mandat-list-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mandat-list-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s ease;
}
.mandat-list-row:last-child { border-bottom: 0; }
.mandat-list-row:hover { background: var(--surface-2); }
.mandat-list-title {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mandat-list-cell {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mandat-list-cell .task-tag,
.mandat-list-cell .task-status { font-size: 0.7rem; }
.mandat-list-cell.is-overdue { color: var(--danger, #b91c1c); font-weight: 600; }
.mandat-list-cell.is-soon { color: var(--warning, #b45309); font-weight: 600; }
.mandat-list-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
@media (max-width: 900px) {
  .mandat-list-header { display: none; }
  .mandat-list-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
  }
  .mandat-list-cell::before {
    content: attr(data-label) ' : ';
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.35rem;
  }
}

/* ================= Kanban: sub-status groups ================= */
.kanban-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.status-group {
  border-radius: var(--radius-sm);
  transition: background 120ms ease;
}
.status-group-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.25rem;
  margin-bottom: 0.35rem;
}
.status-group-head .task-status {
  flex: 1;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
}
.status-group-head .count {
  min-width: 1.25rem;
  height: 1.25rem;
  font-size: 0.68rem;
}
.status-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0.5rem;
  padding: 0.15rem;
  border-radius: var(--radius-sm);
  transition: background 120ms ease, box-shadow 120ms ease;
}
.status-list.drop-target-sub {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}
.status-empty {
  color: var(--text-subtle);
  font-size: 0.75rem;
  font-style: italic;
  padding: 0.35rem 0.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* ================= Task card additions (client + assignee) ================= */
.task-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.15rem;
  border-top: 1px dashed var(--border);
  margin-top: 0.15rem;
}
.task-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}
.task-due,
.task-recurrence {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.task-recurrence {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.task-client {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}
.task-assignee {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
}
.task-people {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}
.task-director {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning, #f59e0b) 20%, transparent);
  color: var(--warning, #b45309);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 45%, transparent);
  flex-shrink: 0;
}
.task-partner {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid #a7f3d0;
  flex-shrink: 0;
}

/* ================= Invite modal ================= */
.invite-code-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: grid;
  gap: 0.35rem;
}
.invite-code {
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  user-select: all;
}

/* ================= Mandat detail modal + checklist ================= */
.modal-wide {
  width: min(640px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.detail-head-main { min-width: 0; flex: 1; }
.detail-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.detail-title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
  margin: 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.detail-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.detail-value {
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-word;
}
.detail-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--text); }
.detail-section { margin-bottom: 1rem; }
.detail-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.detail-description {
  margin: 0.3rem 0 0;
  white-space: pre-wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.checklist-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 120ms ease;
}
.checklist-item:hover { background: var(--surface); }
.checklist-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.checklist-label {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
  word-break: break-word;
  cursor: pointer;
}
.checklist-item.is-done .checklist-label {
  text-decoration: line-through;
  color: var(--text-muted);
}
.checklist-delete {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  transition: color 120ms ease, background 120ms ease;
  flex-shrink: 0;
}
.checklist-delete:hover { color: var(--danger); background: var(--danger-soft); }
.checklist-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  margin: 0 0 0.5rem;
}
.checklist-add {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.checklist-add input[type="text"] {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}
.checklist-add input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.task { cursor: pointer; }
.task .task-controls,
.task .task-btn { cursor: pointer; }

/* ================= Timer (mandat detail) ================= */
.timer-total {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.timer-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.timer-display {
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  flex: 1;
}
.timer-display.is-running { color: var(--accent); }
#timer-toggle.is-running {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
#timer-toggle.is-running:hover { filter: brightness(1.05); }
.timer-totals {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.timer-totals li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.timer-totals .timer-user { color: var(--text); }
.timer-totals .timer-amount {
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
}
.timer-totals .timer-user.is-me::after {
  content: 'vous';
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.timer-history {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}
.timer-history summary {
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem 0;
  user-select: none;
}
.timer-entries {
  list-style: none;
  padding: 0.35rem 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.timer-entries li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.3rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.timer-entries .timer-entry-user { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-entries .timer-entry-when { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.timer-entries .timer-entry-duration {
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
}
.timer-entries li.is-running .timer-entry-duration::after {
  content: '⏵';
  margin-left: 0.35rem;
}
.timer-empty {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
  margin: 0.35rem 0 0;
}

/* Small running-timer indicator on the card */
.task-timer-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  animation: pulse-soft 1.6s ease-in-out infinite;
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ================= Toasts ================= */
.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 2.5rem));
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-size: 0.875rem;
  color: var(--text);
  animation: toast-in 0.18s ease-out;
}
.toast.is-leaving { animation: toast-out 0.18s ease-in forwards; }
.toast-icon { flex-shrink: 0; font-weight: 700; line-height: 1.35; }
.toast-body { flex: 1; line-height: 1.35; word-break: break-word; }
.toast-close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}
.toast-close:hover { color: var(--text); }
.toast-success { border-left: 3px solid #15803d; }
.toast-success .toast-icon { color: #15803d; }
.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info { border-left: 3px solid var(--accent); }
.toast-info .toast-icon { color: var(--accent); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* ================= Confirm modal ================= */
.modal-sm { max-width: 420px; }
.confirm-message {
  margin: 0 0 1.15rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { filter: brightness(1.08); }

/* ================= Attachments ================= */.attachment-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}
.attachment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.attachment-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.attachment-icon { font-size: 0.95rem; line-height: 1; }
.attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  text-align: left;
}
.attachment-name:hover { text-decoration: underline; }
.attachment-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.attachment-delete {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  border-radius: var(--radius-sm);
}
.attachment-delete:hover { color: var(--danger); background: var(--danger-soft); }
.attachment-add {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.attachment-hint { font-size: 0.72rem; color: var(--text-muted); }
.attachment-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.attachment-item.is-uploading { opacity: 0.6; }

/* ================= Notification toggle ================= */.notif-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.notif-toggle input { accent-color: var(--accent); cursor: pointer; }
.notif-toggle:hover { color: var(--text); }

/* ================= Activity log ================= */.activity-summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0;
  user-select: none;
}
.activity-summary:hover { color: var(--text); }
.activity-list {
  list-style: none;
  padding: 0.5rem 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 260px;
  overflow-y: auto;
}
.activity-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.35rem 0.55rem;
  border-left: 2px solid var(--border);
  font-size: 0.82rem;
}
.activity-action { font-weight: 600; color: var(--text); }
.activity-change { color: var(--text-muted); }
.activity-change del { color: var(--danger); text-decoration: line-through; opacity: 0.75; }
.activity-change ins { color: var(--accent); text-decoration: none; }
.activity-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}
.activity-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

/* ================= Checklist templates ================= */
.template-apply {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.template-apply select { flex: 1; min-width: 150px; }
.template-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 220px;
  overflow-y: auto;
}
.template-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.template-item-name { font-weight: 600; color: var(--text); }
.template-item-meta { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.template-delete {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  border-radius: var(--radius-sm);
}
.template-delete:hover { color: var(--danger); background: var(--danger-soft); }
.template-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}
#template-labels {
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
#template-labels:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ================= Hourly rates ================= */.rate-input {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.rate-input input { flex: 1; text-align: right; font-variant-numeric: tabular-nums; }
.rate-suffix {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.rate-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 240px;
  overflow-y: auto;
}
.rate-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 0.6rem;
  align-items: center;
  padding: 0.35rem 0;
}
.rate-row-name {
  font-size: 0.85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rate-row input {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 100%;
}
.timer-cost {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}
.timer-cost .cost-breakdown {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

/* ================= Statutory deadline hint ================= */
.deadline-hint {
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.deadline-apply {
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.deadline-apply:hover { filter: brightness(1.2); }

/* ================= Reports ================= */
.modal-lg { max-width: 760px; }
.report-range {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.report-range .field-inline select,
.report-range .field-inline input { min-width: 0; }
.report-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.15rem;
}
.report-kpi {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
}
.report-kpi-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.report-kpi-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}
.report-kpi.is-alert .report-kpi-value { color: var(--danger); }
.report-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1rem;
}
.report-block { min-width: 0; }
.report-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 240px;
  overflow-y: auto;
}
.report-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
}
.report-row:last-child { border-bottom: 0; }
.report-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.report-row-hours,
.report-row-cost {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-muted);
}
.report-row-cost { font-weight: 600; color: var(--text); }
.report-empty {
  font-size: 0.83rem;
  color: var(--text-muted);
  padding: 0.5rem;
}

/* ================= Client feedback round 1 ================= */
.field-hint-inline {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}
#task-title[readonly] {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: default;
}
.title-override {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
}
.title-override input { accent-color: var(--accent); cursor: pointer; }

.due-custom {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.due-custom input { min-width: 140px; }
.due-custom-sep { color: var(--text-muted); }

.detail-status-select {
  width: 100%;
  font-size: 0.85rem;
  padding: 0.3rem 0.4rem;
}
.detail-status-select:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
}

.billed-banner {
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.65rem;
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 600;
}

.perm-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 220px;
  overflow-y: auto;
}
.perm-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.83rem;
}
.perm-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.perm-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.perm-check input { accent-color: var(--accent); cursor: pointer; }
.perm-check input:disabled { cursor: not-allowed; }

.timer-entry-edit {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.2rem;
  border-radius: var(--radius-sm);
}
.timer-entry-edit:hover { color: var(--accent); background: var(--accent-soft); }
.timer-entry-auto {
  font-size: 0.68rem;
  color: var(--warning);
  font-weight: 600;
}

/* ================= Responsive ================= */
@media (max-width: 1100px) {
  .kanban, .kanban.closed-collapsed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban-col.is-collapsed .kanban-head { flex-direction: row; }
  .kanban-col.is-collapsed .kanban-head h3 { writing-mode: horizontal-tb; transform: none; flex: 1; }
}
@media (max-width: 720px) {
  .kanban, .kanban.closed-collapsed { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .container { padding: 1.5rem 1rem 2rem; }
  .topbar-inner { padding: 0.65rem 1rem; }
  .user-email { display: none; }
  .notif-toggle span { display: none; }
  .brand-sub { display: none; }
  .field-row, .field-row-3, .field-row-name-kind { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .report-tables { grid-template-columns: 1fr; }
  .field-inline { flex-direction: column !important; align-items: stretch; }
  .field-inline select { min-width: 0; width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
}
