/* ============================================================
   Lead Capture & Management System
   Estilo: Dark Premium (cinza escuro · preto · branco · dourado · bordô)
   Stack: CSS3 puro — sem frameworks externos
   ============================================================ */

/* ---------- Tokens de design ---------- */
:root {
    /* Cores base */
    --bg-dominant:      #161616;   /* cinza bem escuro — fundo dominante */
    --bg-depth:         #0c0c0c;   /* preto — profundidade */
    --bg-elevated:      #1f1f1f;   /* cinza elevado — cards */
    --bg-elevated-2:    #242424;   /* cinza elevado — hover */
    --border-subtle:    #2a2a2a;   /* bordas discretas */
    --border-strong:    #3a3a3a;

    /* Texto */
    --text-primary:     #f5f5f5;   /* branco para leitura */
    --text-secondary:   #b5b5b5;
    --text-muted:       #7a7a7a;

    /* Acentos premium */
    --gold:             #c9a961;   /* dourado — destaques premium */
    --gold-hover:       #d9bc78;
    --gold-soft:        rgba(201, 169, 97, 0.12);

    --bordo:            #7a1f2b;   /* bordô — assinatura da marca */
    --bordo-hover:      #94303d;
    --bordo-soft:       rgba(122, 31, 43, 0.18);

    /* Estados */
    --success:          #4a8a5e;
    --error:            #b54343;
    --warning:          #c9a961;

    /* Tipografia — fontes do sistema (sem CDN, conforme PRD §9.1) */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "Monaco", "Consolas", "Courier New", monospace;

    /* Espaçamento */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 3.5rem;

    /* Outros */
    --radius: 6px;
    --radius-sm: 4px;
    --shadow-soft: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-gold: 0 0 0 1px rgba(201,169,97,0.35);
    --transition: 180ms ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dominant);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-hover); }

/* ---------- Tipografia ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

h1 { font-size: 1.875rem; font-weight: 700; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-gold { color: var(--gold); }
.text-bordo { color: var(--bordo-hover); }

/* ---------- Layout ---------- */
.page-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-lg);
}

.section {
    margin-bottom: var(--space-lg);
}

/* ---------- Header ---------- */
.site-header {
    background-color: var(--bg-depth);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-md) var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--gold) 0%, var(--bordo) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-depth);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.brand-version {
    color: #d4a843 !important;
    font-size: 0.55rem !important;
    font-weight: 400 !important;
    vertical-align: super;
}
.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: var(--space-xs) 0;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}
.nav-link:hover { color: var(--gold); border-bottom-color: var(--gold); }
.nav-link.active { color: var(--gold); border-bottom-color: var(--gold); }

.user-pill {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 0.85rem;
}
.user-pill .avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bordo);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ---------- Login ---------- */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background:
        radial-gradient(circle at 20% 20%, rgba(122,31,43,0.10) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(201,169,97,0.06) 0%, transparent 50%),
        var(--bg-dominant);
}

.login-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: var(--space-xl) var(--space-lg);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-soft);
}

.login-card .brand {
    justify-content: center;
    margin-bottom: var(--space-lg);
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
}
.login-card .brand-mark { width: 48px; height: 48px; font-size: 1.25rem; }
.login-card h1 { text-align: center; margin-bottom: var(--space-xs); font-size: 1.5rem; }
.login-card .login-sub {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-depth);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.form-control::placeholder { color: var(--text-muted); }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c9a961' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    align-items: end;
}

.form-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: center;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.65rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.2;
}

.btn:hover { background: var(--bg-elevated-2); color: var(--text-primary); }

.btn-primary {
    background: var(--gold);
    color: var(--bg-depth);
    font-weight: 600;
}
.btn-primary:hover {
    background: var(--gold-hover);
    color: var(--bg-depth);
}

.btn-bordo {
    background: var(--bordo);
    color: var(--text-primary);
}
.btn-bordo:hover { background: var(--bordo-hover); color: var(--text-primary); }

.btn-ghost {
    background: transparent;
    border-color: var(--border-subtle);
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--gold);
}

.btn-danger {
    background: transparent;
    border-color: var(--error);
    color: var(--error);
}
.btn-danger:hover { background: var(--error); color: var(--text-primary); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-icon { padding: 0.4rem 0.6rem; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: var(--space-lg);
    box-shadow: var(--shadow-soft);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.card-header h2, .card-header h3 { margin: 0; }
.card-header .actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* ---------- Stats ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: var(--space-md) var(--space-lg);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gold);
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* ---------- Tables ---------- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    table-layout: fixed;
}

table.data-table thead th {
    background: var(--bg-depth);
    color: var(--text-secondary);
    text-align: left;
    padding: 0.6rem 0.55rem;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

table.data-table tbody td {
    padding: 0.6rem 0.55rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
    transition: background 0.15s ease;
}

table.data-table tbody tr:last-child td { border-bottom: none; }

table.data-table tbody tr:hover td { background: var(--bg-elevated-2); }

table.data-table .col-muted { color: var(--text-muted); }
table.data-table .col-mono  { font-family: var(--font-mono); font-size: 0.8rem; }
table.data-table .col-tight { white-space: nowrap; }

/* v2.1 — Truncar textos longos com reticências */
table.data-table .cell-truncate {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* v2.1 — Botões de ação lado a lado */
.action-btns {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    white-space: nowrap;
    min-width: max-content;
    flex-shrink: 0;
}
.action-btns .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    flex-shrink: 0;
}

/* v2.1 — Botão excluir (outline vermelho) */
.btn-danger-outline {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-danger-outline:hover {
    background: var(--error);
    color: var(--white, #fff);
}
.btn-icon {
    padding: 0.3rem 0.4rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    text-transform: uppercase;
}
.badge-gold {
    background: var(--gold-soft);
    color: var(--gold);
    border-color: var(--gold);
}
.badge-success {
    background: rgba(74, 138, 94, 0.15);
    color: #6db585;
    border-color: var(--success);
}
.badge-danger {
    background: rgba(181, 67, 67, 0.15);
    color: #d97171;
    border-color: var(--error);
}
.badge-bordo {
    background: var(--bordo-soft);
    color: var(--bordo-hover);
    border-color: var(--bordo);
}
.badge-neutral {
    background: var(--bg-elevated-2);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}
.badge-new {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.3);
}

/* ---------- Feedback banners ---------- */
.feedback {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    border-left: 3px solid;
    font-size: 0.9rem;
    animation: slideDown 250ms ease;
}
.feedback-success { background: rgba(74,138,94,0.10); border-color: var(--success); color: #b4d9bf; }
.feedback-error   { background: rgba(181,67,67,0.10); border-color: var(--error);   color: #e5a4a4; }
.feedback-warning { background: var(--gold-soft);    border-color: var(--gold);     color: var(--gold); }
.feedback-info    { background: var(--bg-elevated-2);border-color: var(--border-strong); color: var(--text-secondary); }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.pagination-info { color: var(--text-muted); font-size: 0.875rem; }
.pagination-controls { display: flex; gap: var(--space-xs); }

/* ---------- Detail page ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.detail-block {
    background: var(--bg-depth);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
}
.detail-block h4 {
    color: var(--gold);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--border-subtle);
    font-size: 0.875rem;
    gap: var(--space-sm);
}
.detail-row:last-child { border-bottom: none; }
.detail-row .key { color: var(--text-muted); }
.detail-row .val { color: var(--text-primary); text-align: right; word-break: break-word; }

/* ---------- Token box ---------- */
.token-box {
    background: var(--bg-depth);
    border: 1px dashed var(--gold);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--gold);
    word-break: break-all;
    position: relative;
    margin: var(--space-sm) 0;
}

/* ---------- Modal (CSS puro) ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: var(--space-md);
}
.modal-overlay.is-open { display: flex; }
.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: var(--space-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-soft);
}
.modal h3 { margin-bottom: var(--space-md); }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: var(--space-xl);
}

/* ---------- Utilities ---------- */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.text-center { text-align: center; }
.text-sm { font-size: 0.8rem; }
.text-mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-lg) 0;
}

.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    color: var(--text-muted);
}
.empty-state .icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    color: var(--border-strong);
}

/* ---------- Code block (snippets) ---------- */
.code-block {
    background: var(--bg-depth);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    overflow-x: auto;
    position: relative;
}
.code-block pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}
.code-block .copy-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    .header-nav { width: 100%; flex-wrap: wrap; }
    .page-wrap { padding: var(--space-md); }
    h1 { font-size: 1.5rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 1.4rem; }
    .form-row { grid-template-columns: 1fr; }
    .login-card { padding: var(--space-lg) var(--space-md); }

    /* v2.1 — Tabela compacta em telas estreitas */
    table.data-table thead th,
    table.data-table tbody td {
        padding: 0.45rem 0.35rem;
        font-size: 0.6875rem;
    }
    table.data-table thead th {
        font-size: 0.625rem;
    }
    .action-btns { flex-direction: column; gap: 0.2rem; }
    .action-btns .btn { width: 100%; text-align: center; }
}

/* ============================================================
   v2 — Badges de status
   ============================================================ */
.badge-blue {
    background: rgba(74, 122, 181, 0.15);
    color: #6da8d9;
    border-color: #4a7ab5;
}
.badge-warning {
    background: var(--gold-soft);
    color: var(--gold);
    border-color: var(--gold);
}

/* ============================================================
   v2 — Product tags
   ============================================================ */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.product-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    background: var(--bordo-soft);
    color: var(--bordo-hover);
    border: 1px solid rgba(122, 31, 43, 0.3);
    white-space: nowrap;
}

/* ============================================================
   v2 — Contact management (lead-detail)
   ============================================================ */
/* v2.2 — Form tags (multiple form badges) */
.form-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.contact-section {
    margin-bottom: var(--space-lg);
}
.contact-section:last-child {
    margin-bottom: 0;
}
.contact-section-title {
    color: var(--gold);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.9rem;
    background: var(--bg-depth);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    gap: var(--space-sm);
    transition: border-color var(--transition);
}
.contact-item:hover {
    border-color: var(--border-strong);
}
.contact-item-primary {
    border-color: var(--gold);
    background: rgba(201, 169, 97, 0.05);
}
.contact-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================================
   v2 — Conversion timeline (lead-detail)
   ============================================================ */
.conversion-timeline {
    position: relative;
    padding-left: 1.5rem;
}
.conversion-timeline::before {
    content: '';
    position: absolute;
    left: 0.45rem;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 2px;
    background: var(--border-subtle);
}
.timeline-item {
    position: relative;
    padding-bottom: var(--space-md);
    padding-left: 0.5rem;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-dot {
    position: absolute;
    left: -1.35rem;
    top: 0.35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--bg-elevated);
    z-index: 1;
}
.timeline-content {
    background: var(--bg-depth);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ============================================================
   v2 — Checkbox group (product selection)
   ============================================================ */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: var(--bg-depth);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.checkbox-item:hover {
    border-color: var(--gold);
    color: var(--text-primary);
}
.checkbox-item input[type="checkbox"] {
    width: auto;
    accent-color: var(--gold);
    cursor: pointer;
}
.checkbox-item input[type="checkbox"]:checked + .checkbox-label {
    color: var(--gold);
    font-weight: 500;
}
.checkbox-label {
    cursor: pointer;
    transition: color var(--transition);
}

/* ============================================================
   v2.3 — Kanban Board
   ============================================================ */

/* ---------- View Switcher (Lista / Kanban) ---------- */
.view-switcher {
    display: inline-flex;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.view-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
    border-right: 1px solid var(--border-subtle);
    line-height: 1.4;
}

.view-switcher-btn:last-child {
    border-right: none;
}

.view-switcher-btn:hover {
    background: var(--bg-elevated-2);
    color: var(--text-primary);
}

.view-switcher-btn.active {
    background: var(--gold-soft);
    color: var(--gold);
}

/* ---------- Kanban Board ---------- */
.kanban-section {
    overflow: hidden;
}

.kanban-board {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-md);
    min-height: 400px;
    scroll-behavior: smooth;
}

.kanban-board::-webkit-scrollbar {
    height: 8px;
}
.kanban-board::-webkit-scrollbar-track {
    background: var(--bg-depth);
    border-radius: 4px;
}
.kanban-board::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}
.kanban-board::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---------- Kanban Column ---------- */
.kanban-column {
    flex: 0 0 290px;
    min-width: 290px;
    max-height: calc(100vh - 320px);
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    border-top: 3px solid var(--border-strong);
    overflow: hidden;
    transition: border-color var(--transition);
}

/* Column accent colors (top border) */
.kanban-accent-new     { border-top-color: #2ecc71; }
.kanban-accent-neutral { border-top-color: #6a6a6a; }
.kanban-accent-blue    { border-top-color: #4a7ab5; }
.kanban-accent-warning { border-top-color: var(--gold); }
.kanban-accent-success { border-top-color: var(--success); }
.kanban-accent-danger  { border-top-color: var(--error); }

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-depth);
    flex-shrink: 0;
}

.kanban-column-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kanban-column-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-height: 80px;
    transition: background 200ms ease, outline 200ms ease;
}

/* Drop target highlight */
.kanban-column-body.drag-over {
    background: var(--gold-soft);
    outline: 2px dashed var(--gold);
    outline-offset: -4px;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Column body scrollbar */
.kanban-column-body::-webkit-scrollbar {
    width: 4px;
}
.kanban-column-body::-webkit-scrollbar-track {
    background: transparent;
}
.kanban-column-body::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}
.kanban-column-body::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

/* ---------- Kanban Card ---------- */
.kanban-card {
    background: var(--bg-dominant);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    cursor: grab;
    transition: all 180ms ease;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

.kanban-card:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.35;
    transform: rotate(1.5deg) scale(0.97);
    box-shadow: none;
}

.kanban-card-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-contact {
    margin-bottom: 8px;
}

.kanban-card-field {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.7;
}

.kanban-card-field svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.kanban-card-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 6px;
    margin-top: 4px;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}

.kanban-card-date {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.kanban-form-badge {
    font-size: 0.625rem !important;
    padding: 1px 6px !important;
    cursor: help;
}

/* ---------- Kanban Load More ---------- */
.kanban-load-more {
    width: 100%;
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    text-align: center;
    flex-shrink: 0;
}

/* ---------- Kanban Filter Panel ---------- */
.kanban-filter-header {
    user-select: none;
    -webkit-user-select: none;
}

.kanban-filter-header .kanban-filter-arrow {
    transition: transform 250ms ease;
    color: var(--text-muted);
    font-size: 0.75rem;
    display: inline-block;
}

.kanban-filter-header.is-open .kanban-filter-arrow {
    transform: rotate(180deg);
}

.kanban-filters-body {
    display: none;
    padding: 0 var(--space-md) var(--space-md);
}

.kanban-filters-body.is-open {
    display: block;
}

/* ---------- Kanban Toast (feedback visual) ---------- */
.kanban-toast {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    z-index: 9999;
    pointer-events: none;
    animation: kanbanToastIn 300ms ease, kanbanToastOut 300ms ease 2.7s forwards;
    box-shadow: var(--shadow-soft);
}

.kanban-toast.success {
    background: var(--success);
    color: #fff;
}

.kanban-toast.error {
    background: var(--error);
    color: #fff;
}

@keyframes kanbanToastIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes kanbanToastOut {
    from { opacity: 1; }
    to   { opacity: 0; transform: translateY(-10px); }
}

/* ---------- Kanban Empty Column ---------- */
.kanban-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: var(--space-lg) var(--space-sm);
    text-align: center;
    flex: 1;
}


/* ============================================================
   v2.4 — Botão WhatsApp (Umbler Talk)
   ============================================================ */

/* Botão WhatsApp na lista de leads */
.btn-whatsapp {
    color: #25D366;
    border-color: #25D366;
    transition: all 0.2s ease;
}
.btn-whatsapp:hover {
    background: #25D366;
    color: #fff;
}
.btn-whatsapp[aria-disabled="true"] {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

/* Link WhatsApp inline nos cards Kanban */
.kanban-whatsapp-link {
    display: inline-flex;
    align-items: center;
    color: #25D366;
    margin-left: 4px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    vertical-align: middle;
}
.kanban-whatsapp-link:hover {
    opacity: 1;
}

/* ============================================================
   v2.6 — Abas de Navegação (Responsáveis / Produtos)
   ============================================================ */
.tabs-nav {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-xs);
    flex-wrap: wrap;
}
.tab-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.65rem 1.25rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
}
.tab-link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}
.tab-link.active {
    color: var(--gold);
    background: var(--bg-elevated);
    border-color: var(--border-subtle);
    font-weight: 600;
}

