/* Ledda Feedback — tokens do design system "Ledda Cockpit" (ledda-orchestrate/apps/web/DESIGN.md). */
:root {
  --canvas: #f1f5f4;
  --surface: #fafcfb;
  --surface-sunken: #e7eeec;
  --surface-raised: #ffffff;
  --ink-1: #12312f;
  --ink-2: #46605d;
  --ink-3: #58706c;
  --ink-mute: #93a6a3;
  --line-1: #12312f14;
  --line-2: #12312f26;
  --brand: #1e4d4a;
  --brand-hover: #163b39;
  --brand-wash: #1e4d4a0f;
  --brand-line: #1e4d4a2e;
  --deep: #14393a;
  --moss: #c2d9c3;
  --pos: #2c7358;
  --pos-fill: #3e8f6e1a;
  --signal: #a34e2f;
  --signal-fill: #a65e4214;
  --signal-dot: #c2603e;
  --gold: #7f6128;
  --gold-fill: #c09b6e24;
  --gold-dot: #c09b6e;
  --rust: #b23a2e;
  --rust-fill: #c3302a14;
  --rust-dot: #c3302a;

  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Instrument Serif", Georgia, serif;

  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --sh-raised: 0 1px 2px #12312f14;
  --sh-pop: 0 4px 12px -4px #12312f1f;
  --sh-sheet: 0 12px 28px -12px #12312f30;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink-1);
  font: 400 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid #1e4d4ab3; outline-offset: 2px; border-radius: var(--r-sm); }

/* ---------- tipografia ---------- */
.display { font: italic 400 2rem/1.15 var(--serif); margin: 0; letter-spacing: 0; }
.headline { font: 600 1.5rem/1.15 var(--sans); letter-spacing: -0.011em; margin: 0; }
.title { font: 600 1.25rem/1.35 var(--sans); letter-spacing: -0.011em; margin: 0; }
.label {
  font: 500 11px/1.35 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.meta { color: var(--ink-3); font-size: 12.5px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-1);
}
.topbar-in {
  max-width: 1180px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 20px; height: 56px;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink-1); flex: none; }
.brand img, .mark-tile { width: 28px; height: 28px; padding: 4px; background: var(--deep); border-radius: 7px; flex: none; }
.brand b { font-weight: 600; letter-spacing: -0.011em; }
.brand span { color: var(--ink-3); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: none; padding: 7px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { background: var(--brand-wash); color: var(--ink-1); }
.tab[aria-selected="true"] { color: var(--brand); background: var(--brand-wash); box-shadow: inset 0 -2px 0 var(--brand); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.tab .count { font: 500 11px var(--mono); background: var(--signal-fill); color: var(--signal); padding: 1px 6px; border-radius: 999px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.who button { border: 0; background: none; color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 4px; font-size: 12.5px; }
.who a { color: var(--ink-3); text-underline-offset: 2px; font-size: 12.5px; }

@media (max-width: 640px) {
  .topbar-in { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 6px 12px; }
  .tabs { order: 3; width: 100%; margin: 0 -4px; }
  .brand span { display: none; }
}

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 80px; }
.narrow { max-width: 720px; margin: 0 auto; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-1); font-weight: 500; cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s; min-height: 36px;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-raised); box-shadow: var(--sh-raised); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--canvas); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--brand-wash); box-shadow: none; color: var(--ink-1); }
.btn-danger { color: var(--rust); }
.btn-danger:hover { background: var(--rust-fill); border-color: #b23a2e40; }
.btn-sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn-lg { padding: 11px 22px; min-height: 44px; font-size: 15px; }

/* ---------- formulários ---------- */
.field { display: grid; gap: 6px; margin: 0; }
.field > .label-text { font-weight: 600; font-size: 13.5px; }
.field .hint { color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.input, .textarea, .select {
  width: 100%; background: var(--surface-sunken); border: 1px solid transparent;
  border-radius: var(--r-sm); padding: 9px 12px; color: var(--ink-1);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-mute); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--line-2); }
.input:focus, .textarea:focus, .select:focus { outline: none; background: var(--surface-raised); border-color: var(--brand-line); box-shadow: 0 0 0 3px #1e4d4a26; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }

/* segmented control */
.field > .seg { justify-self: start; }
.seg { display: inline-flex; background: var(--surface-sunken); border-radius: var(--r-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 6px 14px; border-radius: 4px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.seg input:checked + span { background: var(--surface-raised); color: var(--ink-1); box-shadow: var(--sh-raised); }
.seg input:focus-visible + span { outline: 3px solid #1e4d4ab3; outline-offset: 1px; }

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1.35 var(--mono);
  letter-spacing: 0.04em; padding: 2px 8px; border-radius: var(--r-xs);
  background: var(--surface-sunken); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-mute); flex: none; }
.chip.nodot::before { display: none; }
.chip.t-pos { background: var(--pos-fill); color: var(--pos); } .chip.t-pos::before { background: var(--pos); }
.chip.t-signal { background: var(--signal-fill); color: var(--signal); } .chip.t-signal::before { background: var(--signal-dot); }
.chip.t-gold { background: var(--gold-fill); color: var(--gold); } .chip.t-gold::before { background: var(--gold-dot); }
.chip.t-rust { background: var(--rust-fill); color: var(--rust); } .chip.t-rust::before { background: var(--rust-dot); }
.chip.t-brand { background: var(--brand-wash); color: var(--brand); } .chip.t-brand::before { background: var(--brand); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.imp-4 { background: var(--rust-dot); } .imp-3 { background: var(--signal-dot); } .imp-2 { background: var(--gold-dot); } .imp-1 { background: var(--ink-mute); }
/* ideias: valor em tons de teal (não é urgência) */
.val-4 { background: var(--brand); } .val-3 { background: #3e8f6e; } .val-2 { background: #8fbfa3; } .val-1 { background: var(--ink-mute); }

/* ---------- painéis e listas ---------- */
.panel { background: var(--surface); border: 1px solid var(--line-1); border-radius: var(--r-lg); }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line-1); border-radius: var(--r-lg); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line-1); }
.empty { padding: 48px 16px; text-align: center; color: var(--ink-2); }
.empty .display { font-size: 1.6rem; color: var(--ink-1); margin-bottom: 6px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.pillbar { display: flex; gap: 4px; flex-wrap: wrap; }
.pill { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 4px 12px; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.pill:hover { background: var(--brand-wash); }
.pill[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--canvas); }

/* ---------- linha de feedback ---------- */
.fb-row { padding: 14px 16px; }
.fb-head { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: start; cursor: pointer; }
.fb-head .dot { margin-top: 7px; }
.fb-title { font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.fb-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.fb-side { display: flex; align-items: center; gap: 8px; }
.fb-body { margin: 12px 0 0 20px; display: grid; gap: 12px; }
.fb-desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; max-width: 72ch; color: var(--ink-1); }
.note { border-left: 2px solid var(--brand-line); padding: 6px 12px; background: var(--brand-wash); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.note .label { display: block; margin-bottom: 2px; }
.vote {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: 999px; padding: 3px 10px; cursor: pointer; font: 500 12px var(--mono); color: var(--ink-2);
}
.vote:hover { border-color: var(--brand-line); color: var(--brand); }
.vote[aria-pressed="true"] { background: var(--brand-wash); border-color: var(--brand-line); color: var(--brand); }
@media (max-width: 640px) {
  .fb-head { grid-template-columns: auto 1fr; }
  .fb-side { grid-column: 2; }
  .fb-body { margin-left: 0; }
}

/* anexos */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 104px; height: 78px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line-1); background: var(--surface-sunken); cursor: zoom-in; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: #12312fcc; color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 13px; line-height: 1;
}
audio { width: 100%; max-width: 420px; height: 40px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; background: #0e2c2be6; display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); box-shadow: var(--sh-sheet); }

/* sheet / modal */
.scrim { position: fixed; inset: 0; z-index: 50; background: #0e2c2b59; display: flex; justify-content: flex-end; }
.sheet {
  background: var(--surface-raised); width: min(560px, 100%); height: 100%; overflow-y: auto;
  box-shadow: var(--sh-sheet); padding: 20px 20px 40px; display: grid; gap: 16px; align-content: start;
  animation: sheet-in .2s ease-out;
}
.sheet-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: var(--deep); color: #edf3f1; padding: 10px 16px; border-radius: var(--r-md); box-shadow: var(--sh-pop);
  font-size: 13.5px; max-width: calc(100% - 32px);
}

/* ---------- kanban do roadmap ---------- */
.kanban-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px 12px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.kanban { display: flex; gap: 12px; align-items: stretch; min-width: min-content; height: 100%; }
.col {
  width: 248px; flex: none; scroll-snap-align: start; background: var(--surface-sunken); border-radius: var(--r-lg);
  padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; transition: box-shadow .15s, background-color .15s;
  overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin;
}
.col > * { flex: none; }
.col.now { background: #dfe9e6; box-shadow: inset 0 0 0 1.5px var(--brand-line); }
.col.late { background: #f3e3dc; }
.col.past { background: #e9eeed; }
.col.drop { box-shadow: inset 0 0 0 2px var(--brand); background: #d9e6e2; }
/* cabeçalho fica fixo enquanto a coluna rola */
.col-head { position: sticky; top: -10px; z-index: 1; margin: -10px -10px 0; padding: 12px 14px 8px; display: grid; gap: 1px; background: inherit; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.col-head .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.col-head strong { font-weight: 600; }
.col-head .range { font: 500 11px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.col-empty { color: var(--ink-mute); font-size: 12.5px; padding: 10px 4px; text-align: center; }

.card {
  background: var(--surface); border: 1px solid var(--line-1); border-radius: var(--r-md); padding: 10px 12px;
  display: grid; gap: 7px; cursor: pointer; text-align: left; width: 100%; transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--sh-raised); background: var(--surface-raised); }
.card.shipped { background: #f6faf8; }
.card.shipped .card-title { color: var(--ink-2); }
.card.dragging { opacity: .45; }
.card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-title { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; margin: 0; font-size: 13.5px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: 12px; }
.card-foot .mono { font-size: 11.5px; }
.card-foot .mono:last-child { white-space: nowrap; flex: none; }
.prio { font: 600 11px var(--mono); padding: 1px 6px; border-radius: var(--r-xs); letter-spacing: .03em; }
.prio.P0 { background: var(--rust-fill); color: var(--rust); }
.prio.P1 { background: var(--signal-fill); color: var(--signal); }
.prio.P2 { background: var(--brand-wash); color: var(--brand); }
.prio.P3 { background: var(--surface-sunken); color: var(--ink-3); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-3); font-size: 12.5px; margin-bottom: 14px; align-items: center; }

/* spinner */
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; text-align: center; color: var(--ink-3); }
.kanban-nav { display: flex; gap: 6px; margin-left: auto; }
.kanban-nav .btn { min-width: 36px; padding: 4px 10px; }
@media (max-width: 640px) { .kanban-nav { display: none; } }
