:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #193247;
  background: #f5f7f8;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #8fc1c0; outline-offset: 2px;
}
a { color: #086d6c; }
h1,h2,h3,p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(1.7rem, 3vw, 2.1rem); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.25rem; letter-spacing: -.025em; }
h3 { margin-bottom: 0; }
.eyebrow { margin-bottom: 9px; font-size: .71rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: #137e78; }
.muted { color: #69808f; }
.small { font-size: .89rem; }
.fineprint { font-size: .8rem; }
.primary, .secondary { border-radius: 12px; min-height: 44px; padding: 10px 17px; font-weight: 700; border: 1px solid transparent; }
.primary { background: #0d6865; color: #fff; box-shadow: 0 4px 10px #0d68651a; }
.primary:hover { background: #075652; }
.secondary { color: #26475b; border-color: #d8e1e6; background: white; }
.secondary:hover { background: #f0f5f5; }
.link-button { color: #0b726c; border: 0; background: none; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 600; min-width: 0; }
.field span, .form-stack label { color: #405d6d; }
.field b { color: #ae4f50; }
.field input, .field select, .field textarea, .form-stack input {
  display: block; width: 100%; min-height: 43px; border: 1px solid #d4dfe4;
  border-radius: 10px; background: #fff; color: #193247; padding: 10px 12px; outline: none;
}
.field textarea { resize: vertical; }
.field input::placeholder { color: #98a8b2; font-weight: 400; }
.login-screen { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(circle at top, #d5efeb 0%, #f5f7f8 45%); }
.login-box { width: min(100%, 420px); padding: clamp(25px, 5vw, 42px); border-radius: 22px; box-shadow: 0 14px 55px #1b41501c; background: white; }
.login-box h1 { font-size: 1.9rem; }
.login-box .muted { margin-bottom: 26px; }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 20px; border-radius: 15px; background: #11374b; color: white; font-weight: 800; font-size: 1.7rem; letter-spacing: -.09em; }
.brand-mark.mini { width: 39px; height: 39px; margin: 0; font-size: 1.3rem; border-radius: 11px; }
.form-stack { display: flex; flex-direction: column; gap: 10px; }
.form-stack label { font-size: .88rem; font-weight: 700; }
.form-stack input { margin-bottom: 9px; }
.form-stack button { margin-top: 8px; }
.form-error { min-height: 20px; font-size: .86rem; color: #ac3434; margin: 14px 0 0; }
.header { background: #fff; border-bottom: 1px solid #e6ecef; }
.header-inner { max-width: 1200px; margin: auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; gap: 11px; align-items: center; }
.brand strong { display: block; font-size: 1.03rem; }
.brand small { display: block; color: #788c97; font-size: .72rem; }
.account { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; font-size: .85rem; }
.account span { color: #4a6879; }
.container { max-width: 1200px; margin: 0 auto; padding: 38px 24px 80px; }
.welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.welcome .muted { margin: 9px 0 0; font-size: .93rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-bottom: 25px; }
.stat { padding: 20px 19px; border: 1px solid #e5ecee; border-radius: 14px; background: #fff; }
.stat span { display: block; color: #66808f; font-size: .79rem; margin-bottom: 10px; }
.stat strong { display: block; font-size: 1.7rem; letter-spacing: -.03em; }
.board { border: 1px solid #e5ecee; background: #fff; border-radius: 17px; padding: 22px; }
.board-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 19px; }
.board-heading .muted { font-size: .84rem; }
.filters { display: grid; grid-template-columns: minmax(210px,2fr) repeat(3,minmax(130px,1fr)); align-items: end; gap: 12px; margin-bottom: 20px; }
.leads { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.lead { padding: 18px; border: 1px solid #e1e8ec; border-radius: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lead-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lead-title { font-size: 1.03rem; margin: 0; color: #173549; overflow-wrap: anywhere; }
.lead-subtitle { font-size: .83rem; color: #6b808c; margin: 5px 0 0; }
.lead-body { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { border-radius: 30px; font-size: .74rem; padding: 6px 9px; background: #f0f5f6; color: #3b6270; font-weight: 600; }
.tag.overdue { background: #fff2e8; color: #a25121; }
.lead-footer { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: auto; border-top: 1px solid #edf0f2; padding-top: 12px; }
.lead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lead-actions a, .edit-button { border: 0; background: none; text-decoration: none; color: #0b736e; font-size: .84rem; font-weight: 700; padding: 8px 4px; }
.stage-select { max-width: 180px; min-height: 36px; padding: 6px 7px; background: #f5f8f9; border: 1px solid #e0e9eb; border-radius: 8px; color: #32586a; font-size: .78rem; font-weight: 700; }
.empty { text-align: center; padding: 52px 15px; grid-column: 1/-1; color: #6f8793; }
.empty h3 { color: #173549; margin-bottom: 8px; }
.dialog { border: 1px solid #e2e9eb; border-radius: 18px; width: min(calc(100% - 24px),620px); max-height: 92vh; padding: 0; box-shadow: 0 20px 70px #1b40583d; overflow: auto; }
.dialog.narrow { width: min(calc(100% - 24px),440px); }
.dialog::backdrop { background: #0a293b8a; }
.dialog-content { display: flex; flex-direction: column; gap: 18px; padding: clamp(20px, 4vw, 28px); }
.dialog-title { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-title h2 { font-size: 1.5rem; }
.dialog-title .eyebrow { margin-bottom: 6px; }
.dialog-content > .muted { margin: -8px 0 0; }
.close-button { border: 0; background: #edf3f4; border-radius: 8px; color: #365566; width: 36px; height: 36px; font-size: 1.5rem; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.field.full { grid-column: 1/-1; }
.details { border-top: 1px solid #e5eaec; padding-top: 14px; }
.details summary { cursor: pointer; color: #0d6b68; font-size: .9rem; font-weight: 700; }
.details .form-grid { margin-top: 18px; }
.history { border-top: 1px solid #e5eaec; padding-top: 14px; }
.history h3 { font-size: .91rem; margin-bottom: 11px; }
.history-list { max-height: 180px; overflow-y: auto; }
.history-event { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid #f0f3f4; font-size: .79rem; color: #536c7b; }
.history-event time { margin-left: auto; flex-shrink: 0; color: #97a7b0; font-size: .72rem; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #ebeff1; padding-top: 17px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #173b4a; color: white; padding: 12px 18px; border-radius: 11px; box-shadow: 0 5px 22px #0004; z-index: 99; max-width: calc(100% - 30px); text-align: center; font-size: .87rem; }
/* v2: duplicidade, perda e exclusão */
.notice { border-radius: 11px; padding: 12px 14px; background: #fff6df; color: #7a5300; font-size: .86rem; display: flex; flex-direction: column; gap: 10px; }
.notice p { margin: 0; }
.notice.danger { background: #fdecec; color: #8f2c2c; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.check input { width: 18px; height: 18px; }
.danger-zone { border-top: 1px solid #e5eaec; padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.danger-link { align-self: flex-start; border: 0; background: none; color: #ac3434; font-weight: 700; padding: 6px 0; }
.danger-button { border-radius: 12px; min-height: 44px; padding: 10px 17px; font-weight: 700; border: 0; background: #ac3434; color: #fff; }
.tag.lost { background: #f6eceb; color: #8f3b33; }
.tag.today { background: #fff6df; color: #7a5300; }
.stage-select.is-lost { color: #8f3b33; background: #fbf1f0; }
/* v3: alternância lista/quadro e quadro Kanban */
.board-heading { flex-wrap: wrap; }
.view-toggle { margin-left: auto; display: inline-flex; padding: 3px; gap: 3px; border: 1px solid #dfe7ea; background: #f3f7f8; border-radius: 10px; }
.view-toggle button { border: 0; background: none; border-radius: 7px; padding: 6px 14px; font-weight: 700; font-size: .84rem; color: #557080; }
.view-toggle button[aria-pressed="true"] { background: #fff; color: #173549; box-shadow: 0 1px 3px #1b41502a; }
.view-board .container, .view-board .header-inner { max-width: 1680px; }
.leads.kanban { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 8px; scroll-snap-type: x proximity; }
.kanban-col { background: #f4f7f8; border: 1px solid #e3eaed; border-radius: 13px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; scroll-snap-align: start; transition: background .15s, border-color .15s; }
.kanban-col.drop-target { background: #e3f3f1; border-color: #0d6865; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px; }
.kanban-title { font-weight: 800; font-size: .86rem; color: #173549; }
.kanban-count { min-width: 24px; text-align: center; border-radius: 20px; background: #fff; border: 1px solid #e0e8eb; font-size: .74rem; font-weight: 700; color: #557080; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.kanban-body { display: flex; flex-direction: column; gap: 9px; min-height: 40px; }
.kanban-empty { margin: 0; padding: 10px 4px; font-size: .8rem; color: #8aa0ab; }
.kanban .lead { background: #fff; padding: 13px; gap: 8px; cursor: grab; }
.kanban .lead.dragging { opacity: .45; }
.kanban .lead-top { flex-direction: column; }
.kanban .stage-select { max-width: 100%; width: 100%; }
@media (prefers-reduced-motion: reduce) { .kanban-col { transition: none; } }
/* v4: equipe e senha */
.team-list { display: flex; flex-direction: column; border-top: 1px solid #edf0f2; }
.team-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid #edf0f2; }
.team-info { flex: 1 1 220px; min-width: 0; }
.team-info strong { display: block; overflow-wrap: anywhere; }
.team-info small { display: block; color: #6b808c; overflow-wrap: anywhere; }
.team-row.inactive .team-info { opacity: .6; }
.team-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.team-actions button { min-height: 36px; padding: 6px 11px; font-size: .82rem; border-radius: 9px; }
.team-reset { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.team-reset input { flex: 1 1 200px; min-width: 0; min-height: 40px; border: 1px solid #d4dfe4; border-radius: 9px; padding: 8px 10px; }
.pill-off { font-size: .72rem; font-weight: 700; color: #8f3b33; background: #f6eceb; border-radius: 20px; padding: 3px 8px; margin-left: 6px; }
@media (max-width:900px) {
  .stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .search-field { grid-column: 1/-1; }
}
@media (max-width:650px) {
  .container { padding: 25px 15px 55px; }
  .header-inner { padding: 13px 15px; }
  .account { gap: 8px; }
  .account span { display: none; }
  .account { gap: 12px; }
  .welcome { align-items: flex-start; }
  .actions { width: 100%; }
  .actions button { flex: 1; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 1.5rem; }
  .stat span { font-size: .72rem; }
  .board { padding: 15px; }
  .filters { gap: 10px; }
  .filters .field { font-size: .75rem; }
  .leads { grid-template-columns: minmax(0,1fr); }
  .leads.kanban { grid-auto-columns: 82%; margin: 0 -15px; padding: 0 15px 8px; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .dialog-footer .primary { flex: 1; }
}
