/* Leads: inbox (lista + detalhe), links de lead (cards com o essencial à vista e o técnico recolhido), editor. */

/* ---------- inbox ---------- */
.inbox-status { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.inbox-status .status-pill strong { font-weight: 700; }
.inbox-status .status-pill.is-on .dot { outline: 2px solid rgba(255,255,255,.5); }
.st-novo.dot, .status-btn.st-novo.is-on { background: var(--info); } .st-qualificado.dot, .status-btn.st-qualificado.is-on { background: #c98a12; }
.st-ganho.dot, .status-btn.st-ganho.is-on { background: var(--ok); } .st-perdido.dot, .status-btn.st-perdido.is-on { background: var(--muted); }
.inbox-filters { margin-bottom: 14px; align-items: flex-start; }
.inbox-more-filters { display: contents; }
.inbox-more-filters > summary { list-style: none; cursor: pointer; display: inline-flex; }
.inbox-more-filters > summary::-webkit-details-marker { display: none; }
.inbox-more-filters:not([open]) > :not(summary) { display: none; }
.lead-status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inbox-search { position: relative; min-width: 260px; flex: 1; max-width: 360px; }
.inbox-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.inbox-search .input { padding-left: 32px; }
.inbox { display: grid; grid-template-columns: 360px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; min-height: 560px; box-shadow: var(--shadow-sm); }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 250px); background: var(--surface-3); }
.inbox-none { padding: 24px 16px; margin: 0; text-align: center; }
.inbox-item { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: background .12s; }
.inbox-item:hover { background: var(--surface); }
.inbox-item.is-active { background: var(--surface); box-shadow: inset 3px 0 0 var(--orange); }
.inbox-item.is-unread .inbox-top strong { font-weight: 700; }
.inbox-item.is-unread .inbox-avatar { box-shadow: 0 0 0 2px var(--orange); }
.inbox-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; flex: none; color: var(--ink-2); }
.inbox-avatar-lg { width: 52px; height: 52px; font-size: 20px; background: var(--orange-soft); color: var(--ink); }
.inbox-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-top { display: flex; justify-content: space-between; gap: 8px; }
.inbox-top strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-top small { color: var(--muted); flex: none; font-size: 12px; }
.inbox-sub { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.inbox-meta .dot { width: 7px; height: 7px; }
.inbox-more { margin: 10px auto; display: flex; width: fit-content; }
.inbox-detail { overflow-y: auto; max-height: calc(100vh - 250px); }
.inbox-pick { height: 100%; min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px; }
.inbox-pick p { margin: 0; max-width: 260px; }

/* ---------- detalhe do lead ---------- */
.lead { padding: 22px 26px; display: flex; flex-direction: column; gap: 16px; }
.lead-head { display: flex; gap: 14px; align-items: center; }
.lead-head h2 { margin: 0; font-size: 20px; }
.lead-head p { margin: 2px 0 0; }
.lead-delete:hover { color: var(--err); background: var(--err-soft); }
.lead-status { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; width: fit-content; flex-wrap: wrap; }
.status-btn { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font: 600 13.5px var(--font); cursor: pointer; color: var(--ink-2); transition: background .12s, color .12s; }
.status-btn:hover { color: var(--ink); }
.status-btn.is-on { color: #fff; box-shadow: var(--shadow-sm); }
.lead-contact { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-hint { margin: -6px 0 0; }
.lead-section { border-top: 1px solid var(--line); padding-top: 16px; }
.lead-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.lead-section-title small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.lead-fields { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; margin: 0; }
.lead-fields dt { color: var(--muted); }
.lead-fields dd { margin: 0; font-weight: 600; }
.lead-fields .break { word-break: break-all; font-weight: 400; }
.lead-message { margin-top: 12px; background: var(--surface-3); border-radius: var(--radius); padding: 14px 16px; line-height: 1.55; border-left: 3px solid var(--orange); }
.note-form { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.note-form .textarea { min-height: 44px; flex: 1; }
.note-form .btn { flex: none; height: 38px; }
.notes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.notes li { background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 12px; padding: 10px 40px 10px 14px; position: relative; font-size: 14px; }
.notes li p { margin: 4px 0 0; }
.notes .icon-btn { position: absolute; top: 6px; right: 6px; }
.lead-origin summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lead-origin summary::-webkit-details-marker { display: none; }
.lead-origin summary .icon { transition: transform .2s; }
.lead-origin[open] summary .icon { transform: rotate(180deg); }
.lead-origin dl { margin-top: 12px; }

/* ---------- links de lead ---------- */
.lf-list { display: flex; flex-direction: column; gap: 14px; }
.lf-card { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.lf-card.is-off { opacity: .7; }
.lf-card-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.lf-card-title { flex: 1; min-width: 200px; }
.lf-card-title h3 { margin: 0 0 2px; font-size: 17px; }
.lf-card-title p { margin: 0; }
.lf-card-head .chip { margin-top: 4px; }
.lf-card-actions { margin-left: auto; }
.lf-link .label-sm { margin-top: 0; }
.copy-row { display: flex; gap: 6px; align-items: flex-start; }
.copy-row .input, .copy-row .textarea { flex: 1; min-width: 0; }
.copy-row .btn { flex: none; height: 38px; }
.copy-row .input-sm + .btn { height: 32px; }
.lf-more { display: flex; flex-direction: column; gap: 6px; }
.lf-fold { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-3); }
.lf-fold > summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; list-style: none; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.lf-fold > summary::-webkit-details-marker { display: none; }
.lf-fold > summary:hover { color: var(--ink); }
.lf-chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
.lf-fold[open] > summary .lf-chev { transform: rotate(180deg); }
.lf-fold-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.lf-fold-body p { margin: 0; }
.lf-utm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lf-utm-row .select { width: 100%; }
.lf-example summary { cursor: pointer; }
.lf-example pre { margin-top: 6px; }
.lf-meta { margin-top: 16px; }
.lf-meta .lf-fold-body { display: block; }

/* ---------- editor do link ---------- */
.lf-editor-card { padding: 0; }
.lf-editor-section { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.lf-editor-section:last-child { border-bottom: 0; }
.lf-editor-head { margin-bottom: 14px; }
.lf-editor-head h3 { margin: 0; font-size: 16px; }
.lf-editor-head p { margin: 2px 0 0; }
.lf-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.lf-field-row { display: grid; grid-template-columns: 1.4fr 1fr 1.6fr 52px 32px; gap: 8px; align-items: center; }
.lf-field-row-head { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 2px; }
.lf-req { display: grid; place-items: center; }
.lf-req input { width: 17px; height: 17px; accent-color: var(--orange); }

@media (max-width: 1100px) { .inbox { grid-template-columns: 1fr; } .inbox-list { max-height: 360px; border-right: 0; border-bottom: 1px solid var(--line); } }
@media (max-width: 760px) { .status-btn { padding: 6px 11px; font-size: 13px; } .lf-field-row { grid-template-columns: 1fr 1fr; } .lf-field-row-head { display: none; } .lf-utm-row { grid-template-columns: 1fr; } .lead { padding: 18px; } .lead-fields { grid-template-columns: 1fr; gap: 2px 0; } .lead-fields dd { margin-bottom: 8px; } .copy-row { flex-wrap: wrap; } .inbox-search { max-width: none; } }
