/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1E293B;
    background: #fff;
}
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.25; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: inherit; }


/* ══════════════════════════════════════════════════════════════
   AUTH — split-screen layout
══════════════════════════════════════════════════════════════ */

.auth-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Brand panel (left) ──────────────────────────────────────── */
.auth-brand {
    flex: 1;
    background: linear-gradient(160deg, #0F172A 0%, #1E293B 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.07);
    top: -140px;
    right: -120px;
    pointer-events: none;
}

.auth-brand::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.05);
    bottom: -80px;
    left: -60px;
    pointer-events: none;
}

.brand-inner {
    position: relative;
    z-index: 1;
    max-width: 380px;
    color: #fff;
}

.brand-logo { margin-bottom: 2rem; }

.brand-logo-img {
    display: block;
    max-width: 200px;
    width: 100%;
    height: auto;
}

.brand-product-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0 0 2rem 0;
}

.brand-tagline {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    margin: 0 0 2rem 0;
    letter-spacing: -0.03em;
}

.brand-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.brand-features li {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.brand-features li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.28);
    color: #93C5FD;
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Form panel (right) ──────────────────────────────────────── */
.auth-form-panel {
    flex: 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.auth-form-container {
    width: 100%;
    max-width: 390px;
}

.auth-form-header { margin-bottom: 2rem; }

.auth-form-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.025em;
}

.auth-form-header p {
    color: #6B7280;
    font-size: 0.9rem;
}

.auth-layout .form-group { margin-bottom: 1.25rem; }

.auth-layout label {
    display: block;
    font-size: 0.83rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.4rem;
}

.auth-layout input[type="email"],
.auth-layout input[type="password"],
.auth-layout input[type="text"] {
    display: block;
    width: 100%;
    padding: 0.7rem 0.95rem;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #111827;
    background: #FAFAFA;
    outline: none;
    box-shadow: none;
    margin: 0;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.auth-layout input[type="email"]:focus,
.auth-layout input[type="password"]:focus,
.auth-layout input[type="text"]:focus {
    border-color: #3B82F6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ── Auth buttons ────────────────────────────────────────────── */
.btn-auth {
    display: block;
    width: 100%;
    padding: 0.78rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, transform 0.12s, border-color 0.18s;
    border: 1.5px solid transparent;
    margin: 0 0 0.75rem 0;
    text-align: center;
    line-height: 1;
    box-shadow: none;
}

.btn-auth--primary {
    background: #2563EB;
    color: #fff;
    border-color: #2563EB;
}

.btn-auth--primary:hover:not(:disabled) {
    background: #1D4ED8;
    border-color: #1D4ED8;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
}

.btn-auth--primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.btn-auth--primary:disabled {
    background: #93C5FD;
    border-color: #93C5FD;
    cursor: not-allowed;
}

.btn-auth--secondary {
    background: transparent;
    color: #2563EB;
    border-color: #E5E7EB;
    font-weight: 500;
}

.btn-auth--secondary:hover:not(:disabled) {
    background: #EFF6FF;
    border-color: #BFDBFE;
}

/* ── Divider ─────────────────────────────────────────────────── */
.auth-divider {
    text-align: center;
    position: relative;
    margin: 0.25rem 0;
    color: #D1D5DB;
    font-size: 0.78rem;
    line-height: 1;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 18px);
    height: 1px;
    background: #E5E7EB;
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* ── Alerts ──────────────────────────────────────────────────── */
.auth-alert {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.auth-alert--error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.auth-alert--info {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

/* ── Confirm-email ───────────────────────────────────────────── */
.auth-confirm { text-align: center; padding: 0.5rem 0; }

.auth-confirm .confirm-icon {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    display: block;
}

.auth-confirm h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.auth-confirm p {
    color: #6B7280;
    font-size: 0.875rem;
    line-height: 1.65;
    margin: 0 0 1.5rem 0;
}

/* ── Mobile auth ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-layout { flex-direction: column; }
    .auth-brand { padding: 1.75rem 1.5rem; flex: none; }
    .brand-tagline { font-size: 1.4rem; }
    .brand-features { display: none; }
    .auth-form-panel { padding: 2rem 1.5rem; }
}


/* ══════════════════════════════════════════════════════════════
   APP — dashboard 3-colunas
══════════════════════════════════════════════════════════════ */

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #F1F5F9;
    overflow: hidden;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.app-topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    z-index: 10;
}

.topbar-brand { display: flex; align-items: center; gap: 10px; }

.topbar-logo { height: 26px; width: auto; display: block; }

.topbar-sep {
    color: #CBD5E1;
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1;
    user-select: none;
}

.topbar-product {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748B;
    letter-spacing: 0.01em;
}

.topbar-user { display: flex; align-items: center; gap: 0.75rem; }

.topbar-email {
    font-size: 0.82rem;
    color: #64748B;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-signout-btn {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748B;
    background: transparent;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.topbar-signout-btn:hover {
    background: #F8FAFC;
    color: #1E293B;
    border-color: #CBD5E1;
}

/* ── Body ────────────────────────────────────────────────────── */
.app-body { display: flex; flex: 1; overflow: hidden; }

/* ── Coluna título ───────────────────────────────────────────── */
.col-title {
    padding: 0.8rem 1rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #94A3B8;
    border-bottom: 1px solid #E2E8F0;
    flex-shrink: 0;
    background: #fff;
}

/* ── Col 1: Agents ───────────────────────────────────────────── */
.col-agents {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.agents-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
}

.agent-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}

.agent-btn:hover { background: #f5f5f5; }

.agent-btn.active {
    background: #eef3ff;
    color: #2563eb;
    font-weight: 600;
    border-left: 3px solid #2563eb;
    padding-left: 13px;
}

/* ── Col 2: Leads ────────────────────────────────────────────── */
.col-leads {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.leads-search-wrap {
    padding: 8px;
    margin: 0;
    border-bottom: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.leads-search {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.48rem 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 7px;
    font-size: 0.82rem;
    color: #1E293B;
    background: #F8FAFC;
    outline: none;
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.leads-search:focus {
    border-color: #3B82F6;
    background: #fff;
    box-shadow: 0 0 0 2.5px rgba(59,130,246,0.1);
}

.leads-list { flex: 1; overflow-y: auto; }

.lead-item {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #F1F5F9;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.1s;
}

.lead-item:hover { background: #F8FAFC; }

.lead-item.selected {
    background: #EFF6FF;
    border-left-color: #2563EB;
}

.lead-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-phone { font-size: 0.78rem; color: #64748B; margin-top: 2px; }
.lead-time  { font-size: 0.72rem; color: #94A3B8; margin-top: 3px; }

/* ── Col 3: Conversa ─────────────────────────────────────────── */
.col-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #F8FAFC;
}

.col-conversation .col-title { background: #F8FAFC; }

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Estado vazio ────────────────────────────────────────────── */
.col-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #CBD5E1;
    font-size: 0.84rem;
    line-height: 1.6;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .col-agents { width: 160px; }
    .col-leads  { width: 220px; }
}

@media (max-width: 600px) {
    .app-body { flex-direction: column; }
    .col-agents {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #E2E8F0;
    }
    .agents-list { flex-direction: row; flex-wrap: wrap; }
    .col-leads {
        width: 100%;
        height: 200px;
        border-right: none;
    }
}


/* ══════════════════════════════════════════════════════════════
   MODAL — feedback de mensagens
══════════════════════════════════════════════════════════════ */

dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    background: #fff;
}

dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
}

dialog article {
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

dialog article header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #E2E8F0;
    margin: 0;
}

dialog article header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1E293B;
}

dialog article > p {
    padding: 1rem 1.5rem 0;
    font-size: 0.875rem;
    color: #475569;
}

dialog article label {
    display: block;
    padding: 0.75rem 1.5rem 0;
    font-size: 0.83rem;
    font-weight: 500;
    color: #374151;
}

dialog article select,
dialog article textarea {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1E293B;
    background: #FAFAFA;
    outline: none;
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

dialog article select:focus,
dialog article textarea:focus {
    border-color: #3B82F6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

dialog article textarea { resize: vertical; }

dialog article footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #E2E8F0;
    margin-top: 0.75rem;
}

dialog article footer button {
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: none;
    margin: 0;
}

dialog article footer button.secondary {
    background: transparent;
    color: #64748B;
    border: 1px solid #E2E8F0;
}

dialog article footer button.secondary:hover {
    background: #F8FAFC;
    color: #1E293B;
}

dialog article footer button:not(.secondary) {
    background: #2563EB;
    color: #fff;
}

dialog article footer button:not(.secondary):hover {
    background: #1D4ED8;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

dialog article input[type="text"] {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1E293B;
    background: #FAFAFA;
    outline: none;
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

dialog article input[type="text"]:focus {
    border-color: #3B82F6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

dialog.dialog-wide { max-width: 580px; }


/* ══════════════════════════════════════════════════════════════
   BADGES — status, prioridade, categoria
══════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge--pendente     { background: #FEF9C3; color: #854D0E; }
.badge--em_andamento { background: #DBEAFE; color: #1E40AF; }
.badge--concluido    { background: #DCFCE7; color: #166534; }
.badge--rejeitado    { background: #FEE2E2; color: #991B1B; }

.badge--pri-baixa   { background: #F1F5F9; color: #64748B; }
.badge--pri-media   { background: #FEF9C3; color: #854D0E; }
.badge--pri-alta    { background: #FFEDD5; color: #9A3412; }
.badge--pri-urgente { background: #FEE2E2; color: #991B1B; }

.badge--cat-funcionalidade { background: #EDE9FE; color: #5B21B6; }
.badge--cat-comportamento  { background: #E0F2FE; color: #0369A1; }
.badge--cat-tom            { background: #FCE7F3; color: #9D174D; }
.badge--cat-integracao     { background: #ECFDF5; color: #065F46; }
.badge--cat-outro          { background: #F1F5F9; color: #475569; }

.badge--tp-info_incorreta     { background: #FEE2E2; color: #991B1B; }
.badge--tp-tom_inadequado     { background: #FFEDD5; color: #9A3412; }
.badge--tp-fluxo_confuso      { background: #FEF9C3; color: #854D0E; }
.badge--tp-promessa_exagerada { background: #EDE9FE; color: #5B21B6; }
.badge--tp-outro              { background: #F1F5F9; color: #475569; }


/* ══════════════════════════════════════════════════════════════
   MELHORIAS — página de gestão
══════════════════════════════════════════════════════════════ */

.topbar-nav-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748B;
    text-decoration: none;
    padding: 0.32rem 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.topbar-nav-link:hover {
    background: #F8FAFC;
    color: #1E293B;
    border-color: #CBD5E1;
}

.melhorias-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
}

.melhorias-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.toolbar-filters {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.42rem 0.75rem;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.83rem;
    color: #1E293B;
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}

.filter-select:focus { border-color: #3B82F6; }

.btn-primary {
    padding: 0.48rem 1.1rem;
    background: #2563EB;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
    background: #1D4ED8;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.melhorias-table-wrap {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
}

.melhorias-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.melhorias-table thead th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #94A3B8;
    border-bottom: 1px solid #E2E8F0;
    background: #F8FAFC;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.melhorias-table tbody tr {
    border-bottom: 1px solid #F1F5F9;
    cursor: pointer;
    transition: background 0.1s;
}

.melhorias-table tbody tr:last-child { border-bottom: none; }
.melhorias-table tbody tr:hover { background: #F8FAFC; }

.melhorias-table td {
    padding: 0.72rem 1rem;
    color: #1E293B;
    vertical-align: middle;
}

.td-titulo {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-empty {
    text-align: center;
    color: #CBD5E1;
    padding: 3rem 1rem;
    font-size: 0.875rem;
}

.detalhe-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.5rem;
    padding: 1rem 1.5rem;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
}

.detalhe-meta-item > label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #94A3B8;
    padding: 0;
    margin-bottom: 0.2rem;
}

.detalhe-meta-item > span {
    font-size: 0.875rem;
    color: #1E293B;
    font-weight: 500;
}

.feedback-contadores {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
