:root {
  --bg: #0c0c0e;
  --bg-2: #101013;
  --surface: #17181b;
  --surface-2: #1f2024;
  --surface-3: #26272c;
  --border: #2a2b30;
  --border-soft: #222328;
  --text: #e6e6e8;
  --text-muted: #8d8e94;
  --text-faint: #5d5e65;
  --silver: #d9d9dc;
  --gold: #c9a24a;
  --gold-light: #e6c577;
  --gold-dark: #8f6d23;
  --gold-soft: rgba(201, 162, 74, 0.12);
  --danger: #e0786b;
  --warn: #e3b25a;
  --success: #6fc59a;
  --info: #7fa7e0;
  --violet: #a992e3;
  --radius: 10px;
  --radius-lg: 14px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

svg { flex: none; }

[hidden] { display: none !important; }

/* Login */

.page-login {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 162, 74, 0.08), transparent 60%),
    var(--bg);
}

.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login__card {
  width: 100%;
  max-width: 400px;
  padding: 8px 36px 32px;
  background: linear-gradient(180deg, #1b1c1f 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.login__logo {
  display: block;
  width: 240px;
  max-width: 100%;
  margin: 0 auto 4px;
  -webkit-mask-image: radial-gradient(ellipse 50% 42% at 50% 52%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 42% at 50% 52%, #000 70%, transparent 100%);
}

.login__form { display: grid; gap: 18px; }

.field { display: grid; gap: 7px; align-content: start; }

.field label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input,
.main input[type="text"],
.main input[type="email"],
.main input[type="number"],
.main input[type="date"],
.main input[type="password"],
.main input[type="search"],
.main textarea,
.main select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  color-scheme: dark;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.main textarea { resize: vertical; min-height: 110px; line-height: 1.5; }

.field input::placeholder,
.main textarea::placeholder { color: var(--text-faint); }

.field input[aria-invalid="true"],
.main [aria-invalid="true"] { border-color: rgba(224, 120, 107, 0.6); }

.field__error { color: var(--danger); font-size: 13px; }

.field input:focus,
.main input:focus,
.main textarea:focus,
.main select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.16);
}

.btn-gold {
  margin-top: 6px;
  padding: 13px 16px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 55%, var(--gold-dark) 100%);
  color: #1a1407;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 24px rgba(201, 162, 74, 0.18);
  transition: filter .15s, transform .05s;
}

.btn-gold:hover { filter: brightness(1.07); }
.btn-gold:active { transform: translateY(1px); }
.btn-gold:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

.alert {
  padding: 11px 14px;
  border: 1px solid rgba(224, 120, 107, 0.35);
  border-radius: var(--radius);
  background: rgba(224, 120, 107, 0.08);
  color: var(--danger);
  font-size: 14px;
}

.alert ul { margin: 0; padding-left: 18px; }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.alert + .people { margin-top: 18px; }

.alert--warn {
  border-color: rgba(227, 178, 90, 0.35);
  background: rgba(227, 178, 90, 0.08);
  color: var(--warn);
}

.login__footnote {
  margin: 22px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.wordmark {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.05em;
  color: var(--silver);
}

.wordmark__i { color: var(--gold); }

/* App shell */

.page-app { overflow: hidden; }

.app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 248px;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  background: linear-gradient(180deg, #141417 0%, #111113 100%);
  border-right: 1px solid var(--border-soft);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px;
  text-decoration: none;
}

.sidebar__mark {
  position: relative;
  width: 40px;
  height: 27px;
  overflow: hidden;
}

.sidebar__mark img {
  position: absolute;
  width: 63px;
  left: -11px;
  top: -12px;
}

.sidebar__nav {
  display: grid;
  gap: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }

.nav-item.is-active {
  background: linear-gradient(90deg, rgba(201, 162, 74, 0.16), rgba(201, 162, 74, 0.04));
  color: var(--gold-light);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}

.sidebar__user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.sidebar__user form { margin: 0 0 0 auto; }

.sidebar__who { display: grid; min-width: 0; }
.sidebar__who strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__who small { font-size: 12px; color: var(--text-muted); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
}

.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { border-color: var(--border); color: var(--gold-light); }

.main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 30px 36px 48px;
  background:
    radial-gradient(ellipse 60% 40% at 80% -10%, rgba(201, 162, 74, 0.05), transparent 70%),
    var(--bg);
}

/* Page header and tabs */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--silver);
}

.subtitle {
  margin: 6px 0 0;
  max-width: 640px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.page-header__actions { display: flex; align-items: center; gap: 10px; flex: none; }
.page-header__actions form { margin: 0; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}

.back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { color: var(--gold-light); }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}

.tab {
  position: relative;
  padding: 10px 14px 13px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.tab:hover { color: var(--text); }

.tab.is-active { color: var(--gold-light); }

.tab.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .15s, background .15s, border-color .15s, color .15s, transform .05s;
}

.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }

.btn--gold {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 55%, var(--gold-dark) 100%);
  color: #1a1407;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 18px rgba(201, 162, 74, 0.18);
}

.btn--gold:hover { filter: brightness(1.07); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover { border-color: var(--gold); color: var(--gold-light); }

.btn--danger {
  background: transparent;
  border-color: rgba(229, 72, 77, 0.4);
  color: #f08a8d;
}

.btn--danger:hover { background: rgba(229, 72, 77, 0.12); border-color: #e5484d; color: #ffb4b6; }

.btn--sm { padding: 7px 12px; font-size: 13px; }
.btn--block { width: 100%; }

.link-muted { color: var(--text-muted); font-size: 13px; }
.link-muted:hover, .link-gold:hover { color: var(--gold-light); }
.link-gold { color: var(--gold); text-decoration: none; font-weight: 500; }
.muted { color: var(--text-muted); }

/* Selects, switches, checkboxes */

.select { position: relative; display: block; }

.select select {
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
}

.select::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.6px solid var(--text-muted);
  border-bottom: 1.6px solid var(--text-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.switch, .toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.switch input, .toggle input { position: absolute; opacity: 0; pointer-events: none; }

.switch__track, .toggle__track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s;
}

.switch__track::after, .toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform .15s, background .15s;
}

.switch input:checked + .switch__track,
.toggle input:checked + .toggle__track { background: var(--gold-soft); border-color: var(--gold); }

.switch input:checked + .switch__track::after,
.toggle input:checked + .toggle__track::after { transform: translateX(14px); background: var(--gold); }

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.check input { position: absolute; opacity: 0; pointer-events: none; }

.check span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  transition: background .15s, border-color .15s;
}

.check input:checked + span {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 3px var(--bg);
}

.check--danger input:checked + span { background: var(--danger); border-color: var(--danger); }

/* Chips, badges, avatars */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tag {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

.badge {
  --tone: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  color: var(--tone);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge .dot, .column__head .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone);
}

.badge--lg { padding: 7px 14px; font-size: 13px; }

.badge--neutral, .column--neutral { --tone: #9a9ba3; }
.badge--warn, .column--warn { --tone: var(--warn); }
.badge--info, .column--info { --tone: var(--info); }
.badge--gold, .column--gold { --tone: var(--gold-light); }
.badge--violet, .column--violet { --tone: var(--violet); }
.badge--success, .column--success { --tone: var(--success); }
.badge--danger, .column--danger { --tone: var(--danger); }

.role {
  --tone: var(--text-muted);
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--tone) 13%, transparent);
  color: var(--tone);
  font-size: 11px;
  font-weight: 600;
}

.role--comercial { --tone: var(--success); }
.role--desenvolvimento { --tone: var(--info); }
.role--design { --tone: var(--violet); }

.avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--silver);
  font-size: 11px;
  font-weight: 700;
}

.avatar--gold {
  background: linear-gradient(180deg, #3a2f18, #241d0f);
  border-color: rgba(201, 162, 74, 0.45);
  color: var(--gold-light);
}

.avatar--empty { border-style: dashed; color: var(--text-faint); background: transparent; }
.avatar--lg { width: 42px; height: 42px; font-size: 16px; }
.sidebar__user .avatar { width: 34px; height: 34px; font-size: 14px; }

/* Cards */

.card {
  padding: 22px;
  background: linear-gradient(180deg, #19191c 0%, var(--surface) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
}

.card--flush { padding: 0; overflow: hidden; }

.card__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.card__head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--silver); }
.card__head p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }

.card__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card__row .section-label { white-space: nowrap; }

.step {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 74, 0.45);
  background: var(--gold-soft);
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 700;
}

.section-label {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fields { display: grid; gap: 16px; }
.fields--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field--full { grid-column: 1 / -1; }

.stack-lg { display: grid; gap: 18px; max-width: 960px; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; }

.empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 44px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state h2 { margin: 0; font-size: 18px; color: var(--silver); }
.empty-state p { margin: 0 0 12px; color: var(--text-muted); }

/* Toasts */

.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 420px;
  padding: 12px 16px;
  border: 1px solid rgba(201, 162, 74, 0.35);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  background: #1a1a1d;
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  animation: toast-in .25s ease-out;
  transition: opacity .35s, transform .35s;
}

.toast--error { border-color: rgba(224, 120, 107, 0.4); border-left-color: var(--danger); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Board */

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

.stat {
  display: grid;
  gap: 6px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.stat__label { font-size: 12px; color: var(--text-muted); }
.stat__value { font-size: 24px; font-weight: 600; color: var(--silver); }
.stat--warn .stat__value { color: var(--warn); }

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar .select { width: 210px; }
.toolbar select { padding-top: 9px; padding-bottom: 9px; font-size: 13px; }
.toolbar .switch { margin-left: auto; }

.board {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 14px;
  margin-right: -36px;
  padding-right: 36px;
}

.board::-webkit-scrollbar { height: 9px; }
.board::-webkit-scrollbar-track { background: transparent; }
.board::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

.board.hide-empty .column.is-empty { display: none; }

.column {
  --tone: #9a9ba3;
  flex: 0 0 284px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 330px);
  min-height: 180px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-top: 3px solid var(--tone);
  border-radius: var(--radius-lg);
  transition: border-color .15s, background .15s;
}

.column.is-over {
  background: color-mix(in srgb, var(--tone) 6%, var(--bg-2));
  border-color: color-mix(in srgb, var(--tone) 55%, transparent);
}

.column__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px 12px;
}

.column__name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--silver);
}

.column__count {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.column__body {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding: 2px 10px 12px;
}

.column__empty {
  display: none;
  margin: 0;
  padding: 18px 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}

.column.is-empty .column__empty,
.column.is-over .column__empty { display: block; }

.task {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #1b1b1f 0%, #18181b 100%);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 6px 16px rgba(0, 0, 0, 0.25);
  cursor: grab;
  transition: border-color .15s, transform .15s, opacity .15s;
}

.task:hover { border-color: #3a3b41; transform: translateY(-1px); }
.task.is-dragging { opacity: 0.4; }
.task.is-saving { opacity: 0.6; pointer-events: none; }

.task__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task__id { color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.task__meta { display: inline-flex; align-items: center; gap: 4px; }

.task__delete {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
}

.task__delete svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.task:hover .task__delete, .task__delete:focus-visible { opacity: 1; }
.task__delete:hover { background: rgba(229, 72, 77, 0.12); color: #f08a8d; }

@media (hover: none) {
  .task__delete { opacity: 1; }
}

/* Barras de rolagem discretas */
.page-app * {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.column__body { scrollbar-color: transparent transparent; }
.column:hover .column__body { scrollbar-color: rgba(201, 162, 74, 0.28) transparent; }

.page-app ::-webkit-scrollbar { width: 6px; height: 6px; }
.page-app ::-webkit-scrollbar-track { background: transparent; }
.page-app ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 99px; }
.page-app ::-webkit-scrollbar-thumb:hover { background: rgba(201, 162, 74, 0.4); }

.task__title {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.task__title:hover { color: var(--gold-light); }

.task__client { margin: -2px 0 0; color: var(--text-muted); font-size: 12px; }

.task__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.task__assign {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}

.task__assign:hover, .task__assign.is-open { background: var(--surface-2); }
.task__assign:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 1px; }
.task__caret { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--text-faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .15s; }
.task__assign:hover .task__caret, .task__assign.is-open .task__caret { opacity: 1; }

@media (hover: none) {
  .task__caret { opacity: 1; }
}

.assign-menu {
  position: fixed;
  z-index: 60;
  width: 260px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.assign-menu__title {
  margin: 4px 8px 6px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assign-menu__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.assign-menu__option:hover:not(:disabled) { background: var(--surface-2); }
.assign-menu__option.is-current { background: var(--gold-soft); }
.assign-menu__option.is-current strong { color: var(--gold-light); }
.assign-menu__option:disabled { opacity: 0.45; cursor: not-allowed; }
.assign-menu__text { display: grid; min-width: 0; }
.assign-menu__text strong { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assign-menu__text small { color: var(--text-muted); font-size: 11px; }

.task__person { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task__person.is-muted { color: var(--text-muted); }

.task__alert {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(227, 178, 90, 0.16);
  color: var(--warn);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

/* Compose */

.compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
  max-width: 1560px;
}

.compose__main { display: grid; gap: 18px; }

.compose__side { position: sticky; top: 0; }

.segmented {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.segmented__option {
  padding: 8px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.segmented__option.is-active { background: var(--surface-3); color: var(--gold-light); }

.service-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.service-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.service-option input { position: absolute; opacity: 0; pointer-events: none; }

.service-option::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  transition: border .15s;
}

.service-option.is-active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(201, 162, 74, 0.1), rgba(201, 162, 74, 0.03));
}

.service-option.is-active::before { border: 5px solid var(--gold); }
.service-option strong { font-size: 14px; font-weight: 600; }

.items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.item-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.item-option > input { position: absolute; opacity: 0; pointer-events: none; }

.item-option__check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  transition: background .15s, border-color .15s;
}

.item-option__check svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #1a1407;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.item-option__body { display: grid; gap: 5px; justify-items: start; }
.item-option__body strong { font-size: 14px; font-weight: 500; }

.item-option.is-checked { border-color: rgba(201, 162, 74, 0.6); background: rgba(201, 162, 74, 0.05); }
.item-option.is-checked .item-option__check { background: var(--gold); border-color: var(--gold); }
.item-option.is-checked .item-option__check svg { opacity: 1; }
.item-option:focus-within { box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.16); }

.summary {
  padding: 22px;
  border: 1px solid rgba(201, 162, 74, 0.28);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 162, 74, 0.1), transparent 70%),
    var(--surface);
}

.summary h3 { margin: 0; font-size: 18px; color: var(--silver); word-break: break-word; }
.summary__service { margin: 4px 0 0; color: var(--gold-light); font-size: 13px; min-height: 18px; }

.summary__meter {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 20px 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
}

.summary__meter strong { font-size: 30px; color: var(--gold-light); line-height: 1; }
.summary__meter span { color: var(--text-muted); font-size: 13px; }

.summary__list { list-style: none; display: grid; gap: 2px; margin: 0 0 18px; padding: 0; }

.summary__list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}

.summary__list small { color: var(--text-muted); }
.summary__list .is-empty { color: var(--text-faint); justify-content: center; border: 0; }

.summary__hint { margin: 12px 0 0; color: var(--text-faint); font-size: 12px; text-align: center; line-height: 1.5; }

/* Detail */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  max-width: 1180px;
}

.detail__main, .detail__side { display: grid; gap: 16px; }

.prose { margin: 0; color: var(--text); line-height: 1.65; font-size: 14px; }

.status-form { display: grid; gap: 10px; margin-top: 16px; }

.meta { display: grid; gap: 14px; margin: 0; }
.meta div { display: grid; gap: 4px; }
.meta dt { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.meta dd { margin: 0; font-size: 14px; }

.person { display: flex; align-items: center; gap: 10px; }
.person div { display: grid; }
.person small { color: var(--text-muted); font-size: 12px; }

.sibling-list { list-style: none; margin: 0; padding: 0; }

.sibling-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border-soft);
}

.sibling-list a { color: var(--text); text-decoration: none; font-size: 14px; }
.sibling-list a:hover { color: var(--gold-light); }

/* Services area */

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.service-card { display: flex; flex-direction: column; gap: 16px; }
.service-card.is-off { opacity: 0.6; }

.service-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.service-card__head .badge { flex-shrink: 0; }
.service-card__head h2 { margin: 0; font-size: 18px; color: var(--silver); }
.service-card__head p { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.package { list-style: none; margin: 0; padding: 0; flex: 1; }

.package li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 14px;
}

.package .is-empty { color: var(--text-faint); }
.package__tags { display: flex; align-items: center; gap: 6px; flex: none; }

.service-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
}

.service-card__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.service-card__actions form { margin: 0; }

.item-rows { display: grid; gap: 12px; }

.item-row {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-2);
}

.item-row--new { border-style: dashed; background: transparent; }
.item-row__label { margin: 0; color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

.item-row__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 90px;
  gap: 14px;
}

.item-row__grid textarea { min-height: 70px; }
.item-row__flags { display: flex; flex-wrap: wrap; gap: 22px; }

.item-rows:has(.item-row--compact) { gap: 8px; }

.item-row--compact {
  grid-template-columns: minmax(0, 1fr) 90px auto;
  align-items: end;
  padding: 10px 12px;
}

.item-row--compact .item-row__flags { min-width: 190px; padding-bottom: 10px; }

.form-hint { margin: 12px 0 0; font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
a.chip:hover { background: rgba(201, 162, 74, 0.25); }

.service-group { margin-bottom: 24px; }

.row-actions { display: inline-flex; justify-content: flex-end; gap: 6px; }
.row-actions form { margin: 0; }

.table tr.is-off td, .package li.is-off { opacity: 0.5; }

.section-label--spaced { margin-top: 22px; }

.service-option--single { border-style: dashed; }

.main input.items-search {
  width: 260px;
  flex: none;
  margin-bottom: 12px;
  padding: 8px 12px;
  font-size: 13px;
}

.item-option__meta { display: flex; flex-wrap: wrap; gap: 6px; }

.items-empty { margin: 4px 0 0; font-size: 13px; }

.coverage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.coverage__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(227, 178, 90, 0.25);
  border-radius: 12px;
  background: rgba(227, 178, 90, 0.05);
}

.coverage__item.is-ready { border-color: rgba(111, 197, 154, 0.3); background: rgba(111, 197, 154, 0.05); }
.coverage__item div { display: grid; gap: 2px; }
.coverage__item strong { font-size: 14px; }
.coverage__item small { color: var(--text-muted); font-size: 12px; }

.coverage__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: rgba(227, 178, 90, 0.16);
  color: var(--warn);
  font-weight: 700;
}

.coverage__item.is-ready .coverage__icon { background: rgba(111, 197, 154, 0.16); color: var(--success); }
.coverage__icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.person-card { display: grid; gap: 14px; margin: 0; }

.person-card__head { display: flex; align-items: center; gap: 12px; }
.person-card__head div { display: grid; flex: 1; min-width: 0; }
.person-card__head strong { font-size: 15px; }
.person-card__head small { color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.table { width: 100%; border-collapse: collapse; }

.table th {
  padding: 13px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.table td { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.015); }
.table__actions { text-align: right; }

.stacked { display: grid; gap: 2px; }
.stacked small { color: var(--text-muted); font-size: 12px; }

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

@media (max-width: 820px) {
  .page-app { overflow: auto; }
  .app { flex-direction: column; height: auto; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; gap: 10px; padding: 12px; }
  .sidebar__brand { padding: 0 8px 0 0; }
  .sidebar__nav { display: flex; padding: 0; border: 0; }
  .nav-item.is-active::before { display: none; }
  .sidebar__user { margin: 0 0 0 auto; padding: 6px; border: 0; background: none; }
  .sidebar__who { display: none; }
  .main { padding: 22px 18px 40px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .fields--two, .coverage, .item-row__grid { grid-template-columns: 1fr; }
  .toolbar .select { width: 100%; }
  .toolbar .switch { margin-left: 0; }
  .column { max-height: none; }
}
