:root {
  /* Marca Focus NFe */
  --brand: #FF5900;
  --brand-hover: #FF730D;
  --brand-strong: #FF4000;
  --brand-grad: linear-gradient(135deg, #FF730D 0%, #FF4000 100%);
  --ink: #2B2E33;        /* texto principal (grafite do wordmark) */
  --ink-soft: #5c636e;   /* texto secundário */
  --muted: #8a929e;      /* texto terciário */
  --line: #e4e7ec;       /* bordas */
  --bg: #f4f5f7;         /* fundo app */
  --surface: #ffffff;    /* cartões/superfícies */
  --col-bg: #eceef1;     /* fundo das colunas */
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow-md: 0 4px 12px rgba(16,24,40,.10);
  --ok: #12805c; --warn: #b25e09; --danger: #b42318;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.45;
}
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.3rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: var(--surface);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 20;
}
.topbar__brand { display: flex; align-items: center; gap: 10px; }
.topbar__brand img { height: 26px; display: block; }
.topbar__user { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); }
.topbar__avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand-grad);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px;
}

/* ---------- Board ---------- */
.board-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.board-header__meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }

/* Pipeline switcher dropdown */
.pipe-switcher { position: relative; display: inline-block; }
.pipe-switcher summary { list-style: none; cursor: pointer; display: inline-flex; }
.pipe-switcher summary::-webkit-details-marker { display: none; }
.pipe-switcher__title { display: inline-flex; align-items: center; gap: 8px; }
.pipe-switcher__caret { color: var(--muted); font-size: .8rem; }
.pipe-switcher[open] .pipe-switcher__caret { color: var(--brand-strong); }
.pipe-switcher__menu { position: absolute; z-index: 30; margin: 6px 0 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); min-width: 220px; }
.pipe-switcher__menu li { border-radius: 6px; }
.pipe-switcher__menu li a { display: block; padding: 8px 10px; color: var(--ink); font-size: .9rem; font-weight: 500; }
.pipe-switcher__menu li a:hover { background: #f7f8fa; text-decoration: none; }
.pipe-switcher__menu li.is-current a { color: var(--brand-strong); }
.pipe-switcher__menu li.is-current a::after { content: " ✓"; }
.board { display: flex; gap: 14px; padding: 4px 20px 24px; overflow-x: auto; align-items: flex-start; }
.board-column { background: var(--col-bg); border-radius: var(--radius); width: 300px; flex: 0 0 300px; max-height: calc(100vh - 150px); display: flex; flex-direction: column; }
.board-column__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.board-column__name { font-weight: 600; color: var(--ink); font-size: .9rem; }
.board-column__count { color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1px 9px; font-size: .78rem; font-weight: 600; }
.board-column__sum { color: var(--muted); font-size: .75rem; padding: 0 14px 6px; }
.board-column__list { padding: 4px 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; min-height: 30px; }

/* ---------- Deal card ---------- */
.deal-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 12px; cursor: grab; box-shadow: var(--shadow-sm);
  border-left: 3px solid transparent; transition: box-shadow .12s, transform .02s;
}
.deal-card:hover { box-shadow: var(--shadow-md); border-left-color: var(--brand); }
.deal-card:active { cursor: grabbing; transform: scale(.998); }
.deal-card--ghost { opacity: .35; }
.deal-card__title { font-weight: 600; color: var(--ink); display: block; margin-bottom: 6px; }
.deal-card__title:hover { text-decoration: none; color: var(--brand-strong); }
.deal-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.deal-card__value { color: var(--ink); font-weight: 600; font-size: .85rem; }
.deal-card__age { color: var(--muted); font-size: .72rem; }
.deal-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.deal-card__owner { width: 22px; height: 22px; border-radius: 50%; background: #e9ebef; color: var(--ink-soft); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.deal-card__right { display: inline-flex; align-items: center; gap: 7px; }
.task-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.task-dot--none { background: #f5c518; }       /* amarelo: sem task */
.task-dot--scheduled { background: #9aa3af; }   /* cinza: na validade */
.task-dot--today { background: #12805c; }       /* verde: vence hoje */
.task-dot--overdue { background: #e5484d; }     /* vermelho: vencida */
.deal-card__labels { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.label-chip { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; color: #fff; }
.label-chip--cadastro { background: #8a5a2b; }     /* marrom: cadastro */
.label-chip--finalizado { background: #12805c; }   /* verde: cadastro finalizado */
.label-chip--default { background: #9aa3af; }
.task-form { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.task-form input[type=text], .task-form input[type=datetime-local], .task-form select { padding: 7px; border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; }
.task-form input[type=text] { flex: 1; min-width: 140px; }
.task-check { color: var(--ok) !important; font-weight: 700; padding: 0 6px !important; }
.activity--today { border-color: #a6f4c5; background: #f0fdf7; }
.activity--scheduled { }
.chip { font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: #fff3ec; color: var(--brand-strong); border: 1px solid #ffd9c2; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font-weight: 600; font-size: .85rem; }
.btn:hover { background: #f7f8fa; text-decoration: none; }
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-hover); color: #fff; }
.btn--link { border: none; background: none; color: var(--ink-soft); padding: 4px; }
.btn--link:hover { color: var(--brand-strong); background: none; }

/* ---------- Forms ---------- */
.form { max-width: 440px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.form input, .form select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; color: var(--ink); background: #fff; }
.form input:focus, .form select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,89,0,.12); }
.form__errors { background: #fef3f2; color: var(--danger); padding: 10px 12px; border-radius: 8px; border: 1px solid #fecdca; font-weight: 500; }
.form__actions { display: flex; gap: 8px; margin-top: 4px; }
.form--wide { max-width: 560px; }
.form__row { display: flex; gap: 12px; }
.form__row > label { flex: 1; }

/* ---------- Auth ---------- */
.auth { max-width: 380px; margin: 9vh auto; padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); }
.auth__logo { display: block; height: 34px; margin: 0 auto 20px; }
.auth h1 { text-align: center; margin-bottom: 4px; }
.auth__hint { color: var(--muted); font-size: .85rem; text-align: center; margin: 6px 0 18px; }
.auth .form { padding: 0; max-width: none; }

/* ---------- Misc ---------- */
.empty-state { color: var(--muted); padding: 40px 20px; text-align: center; }
.pipeline-list { padding: 10px 20px; list-style: none; }
.pipeline-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.flash { margin: 10px 20px 0; padding: 10px 14px; border-radius: 8px; font-weight: 500; }
.flash--notice { background: #ecfdf3; color: var(--ok); border: 1px solid #a6f4c5; }
.flash--alert { background: #fef3f2; color: var(--danger); border: 1px solid #fecdca; }

/* nav + list/detail pages */
.topbar__nav { display: flex; gap: 18px; margin-left: 8px; flex: 1; }
.topbar__nav a { color: var(--ink-soft); font-weight: 600; font-size: .88rem; }
.topbar__nav a:hover { color: var(--brand-strong); text-decoration: none; }
.list-page, .detail { padding: 18px 20px; max-width: 980px; }
.list-page__head, .detail__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.detail__sub { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.detail__section { font-size: 1rem; margin: 22px 0 8px; color: var(--ink); }
.search { margin-bottom: 14px; }
.search input { width: 100%; max-width: 420px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,89,0,.12); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafbfc; }

/* deal detail */
.deal-show { padding: 18px 20px; max-width: 1000px; }
.deal-show__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.deal-show__crumbs { color: var(--muted); font-size: .8rem; margin-bottom: 4px; }
.deal-show__value { font-size: 1.1rem; font-weight: 700; color: var(--ink); margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.badge { font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 20px; }
.badge--open { background: #fff3ec; color: var(--brand-strong); border: 1px solid #ffd9c2; }
.badge--won { background: #ecfdf3; color: var(--ok); border: 1px solid #a6f4c5; }
.badge--lost { background: #fef3f2; color: var(--danger); border: 1px solid #fecdca; }
.deal-show__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn--won { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn--won:hover { background: #0f6e4f; color: #fff; }
.btn--lost { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--lost:hover { background: #911c13; color: #fff; }

/* ---------- Feedback widget (UAT) — botão flutuante + painel ---------- */
.fb-widget { position: fixed; right: 20px; bottom: 20px; z-index: 60; }
.fb-widget > summary { list-style: none; cursor: pointer; }
.fb-widget > summary::-webkit-details-marker { display: none; }
.fb-widget__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: 999px;
  background: var(--brand-grad); color: #fff; font-weight: 700; font-size: .9rem;
  box-shadow: 0 6px 18px rgba(255,64,0,.38);
  transition: transform .12s ease, box-shadow .12s ease;
}
.fb-widget__btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255,64,0,.46); }
.fb-widget__btn-icon { font-size: 1.1rem; line-height: 1; }
/* leve pulsar pra "chamar atenção" sem ser intrusivo */
@keyframes fb-pulse { 0%,100% { box-shadow: 0 6px 18px rgba(255,64,0,.38); } 50% { box-shadow: 0 6px 26px rgba(255,64,0,.60); } }
.fb-widget:not([open]) .fb-widget__btn { animation: fb-pulse 2.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .fb-widget__btn { animation: none !important; } }

.fb-widget__panel {
  position: absolute; right: 0; bottom: 56px; width: 340px; max-width: calc(100vw - 40px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 16px;
}
.fb-widget__head strong { display: block; color: var(--ink); margin-bottom: 4px; }
.fb-widget__hint { margin: 0 0 12px; color: var(--ink-soft); font-size: .82rem; line-height: 1.4; }
.fb-widget__kinds { display: flex; gap: 6px; margin-bottom: 10px; }
.fb-kind { flex: 1; }
.fb-kind input { position: absolute; opacity: 0; pointer-events: none; }
.fb-kind span {
  display: block; text-align: center; padding: 7px 4px; border: 1px solid var(--line);
  border-radius: 8px; font-size: .78rem; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.fb-kind input:checked + span { border-color: var(--brand); color: var(--brand-strong); background: #fff6f1; }
.fb-widget__textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
  font: inherit; color: var(--ink); resize: vertical; margin-bottom: 10px;
}
.fb-widget__textarea:focus { outline: none; border-color: var(--brand); }
.fb-widget__submit { width: 100%; justify-content: center; }

/* ---------- Tabela admin de feedbacks ---------- */
.fb-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.fb-table th, .fb-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .85rem; }
.fb-table th { background: var(--col-bg); color: var(--ink-soft); font-weight: 600; }
.fb-table .nowrap { white-space: nowrap; }
.won-lost__form { display: flex; gap: 6px; align-items: center; width: 100%; justify-content: flex-end; margin-top: 8px; }
.won-lost__form select { padding: 7px; border: 1px solid var(--line); border-radius: 8px; }
/* Lost disclosure: the form stays hidden until the user opens <details>. */
.lost-disclosure summary { list-style: none; cursor: pointer; }
.lost-disclosure summary::-webkit-details-marker { display: none; }
.lost-disclosure[open] summary { outline: 2px solid rgba(180,35,24,.25); }
.deal-show__grid { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.deal-show__side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.deal-show__side h3 { margin: 0 0 10px; font-size: .9rem; }
.kv { margin: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.kv dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kv dd { margin: 0 0 4px; font-size: .88rem; color: var(--ink); }
.deal-show__main { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.panel h3 { margin: 0 0 10px; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.panel .count { background: #eceef1; color: var(--ink-soft); border-radius: 20px; padding: 0 8px; font-size: .72rem; }
.activity-list, .note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.activity { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: .88rem; }
.activity__type { width: 20px; text-align: center; }
.activity__subject { flex: 1; }
.activity__due { color: var(--muted); font-size: .78rem; }
.activity--overdue { border-color: #fecdca; background: #fef6f5; }
.activity--overdue .activity__due { color: var(--danger); font-weight: 600; }
.activity--done { opacity: .72; }
.activity--done .activity__subject { text-decoration: line-through; }
.note { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.note__meta { color: var(--muted); font-size: .72rem; margin-top: 6px; }
@media (max-width: 760px) { .deal-show__grid { grid-template-columns: 1fr; } }
