* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0c0c0c;
    --surface: #141414;
    --surface2: #1a1a1a;
    --border: #2a2a2a;
    --text: #f5f5f5;
    --text-muted: #888;
    --accent: #fff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 16px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.container.pre-auth {
    visibility: hidden;
}

/* Fallback: mostrar conteúdo após 5 segundos mesmo se houver erro */
@media (prefers-reduced-motion: no-preference) {
    .container.pre-auth {
        animation: showAfterTimeout 0s 5s forwards;
    }
}

@keyframes showAfterTimeout {
    to {
        visibility: visible;
    }
}

/* Header com usuário */
.main-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.header-brand {
    text-align: left;
}

.header-brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    padding: 8px 14px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.btn-logout {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.btn-logout:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

/* Página de login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.login-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form .btn-primary {
    margin-top: 8px;
}

.login-error {
    color: #e57373;
    font-size: 0.9rem;
    margin-bottom: 12px;
    min-height: 20px;
}

/* Histórico de atividades */
.tab-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.historico-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.historico-texto {
    font-size: 0.95rem;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.historico-data {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.35rem;
    margin-bottom: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}

.form-group textarea {
    min-height: 400px;
    resize: vertical;
    line-height: 1.6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface2);
}

.form-group small {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 5px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
    background: #e8e8e8;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    margin-top: 10px;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success { border-left: 4px solid #00ff00; }
.notification.error { border-left: 4px solid #ff0000; }

/* ========== RESUMO DASHBOARD (estilo UTMify) ========== */
:root {
    --resumo-positive: #22c55e;
    --resumo-negative: #ef4444;
}

.resumo-dashboard {
    max-width: 100%;
}

.resumo-header {
    margin-bottom: 28px;
}

.resumo-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.resumo-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.resumo-periodo {
    margin-bottom: 32px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.resumo-periodo-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.resumo-periodo-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.resumo-pill {
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.resumo-pill:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.resumo-pill.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.resumo-periodo-custom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.resumo-periodo-custom label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.resumo-periodo-custom input[type="number"],
.resumo-periodo-custom select {
    width: auto;
    min-width: 60px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
}

.resumo-periodo-custom .resumo-ate {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-resumo-aplicar {
    padding: 8px 20px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-resumo-aplicar:hover {
    background: #e8e8e8;
}

.resumo-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.resumo-kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.resumo-kpi-card:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow);
}

.resumo-kpi-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.resumo-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.resumo-kpi-card--positive .resumo-kpi-value {
    color: var(--resumo-positive);
}

.resumo-kpi-card--negative .resumo-kpi-value {
    color: var(--resumo-negative);
}

.resumo-chart-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.resumo-chart-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.resumo-chart-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.resumo-chart-row {
    display: grid;
    grid-template-columns: 140px 1fr 120px;
    align-items: center;
    gap: 16px;
}

.resumo-chart-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.resumo-chart-bar-wrap {
    height: 28px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
}

.resumo-chart-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.4s ease;
}

.resumo-chart-bar--faturamento {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.resumo-chart-bar--gastos {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.resumo-chart-bar--lucro {
    background: linear-gradient(90deg, var(--resumo-positive), #4ade80);
}

.resumo-chart-bar--prejuizo {
    background: linear-gradient(90deg, var(--resumo-negative), #f87171);
}

.resumo-chart-val {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

.resumo-chart-val--positive {
    color: var(--resumo-positive);
}

.resumo-chart-val--negative {
    color: var(--resumo-negative);
}

.resumo-periodo-label-bottom {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .resumo-periodo-pills {
        gap: 6px;
    }
    .resumo-pill {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    .resumo-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
    .resumo-chart-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .resumo-chart-val {
        text-align: left;
    }
}

.perfis-grid,
.proxies-grid,
.anotacoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.perfil-card,
.proxy-card,
.anotacao-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.perfil-card:hover,
.proxy-card:hover,
.anotacao-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.perfil-nome,
.proxy-perfil,
.anotacao-titulo {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.perfil-email,
.proxy-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.anotacao-preview {
    color: #888;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.proxy-dias {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.dias-ok { color: #00ff00; }
.dias-atencao { color: #ffaa00; }
.dias-urgente { color: #ff4444; }

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show { display: flex; }

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-content-large { max-width: 900px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.btn-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.btn-close:hover { color: var(--text); }

.info-field { margin-bottom: 20px; }

.info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
    display: block;
}

.info-value {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 10px;
    background: var(--bg);
    border-radius: 6px;
    word-break: break-all;
}

.info-value-large {
    min-height: 300px;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 1rem;
}

.totp-display {
    background: var(--bg);
    border: 2px solid #4a9eff;
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.totp-code {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 8px;
    color: #4a9eff;
    margin-bottom: 10px;
}

.totp-timer {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.totp-timer.urgent {
    color: #ff4444;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-edit,
.btn-delete {
    flex: 1;
    padding: 12px;
    background: transparent;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit {
    color: #4a9eff;
    border: 1px solid #4a9eff;
}

.btn-edit:hover {
    background: #4a9eff;
    color: #fff;
}

.btn-delete {
    color: #ff4444;
    border: 1px solid #ff4444;
}

.btn-delete:hover {
    background: #ff4444;
    color: #fff;
}

.lancamento-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 14px;
}

.lancamento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.lancamento-data {
    font-size: 1.1rem;
    font-weight: 600;
}

.lancamento-roi {
    font-size: 1.3rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 6px;
}

.roi-positive {
    color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.roi-negative {
    color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

.lancamento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.lancamento-field {
    display: flex;
    flex-direction: column;
}

.field-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.field-value {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 500;
}

.field-value.highlight {
    font-size: 1.2rem;
    font-weight: 600;
}

.lancamento-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 0.95rem;
}

/* Dono da Conta */
.dono-conta-group .dono-tipo-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 10px;
}

.dono-conta-group .radio-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dono-conta-group .radio-label input { width: auto; }

.dono-valor-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dono-valor-row input {
    max-width: 140px;
}

.dono-preview {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.dono-preview.visible {
    color: var(--text);
    font-weight: 600;
}

/* Gastos Adicionais no form */
.gastos-adic-group .gastos-adic-lista {
    margin-bottom: 12px;
}

.gasto-adic-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.gasto-adic-desc {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text);
    min-width: 0;
}

.gasto-adic-valor {
    font-weight: 600;
    color: var(--text);
}

.btn-remove-gasto {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1.1rem;
    line-height: 1;
}

.btn-remove-gasto:hover {
    color: #e57373;
}

.btn-add-gasto {
    margin-top: 0;
}

/* Histórico de lançamento: gastos adicionais */
.lancamento-field-full {
    grid-column: 1 / -1;
}

.gastos-adic-resumo {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}

.gasto-adic-item {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* ========== CHAT ========== */
.chat-card .card h2 { margin-bottom: 0; }
.chat-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.btn-chat-apagar {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: #c62828;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn-chat-apagar:hover {
    background: #b71c1c;
    transform: translateY(-1px);
}
.chat-mensagens-wrap {
    margin: 20px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    min-height: 280px;
    max-height: 60vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.chat-mensagens {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}
.chat-empty { margin: 24px auto; text-align: center; color: var(--text-muted); }
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chat-msg-eu {
    align-self: flex-end;
    background: var(--surface2);
    border: 1px solid var(--border);
}
.chat-msg-outro {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
}
.chat-msg-usuario {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.chat-msg-texto { word-break: break-word; white-space: pre-wrap; }
.chat-msg-data { font-size: 0.75rem; color: var(--text-muted); }
.chat-msg-midia { margin-top: 4px; }
.chat-msg-imagem img {
    max-width: 100%;
    max-height: 280px;
    border-radius: var(--radius-sm);
    display: block;
}
.chat-msg-video video {
    max-width: 100%;
    max-height: 240px;
    border-radius: var(--radius-sm);
}
.chat-download-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: underline;
}
.chat-msg-arquivo {
    display: inline-block;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
}
.chat-msg-arquivo:hover { border-color: var(--accent); }
.chat-input-wrap { margin-top: 16px; }
.chat-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.chat-input-text {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
}
.chat-input-text:focus {
    outline: none;
    border-color: var(--accent);
}
.btn-chat-emoji, .btn-chat-anexo {
    padding: 12px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: border-color 0.2s;
}
.btn-chat-emoji:hover, .btn-chat-anexo:hover { border-color: var(--accent); }
.btn-chat-enviar {
    padding: 12px 20px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-chat-enviar:hover { background: #e8e8e8; }
.chat-emoji-picker {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.chat-emoji-picker.show { display: flex; }
.chat-emoji-btn {
    padding: 6px 10px;
    font-size: 1.2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.chat-emoji-btn:hover { border-color: var(--accent); }

@media (max-width: 768px) {
    body { padding: 12px; }
    .main-header { flex-direction: column; align-items: stretch; text-align: center; }
    .header-brand h1 { font-size: 1.5rem; }
    .header-user { justify-content: center; }
    .card { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    .tabs { overflow-x: auto; padding-bottom: 2px; }
    .tab { padding: 10px 16px; font-size: 0.9rem; }
    .perfis-grid, .proxies-grid, .anotacoes-grid { grid-template-columns: 1fr; }
    .lancamento-grid { grid-template-columns: 1fr; }
    .lancamento-actions { flex-direction: column; }
    .form-group textarea { min-height: 220px; }
    .historico-item { flex-direction: column; align-items: flex-start; }
    .login-card { padding: 28px 24px; }
    .chat-mensagens-wrap { max-height: 50vh; min-height: 200px; }
    .chat-msg { max-width: 92%; }
    .chat-input-row { width: 100%; }
    .chat-input-text { width: 100%; min-width: 0; }
}