/* Jill Mgmt — dark theme (grey/black + violet).
   No inline styles anywhere: the CSP is `style-src 'self'`. */

:root {
  color-scheme: dark;
  --bg: #121116;
  --bg-sidebar: #0c0b10;
  --surface: #1a1920;
  --surface-2: #222129;
  --surface-3: #2b2a34;
  --border: #2a2832;
  --border-strong: #3a3846;
  --text: #ecebf3;
  --text-muted: #a5a2b5;
  --text-faint: #716e83;
  --primary: #6d4aff;
  --primary-hover: #8064ff;
  --primary-soft: rgba(109, 74, 255, 0.16);
  --primary-text: #b9a8ff;
  --danger: #ff5c69;
  --danger-soft: rgba(255, 92, 105, 0.14);
  --success: #3dd68c;
  --success-soft: rgba(61, 214, 140, 0.13);
  --warning: #f5b041;
  --warning-soft: rgba(245, 176, 65, 0.14);
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --sidebar-w: 236px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--primary-text); text-decoration: none; }
a:hover { color: #d3c8ff; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0 0 0.75em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }

/* ---------- Layout ---------- */

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; color: var(--text); font-size: 16px; }
.brand:hover { color: var(--text); }
.brand b { color: var(--primary-text); font-weight: 600; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #8a6bff, #5b36f2); color: #fff; font-weight: 700;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text-muted); font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: var(--text); }
.nav-link.active .icon { color: var(--primary-text); }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px; color: var(--text-muted); }
.user-chip strong { color: var(--text); font-weight: 500; display: block; }
a.user-chip { text-decoration: none; border-radius: 8px; }
a.user-chip:hover { background: var(--surface-3); color: var(--text); }
a.user-chip .icon { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 28px;
  background: rgba(18, 17, 22, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-search { position: relative; flex: 1; max-width: 560px; }
.topbar-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.topbar-search input { padding-left: 38px; background: var(--surface); border-color: var(--border); border-radius: 999px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.topbar .nav-toggle { display: none; }
.sidebar-backdrop { display: none; }

.content { padding: 28px; width: 100%; max-width: 1440px; }

/* ---------- Page header ---------- */

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-header .subtitle { color: var(--text-muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--text-faint); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.title-row { display: flex; align-items: center; gap: 14px; }
.count { color: var(--text-faint); font-weight: 500; margin-left: 6px; font-size: 16px; }

/* ---------- Cards & grids ---------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.card + .card { margin-top: 18px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-header h2 { display: flex; align-items: center; gap: 8px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-header { padding: 16px 20px 0; }
.card-flush > .list { padding: 0 20px 14px; }
.card-footer { border-top: 1px solid var(--border); padding: 14px 20px; }
.card.narrow { max-width: 620px; }

.layout-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.layout-2 > div > .card + .card { margin-top: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack > .card + .card { margin-top: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; color: var(--text); }
.stat:hover { border-color: var(--border-strong); color: var(--text); }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-text); }
.stat-value { font-size: 22px; font-weight: 600; line-height: 1.1; }
.stat-label { color: var(--text-muted); font-size: 13px; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.project-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; color: var(--text); }
.project-card:hover { border-color: var(--primary); color: var(--text); }
.project-card h2 { font-size: 16px; margin-bottom: 8px; }
.project-card-avatar { margin-bottom: 10px; }
.project-card .meta { color: var(--text-muted); font-size: 13px; display: flex; gap: 14px; }

.workflow-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px; border-top: 1px solid var(--border); }
.workflow-card:first-of-type { border-top: 0; }
.workflow-card .wf-main { flex: 1 1 240px; min-width: 0; }
.workflow-card .wf-main a { font-weight: 600; font-size: 15px; color: var(--text); }
.workflow-card .wf-main a:hover { color: var(--primary-text); }
.status-summary { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 7px 14px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 500; line-height: 1.2;
  cursor: pointer; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); border-color: rgba(255, 92, 105, 0.35); color: #ff8a93; }
.btn-danger:hover { background: rgba(255, 92, 105, 0.24); color: #ffb3b9; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: flex-start; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: #ff8a93; }
.btn-group { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.btn-group .btn { border: 0; border-radius: 0; background: transparent; color: var(--text-muted); }
.btn-group .btn + .btn { border-left: 1px solid var(--border-strong); }
.btn-group .btn.active { background: var(--primary-soft); color: var(--text); }

/* ---------- Dropdown (<details>) ---------- */

.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 220px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--text); }
.menu a:hover { background: var(--surface-3); }

/* ---------- Forms ---------- */

input, select, textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="radio"], input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--primary); margin: 0; }
input[type="date"], input[type="month"] { color-scheme: dark; }

.form-section { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.form-section legend { padding: 0; margin-bottom: 12px; font-weight: 600; font-size: 13px; color: var(--primary-text); text-transform: uppercase; letter-spacing: 0.06em; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; }
.field { min-width: 0; }
.field > label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.field .req { color: var(--primary-text); }
.field-wide { grid-column: 1 / -1; }
.field-grow { flex: 1 1 320px; max-width: none; }
.field .help { margin-top: 5px; font-size: 12px; color: var(--text-faint); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: #ff8a93; font-size: 12.5px; }
.radio-list, .field div[id^="id_"] { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.field div[id^="id_"] label, .radio-list label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); }

.select-filter { margin-bottom: 6px; min-height: 32px; padding: 5px 10px; font-size: 13px; background: var(--surface); }

/* ---------- Autocomplétion d'adresse ---------- */

.field { position: relative; }
.ac-box {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40; margin-top: 4px;
  max-height: 280px; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 8px; box-shadow: var(--shadow);
}
.ac-item { padding: 8px 10px; cursor: pointer; }
.ac-item.active, .ac-item:hover { background: var(--surface-3); }
.ac-item .sub { color: var(--text-faint); font-size: 12px; }

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.inline-form > * { flex: 1 1 160px; min-width: 0; }
.inline-form > .btn, .inline-form > button { flex: 0 0 auto; }
.inline-form .field > label { margin-bottom: 4px; font-size: 12px; }

.role-form { display: flex; gap: 6px; align-items: center; min-width: 180px; }
.role-form input { min-height: 30px; padding: 4px 8px; font-size: 13px; background: transparent; border-color: transparent; }
.role-form input:hover { border-color: var(--border-strong); }
.role-form input:focus { background: var(--surface-2); }
.role-form .icon-btn { width: 28px; height: 28px; }

/* ---------- Filters ---------- */

.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  padding: 14px 16px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.filters .field { flex: 1 1 170px; max-width: 280px; }
.filters .field > label { font-size: 12px; margin-bottom: 4px; }
.filters .field input, .filters .field select { min-height: 34px; padding: 5px 9px; }
.filters .field .select-filter { display: none; }
.filters-actions { display: flex; gap: 8px; margin-left: auto; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 8px 14px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--primary); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: middle; }
.table th { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); white-space: nowrap; border-bottom: 1px solid var(--border); }
.table th a.sort { color: var(--text-faint); }
.table th a.sort:hover, .table th a.sort-asc, .table th a.sort-desc { color: var(--text); }
.table td { border-top: 1px solid var(--border); }
.table tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table .primary-cell a { color: var(--text); font-weight: 500; }
.table .primary-cell a:hover { color: var(--primary-text); }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .actions form { display: inline; }
.table-compact th, .table-compact td { padding: 8px 10px; }
.card > .table-wrap { margin: 0 -20px; }
.card > .table-wrap .table th:first-child, .card > .table-wrap .table td:first-child { padding-left: 20px; }
.card > .table-wrap .table th:last-child, .card > .table-wrap .table td:last-child { padding-right: 20px; }
.card-flush > .table-wrap { margin: 0; }

.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-sub { color: var(--text-faint); font-size: 12.5px; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Badges, chips, avatars ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1.6; white-space: nowrap;
  background: var(--surface-3); color: var(--text-muted);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-count { font-variant-numeric: tabular-nums; opacity: 0.8; }
a.badge:hover { filter: brightness(1.15); }
.badge.is-active { box-shadow: 0 0 0 1.5px currentColor inset; }

.badge-gray { background: rgba(160, 158, 176, 0.14); color: #c3c1d1; }
.badge-blue { background: rgba(76, 154, 255, 0.15); color: #84b9ff; }
.badge-violet { background: rgba(155, 123, 255, 0.17); color: #bba6ff; }
.badge-teal { background: rgba(45, 212, 191, 0.14); color: #6ee7d6; }
.badge-green { background: rgba(61, 214, 140, 0.14); color: #6fe3aa; }
.badge-amber { background: rgba(245, 176, 65, 0.15); color: #f8c771; }
.badge-orange { background: rgba(255, 138, 61, 0.15); color: #ffaa72; }
.badge-red { background: rgba(255, 92, 105, 0.15); color: #ff8f99; }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.chip a { color: var(--text); }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-text);
  font-size: 12px; font-weight: 600;
}
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-img {
  display: inline-block; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; background: var(--primary-soft);
}
.avatar-img-lg { width: 52px; height: 52px; }

/* ---------- Status select (workflow tables) ---------- */

.status-form { margin: 0; }
.status-select {
  width: auto; min-height: 28px; padding: 2px 26px 2px 10px;
  border-radius: 999px; font-size: 12.5px; font-weight: 500;
  border: 1px solid transparent;
}
.status-select.badge-gray { border-color: rgba(160, 158, 176, 0.25); }
.status-select.badge-blue { border-color: rgba(76, 154, 255, 0.3); }
.status-select.badge-violet { border-color: rgba(155, 123, 255, 0.3); }
.status-select.badge-teal { border-color: rgba(45, 212, 191, 0.3); }
.status-select.badge-green { border-color: rgba(61, 214, 140, 0.3); }
.status-select.badge-amber { border-color: rgba(245, 176, 65, 0.3); }
.status-select.badge-orange { border-color: rgba(255, 138, 61, 0.3); }
.status-select.badge-red { border-color: rgba(255, 92, 105, 0.3); }
.status-select option { background: var(--surface-2); color: var(--text); }

/* ---------- Board (columns view) ---------- */

.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board-col { flex: 0 0 280px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; }
.board-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.board-cards { display: flex; flex-direction: column; gap: 8px; }
.board-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.board-card:hover { border-color: var(--border-strong); }
.board-card .title { font-weight: 500; color: var(--text); display: block; margin-bottom: 4px; }
.board-card .meta { color: var(--text-faint); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.board-empty { color: var(--text-faint); font-size: 13px; text-align: center; padding: 14px 0; }

/* ---------- Detail lists ---------- */

.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.dl dt { color: var(--text-faint); font-size: 13px; }
.dl dd { margin: 0; word-break: break-word; }
.dl dd .icon { vertical-align: -3px; margin-right: 6px; color: var(--text-faint); }
.notes { white-space: pre-line; color: var(--text); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.overdue { color: #ff8f99; font-weight: 500; }
.soon { color: #f8c771; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { color: var(--text); font-weight: 500; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--border-strong); }
.timeline li:last-child::after { display: none; }

/* ---------- Messages ---------- */

.messages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.alert { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface-2); }
.alert-success { background: var(--success-soft); border-color: rgba(61, 214, 140, 0.3); color: #a7f0cb; }
.alert-error { background: var(--danger-soft); border-color: rgba(255, 92, 105, 0.35); color: #ffb3b9; }
.alert-warning { background: var(--warning-soft); border-color: rgba(245, 176, 65, 0.35); color: #fad595; }
.alert-info { background: var(--primary-soft); border-color: rgba(109, 74, 255, 0.35); color: var(--primary-text); }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- Empty states, pagination ---------- */

.empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty .icon { width: 34px; height: 34px; color: var(--text-faint); margin-bottom: 8px; }
.empty p { margin-bottom: 14px; }
.empty-inline { color: var(--text-faint); padding: 6px 0; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--text-muted); font-size: 13px; }
.pagination .pages { display: flex; gap: 6px; }

/* ---------- Status admin rows ---------- */

.status-rows { display: flex; flex-direction: column; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.status-row:first-child { border-top: 0; }
.status-row .move { display: flex; flex-direction: column; }
.status-row .move .icon-btn { width: 26px; height: 20px; }
.status-row .edit { display: flex; flex: 1 1 360px; gap: 8px; align-items: center; }
.status-row .edit input { flex: 2; }
.status-row .edit select { flex: 1; }

/* ---------- Auth & error pages ---------- */

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top, rgba(109, 74, 255, 0.18), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-card .brand { justify-content: center; padding: 0 0 6px; font-size: 18px; }
.auth-card .lead { text-align: center; color: var(--text-muted); margin-bottom: 22px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { width: 100%; margin-top: 6px; min-height: 40px; }
.error-code { font-size: 42px; font-weight: 700; color: var(--primary-text); text-align: center; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; width: 260px;
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .nav-open .sidebar { transform: none; }
  .nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); }
  .topbar .nav-toggle { display: inline-grid; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar .btn-label { display: none; }
  .content { padding: 18px 14px; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .filters .field { max-width: none; }
  .filters-actions { margin-left: 0; width: 100%; }
  .filters-actions .btn { flex: 1; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .table .hide-sm { display: none; }
}
