:root {
    --primary-color: #2B6CB0; --primary-hover: #2C5282;
    --bg-color: #F7FAFC; --sidebar-bg: #1A202C;
    --sidebar-text: #FFFFFF; --sidebar-muted: rgba(255,255,255,.62);
    --sidebar-hover: rgba(255,255,255,.08); --sidebar-border: rgba(255,255,255,.12);
    --text-dark: #2D3748; --text-light: #667085;
    --white: #FFFFFF; --danger: #E53E3E; --border: #E2E8F0; --success: #38A169;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-color); color: var(--text-dark); min-height: 100dvh; overflow: hidden; }
.screen-container { width: 100%; min-height: 100dvh; }

.input-group { text-align: left; margin-bottom: 20px; }
.input-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--text-dark); }
.input-group input, .input-group select, .input-group textarea, .form-control { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus, .form-control:focus { outline: 2px solid transparent; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(43,108,176,.18); }
.btn-primary { width: 100%; padding: 12px; background-color: var(--primary-color); color: var(--white); border: none; border-radius: 4px; font-size: 16px; font-weight: 600; cursor: pointer; transition: 0.3s; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-danger { width: 100%; padding: 8px; background-color: transparent; border: 1px solid var(--danger); color: var(--danger); border-radius: 4px; cursor: pointer; font-weight: 600; transition: 0.3s; }
.btn-danger:hover { background-color: var(--danger); color: var(--white); }
.msg { margin-top: 15px; font-size: 13px; font-weight: 600; }

#login-screen { display: flex; justify-content: center; align-items: center; background: linear-gradient(135deg, #EBF8FF 0%, #BEE3F8 100%); }
.login-box { background: var(--white); padding: 40px; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.05); width: 100%; max-width: 400px; text-align: center; }
.login-box h2 { color: var(--primary-color); margin-bottom: 5px; }

#dashboard-screen { display: flex; height: 100dvh; min-height: 0; overflow: hidden; }
.sidebar { width: 250px; background-color: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; height: 100dvh; }
.brand { padding: 20px; border-bottom: 1px solid var(--sidebar-border); }
.brand-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: 52px; height: 52px; flex: 0 0 52px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,.92); padding: 4px; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.brand-copy { min-width: 0; }
.brand-copy h3 { color: var(--sidebar-text); line-height: 1.18; overflow-wrap: anywhere; margin: 0 0 6px; }
.badge { display: inline-block; font-size: 10px; background-color: var(--primary-color); color: #fff; padding: 2px 6px; border-radius: 4px; }
.menu { flex: 1; padding: 20px 0; display: flex; flex-direction: column; }
.menu-item { background: none; border: none; color: var(--sidebar-muted); padding: 15px 20px; text-align: left; font-size: 15px; cursor: pointer; transition: 0.2s; border-left: 3px solid transparent; }
.menu-item:hover, .menu-item.active { background-color: var(--sidebar-hover); color: var(--sidebar-text); border-left-color: var(--primary-color); }
.sidebar-footer { padding: 20px; border-top: 1px solid var(--sidebar-border); font-size: 12px; color: var(--sidebar-muted); display: flex; flex-direction: column;}
.content-area { flex: 1; min-width: 0; min-height: 0; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background-color: var(--bg-color); }
.top-bar { height: 70px; flex: 0 0 70px; background-color: var(--white); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 30px; }
.content-body { padding: 30px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; }

.view-module { display: none; }
.view-module.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.module-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.welcome-card { background: var(--white); padding: 30px; border-radius: 8px; border: 1px solid var(--border); }

/* WIZARD DE AVALIAÇÃO */
.wizard-progress { display: flex; justify-content: space-between; margin-bottom: 25px; background: var(--white); padding: 15px 20px; border-radius: 8px; border: 1px solid var(--border); box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.step-indicator { flex: 1; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-light); padding-bottom: 10px; border-bottom: 4px solid #EDF2F7; transition: 0.4s; position: relative; }
.step-indicator.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.wizard-step { display: none; animation: fadeIn 0.4s ease-out; }
.wizard-step.active { display: block; }
.btn-row { display: flex; justify-content: space-between; gap: 15px; margin-top: 15px; padding-top: 20px; border-top: 1px solid var(--border); }

.session-card { background: var(--white); padding: 25px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.session-card h3 { font-size: 16px; color: var(--primary-color); border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 20px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }

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

.table-container { background: var(--white); border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { background-color: #EDF2F7; padding: 15px; font-size: 12px; text-transform: uppercase; color: var(--text-light); border-bottom: 1px solid var(--border); }
.data-table td { padding: 15px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-dark); }
.data-table tr:hover { background-color: #F7FAFC; }
.badge-pet { background-color: #C6F6D5; color: #22543D; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: bold; }
.badge-humano { background-color: #BEE3F8; color: #2A4365; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: bold; }
.badge-todos { background-color: #E9D8FD; color: #553C9A; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: bold; }

.slider-row { display: flex; align-items: center; gap: 12px; width: 100%; }
.slider-row input[type=range] { flex: 1; height: 8px; cursor: pointer; accent-color: var(--primary-color); }
.perc-badge { background: #EBF8FF; padding: 6px 12px; border-radius: 4px; font-weight: bold; font-size: 12px; min-width: 55px; text-align: center; color: var(--primary-color); border: 1px solid #BEE3F8; }
.analysis-box { border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.analysis-box h4 { font-size: 14px; margin-bottom: 10px; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.analysis-status { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 20px; font-size: 14px; }
.afeta-group { background: #F7FAFC; padding: 15px; border-radius: 6px; border: 1px solid var(--border); margin-top: 20px;}
.checkbox-row { display: flex; justify-content: space-between; font-size: 13px; }

.biometro-form-row { display: flex; gap: 10px; align-items: center; }
.bio-item { background: #F7FAFC; border: 1px solid var(--border); border-left: 4px solid var(--primary-color); padding: 10px 15px; border-radius: 4px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.bio-item-info { font-size: 14px; color: var(--text-dark); }
.bio-item-info strong { display: block; color: var(--primary-color); margin-bottom: 2px;}
.btn-remover-bio { color: var(--danger); background: none; border: none; font-size: 20px; cursor: pointer; font-weight: bold; }

.task-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.task-info h4 { margin-bottom: 5px; color: var(--text-dark); font-size: 16px; }
.task-info p { margin-bottom: 5px; color: var(--text-light); font-size: 14px; }
.task-time { font-weight: bold; font-size: 13px; padding: 4px 8px; border-radius: 4px; display: inline-block;}
.time-ok { background: #EBF8FF; color: #2B6CB0; }
.time-late { background: #FED7D7; color: #C53030; }
.btn-desmontar { background: var(--success); color: white; border: none; padding: 10px 20px; border-radius: 4px; font-weight: bold; cursor: pointer; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(2px); }
.modal-content { background: var(--white); padding: 30px; border-radius: 8px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; animation: popIn 0.3s ease-out; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 10px;}
.btn-close-modal { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-light); }
@keyframes popIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.config-blocos { background: #F7FAFC; padding: 20px; border-radius: 8px; border: 1px solid var(--border); }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; color: var(--text-dark); }
.switch-row input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary-color); }

.drag-list { display: flex; flex-direction: column; gap: 10px; }
.drag-item { 
    display: flex; align-items: center; background: var(--white); padding: 12px; 
    border: 1px solid var(--border); border-radius: 6px; cursor: grab; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: background-color 0.2s;
}
.drag-item:active { cursor: grabbing; }
.drag-item.over { border: 2px dashed var(--primary-color); background: #EBF8FF; opacity: 0.8; }
.drag-item.dragging { opacity: 0.5; }
.drag-handle { cursor: grab; padding: 0 15px 0 5px; color: var(--text-light); font-size: 20px; }

.aura-radio-group { display: flex; gap: 10px; }
.aura-radio-group label {
    flex: 1; text-align: center; padding: 12px; border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer; font-size: 14px; font-weight: 600; color: var(--primary-color); background: var(--white); transition: 0.2s;
}
.aura-radio-group input[type="radio"] { display: none; }
.aura-radio-group input[type="radio"]:checked + label {
    background-color: var(--primary-color); color: var(--white); border-color: var(--primary-color);
}

.color-checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; cursor: pointer; color: var(--text-dark); }
.color-checkbox-row input[type="checkbox"], .color-checkbox-row input[type="radio"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary-color); }
.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.mentor-tooltip { display: inline-flex; justify-content: center; align-items: center; width: 16px; height: 16px; background-color: var(--primary-color); color: var(--white); border-radius: 50%; font-size: 11px; font-weight: bold; cursor: help; position: relative; vertical-align: middle; font-family: Arial, sans-serif; }
.mentor-tooltip::after { content: attr(data-dica); position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%); background-color: #1A202C; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 12px; font-weight: 500; line-height: 1.4; white-space: normal; width: max-content; max-width: 260px; text-align: left; box-shadow: 0 4px 10px rgba(0,0,0,0.15); opacity: 0; visibility: hidden; transition: 0.2s; z-index: 1000; pointer-events: none; text-transform: none; letter-spacing: normal; }
.mentor-tooltip::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); border-width: 6px; border-style: solid; border-color: #1A202C transparent transparent transparent; opacity: 0; visibility: hidden; transition: 0.2s; z-index: 1000; pointer-events: none; }
.mentor-tooltip:hover::after, .mentor-tooltip:hover::before, .mentor-tooltip.show-mobile::after, .mentor-tooltip.show-mobile::before { opacity: 1; visibility: visible; }

#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 250px; padding: 15px 20px; border-radius: 8px; color: var(--white); font-size: 14px; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,0.15); opacity: 0; transform: translateX(100%); animation: slideInToast 0.3s forwards; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.toast.success { background-color: var(--success); }
.toast.error { background-color: var(--danger); }
.toast.info { background-color: var(--primary-color); }
.toast.fade-out { animation: fadeOutToast 0.3s forwards; }
@keyframes slideInToast { to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOutToast { to { opacity: 0; transform: translateX(100%); } }

.acervo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.acervo-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: 0.2s; }
.acervo-card:hover { border-color: var(--primary-color); box-shadow: 0 4px 8px rgba(0,0,0,0.05); transform: translateY(-2px); }
.acervo-card-header { display: flex; align-items: center; gap: 15px; margin-bottom: 5px; }
.acervo-card-header h4 { color: var(--primary-color); font-size: 16px; margin: 0; flex: 1; }
.acervo-thumb { width: 50px; height: 50px; min-width: 50px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border); background: #F7FAFC; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.acervo-card p { font-size: 13px; color: var(--text-light); margin: 0; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.acervo-card-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }

/* =========================================================
   CRUD - TEXTOS DO SISTEMA
   ========================================================= */
.textos-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.textos-page-header h2 {
    margin: 0 0 5px;
}

.textos-page-header p {
    margin: 0;
    color: #718096;
    font-size: 13px;
    line-height: 1.5;
}

.textos-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.textos-toolbar #busca-textos {
    min-width: 280px;
    max-width: 420px;
    flex: 1;
}

.textos-toolbar #filtro-textos-alvo {
    width: auto;
    min-width: 150px;
}

.btn-texto-novo {
    width: auto;
    min-width: 130px;
    padding: 11px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    background-color: var(--success);
}

.btn-icon-toolbar {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    color: var(--primary-color);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s;
}

.btn-icon-toolbar:hover {
    border-color: var(--primary-color);
    background: #EBF8FF;
}

.textos-table-container {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(100vh - 230px);
    position: relative;
}

.textos-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.textos-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 9px 7px;
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
}

.textos-table th:nth-child(1) { width: 6%; }
.textos-table th:nth-child(2) { width: 10%; }
.textos-table th:nth-child(3) { width: 12%; }
.textos-table th:nth-child(4) { width: 8%; }
.textos-table th:nth-child(5) { width: 27%; }
.textos-table th:nth-child(6) { width: 27%; }
.textos-table th:nth-child(7) { width: 10%; }

.textos-table td {
    vertical-align: top;
    padding: 9px 7px;
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.textos-table td strong {
    font-size: 12px;
}

.textos-table .badge-pet,
.textos-table .badge-humano,
.textos-table .badge-todos {
    display: inline-block;
    max-width: 100%;
    padding: 3px 6px;
    font-size: 9px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.texto-sistema-cell {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
    max-height: 105px;
    overflow-y: auto;
    padding-right: 3px;
    color: #4A5568;
    scrollbar-width: thin;
}

.texto-sistema-vazio {
    color: #A0AEC0;
    font-style: italic;
}

.textos-acoes-col,
.textos-acoes-cell {
    text-align: center !important;
    background: #EDF2F7 !important;
}

.textos-acoes-cell {
    background: var(--white) !important;
}

.textos-table tr:hover .textos-acoes-cell {
    background: #F7FAFC !important;
}

.textos-action-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    white-space: nowrap;
}

.btn-texto-acao {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: transform 0.15s, border-color 0.15s, background-color 0.15s;
}

.btn-texto-acao:hover {
    transform: translateY(-1px);
}

.btn-texto-editar:hover {
    border-color: var(--primary-color);
    background: #EBF8FF;
}

.btn-texto-duplicar:hover {
    border-color: #805AD5;
    background: #FAF5FF;
}

.btn-texto-excluir:hover {
    border-color: var(--danger);
    background: #FFF5F5;
}

.modal-texto-content {
    max-width: 920px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.interface-color-grid small {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 11px;
    line-height: 1.4;
}

.modal-texto-content textarea {
    min-height: 150px;
    resize: vertical;
    overflow: auto;
    caret-color: var(--primary-color);
}

.modal-texto-content input,
.modal-texto-content select,
.modal-texto-content textarea {
    scroll-margin: 24px;
}

.modal-texto-content .modal-header {
    align-items: flex-start;
}

.modal-subtitle {
    margin: 5px 0 0;
    font-size: 12px;
    color: #718096;
    line-height: 1.45;
}

.textarea-texto-sistema {
    resize: vertical;
    min-height: 130px;
    line-height: 1.5;
}

.modal-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.modal-form-actions .btn-primary,
.modal-form-actions .btn-secondary {
    width: auto;
    min-width: 140px;
}

.btn-secondary {
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #F7FAFC;
}

@media (max-width: 900px) {
    .textos-toolbar {
        justify-content: flex-start;
        width: 100%;
    }

    .textos-toolbar #busca-textos {
        min-width: 100%;
        max-width: none;
    }

    .modal-texto-content .form-grid-2 {
        grid-template-columns: 1fr;
    }
}


/* ========================================================================== */
/* CAMADA COMERCIAL / ASSINATURAS                                              */
/* ========================================================================== */
.commercial-banner {
    padding: 10px 30px;
    border-bottom: 1px solid var(--border);
    background: #FFF8E1;
    color: #744210;
    font-size: 13px;
    font-weight: 700;
}
.commercial-banner.warning { background: #FFF5F5; color: #C53030; }
.commercial-banner.success { background: #F0FFF4; color: #276749; }
.commercial-page-header p, .commercial-muted { color: #718096; font-size: 13px; margin-top: 5px; }
.subscription-status-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary-color);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: 0 3px 10px rgba(0,0,0,.035);
}
.subscription-status-card h3 { margin-bottom: 8px; color: var(--text-dark); }
.subscription-metrics { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 15px; }
.subscription-metric { background: #F7FAFC; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 12px; }
.subscription-metric strong { display: block; font-size: 17px; color: var(--primary-color); margin-top: 2px; }
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; margin-bottom: 24px; }
.plan-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; min-height: 260px; }
.plan-card.featured { border: 2px solid var(--primary-color); box-shadow: 0 8px 20px rgba(43,108,176,.12); }
.plan-card h3 { margin-bottom: 7px; color: var(--primary-color); }
.plan-price { font-size: 30px; font-weight: 800; color: var(--text-dark); margin: 12px 0; }
.plan-price small { font-size: 12px; color: #718096; }
.plan-description { color: #718096; font-size: 13px; line-height: 1.5; flex: 1; }
.plan-features { margin: 14px 0; font-size: 13px; line-height: 1.7; color: #4A5568; }
.plan-card button { margin-top: auto; }
.pix-payment-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.pix-qrcode { width: 250px; min-height: 250px; background: #fff; padding: 10px; border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-top: 15px; }
.pix-payment-details textarea { font-family: Consolas, monospace; font-size: 12px; }
.commercial-actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.commercial-actions-row > * { width: auto; }
.button-link { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-secondary { background: #EDF2F7; color: #2D3748; border: 1px solid #CBD5E0; border-radius: 6px; padding: 10px 15px; cursor: pointer; font-weight: 700; }
.btn-secondary:hover { background: #E2E8F0; }
.proof-upload-box { padding: 16px; background: #F7FAFC; border: 1px solid var(--border); border-radius: 8px; }
.proof-upload-box input, .proof-upload-box textarea { margin-bottom: 10px; }
.admin-dashboard-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.admin-invite-form .input-group { margin-bottom: 12px; }
.admin-clinic-field { grid-column: 1 / -1; }
.admin-plan-list { display: flex; flex-direction: column; gap: 10px; }
.admin-plan-editor { display: grid; grid-template-columns: 1.4fr .7fr .7fr .7fr auto; gap: 8px; align-items: end; border: 1px solid var(--border); background: #F7FAFC; border-radius: 8px; padding: 12px; }
.admin-plan-editor label { display: block; font-size: 10px; text-transform: uppercase; color: #718096; font-weight: 800; margin-bottom: 4px; }
.admin-plan-editor input { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 5px; }
.admin-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.admin-table-container { overflow-x: auto; }
.admin-commercial-table { min-width: 900px; }
.admin-commercial-table td { vertical-align: top; font-size: 12px; }
.admin-action-group { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-action-btn { border: 1px solid var(--border); background: #fff; border-radius: 5px; padding: 6px 8px; cursor: pointer; font-size: 11px; font-weight: 700; }
.admin-action-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.status-pill { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; background: #EDF2F7; color: #4A5568; }
.status-pill.ok { background: #C6F6D5; color: #22543D; }
.status-pill.warn { background: #FEEBC8; color: #7B341E; }
.status-pill.blocked { background: #FED7D7; color: #9B2C2C; }

@media (max-width: 1100px) {
    .plans-grid { grid-template-columns: 1fr; }
    .admin-dashboard-grid, .pix-payment-layout { grid-template-columns: 1fr; }
    .pix-qrcode { width: 230px; min-height: 230px; }
    .admin-plan-editor { grid-template-columns: 1fr 1fr; }
}


/* ========================================================================== */
/* HARDENING VISUAL, ACESSIBILIDADE E RESPONSIVIDADE — V7                     */
/* ========================================================================== */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(43, 108, 176, .45);
    outline-offset: 2px;
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    margin-right: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-dark);
    font-size: 22px;
    cursor: pointer;
}

.toast-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    margin-left: 14px;
}

.table-error {
    padding: 24px !important;
    text-align: center !important;
    color: var(--danger) !important;
    font-weight: 700;
}

.row-archived { opacity: .72; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-action {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
}
.icon-action:hover { background: #EDF2F7; }

.modal-overlay[aria-modal="true"] .modal-content,
#modal-confirm-overlay[aria-modal="true"] .modal-confirm-box {
    box-shadow: 0 18px 55px rgba(0, 0, 0, .2);
}

@media (max-width: 900px) {
    body { overflow: auto; }
    #dashboard-screen { min-height: 100dvh; height: auto; overflow: visible; }
    .mobile-menu-button { display: inline-grid; place-items: center; flex: 0 0 42px; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1200;
        width: min(82vw, 290px);
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 16px 0 40px rgba(0, 0, 0, .24);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1100;
        background: rgba(15, 23, 42, .48);
    }
    .content-area { width: 100%; min-width: 0; min-height: 100dvh; height: auto; overflow: visible; }
    .top-bar { height: auto; min-height: 64px; flex: 0 0 auto; padding: 10px 16px; }
    .top-bar h1 { font-size: 24px; }
    .content-body { padding: 18px 14px 28px; overflow: visible; }
    .module-header { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr !important; }
    .wizard-progress { overflow-x: auto; gap: 8px; }
    .step-indicator { min-width: 110px; }
    .table-container { overflow-x: auto; }
    .data-table:not(.textos-table) { min-width: 720px; }
    .login-box { padding: 28px 22px; }
    .modal-content { width: min(96vw, 720px); max-height: 92dvh; overflow-y: auto; }
}

@media (max-width: 600px) {
    .textos-table th:nth-child(1) { width: 8%; }
    .textos-table th:nth-child(2) { width: 12%; }
    .textos-table th:nth-child(3) { width: 14%; }
    .textos-table th:nth-child(4) { width: 10%; }
    .textos-table th:nth-child(5) { width: 23%; }
    .textos-table th:nth-child(6) { width: 23%; }
    .textos-table th:nth-child(7) { width: 10%; }
    .textos-table td, .textos-table th { padding: 6px 4px; font-size: 10px; }
    .btn-texto-acao { width: 26px; height: 26px; flex-basis: 26px; font-size: 12px; }
}

.link-action {
    border: 0;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 700;
    padding: 6px 4px;
    border-radius: 5px;
}
.link-action:hover { background: #EBF8FF; }
.link-action.purple { color: #6B46C1; }
.link-action.muted { color: #5F6B7A; }
.link-action.danger, .icon-action.danger, .admin-action-btn.danger { color: var(--danger); }
.btn-primary.compact { width: auto; padding: 9px 13px; font-size: 13px; }


/* ==========================================================================
   V8 — ONBOARDING, DOCUMENTOS LEGAIS E MANUAL
   ========================================================================== */

.login-legal-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}
.login-legal-links button,
.sidebar-legal-links button {
    border: 0;
    background: transparent;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
}
.login-company {
    margin-top: 12px;
    color: var(--text-light);
    font-size: 11px;
    line-height: 1.4;
}
.sidebar-legal-links {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.sidebar-legal-links button {
    color: var(--sidebar-muted);
    padding: 0;
}

.legal-gate-screen {
    position: fixed;
    inset: 0;
    z-index: 5000;
    overflow-y: auto;
    padding: 28px 16px;
    background:
        radial-gradient(circle at top left, rgba(128,90,213,.18), transparent 35%),
        linear-gradient(135deg, #EBF8FF, #F7FAFC 48%, #FAF5FF);
}
.legal-gate-card {
    width: min(980px, 100%);
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(26, 32, 44, .16);
    padding: 28px;
}
.legal-gate-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
}
.legal-gate-header h1 {
    margin: 4px 0 8px;
    font-size: clamp(24px, 4vw, 34px);
    color: var(--text-dark);
}
.legal-gate-header p {
    margin: 0;
    color: var(--text-light);
    line-height: 1.55;
}
.legal-gate-eyebrow,
.demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #553C9A;
    background: #FAF5FF;
    border: 1px solid #D6BCFA;
    border-radius: 999px;
    padding: 6px 10px;
}
.legal-version-badge {
    flex: none;
    border-radius: 999px;
    padding: 7px 12px;
    background: #EBF8FF;
    color: #2B6CB0;
    font-size: 12px;
    font-weight: 800;
}
.legal-scroll {
    max-height: 52vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    background: #FCFCFD;
    scroll-behavior: smooth;
}
.legal-document + .legal-document {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 3px solid #E9D8FD;
}
.legal-document-heading {
    position: sticky;
    top: -24px;
    z-index: 2;
    background: rgba(252,252,253,.96);
    backdrop-filter: blur(8px);
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.legal-document-heading h2 {
    margin: 0;
    color: var(--primary-color);
}
.legal-document-heading small {
    color: var(--text-light);
}
.legal-scroll-hint {
    margin: 10px 0 0;
    color: #744210;
    font-size: 13px;
    font-weight: 700;
}
.legal-scroll-hint.done {
    color: #276749;
}
.legal-checks {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}
.legal-check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #F7FAFC;
}
.legal-check-row input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
}
.legal-gate-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}
.legal-gate-actions .btn-primary,
.legal-gate-actions .btn-secondary {
    width: auto;
    min-width: 190px;
}
.legal-contact {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    margin-top: 15px;
}

.rich-content,
.manual-article {
    color: var(--text-dark);
    line-height: 1.7;
}
.rich-content h2,
.manual-article h2 {
    margin: 24px 0 10px;
    color: var(--primary-color);
    font-size: 20px;
}
.rich-content h3,
.manual-article h3 {
    margin: 20px 0 8px;
    color: var(--text-dark);
}
.rich-content p,
.manual-article p {
    margin: 0 0 12px;
}
.rich-content ul,
.rich-content ol,
.manual-article ul,
.manual-article ol {
    padding-left: 24px;
    margin: 10px 0 16px;
}
.rich-content li,
.manual-article li {
    margin-bottom: 7px;
}
.rich-content blockquote,
.manual-article blockquote {
    margin: 16px 0;
    padding: 16px 18px;
    border-left: 4px solid var(--primary-color);
    background: #F7FAFC;
    border-radius: 6px;
}
.public-content-modal {
    width: min(900px, calc(100% - 24px));
    max-width: 900px;
    max-height: 90vh;
}
.public-content-modal .rich-content {
    max-height: 72vh;
    overflow-y: auto;
    padding-right: 10px;
}

.onboarding-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 28px;
    align-items: center;
    margin-bottom: 22px;
    padding: 26px;
    border: 1px solid #D6BCFA;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(250,245,255,.95), rgba(235,248,255,.92)),
        #fff;
    box-shadow: 0 10px 30px rgba(85,60,154,.08);
}
.onboarding-copy h3 {
    margin: 12px 0 8px;
    color: #44337A;
    font-size: 24px;
}
.onboarding-copy p {
    color: #4A5568;
    line-height: 1.55;
}
.onboarding-actions {
    display: grid;
    gap: 10px;
}
.onboarding-actions .btn-primary,
.onboarding-actions .btn-secondary {
    width: 100%;
}
.onboarding-checklist {
    display: grid;
    gap: 7px;
    margin-top: 16px;
}
.onboarding-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4A5568;
    font-size: 13px;
}
.onboarding-step.done {
    color: #276749;
    font-weight: 700;
}
.link-danger {
    border: 0;
    background: transparent;
    color: var(--danger);
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
}
.context-help {
    display: inline-flex;
    margin-top: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
}
.demo-row {
    background: #FFFAF0 !important;
}
.status-pill.demo {
    background: #FAF5FF;
    color: #553C9A;
    border: 1px solid #D6BCFA;
}
.demo-disclaimer {
    display: inline-block;
    margin-top: 4px;
    color: #744210;
    font-size: 11px;
    font-weight: 700;
}

.manual-header p,
.admin-v8-section p {
    color: var(--text-light);
    margin-top: 4px;
}
.manual-search-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 18px;
}
.manual-search-box label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}
.manual-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    min-height: 500px;
}
.manual-categories,
.manual-content {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.manual-categories {
    padding: 10px;
    align-self: start;
}
.manual-category-btn {
    width: 100%;
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 8px;
    text-align: left;
    align-items: center;
    padding: 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
}
.manual-category-btn:hover,
.manual-category-btn.active {
    background: #EBF8FF;
    color: var(--primary-color);
}
.manual-category-btn small {
    grid-column: 2;
    color: var(--text-light);
}
.manual-content {
    padding: 20px;
}
.manual-results {
    display: grid;
    gap: 12px;
}
.manual-result-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.manual-result-card:hover {
    border-color: #90CDF4;
    box-shadow: 0 4px 14px rgba(49,130,206,.08);
}
.manual-result-card button {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
}
.manual-result-card p {
    color: var(--text-light);
    margin: 7px 0 0;
    line-height: 1.5;
}
.manual-result-meta {
    margin-top: 8px;
    font-size: 11px;
    color: #805AD5;
    font-weight: 700;
}
.manual-back {
    border: 0;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    margin-bottom: 16px;
    font-weight: 700;
}
.manual-article-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 24px;
    color: var(--text-light);
    font-size: 12px;
}
.manual-article-footer .btn-secondary {
    width: auto;
}
.manual-note {
    padding: 12px;
    border-left: 4px solid #805AD5;
    background: #FAF5FF;
    border-radius: 6px;
}

.admin-v8-section {
    margin-top: 20px;
}
.admin-v8-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 24px;
}
.admin-v8-form {
    min-width: 0;
}
.legal-admin-options {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 0 15px;
}
.legal-admin-options label {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
}
.admin-v8-list {
    display: grid;
    gap: 10px;
    max-height: 600px;
    overflow-y: auto;
}
.admin-v8-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #F7FAFC;
}
.admin-v8-item h5 {
    margin: 0 0 5px;
    color: var(--text-dark);
}
.admin-v8-item p {
    margin: 0 0 7px;
    font-size: 12px;
}
.admin-v8-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-v8-item-actions button {
    border: 0;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 700;
    padding: 3px 0;
}
.admin-v8-item-actions button.danger {
    color: var(--danger);
}

@media (max-width: 900px) {
    .onboarding-card,
    .manual-layout,
    .admin-v8-grid {
        grid-template-columns: 1fr;
    }
    .manual-categories {
        display: flex;
        overflow-x: auto;
        gap: 8px;
    }
    .manual-category-btn {
        min-width: 190px;
    }
}
@media (max-width: 620px) {
    .legal-gate-card {
        padding: 18px;
    }
    .legal-gate-header {
        display: block;
    }
    .legal-version-badge {
        display: inline-flex;
        margin-top: 10px;
    }
    .legal-scroll {
        max-height: 48vh;
        padding: 16px;
    }
    .legal-gate-actions {
        flex-direction: column-reverse;
    }
    .legal-gate-actions .btn-primary,
    .legal-gate-actions .btn-secondary {
        width: 100%;
    }
    .onboarding-card {
        padding: 18px;
    }
    .manual-article-footer {
        align-items: stretch;
        flex-direction: column;
    }
}

/* V8 — detalhes de demonstração, documentos e manual */
.legal-document-block { padding: 8px 2px 22px; }
.legal-document-block header { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; color:var(--primary-color); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.legal-document-block h2 { margin:12px 0 8px; }
.legal-summary, .manual-lead { font-size:15px; color:var(--text-light); }
.legal-check-row { display:flex; align-items:flex-start; gap:10px; padding:12px; border:1px solid var(--border); border-radius:10px; background:#fff; }
.legal-check-row input { margin-top:3px; flex:0 0 auto; }
.row-demo { background:#fbf9ff; }
.demo-inline-tag { display:inline-block; margin-top:5px; padding:3px 7px; border-radius:999px; background:#ede9fe; color:#5b21b6; font-size:10px; font-weight:800; letter-spacing:.03em; }
.table-note { display:block; margin-top:6px; color:var(--text-light); font-size:11px; }
.public-manual-list p { padding:12px; border:1px solid var(--border); border-radius:10px; }
.public-manual-list a { color:var(--primary-color); }
.manual-lead { margin-bottom:20px; }
.rich-content table { width:100%; border-collapse:collapse; margin:16px 0; }
.rich-content th, .rich-content td { border:1px solid var(--border); padding:8px; text-align:left; vertical-align:top; }
.rich-content blockquote, .manual-note, .manual-warning, .manual-tip, .legal-highlight { margin:14px 0; padding:14px 16px; border-left:4px solid var(--primary-color); background:#f7f5ff; border-radius:8px; }
.manual-warning { border-left-color:#c05621; background:#fffaf0; }
.manual-tip { border-left-color:#2f855a; background:#f0fff4; }
.admin-v8-list-item .link-danger { width:auto; margin:0; }

@media (max-width: 720px) {
    .legal-document-block header { flex-direction:column; }
    .row-demo td { min-width:130px; }
}
.admin-v8-item { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.admin-v8-item > div:first-child { display:grid; gap:4px; min-width:0; }
.admin-v8-item span, .admin-v8-item small { display:block; color:var(--text-light); }
.admin-v8-item > .btn-secondary { width:auto; flex:0 0 auto; }

/* ========================================================================== 
   V9 — TABELAS MESTRES DE ACERVO, MEUS GRÁFICOS E TEXTOS
   ========================================================================== */
.badge-master,
.badge-personalizado {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-master {
    background: #EDE9FE;
    color: #5B21B6;
    border: 1px solid #DDD6FE;
}

.badge-personalizado {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}

#acervo-admin-table-container .texto-sistema-cell {
    max-width: 330px;
}

#view-catalogo-graficos .textos-table th:nth-child(1) {
    min-width: 260px;
}

#view-catalogo-graficos .textos-table th:nth-child(2),
#view-catalogo-graficos .textos-table th:nth-child(3) {
    min-width: 150px;
}

#view-acervo-graficos .textos-toolbar,
#view-catalogo-graficos .textos-toolbar {
    align-items: center;
}

#view-acervo-graficos .textos-toolbar input,
#view-catalogo-graficos .textos-toolbar input {
    min-width: min(320px, 70vw);
}

@media (max-width: 760px) {
    #view-acervo-graficos .textos-toolbar,
    #view-catalogo-graficos .textos-toolbar {
        width: 100%;
        align-items: stretch;
    }

    #view-acervo-graficos .textos-toolbar input,
    #view-catalogo-graficos .textos-toolbar input,
    #view-acervo-graficos .textos-toolbar button,
    #view-catalogo-graficos .textos-toolbar button {
        width: 100%;
        min-width: 0;
    }
}

/* V9.8 — Áreas da vida: duas colunas equilibradas, com três cartões em cada lado. */
.areas-life-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.areas-life-grid .analysis-box {
    height: 100%;
}

@media (max-width: 760px) {
    .areas-life-grid {
        grid-template-columns: 1fr;
    }
}


/* ========================================================================== 
   V9.12 — Recuperação de senha e ações administrativas seguras
   ========================================================================== */
.login-help-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.login-help-button {
    width: auto;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.login-help-button:hover,
.login-help-button:focus-visible {
    text-decoration-thickness: 2px;
}

.admin-invite-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.admin-invite-actions .btn-primary,
.admin-invite-actions .btn-secondary {
    width: 100%;
}

.admin-invite-warning {
    display: block;
    margin-top: 9px;
    color: var(--text-light);
    line-height: 1.45;
}

@media (max-width: 720px) {
    .admin-invite-actions {
        grid-template-columns: 1fr;
    }
}
