/* Carteira comercial: lista compacta; informações completas ficam na ficha. */
.leads-sheet{display:grid;gap:20px;min-width:0;max-width:100%}
.leads-sheet>*{min-width:0;max-width:100%}
.leads-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:0;padding:4px 0 20px;border-bottom:1px solid var(--aura-border)}
.leads-summary>div{display:grid;gap:6px;min-width:0;padding:0 24px;border-left:1px solid var(--aura-border)}
.leads-summary>div:first-child{padding-left:0;border-left:0}
.leads-summary dt{font-size:12px;line-height:1.5;color:var(--aura-text-muted);overflow-wrap:anywhere}
.leads-summary dd{margin:0;font-size:26px;font-weight:650;line-height:1.2;letter-spacing:-.025em;font-variant-numeric:tabular-nums;color:var(--aura-text-primary)}
.leads-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;min-width:0}
.leads-view,.leads-display-view{display:inline-flex;align-items:center;gap:3px;min-width:0;max-width:100%;padding:3px;border:1px solid var(--aura-border);border-radius:12px;background:var(--aura-surface-muted)}
body[data-shell=admin] .leads-view .tbtn,body[data-shell=admin] .leads-display-view .tbtn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:40px;height:auto;padding:8px 12px;border:0;border-radius:9px;background:transparent;color:var(--aura-text-muted);font-size:12px;font-weight:500;line-height:1.4;box-shadow:none;white-space:normal;text-align:center}
body[data-shell=admin] .leads-view .tbtn[aria-pressed=true],body[data-shell=admin] .leads-display-view .tbtn[aria-pressed=true]{background:var(--aura-surface);color:var(--aura-text-primary);font-weight:600}
.leads-manage{position:relative;min-width:0;margin-left:auto}
.leads-manage>summary,.leads-filters>summary{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 14px;border:1px solid var(--aura-border);border-radius:12px;background:var(--aura-surface);color:var(--aura-text-secondary);font-size:12px;font-weight:500;line-height:1.4;cursor:pointer;list-style:none}
.leads-manage>summary::-webkit-details-marker,.leads-filters>summary::-webkit-details-marker{display:none}
.leads-manage>summary::after,.leads-filters>summary::after{content:'';width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin-left:3px;flex:none}
.leads-manage[open]>summary::after,.leads-filters[open]>summary::after{transform:rotate(225deg)}
.leads-manage-menu{position:absolute;z-index:20;top:calc(100% + 8px);right:0;display:grid;gap:8px;width:280px;max-width:calc(100vw - 32px);padding:12px;border:1px solid var(--aura-border);border-radius:14px;background:var(--aura-surface);box-shadow:var(--shadow);text-align:left}
.leads-manage-menu .btn,.leads-manage-menu .linkish{justify-content:flex-start;width:100%;min-width:0;min-height:42px;height:auto;padding:10px 12px;font-size:12px;line-height:1.4;white-space:normal;text-align:left}
.leads-manage-menu .leads-source{margin:6px 0 0;padding:12px 4px 0;border-top:1px solid var(--aura-border);font-size:11px;font-weight:500;color:var(--aura-text-muted)}
.leads-source-list{display:grid;gap:6px;min-width:0;margin:0;padding:0 4px;list-style:none;font-size:11px;line-height:1.5;color:var(--aura-text-muted);overflow-wrap:anywhere}
.leads-filters{min-width:0}
.leads-filters>summary{width:fit-content;max-width:100%;justify-content:flex-start}
.leads-filters>summary span{display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border-radius:6px;background:var(--aura-primary-subtle);color:var(--p-text);font-size:10px;font-variant-numeric:tabular-nums}
.leads-filter-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));align-items:end;gap:14px;min-width:0;margin-top:12px;padding:16px;border:1px solid var(--aura-border);border-radius:14px;background:var(--aura-surface)}
.leads-filter-fields label,.leads-filter-fields .fld{display:grid;gap:6px;min-width:0;margin:0;font-size:11px;line-height:1.5;color:var(--aura-text-muted)}
.leads-filter-fields select{width:100%;max-width:100%;min-width:0;height:44px;font-size:13px}
.leads-filter-fields [data-leads-clear]{min-height:44px;height:auto;font-size:12px;white-space:normal}
.leads-search-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;min-width:0}
.leads-search{display:flex;align-items:center;gap:10px;flex:1 1 240px;min-width:0;min-height:46px;margin:0;padding:0 12px;border:1px solid var(--aura-border);border-radius:12px;background:var(--aura-surface);color:var(--aura-text-muted)}
.leads-search>svg{flex:none}
body[data-shell=admin] .leads-search input[type=search]{display:block;width:100%;min-width:0;height:44px;margin:0;padding:0!important;border:0!important;border-radius:0;background:transparent!important;color:var(--aura-text-primary);font-size:14px;box-shadow:none!important;outline:0}
.leads-search:focus-within{border-color:var(--aura-primary);box-shadow:var(--ring)}
.leads-result-count{flex:none;font-size:12px;line-height:1.5;color:var(--aura-text-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.leads-content{min-width:0;max-width:100%}
body[data-shell=admin] .leads-sheet .tc{margin:0;border:1px solid var(--aura-border);border-radius:16px;box-shadow:none;background:var(--aura-surface)}
body[data-shell=admin] .leads-sheet .tc .card-h{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:16px 18px;background:transparent}
body[data-shell=admin] .leads-sheet .tc .card-h h2{margin:0;font-size:16px;font-weight:600;line-height:1.4}
body[data-shell=admin] .leads-sheet .tc .tools{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;min-width:0;max-width:100%;width:auto;margin-left:auto}
body[data-shell=admin] .leads-sheet .tc .tools .tbtn{min-height:40px;height:auto;padding:8px 12px;font-size:12px;line-height:1.4}
body[data-shell=admin] .leads-sheet .tc .srch{display:none!important}
body[data-shell=admin] .leads-sheet .tc .srch input{min-width:150px;max-width:100%}
.leads-sheet .tc .scroll{min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.leads-sheet table.dt{width:100%;min-width:1100px;table-layout:fixed}
.leads-sheet table.dt th:first-child{width:22%}.leads-sheet table.dt th:nth-child(2){width:24%}.leads-sheet table.dt th:nth-child(3){width:11%}.leads-sheet table.dt th:nth-child(4){width:8%}.leads-sheet table.dt th:nth-child(5){width:12%}.leads-sheet table.dt th:nth-child(6){width:12%}.leads-sheet table.dt th:last-child{width:11%}
body[data-shell=admin] .leads-sheet table.dt th{padding:12px 16px;font-size:10px;font-weight:600;letter-spacing:.04em;line-height:1.5;text-align:left;white-space:normal}
body[data-shell=admin] .leads-sheet table.dt td{height:auto;padding:16px;white-space:normal;overflow-wrap:anywhere;vertical-align:middle;line-height:1.5;font-size:12px}
.lead-identity{min-width:0}.lead-identity b{display:block;font-size:13px;font-weight:600;line-height:1.5;color:var(--aura-text-primary);overflow-wrap:anywhere}
.lead-identity small,.leads-sheet table.dt td small{display:block;margin-top:4px;font-size:11px;font-weight:400;line-height:1.5;color:var(--aura-text-muted);overflow-wrap:anywhere}
.lead-identity b,.lead-identity small{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;max-height:3em;overflow:hidden}
.lead-stage{display:inline-block;max-width:100%;padding:4px 8px;border-radius:7px;background:var(--aura-surface-muted);color:var(--aura-text-secondary);font-size:11px;font-weight:500;line-height:1.4;overflow-wrap:anywhere}
.lead-stage[data-stage=won]{background:var(--aura-success-bg);color:var(--aura-success)}
.lead-stage[data-stage=contacted],.lead-stage[data-stage=qualified],.lead-stage[data-stage=proposal]{background:var(--aura-primary-subtle);color:var(--p-text)}
.lead-stage[data-stage=do_not_contact]{background:var(--aura-danger-bg);color:var(--aura-danger)}
.lead-priority{display:inline-flex;align-items:center;gap:6px;max-width:100%;font-size:11px;font-weight:500;line-height:1.4;color:var(--aura-text-muted);overflow-wrap:anywhere}
.lead-priority[data-priority=high]{color:var(--aura-warning)}.lead-priority[data-priority=high]::before{content:'';width:5px;height:5px;border-radius:50%;background:currentColor;flex:none}
.lead-priority[data-priority=low]{font-weight:400}
.lead-overdue{color:var(--aura-warning);font-weight:600}
body[data-shell=admin] .leads-sheet [data-lead-edit]{min-width:0;max-width:100%;min-height:40px;height:auto;padding:8px 10px;font-size:11px;white-space:nowrap;line-height:1.4}
.leads-footnote,.leads-source{margin:0;font-size:11px;line-height:1.6;color:var(--aura-text-muted);overflow-wrap:anywhere}
.lead-editor{display:grid;gap:20px;min-width:0}
.lead-contact-summary{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;min-width:0;padding:0 0 18px;border-bottom:1px solid var(--aura-border);font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.lead-contact-summary>*{min-width:0;max-width:100%}.lead-contact-summary p{margin:0}.lead-contact-summary small{font-size:11px;color:var(--aura-text-muted)}
.lead-contact-block{display:grid;gap:6px;min-width:0;max-width:100%}
.lead-identity+.lead-contact-block{margin-top:10px}
.lead-contact-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px;min-width:0;max-width:100%}
.leads-sheet table.dt td:nth-child(2) .lead-contact-row{flex-wrap:nowrap}
.leads-sheet table.dt td:nth-child(2) .lead-contact-number,.leads-sheet table.dt td:nth-child(2) .lead-whatsapp{flex:none;white-space:nowrap}
.lead-contact-number{min-width:0;color:var(--aura-text-secondary);font-size:11px;line-height:1.5;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.lead-contact-empty{color:var(--aura-text-muted);font-size:11px;line-height:1.5;overflow-wrap:anywhere}
body[data-shell=admin] .lead-contact-block a.lead-whatsapp{display:inline-flex;align-items:center;justify-content:center;gap:5px;max-width:100%;min-height:36px;padding:5px 8px;border:1px solid var(--aura-success);border-radius:8px;background:var(--aura-success-bg);color:var(--aura-success);font-size:11px;font-weight:600;line-height:1.4;text-decoration:none;white-space:nowrap}
.lead-whatsapp>svg{flex:none}.lead-whatsapp:hover{filter:brightness(1.08)}.lead-whatsapp:focus-visible{outline:2px solid var(--aura-primary);outline-offset:2px}
.lead-contact-summary>.lead-contact-block{flex:1 1 100%}
.lead-tracking-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;min-width:0}
.lead-tracking-fields .fld{min-width:0;margin:0}.lead-tracking-fields .lead-notes{grid-column:1/-1}
.lead-tracking-fields input,.lead-tracking-fields select,.lead-tracking-fields textarea{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
.lead-tracking-fields input[type=date]{display:block;min-inline-size:0;max-inline-size:100%;height:46px;-webkit-appearance:none;appearance:none;text-align:left;font-size:16px}
.lead-tracking-fields input[type=date]::-webkit-date-and-time-value{margin:0;min-width:0;max-width:100%;text-align:left}
.lead-tracking-fields textarea{min-height:120px;resize:vertical;line-height:1.6}
.lead-editor-error{padding:12px;border:1px solid var(--aura-danger);border-radius:12px;background:var(--aura-danger-bg);color:var(--aura-danger);font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.lead-origin{min-width:0;padding-top:18px;border-top:1px solid var(--aura-border)}
.lead-origin>summary{min-height:32px;padding:4px 0;font-size:12px;font-weight:500;line-height:1.5;color:var(--aura-text-secondary);cursor:pointer}
.lead-origin dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:16px 0 0}
.lead-origin dl>div{min-width:0}.lead-origin dt{font-size:11px;color:var(--aura-text-muted);margin-bottom:5px}.lead-origin dd{margin:0;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.lead-source-notes{margin:18px 0 0;font-size:12px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.lead-drawer .dr-b{min-width:0}.lead-drawer .dr>header{gap:12px}.lead-drawer .dr>header h2{min-width:0;font-size:18px;line-height:1.45;overflow-wrap:anywhere}.lead-drawer .dr>header .x{flex:none}
.lead-drawer footer .btn{white-space:normal;line-height:1.4;min-height:46px;height:auto}
@media(max-width:900px){
  .leads-toolbar{justify-content:flex-start}.leads-manage{margin-left:auto}
  .leads-filter-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  body[data-shell=admin] .lead-contact-block a.lead-whatsapp{min-height:44px}
  .leads-sheet{gap:16px}
  .leads-summary{padding-bottom:16px}.leads-summary>div{padding:0 14px}.leads-summary dt{font-size:11px}.leads-summary dd{font-size:23px}
  .leads-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px}
  .leads-view{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
  .leads-display-view{width:fit-content;max-width:100%}.leads-manage{margin-left:0;justify-self:end}
  body[data-shell=admin] .leads-view .tbtn,body[data-shell=admin] .leads-display-view .tbtn{min-height:40px;padding:8px 10px;font-size:11px}
  .leads-search-row{display:grid;grid-template-columns:minmax(0,1fr);gap:7px}.leads-search{width:100%}.leads-result-count{font-size:11px}
  .leads-filter-fields{padding:14px;gap:12px}.leads-filter-fields select{font-size:16px}
  body[data-shell=admin] .leads-sheet .tc{border:0;background:transparent;box-shadow:none}
  body[data-shell=admin] .leads-sheet .tc .card-h{display:flex;align-items:center;padding:0 0 12px;gap:10px;border:0}
  body[data-shell=admin] .leads-sheet .tc .card-h h2{font-size:15px}
  body[data-shell=admin] .leads-sheet .tc .tools{display:flex;justify-content:flex-end;width:auto;gap:8px}
  body[data-shell=admin] .leads-sheet .tc .srch{width:100%;min-width:0}
  body[data-shell=admin] .leads-sheet .tc .srch input{width:100%;min-width:0}
  body[data-shell=admin] .leads-sheet .tc .scroll{overflow:visible;padding:0;background:transparent}
  body[data-shell=admin] .leads-sheet table.dt{display:block;width:100%;min-width:0!important;table-layout:auto}
  body[data-shell=admin] .leads-sheet table.dt thead{display:none}
  body[data-shell=admin] .leads-sheet table.dt tbody{display:grid;gap:10px}
  body[data-shell=admin] .leads-sheet table.dt tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 16px;margin:0;padding:16px!important;border:1px solid var(--aura-border)!important;border-radius:14px;background:var(--aura-surface)!important}
  body[data-shell=admin] .leads-sheet table.dt tbody td{display:block;position:static;width:auto;min-width:0;height:auto;padding:0!important;margin:0;border:0!important;white-space:normal;text-align:left;background:transparent!important;font-size:12px}
  body[data-shell=admin] .leads-sheet table.dt td::before{display:block;content:attr(data-label);margin-bottom:5px;max-width:none;text-align:left;font-size:10px;font-weight:400;line-height:1.4;color:var(--aura-text-muted)}
  body[data-shell=admin] .leads-sheet table.dt td:first-child,body[data-shell=admin] .leads-sheet table.dt td:nth-child(2),body[data-shell=admin] .leads-sheet table.dt td:last-child{grid-column:1/-1}
  body[data-shell=admin] .leads-sheet table.dt td:first-child{padding-bottom:12px!important;border-bottom:1px solid var(--aura-border)!important}
  body[data-shell=admin] .leads-sheet table.dt td:first-child::before,body[data-shell=admin] .leads-sheet table.dt td:last-child::before{display:none}
  body[data-shell=admin] .leads-sheet table.dt td:last-child .btn{width:100%;min-height:44px}
  body[data-shell=admin] .leads-sheet .tc .card-f{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;justify-items:center;text-align:center;padding:14px 0;background:transparent;border:0}
  .leads-sheet .pager{max-width:100%;flex-wrap:wrap}
}
@media(max-width:480px){
  .lead-tracking-fields,.lead-origin dl{grid-template-columns:minmax(0,1fr)}
  .lead-drawer footer{flex-wrap:wrap}.lead-drawer footer .btn{flex:1;min-width:0}
}
@media(max-width:360px){
  .leads-summary>div{padding:0 10px}.leads-summary dt{font-size:10px}.leads-summary dd{font-size:22px}
  .leads-filter-fields{grid-template-columns:minmax(0,1fr)}
}
