/**
 * ============================================================================
 * Olivius - Folha de Estilos (Tema Clean Botanical & Saúde)
 * Cores inspiradas na identidade visual da Logo: #3f7859 (oliva) e #777f4f (folhas)
 * Arquivo: assets/style.css
 * ============================================================================
 */

:root {
    /* Cores Institucionais Extraídas da Logo */
    --brand-olive: #3f7859;          /* Verde-oliva principal da tipografia da Logo */
    --brand-olive-hover: #326147;    /* Verde-oliva escurecido para interações */
    --brand-olive-active: #274d38;
    --brand-leaf: #777f4f;           /* Tom das folhas de oliveira */
    --brand-leaf-hover: #656c42;
    --brand-leaf-soft: #eef2e6;      /* Fundo suave com tom de folha */

    /* Superfícies e Estrutura (Clean & Healthcare) */
    --bg-main: #f4f7f4;              /* Fundo névoa/porcelana descansado */
    --card-bg: #ffffff;              /* Branco puro para cards clínicos e relatórios */
    --card-hover: #fafcfa;
    --border-color: #dbe4dd;         /* Bordas sutis em cinza-oliva */
    --border-subtle: #edf3ee;

    /* Tipografia com Alto Contraste e Conforto */
    --text-main: #192e23;            /* Carvão florestal escuro para leitura perfeita */
    --text-dim: #4d6958;             /* Verde-oliva médio para metadados e subtítulos */
    --text-muted: #769181;           /* Sálvia suave para rodapé e separadores */

    /* Ações e Estados */
    --primary: var(--brand-olive);
    --primary-hover: var(--brand-olive-hover);
    --primary-active: var(--brand-olive-active);
    --accent: var(--brand-olive);
    --accent-hover: var(--brand-olive-hover);

    /* Alertas e Status */
    --danger: #dc2626;               /* Vermelho clássico e seguro */
    --danger-hover: #b91c1c;
    --success: #059669;

    /* Tipografia e Geometria */
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 3px rgba(25, 46, 35, 0.05), 0 1px 2px rgba(25, 46, 35, 0.03);
    --shadow-md: 0 4px 16px -2px rgba(25, 46, 35, 0.06), 0 2px 6px -1px rgba(25, 46, 35, 0.04);
    --shadow-lg: 0 12px 32px -4px rgba(25, 46, 35, 0.08), 0 4px 12px -2px rgba(25, 46, 35, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-stack);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
 * Imagens de Marca (Logo)
 * ============================================================================ */
.topbar-logo {
    height: 42px;
    width: auto;
    display: block;
    object-fit: contain;
}

.login-logo {
    max-width: 240px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 8px auto;
    object-fit: contain;
}

/* ============================================================================
 * Barra Superior (Topbar)
 * ============================================================================ */
.topbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-olive);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.brand-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.user-area strong {
    color: var(--text-main);
    font-weight: 600;
}

.user-greeting {
    white-space: nowrap;
}

/* ============================================================================
 * Botões e Ações Interativas
 * ============================================================================ */
.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border: 1px solid transparent;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    touch-action: manipulation;
    box-shadow: 0 2px 4px rgba(63, 120, 89, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 10px rgba(63, 120, 89, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
    background-color: var(--primary-active);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--brand-olive);
    border: 1.5px solid #c9d8ce;
    padding: 10.5px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    touch-action: manipulation;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background-color: #f0f7f3;
    border-color: var(--brand-olive);
    color: var(--primary-hover);
    box-shadow: 0 4px 10px rgba(63, 120, 89, 0.15);
}

.btn-secondary:active {
    transform: scale(0.98);
    background-color: #e3efe8;
}

.btn-block {
    width: 100%;
    text-align: center;
    display: flex;
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger-hover);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

.btn-small {
    background-color: #f0f5f2;
    color: var(--brand-olive);
    border: 1px solid #d3e0d7;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.btn-small:hover {
    background-color: var(--brand-olive);
    color: #ffffff;
    border-color: var(--brand-olive);
}

.btn-nav {
    margin-right: 2px;
}

.btn-logout {
    background-color: transparent;
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.3);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.btn-logout:hover {
    background-color: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

.btn-download {
    background-color: rgba(63, 120, 89, 0.08);
    color: var(--brand-olive);
    border: 1px solid rgba(63, 120, 89, 0.3);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.btn-download:hover {
    background-color: var(--brand-olive);
    color: #ffffff;
    border-color: var(--brand-olive);
    box-shadow: 0 2px 6px rgba(63, 120, 89, 0.25);
}

.btn-action-view {
    background: #f7faf8;
    color: var(--text-dim);
    border: 1px solid #d3e0d7;
    margin-right: 6px;
}

.btn-action-view:hover {
    background-color: #e6eee8;
    color: var(--brand-olive);
}

.btn-space-top {
    margin-top: 10px;
}

/* ============================================================================
 * Formulários e Campos
 * ============================================================================ */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group-lg {
    margin-bottom: 22px;
    text-align: left;
}

.form-compact {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
    color: var(--text-main);
    font-weight: 600;
}

.form-input,
.form-control {
    width: 100%;
    box-sizing: border-box;
    background-color: #ffffff;
    border: 1.5px solid #cbdad0;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:hover,
.form-control:hover {
    border-color: #b0c6b8;
}

.form-input:focus,
.form-control:focus {
    border-color: var(--brand-olive);
    box-shadow: 0 0 0 3px rgba(63, 120, 89, 0.18);
    background-color: #ffffff;
}

select.form-input,
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233f7859' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 36px;
    cursor: pointer;
}

textarea.form-input,
textarea.form-control {
    resize: none;
    min-height: 56px;
    height: 60px;
    font-family: inherit;
    line-height: 1.4;
}

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

/* ============================================================================
 * Layout Principal e Cards
 * ============================================================================ */
.container {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 20px;
}

.intro {
    margin-bottom: 26px;
}

.intro h2 {
    font-size: 1.65rem;
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.intro p {
    color: var(--text-dim);
    font-size: 1rem;
    max-width: 780px;
    line-height: 1.6;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.card:hover {
    border-color: #b7cebf;
    box-shadow: var(--shadow-md);
}

.card h2 {
    font-size: 1.25rem;
    color: var(--brand-olive);
    margin-bottom: 10px;
    font-weight: 700;
}

.card h3 {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 600;
}

.card p {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.6;
}

.card-action {
    margin-top: 22px;
}

.card pre, .card code {
    background: #f0f5f2;
    border: 1px solid #dbe4dd;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: Consolas, monospace;
    font-size: 0.88rem;
    color: var(--brand-olive);
    word-break: break-all;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0 0;
    font-size: 0.92rem;
    line-height: 1.85;
    color: var(--text-main);
}

.security-info-text {
    font-size: 0.92rem;
    color: var(--text-dim);
    line-height: 1.65;
}

/* ============================================================================
 * Breadcrumb
 * ============================================================================ */
.breadcrumb {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.breadcrumb::-webkit-scrollbar {
    display: none;
}

.breadcrumb a {
    color: var(--brand-olive);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.breadcrumb a:hover {
    color: var(--brand-olive-hover);
    text-decoration: underline;
}

.breadcrumb .sep {
    color: var(--text-muted);
    user-select: none;
    flex-shrink: 0;
}

.breadcrumb-active {
    color: var(--text-main);
    font-weight: 600;
}

/* ============================================================================
 * Barra de Busca / Filtro
 * ============================================================================ */
.filter-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-input {
    flex: 1;
    min-width: 220px;
    padding: 11px 16px;
    background: #ffffff;
    border: 1px solid #cbdad0;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-input:focus {
    border-color: var(--brand-olive);
    box-shadow: 0 0 0 3px rgba(63, 120, 89, 0.18);
}

.item-count-badge {
    color: var(--text-dim);
    font-size: 0.85rem;
    white-space: nowrap;
    background: #ffffff;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* ============================================================================
 * Tabela de Arquivos
 * ============================================================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.file-table th {
    background-color: #f0f5f2;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.file-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 0.92rem;
    vertical-align: middle;
}

.col-name {
    width: 50%;
}

.col-size {
    width: 15%;
}

.col-date {
    width: 20%;
}

.col-actions {
    width: 15%;
    text-align: right;
}

.cell-size {
    font-size: 0.85rem;
    color: var(--text-dim);
    white-space: nowrap;
    font-weight: 500;
}

.cell-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.cell-empty {
    color: var(--text-muted);
}

.file-table tbody tr:hover {
    background-color: rgba(63, 120, 89, 0.035);
}

.row-dir td {
    background-color: rgba(240, 245, 242, 0.5);
}

.row-dir:hover td {
    background-color: rgba(63, 120, 89, 0.07);
}

.row-parent-link {
    font-weight: 600;
    color: var(--brand-olive);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.row-parent-link:hover {
    color: var(--brand-olive-hover);
}

.file-name-cell, .file-name-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.file-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1;
}

.file-info-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.file-title {
    word-break: break-word;
    font-weight: 500;
    color: var(--text-main);
}

.row-dir .file-title {
    color: var(--brand-olive);
    font-weight: 600;
}

.mobile-file-meta {
    display: none;
}

.actions-cell {
    white-space: nowrap;
    text-align: right;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--card-bg);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-dim);
}

.empty-icon {
    font-size: 3rem;
    margin: 0 0 10px 0;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 6px;
}

/* ============================================================================
 * Telas de Login, Setup e Erro 404
 * ============================================================================ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px 20px;
    background-color: var(--bg-main);
}

.login-box {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.box-setup {
    max-width: 520px;
}

.box-404 {
    max-width: 460px;
}

.error-code-404 {
    color: var(--brand-olive);
    font-size: 2.8rem;
    margin: 0 0 10px 0;
    font-weight: 800;
}

.error-text-404 {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.login-box .brand {
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.instruction-text {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 16px;
    line-height: 1.5;
}

.link-accent {
    color: var(--brand-olive);
    text-decoration: underline;
    font-weight: 600;
}

.link-accent:hover {
    color: var(--brand-olive-hover);
}

/* ============================================================================
 * Alertas e Mensagens de Status
 * ============================================================================ */
.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 20px;
    text-align: left;
}

.alert-warning-box {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    text-align: left;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    font-size: 0.95rem;
    text-align: left;
}

.alert-info {
    background-color: #f0fdf4;
    border: 1px solid #c7e6d1;
    color: #1b4d32;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 20px;
    text-align: left;
}

.alert-title {
    margin: 0 0 8px 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.alert-title-success {
    color: #166534;
}

.alert-title-danger {
    color: #991b1b;
}

.alert-body {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-strong {
    margin: 0;
    font-weight: 700;
    color: #991b1b;
}

.footer-text {
    margin-top: 26px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ============================================================================
 * Rodapé
 * ============================================================================ */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    background-color: var(--card-bg);
    margin-top: auto;
}

/* ============================================================================
 * Responsividade Mobile Avançada
 * ============================================================================ */
@media (max-width: 640px) {
    .topbar {
        padding: 12px 16px;
    }

    .topbar-logo {
        height: 34px;
    }

    .login-logo {
        max-width: 190px;
    }

    .user-area {
        gap: 8px;
        font-size: 0.85rem;
    }

    .user-greeting {
        display: none;
    }

    .container {
        padding: 18px 14px;
    }

    .intro h2 {
        font-size: 1.35rem;
    }

    .intro p {
        font-size: 0.92rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .filter-input {
        width: 100%;
        min-width: 0;
    }

    .item-count-badge {
        align-self: flex-start;
        font-size: 0.78rem;
        padding: 4px 10px;
    }

    .file-table th:nth-child(2),
    .file-table td:nth-child(2),
    .file-table th:nth-child(3),
    .file-table td:nth-child(3) {
        display: none;
    }

    .file-table th {
        padding: 10px 14px;
    }

    .file-table td {
        padding: 12px 14px;
    }

    .mobile-file-meta {
        display: block;
        font-size: 0.78rem;
        color: var(--text-dim);
        margin-top: 3px;
        line-height: 1.3;
    }

    .mobile-file-meta strong {
        color: var(--text-main);
    }

    .actions-cell {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 6px;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .btn-action-download,
    .btn-action-view {
        min-height: 38px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .login-box {
        padding: 30px 22px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
 * Badges de Status e Perfis de Usuário
 * ============================================================================ */
.badge-status-active {
    background-color: rgba(5, 150, 105, 0.12);
    color: #065f46;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-status-blocked {
    background-color: rgba(220, 38, 38, 0.1);
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-role-admin {
    background-color: rgba(63, 120, 89, 0.12);
    color: var(--brand-olive);
    border: 1px solid #cbdad0;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-role-user {
    background-color: #f0f5f2;
    color: var(--text-dim);
    border: 1px solid #d3e0d7;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-role-main {
    background-color: rgba(63, 120, 89, 0.16);
    color: var(--brand-olive);
    border: 1px solid #a3c2af;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-protected {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-self {
    background-color: rgba(63, 120, 89, 0.08);
    color: var(--brand-olive);
    border: 1px solid #cbdad0;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.username-title {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
}

.card-margin-top {
    margin-top: 10px;
}

.table-margin-top {
    margin-top: 18px;
}

.action-group {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.btn-warning {
    background-color: #f59e0b;
    border: 1px solid #d97706;
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #d97706;
}

/* ============================================================================
 * Badges de Status de Conexão (Header)
 * ============================================================================ */
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-decoration: none;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.status-badge-online {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-badge-offline {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    cursor: pointer;
}

.status-badge-offline:hover {
    background-color: #fee2e2;
    transform: scale(1.02);
}

.status-badge-local {
    background-color: var(--brand-leaf-soft);
    color: var(--brand-olive-active);
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.status-badge-online .status-dot {
    background-color: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.status-badge-offline .status-dot {
    background-color: #ef4444;
}

/* ============================================================================
 * Alertas e Mensagens de Conectividade
 * ============================================================================ */
.alert-box {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.alert-offline {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.alert-content h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: #78350f;
}

.alert-content p {
    font-size: 0.88rem;
    line-height: 1.45;
    color: #92400e;
    margin-bottom: 10px;
}

/* ============================================================================
 * Barra de Controles e Alternador de Visão
 * ============================================================================ */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-input-wrap {
    flex: 1;
    min-width: 240px;
}

.filter-meta-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.view-mode-toggle {
    display: inline-flex;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.btn-toggle {
    background: transparent;
    border: none;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dim);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.btn-toggle.active {
    background-color: var(--brand-olive);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.table-thumb-mini {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    flex-shrink: 0;
}

/* ============================================================================
 * Grade de Galeria de Fotos (Gallery Grid)
 * ============================================================================ */
.gallery-parent-card {
    margin-bottom: 14px;
}

.gallery-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--brand-olive);
    text-decoration: none;
    padding: 8px 14px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.gallery-back-link:hover {
    background-color: var(--card-hover);
    border-color: var(--brand-olive);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.gallery-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-olive);
}

.gallery-card-dir {
    padding: 16px;
    text-decoration: none;
    color: var(--text-main);
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.gallery-card-icon {
    font-size: 2rem;
    line-height: 1;
}

.gallery-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: var(--bg-main);
    cursor: pointer;
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.gallery-thumb-wrap:hover .gallery-img {
    transform: scale(1.05);
}

.gallery-overlay-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(25, 46, 35, 0.75);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
    backdrop-filter: blur(4px);
}

.gallery-thumb-wrap:hover .gallery-overlay-badge {
    opacity: 1;
}

.gallery-thumb-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-ext {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-leaf);
    background-color: var(--brand-leaf-soft);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.gallery-card-info {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gallery-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.gallery-card-meta {
    font-size: 0.76rem;
    color: var(--text-dim);
}

.gallery-download-icon {
    text-decoration: none;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.gallery-download-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* ============================================================================
 * Lightbox Modal (Visualizador de Imagens)
 * ============================================================================ */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(10, 20, 15, 0.88);
    backdrop-filter: blur(8px);
}

.lightbox-dialog {
    position: relative;
    z-index: 10;
    width: 95vw;
    height: 94vh;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background-color: rgba(18, 32, 24, 0.8);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.lightbox-title {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}

.lightbox-counter {
    color: #94a3b8;
    font-size: 0.82rem;
    background-color: rgba(255, 255, 255, 0.12);
    padding: 2px 8px;
    border-radius: 12px;
}

.lightbox-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lightbox-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    opacity: 0.8;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.lightbox-close-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

.lightbox-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 10px;
    overflow: hidden;
}

.lightbox-stage {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease;
    opacity: 1;
}

.lightbox-img.is-loading-img {
    opacity: 0.3;
}

.lightbox-nav-btn {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 1.6rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 20;
    user-select: none;
}

.lightbox-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.08);
}

.lightbox-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-meta-wrap {
        justify-content: space-between;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .lightbox-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }
}

/* ============================================================================
 * Login Passwordless & OTP
 * ============================================================================ */
.login-instruction {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.45;
    margin-bottom: 18px;
    text-align: center;
}

.login-credentials-tip {
    margin-top: 18px;
    padding: 10px 12px;
    background-color: var(--brand-leaf-soft);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
    border: 1px solid var(--danger-hover);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}





/* ============================================================================
 * Visualizador Médico de Tomografia DICOM (Tema Olivius)
 * ============================================================================ */
.viewer-page {
    background-color: #0d1210;
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.viewer-topbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    z-index: 20;
    flex-wrap: nowrap;
    gap: 12px;
}

.viewer-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.viewer-exam-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 380px;
}

.viewer-badge-slices {
    background-color: var(--brand-leaf-soft);
    color: var(--brand-olive);
    border: 1px solid var(--brand-leaf);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.viewer-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.viewer-select {
    padding: 5px 10px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-main);
    cursor: pointer;
    outline: none;
}

.viewer-toolbar {
    background-color: #141b17;
    border-bottom: 1px solid #233029;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 15;
    row-gap: 6px;
}

.viewer-tool-group {
    display: flex;
    align-items: center;
    background-color: #1c2620;
    border: 1px solid #2d3e34;
    border-radius: var(--radius-sm);
    padding: 2px 4px;
    gap: 2px;
    flex-shrink: 0;
}

.viewer-tool-label {
    font-size: 0.74rem;
    color: #9cb3a4;
    padding: 0 6px;
    font-weight: 600;
    user-select: none;
}

.viewer-btn {
    background: transparent;
    color: #c2d4c9;
    border: none;
    padding: 5px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    outline: none;
    white-space: nowrap;
}

.viewer-btn:hover {
    background-color: #27362d;
    color: #ffffff;
}

.viewer-btn.active {
    background-color: var(--brand-olive);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Responsividade Avançada da Barra de Ferramentas */
@media (max-width: 1200px) {
    .viewer-toolbar {
        padding: 6px 10px;
        gap: 6px;
        row-gap: 6px;
    }
    .viewer-btn {
        padding: 5px 7px;
        font-size: 0.75rem;
    }
    .viewer-tool-label {
        font-size: 0.7rem;
        padding: 0 4px;
    }
}

@media (max-width: 860px) {
    .viewer-toolbar {
        justify-content: flex-start;
    }
    .viewer-topbar {
        padding: 8px 12px;
    }
    .viewer-exam-title {
        max-width: 200px;
    }
}

.viewer-main {
    flex: 1;
    display: flex;
    position: relative;
    background-color: #060907;
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

.viewer-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: ns-resize;
}

.viewer-viewport.tool-pan {
    cursor: grab;
}

.viewer-viewport.tool-pan:active {
    cursor: grabbing;
}

.viewer-viewport.tool-wl {
    cursor: crosshair;
}

.viewer-canvas-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    transition: transform 0.05s ease-out;
}

.viewer-canvas {
    display: block;
    background-color: #000000;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.9);
    border: 1px solid #1f2e24;
    border-radius: var(--radius-sm);
    max-width: min(78vh, 78vw);
    max-height: min(78vh, 78vw);
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.viewer-osd {
    position: absolute;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    color: #a8dfbc;
    text-shadow: 1px 1px 2px #000, -1px -1px 2px #000;
    pointer-events: none;
    z-index: 10;
    line-height: 1.5;
}

.viewer-osd-tl { top: 14px; left: 18px; }
.viewer-osd-tr { top: 14px; right: 18px; text-align: right; }
.viewer-osd-bl { bottom: 14px; left: 18px; }
.viewer-osd-br { bottom: 14px; right: 18px; text-align: right; }

.viewer-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 60px;
    box-sizing: border-box;
    z-index: 20;
}

.viewer-slice-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.viewer-slider-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.viewer-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.viewer-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background-color: var(--brand-olive);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(63, 120, 89, 0.4);
    transition: transform 0.1s;
}

.viewer-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.viewer-counter {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    min-width: 130px;
    text-align: right;
}

/* ============================================================================
 * Visualizador 3D do Maxilar e Arcadas (WebGL Three.js)
 * ============================================================================ */
.viewer-mode-tabs {
    display: inline-flex;
    background-color: var(--border-color);
    padding: 3px;
    border-radius: var(--radius-sm);
    gap: 3px;
}

.viewer-mode-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.viewer-mode-btn:hover {
    color: var(--text-main);
}

.viewer-mode-btn.active {
    background-color: var(--card-bg);
    color: var(--brand-olive);
    box-shadow: var(--shadow-sm);
}

.viewer-3d-viewport {
    width: 100%;
    height: 100%;
    position: relative;
    background: radial-gradient(circle at center, #18221c 0%, #080b09 100%);
    display: none;
}

.viewer-3d-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.viewer-3d-canvas:active {
    cursor: grabbing;
}

#toolbar3D {
    display: none;
}

.viewer-tool-hint {
    color: #c2d4c9;
}

.viewer-3d-progress {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(14, 20, 16, 0.95);
    border: 1px solid #2d3e34;
    border-radius: var(--radius-md);
    padding: 24px 32px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    z-index: 50;
    min-width: 320px;
}

.viewer-3d-progress-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.viewer-3d-progress-sub {
    font-size: 0.8rem;
    color: #9cb3a4;
    margin-bottom: 14px;
}

.viewer-3d-bar-bg {
    width: 100%;
    height: 8px;
    background-color: #243028;
    border-radius: 4px;
    overflow: hidden;
}

.viewer-3d-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brand-olive), #52a377);
    transition: width 0.15s ease;
}

.viewer-3d-osd-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(12, 17, 14, 0.8);
    border: 1px solid #233029;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    color: #a8dfbc;
    line-height: 1.4;
    pointer-events: none;
}

/* Legenda Anatômica 3D */
.viewer-3d-legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(14, 20, 16, 0.88);
    border: 1px solid #233029;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.viewer-3d-legend-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9cb3a4;
    margin-bottom: 2px;
}

.viewer-3d-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: #e2e8f0;
}

.viewer-3d-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-teeth {
    background-color: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.dot-bone {
    background-color: #c89f72;
    box-shadow: 0 0 4px rgba(200, 159, 114, 0.6);
}

.dot-metal {
    background-color: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.8);
}

/* ============================================================================
 * MÓDULO DE GESTÃO DE TAREFAS - OLIVIUS CLEAN BOTANICAL
 * ============================================================================ */

/* Barra de Navegação - Botão Ativo e Sininho */
.btn-nav-active {
    background-color: var(--brand-olive) !important;
    color: #ffffff !important;
}

.notif-wrapper {
    position: relative;
    display: inline-block;
}

.btn-notif {
    background: transparent;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    position: relative;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
    outline: none;
}

.btn-notif:hover {
    background: rgba(63, 120, 89, 0.1);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #e53e3e;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    line-height: 17px;
    text-align: center;
    border-radius: 10px;
    padding: 0 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.notif-dropdown.active {
    display: block;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    color: var(--text-main);
}

.notif-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    display: block;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: background 0.15s ease;
}

.notif-item:hover {
    background: #f4f8f5;
}

.notif-item.unread {
    background: #eef7f1;
    border-left: 3px solid var(--brand-olive);
}

.notif-item-msg {
    font-size: 0.82rem;
    color: var(--text-main);
    line-height: 1.35;
    margin-bottom: 4px;
}

.notif-item-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.notif-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Cabeçalho do Gestor de Tarefas */
.tasks-container {
    max-width: 1240px;
    margin: 28px auto 60px;
    padding: 0 20px;
}

.tasks-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.tasks-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px;
}

.tasks-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin: 0;
}

.tasks-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 4 Cards de Métricas */
.tasks-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.task-metric-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.task-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-icon-wrap {
    font-size: 1.9rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.metric-pending .metric-icon-wrap { background: #fef3c7; }
.metric-upcoming .metric-icon-wrap { background: #e0f2fe; }
.metric-overdue .metric-icon-wrap { background: #fee2e2; }
.metric-completed .metric-icon-wrap { background: #dcfce7; }

.metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
}

.metric-overdue .metric-value {
    color: #b91c1c;
}

.metric-completed .metric-value {
    color: #15803d;
}

.metric-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
}

.metric-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Abas de Escopo */
.tasks-scope-nav {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.scope-tab {
    padding: 10px 18px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.92rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.scope-tab:hover {
    color: var(--brand-olive);
}

.scope-tab.active {
    color: var(--brand-olive);
    border-bottom-color: var(--brand-olive);
}

.tab-badge {
    background: #eef7f1;
    color: var(--brand-olive);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

/* Toolbar de Filtros e Alternador */
.tasks-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.tasks-filter-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex-grow: 1;
}

.tasks-search-input {
    min-width: 260px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    font-size: 0.86rem;
    color: var(--text-main);
    outline: none;
}

.tasks-view-toggle {
    display: flex;
    background: #eef4f0;
    padding: 3px;
    border-radius: var(--radius-sm);
    gap: 2px;
}

.toggle-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.toggle-btn.active {
    background: #ffffff;
    color: var(--brand-olive);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Tabela de Tarefas */
.tasks-table th {
    padding: 12px 14px;
}

.tasks-table td {
    padding: 12px 14px;
    vertical-align: middle;
}

.col-task-title { width: 34%; }
.col-task-users { width: 20%; }
.col-task-due { width: 16%; }
.col-task-priority { width: 10%; }
.col-task-status { width: 10%; }
.col-task-actions { width: 10%; text-align: right; }

.task-title-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-link-title {
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.94rem;
}

.task-link-title:hover {
    color: var(--brand-olive);
    text-decoration: underline;
}

.task-meta-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
}

.badge-category {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
}

.task-snippet {
    color: var(--text-muted);
}

.task-users-cell {
    font-size: 0.84rem;
    line-height: 1.35;
}

.task-creator-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.due-cell {
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.due-overdue {
    color: #b91c1c;
    font-weight: 600;
}

.badge-overdue {
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.row-overdue td {
    background-color: #fff9f9;
}

/* Badges de Prioridade */
.priority-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-block;
}

.priority-urgent { background: #fee2e2; color: #991b1b; }
.priority-high { background: #ffedd5; color: #9a3412; }
.priority-medium { background: #fef9c3; color: #854d0e; }
.priority-low { background: #f1f5f9; color: #475569; }

/* Badges de Status */
.status-badge {
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-block;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-in_progress { background: #e0f2fe; color: #075985; }
.status-completed { background: #dcfce7; color: #166534; }
.status-cancelled { background: #f1f5f9; color: #64748b; }

.task-actions-cell {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.btn-gcal-action {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    text-decoration: none;
    font-weight: 600;
}

.btn-gcal-action:hover {
    background: #dcfce7;
    color: #14532d;
}

/* Quadro Kanban */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    align-items: start;
}

.kanban-column {
    background: #f4f7f5;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    min-height: 480px;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-subtle);
}

.kanban-col-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.kanban-col-count {
    background: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-dim);
}

.kanban-cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-overdue {
    border-left: 4px solid #b91c1c;
}

.kanban-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    line-height: 1.35;
}

.kanban-card-title:hover {
    color: var(--brand-olive);
}

.kanban-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    color: var(--text-dim);
    margin-top: 4px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 8px;
}

.kanban-card-due {
    font-weight: 600;
}

.kanban-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}

.kanban-card-empty {
    padding: 30px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
}

/* Modais de Tarefas e Sistema (Totalmente Responsivos) */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(14, 20, 16, 0.65);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-backdrop.active {
    display: flex;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 580px;
    margin: auto 0;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    border: 1px solid #d5e2da;
    padding: 18px 24px;
    animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

@media (max-height: 850px) {
    .modal-backdrop {
        padding: 12px 10px;
    }
    .modal-card {
        max-height: calc(100vh - 24px);
        padding: 12px 18px;
    }
    .modal-card .form-group {
        margin-bottom: 8px;
    }
    .modal-card .form-control {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    .modal-card .form-label {
        font-size: 0.78rem;
        margin-bottom: 3px;
    }
    .modal-header {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }
    .modal-footer {
        padding-top: 8px;
        margin-top: 8px;
    }
}
    }
    .modal-footer {
        padding-top: 8px;
        margin-top: 10px;
    }
}

.modal-card-lg {
    max-width: 820px;
    max-height: 88vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.97) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e7efe9;
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: #f0f5f2;
    border: none;
    font-size: 0.92rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    text-decoration: none;
    outline: none;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #e2ede6;
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e7efe9;
    padding-top: 12px;
    margin-top: 14px;
}

.form-group {
    margin-bottom: 10px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 3px;
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .modal-card {
        padding: 16px;
        width: 100%;
        margin: 10px;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }
    .modal-footer button {
        width: 100%;
    }
}

.copy-input-group {
    display: flex;
    gap: 8px;
}

.calendar-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.sync-instructions {
    background: #f7faf8;
    border-left: 4px solid var(--brand-olive);
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.sync-instructions h4 {
    margin: 0 0 6px 0;
    color: var(--brand-olive);
    font-size: 0.9rem;
}

.sync-instructions ol {
    margin: 0;
    padding-left: 20px;
    font-size: 0.82rem;
    color: var(--text-main);
}

/* Detalhes e Linha do Tempo da Tarefa */
.task-detail-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-detail-title {
    font-size: 1.4rem;
    margin: 0 0 16px;
    color: var(--text-main);
}

.task-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    background: #f9fbf9;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 18px;
}

.task-detail-grid-item {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grid-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.task-detail-description {
    background: #ffffff;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.task-detail-description h4 {
    margin: 0 0 6px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.task-detail-description p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 20px 0;
}

.status-change-box {
    background: #f4f8f5;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid #d2e4d9;
}

.status-change-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.select-status {
    width: auto;
    font-weight: 600;
}

.input-note {
    flex-grow: 1;
}

/* Linha do Tempo */
.task-timeline-section h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    color: var(--text-main);
}

.timeline-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 16px;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.timeline-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #eef7f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    border: 1px solid #cde3d6;
}

.timeline-content {
    background: #fbfdfb;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    flex-grow: 1;
}

.timeline-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.timeline-meta strong {
    color: var(--text-main);
}

.timeline-note {
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.45;
}

.timeline-attachment {
    margin-top: 8px;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.82rem;
    transition: background 0.15s ease;
}

.attachment-link:hover {
    background: #eef7f1;
    border-color: var(--brand-olive);
}

.btn-download-att {
    color: var(--brand-olive);
    font-weight: 700;
}

.new-comment-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.new-comment-box h4 {
    margin: 0 0 10px;
    font-size: 0.92rem;
    color: var(--text-main);
}

/* Responsividade de Tarefas */
@media (max-width: 980px) {
    .tasks-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .kanban-board {
        grid-template-columns: 1fr;
    }
    .task-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .tasks-metrics-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .task-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Card de Resumo de Tarefas no Dashboard */
.dashboard-task-preview {
    display: flex;
    gap: 10px;
    margin: 14px 0 16px;
}

.task-preview-stat {
    flex: 1;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-pending { background: #fef3c7; border-color: #fde68a; }
.stat-overdue { background: #fee2e2; border-color: #fecaca; }
.stat-completed { background: #dcfce7; border-color: #bbf7d0; }

.stat-val {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-pending .stat-val { color: #92400e; }
.stat-overdue .stat-val { color: #991b1b; }
.stat-completed .stat-val { color: #166534; }

.stat-lbl {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-top: 2px;
}

.user-role-badge {
    font-size: 0.78rem;
    opacity: 0.85;
}

/* ============================================================================
 * APPLE WORKSPACE DASHBOARD & POST-ITS (OLIVIUS CLEAN BOTANICAL)
 * ============================================================================ */

.dashboard-body {
    background-color: #f6f8f6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.apple-topbar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(219, 230, 223, 0.8);
}

.apple-dashboard {
    max-width: 1180px;
    width: 100%;
    margin: 32px auto 60px;
    padding: 0 24px;
    flex: 1;
    box-sizing: border-box;
}

.apple-alert {
    margin-bottom: 24px;
}

/* Hero Minimalista */
.apple-hero {
    margin-bottom: 28px;
}

.apple-hero-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
    margin: 0 0 6px 0;
}

.apple-hero-date {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

/* Grade de Módulos (Cápsulas Estilo Apple) */
.apple-modules-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.apple-tile {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.apple-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(63, 120, 89, 0.08);
    border-color: #b7cebf;
}

.tile-icon-wrap {
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f0f6f2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    transition: transform 0.2s ease;
}

.apple-tile:hover .tile-icon-wrap {
    transform: scale(1.08);
}

.tile-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tile-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
}

.tile-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0 0 14px 0;
    flex-grow: 1;
}

.tile-status-pill {
    display: flex;
    align-items: center;
}

.pill-badge {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    display: inline-block;
}

.pill-success { background: #dcfce7; color: #166534; }
.pill-danger  { background: #fee2e2; color: #991b1b; }
.pill-warning { background: #fef3c7; color: #92400e; }
.pill-info    { background: #e0f2fe; color: #0369a1; }
.pill-olive   { background: #eef7f1; color: var(--brand-olive); }
.pill-muted   { background: #f1f5f9; color: #64748b; }

.tile-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.1rem;
    color: #cbdad0;
    transition: all 0.15s ease;
}

.apple-tile:hover .tile-arrow {
    color: var(--brand-olive);
    transform: translateX(3px);
}

/* Seção de Post-its / Anotações Rápidas */
.apple-notes-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 16px);
    padding: 28px 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.025);
}

.apple-notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.apple-notes-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
}

.apple-notes-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.btn-apple-add {
    background: var(--brand-olive);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(63, 120, 89, 0.25);
    outline: none;
}

.btn-apple-add:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(63, 120, 89, 0.35);
}

.btn-apple-add:active {
    transform: scale(0.98);
}

/* Grid de Post-its */
.apple-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.apple-notes-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    background: #fbfdfb;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-md);
}

.empty-stick-icon {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.apple-notes-empty h4 {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    color: var(--text-main);
}

.apple-notes-empty p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Card Individual de Post-it */
.apple-postit {
    border-radius: var(--radius-sm, 10px);
    padding: 16px 18px 14px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    position: relative;
    box-sizing: border-box;
}

.apple-postit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Cores Apple Stickies Pastéis */
.postit-yellow { background: #fef9c3; border-color: #fde047; }
.postit-green  { background: #dcfce7; border-color: #86efac; }
.postit-blue   { background: #e0f2fe; border-color: #7dd3fc; }
.postit-pink   { background: #fce7f3; border-color: #f472b6; }
.postit-purple { background: #f3e8ff; border-color: #d8b4fe; }
.postit-orange { background: #ffedd5; border-color: #fdba74; }

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

.postit-status-text {
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.45);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.postit-status-text.saving {
    color: #0369a1;
}

.postit-btn-delete {
    background: transparent;
    border: none;
    color: rgba(0, 0, 0, 0.35);
    font-size: 0.85rem;
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    outline: none;
}

.postit-btn-delete:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #991b1b;
}

.postit-textarea {
    flex-grow: 1;
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.92rem;
    color: #1f2937;
    line-height: 1.5;
    resize: none;
    outline: none;
    padding: 0;
    box-sizing: border-box;
    min-height: 80px;
    max-height: 140px;
    overflow-y: auto;
}

.postit-deleting {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.postit-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.postit-color-picker {
    display: flex;
    gap: 6px;
    align-items: center;
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
    outline: none;
}

.color-dot:hover {
    transform: scale(1.25);
}

.color-dot.active {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(0, 0, 0, 0.5);
    transform: scale(1.15);
}

.dot-yellow { background-color: #fef08a; }
.dot-green  { background-color: #bbf7d0; }
.dot-blue   { background-color: #bae6fd; }
.dot-pink   { background-color: #fbcfe8; }
.dot-purple { background-color: #e9d5ff; }
.dot-orange { background-color: #fed7aa; }

.postit-time {
    font-size: 0.68rem;
    color: rgba(0, 0, 0, 0.45);
}

.postit-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fbfdfb !important;
}

.postit-loading-text {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Rodapé Minimalista Estilo Apple */
.apple-footer {
    padding: 24px 20px 32px;
    display: flex;
    justify-content: center;
}

.apple-footer-capsule {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 8px 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-dim);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.footer-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-online  { background-color: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }
.dot-offline { background-color: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }

.footer-meta-sep {
    color: var(--border-color);
}

/* Responsividade Apple Dashboard */
@media (max-width: 1024px) {
    .apple-modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .apple-dashboard {
        margin: 20px auto 40px;
        padding: 0 16px;
    }
    .apple-hero-title {
        font-size: 1.65rem;
    }
    .apple-modules-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 28px;
    }
    .apple-notes-section {
        padding: 20px 16px;
    }
    .apple-notes-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn-apple-add {
        width: 100%;
        justify-content: center;
    }
    .apple-notes-grid {
        grid-template-columns: 1fr;
    }
    .apple-footer-capsule {
        flex-direction: column;
        border-radius: 12px;
        gap: 4px;
        text-align: center;
    }
    .footer-meta-sep {
        display: none;
    }
}

/* ============================================================================
 * Módulo de Alertas Globais do Sistema (Faixa Superior e Gestão)
 * ============================================================================ */

/* Faixa de Alertas Fixada no Topo (Global Broadcast Banner) */
.global-alerts-bar {
    width: 100%;
    display: flex;
    flex-direction: column;
    z-index: 850;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.global-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 28px;
    font-size: 0.9rem;
    line-height: 1.45;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-left: 5px solid transparent;
}

.global-alert-item.alert-type-info {
    background-color: #f1f8f3;
    border-left-color: var(--brand-olive);
    color: #1b452e;
}

.global-alert-item.alert-type-warning {
    background-color: #fffbeb;
    border-left-color: #d97706;
    color: #78350f;
}

.global-alert-item.alert-type-danger {
    background-color: #fef2f2;
    border-left-color: #dc2626;
    color: #991b1b;
}

.global-alert-content {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.global-alert-icon {
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
    align-self: center;
}

.global-alert-title {
    font-weight: 700;
    color: inherit;
    letter-spacing: -0.01em;
}

.global-alert-message {
    color: inherit;
    font-weight: 400;
    word-break: break-word;
}

.global-alert-meta {
    font-size: 0.78rem;
    opacity: 0.85;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

/* Gestão de Alertas (alerts.php) */
.alerts-page-container {
    max-width: 1200px;
    margin: 28px auto 60px;
    padding: 0 24px;
}

.alerts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.alerts-header-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin: 0 0 4px 0;
}

.alerts-header-text p {
    font-size: 0.92rem;
    color: var(--text-dim);
    margin: 0;
}

.alerts-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.alert-stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.alert-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: var(--brand-olive);
}

.alert-stat-card.active {
    border-color: var(--brand-olive);
    background: #fcfdfc;
    box-shadow: 0 2px 8px rgba(63, 120, 89, 0.12);
}

.alert-stat-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.alert-stat-info {
    display: flex;
    flex-direction: column;
}

.alert-stat-number {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.alert-stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
}

.alerts-table-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.alerts-table-header-bar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafcfa;
}

.alerts-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.alerts-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    background: transparent;
    transition: all 0.15s ease;
}

.alerts-tab-btn:hover {
    background: #eef2ee;
    color: var(--text-main);
}

.alerts-tab-btn.active {
    background: var(--brand-olive);
    color: #ffffff;
    font-weight: 600;
}

.alerts-tab-btn.active .tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.alerts-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.alerts-table th {
    background: #f7faf7;
    padding: 12px 18px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border-color);
}

.alerts-table td {
    padding: 14px 18px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

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

.alerts-table tr:hover td {
    background-color: #fafcfa;
}

/* Status e Severidade */
.alert-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-badge-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge-scheduled {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-badge-paused {
    background-color: #f3f4f6;
    color: #4b5563;
}

.status-badge-expired {
    background-color: #fef2f2;
    color: #991b1b;
}

.alert-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
}

.type-pill-info {
    background-color: #eef6f0;
    color: #1b452e;
}

.type-pill-warning {
    background-color: #fff9eb;
    color: #78350f;
}

.type-pill-danger {
    background-color: #fdf2f2;
    color: #991b1b;
}

.alert-actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.btn-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-action-icon:hover {
    background: #f4f7f4;
    color: var(--text-main);
    border-color: var(--brand-olive);
}

.btn-action-icon.btn-action-delete:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

.empty-alerts-state {
    padding: 48px 24px;
    text-align: center;
}

.empty-alerts-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
    opacity: 0.7;
}

.empty-alerts-text {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin: 0;
}

/* Responsividade de Alertas */
@media (max-width: 900px) {
    .alerts-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .global-alert-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 16px;
        gap: 6px;
    }
    .global-alert-meta {
        font-size: 0.74rem;
    }
    .alerts-page-container {
        padding: 0 16px;
        margin: 20px auto 40px;
    }
    .alerts-stats-grid {
        grid-template-columns: 1fr;
    }
    .alerts-header {
        flex-direction: column;
        align-items: stretch;
    }
    .alerts-header-actions {
        width: 100%;
    }
    .alerts-header-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }
    .alerts-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================================================
 * Novo Layout do Dashboard (Workspace 3-Colunas: Drawer, Post-its, Operações)
 * ============================================================================ */

/* Header Superior Oficial do Dashboard */
.dash-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 800;
}

.dash-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-main);
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-sidebar-toggle:hover {
    background: #f0f5f1;
    border-color: var(--brand-olive);
    color: var(--brand-olive);
}

.dash-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.dash-brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-olive);
    letter-spacing: -0.02em;
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Cápsula de Data e Hora em Tempo Real */
.dash-time-capsule {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f4f7f4;
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.84rem;
    color: var(--text-dim);
}

.dash-day-date {
    font-weight: 500;
}

.dash-time-sep {
    color: #cbd5e1;
    font-size: 0.8rem;
}

.dash-clock {
    font-weight: 700;
    color: var(--brand-olive);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* Pílula do Usuário Logado */
.dash-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 4px 12px 4px 6px;
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
}

.dash-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-olive);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dash-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.dash-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
}

.dash-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Layout Estrutural do Workspace */
.dash-workspace {
    display: flex;
    flex-direction: row;
    min-height: calc(100vh - 60px);
    position: relative;
    background: var(--bg-main);
    width: 100%;
}

/* Área de Conteúdo Principal (100% Fluida ao lado do Dock de 68px) */
.dash-main-content {
    flex: 1 1 0%;
    min-width: 0;
    width: calc(100% - 68px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden;
    background: var(--bg-main, #f8fafc);
}

/* Menu Lateral Autohide (Sidebar Drawer) */
.dash-sidebar-drawer {
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    width: 64px;
    transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 700;
    overflow-x: hidden;
    white-space: nowrap;
}

.dash-sidebar-drawer.expanded {
    width: 230px;
    box-shadow: 2px 0 14px rgba(0, 0, 0, 0.04);
}

.dash-nav-list {
    display: flex;
    flex-direction: column;
    padding: 14px 8px;
    gap: 4px;
    flex-grow: 1;
}

.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
}

.dash-nav-item:hover {
    background: #f0f5f1;
    color: var(--brand-olive);
}

.dash-nav-item.active {
    background: #eaf2ec;
    color: var(--brand-olive);
    font-weight: 600;
}

.dash-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.dash-nav-label {
    opacity: 0;
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.dash-sidebar-drawer.expanded .dash-nav-label {
    opacity: 1;
}

.dash-nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
}

/* Área Principal Dividida em Centro e Direita */
.dash-main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    padding: 24px;
    min-width: 0;
    box-sizing: border-box;
}

/* Coluna Central: Post-its e Anotações Pessoais */
.dash-center-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.dash-notes-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    min-height: 520px;
}

.dash-notes-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.dash-notes-title-group h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.015em;
    margin: 0 0 3px 0;
}

.dash-notes-title-group p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.dash-notes-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Grade Livre de Post-its */
.dash-postits-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
    align-items: start;
    flex-grow: 1;
}

/* Coluna Direita: Operações, Desempenho, Tarefas e Chat */
.dash-right-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/* Card Genérico de Widget */
.dash-widget-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.dash-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.dash-widget-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.dash-widget-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brand-olive);
    text-decoration: none;
}

.dash-widget-link:hover {
    text-decoration: underline;
}

/* Widget: Índice de Desempenho */
.perf-score-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.perf-score-circle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 4px solid var(--brand-olive);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.perf-score-number {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-olive);
}

.perf-score-meta {
    display: flex;
    flex-direction: column;
}

.perf-score-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
    width: fit-content;
}

.perf-excellent {
    background: #dcfce7;
    color: #166534;
}

.perf-good {
    background: #fef9c3;
    color: #854d0e;
}

.perf-warning {
    background: #fee2e2;
    color: #991b1b;
}

.perf-score-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.35;
    margin: 0;
}

.perf-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: #f8faf8;
    border-radius: 10px;
    padding: 8px 10px;
    text-align: center;
}

.perf-stat-item strong {
    display: block;
    font-size: 1.05rem;
    color: var(--text-main);
}

.perf-stat-item span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Widget: Tarefas do Dia e Vencidas */
.dash-task-section {
    margin-bottom: 10px;
}

.dash-task-section:last-child {
    margin-bottom: 0;
}

.dash-task-subtitle {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-task-subtitle.overdue {
    color: #dc2626;
}

.dash-task-subtitle.today {
    color: var(--brand-olive);
}

.dash-mini-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-mini-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fafcfa;
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: inherit;
    font-size: 0.82rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dash-mini-task-item:hover {
    background: #f0f7f2;
    border-color: var(--brand-olive);
}

.dash-mini-task-item.is-overdue {
    background: #fef2f2;
    border-color: #fecaca;
}

.dash-mini-task-title {
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.dash-mini-task-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.dash-empty-tasks-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 4px 0 0;
}

/* Widget: Chat entre Funcionários */
.dash-chat-container {
    display: flex;
    flex-direction: column;
    height: 320px;
}

.dash-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.dash-chat-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: auto;
}

.chat-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 82%;
}

.chat-bubble-wrap.is-me {
    align-self: flex-end;
}

.chat-bubble-wrap.is-other {
    align-self: flex-start;
}

.chat-bubble-sender {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 2px;
}

.chat-bubble-wrap.is-me .chat-bubble-sender {
    text-align: right;
    display: none;
}

.chat-bubble {
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.84rem;
    line-height: 1.35;
    word-break: break-word;
}

.chat-bubble-wrap.is-me .chat-bubble {
    background: var(--brand-olive);
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.chat-bubble-wrap.is-other .chat-bubble {
    background: #f1f5f2;
    color: var(--text-main);
    border-bottom-left-radius: 3px;
}

.chat-bubble-time {
    font-size: 0.65rem;
    opacity: 0.75;
    margin-top: 2px;
}

.chat-bubble-wrap.is-me .chat-bubble-time {
    text-align: right;
    color: var(--text-muted);
}

.chat-bubble-wrap.is-other .chat-bubble-time {
    color: var(--text-muted);
}

.dash-chat-form {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

.dash-chat-input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.84rem;
    outline: none;
    background: #ffffff;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.dash-chat-input:focus {
    border-color: var(--brand-olive);
}

.dash-chat-btn-send {
    background: var(--brand-olive);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dash-chat-btn-send:hover {
    background: var(--brand-olive-hover);
}

/* Responsividade Avançada */
@media (max-width: 1140px) {
    .dash-main-grid {
        grid-template-columns: 1fr;
    }
    .dash-right-column {
        order: 2;
    }
    .dash-center-column {
        order: 1;
    }
}

@media (max-width: 768px) {
    .dash-header {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 14px;
        gap: 10px;
    }
    .dash-header-left {
        justify-content: space-between;
    }
    .dash-header-right {
        justify-content: space-between;
    }
    .dash-time-capsule {
        padding: 4px 10px;
        font-size: 0.76rem;
    }
    .dash-main-grid {
        padding: 14px;
        gap: 16px;
    }
    .dash-sidebar-drawer {
        position: fixed;
        left: 0;
        top: 60px;
        bottom: 0;
        transform: translateX(-100%);
        width: 240px !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    .dash-sidebar-drawer.expanded {
        transform: translateX(0);
    }
    .dash-sidebar-drawer .dash-nav-label {
        opacity: 1 !important;
    }
    .dash-notes-panel {
        padding: 16px;
    }
    .dash-postits-board {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
 * Módulo Olivius CRM (Nativo PHP + MySQL: WhatsApp Inbox, Funil Kanban, IA)
 * ============================================================================ */

/* Barra de Navegação Interna do CRM */
.crm-subnav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.crm-subnav-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.15s ease;
}

.crm-subnav-btn:hover {
    background: #f0f5f1;
    color: var(--brand-olive);
}

.crm-subnav-btn.active {
    background: #eaf2ec;
    color: var(--brand-olive);
    font-weight: 700;
}

.crm-subnav-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1;
}

.crm-subnav-back {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.crm-subnav-back:hover {
    color: var(--brand-olive);
}

/* Container do CRM */
.crm-page-container {
    max-width: 1300px;
    margin: 20px auto 60px;
    padding: 0 24px;
    box-sizing: border-box;
}

/* Grade de Métricas do CRM */
.crm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.crm-stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.crm-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.crm-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
}

.crm-stat-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.crm-stat-val {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.crm-stat-meta {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--brand-olive);
    margin-top: 4px;
}

/* WhatsApp Inbox: Layout de 2 Colunas */
.crm-inbox-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    height: calc(100vh - 170px);
    min-height: 580px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.crm-inbox-sidebar {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.crm-inbox-search-box {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background: #fafcfa;
}

.crm-inbox-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.82rem;
    outline: none;
    background: #ffffff;
    box-sizing: border-box;
}

.crm-inbox-search-input:focus {
    border-color: var(--brand-olive);
}

.crm-inbox-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.crm-inbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
    cursor: pointer;
    background: #ffffff;
    border-left: 3px solid transparent;
}

.crm-inbox-item:hover {
    background: #fafcfa;
}

.crm-inbox-item.active {
    background: #eef5f0;
    border-left-color: var(--brand-olive);
}

.crm-inbox-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-olive);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
}

.crm-inbox-ai-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #059669;
    color: #ffffff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ffffff;
}

.crm-inbox-info {
    flex: 1;
    min-width: 0;
}

.crm-inbox-name-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.crm-inbox-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-inbox-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.crm-inbox-preview {
    font-size: 0.78rem;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

/* Área de Chat */
.crm-chat-area {
    display: flex;
    flex-direction: column;
    background: #fbfdfb;
    height: 100%;
}

.crm-chat-topbar {
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.crm-chat-contact-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crm-chat-contact-name {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-main);
}

.crm-chat-contact-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.crm-chat-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-ai-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: #ffffff;
    transition: all 0.15s ease;
}

.crm-ai-toggle-btn.ai-on {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

.crm-ai-toggle-btn.ai-off {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #64748b;
}

.crm-chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crm-chat-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.crm-chat-bubble-wrap.from-contact {
    align-self: flex-start;
}

.crm-chat-bubble-wrap.from-user,
.crm-chat-bubble-wrap.from-ai {
    align-self: flex-end;
}

.crm-bubble-sender {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 3px;
}

.crm-bubble-box {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.84rem;
    line-height: 1.45;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.from-contact .crm-bubble-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.from-user .crm-bubble-box {
    background: var(--brand-olive);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.from-ai .crm-bubble-box {
    background: #065f46;
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.crm-bubble-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.from-user .crm-bubble-time,
.from-ai .crm-bubble-time {
    text-align: right;
}

.crm-chat-input-bar {
    padding: 12px 18px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-chat-input-field {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.84rem;
    outline: none;
    font-family: inherit;
    background: #fafcfa;
}

.crm-chat-input-field:focus {
    border-color: var(--brand-olive);
    background: #ffffff;
}

.crm-btn-send {
    background: var(--brand-olive);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.crm-btn-send:hover {
    background: var(--brand-olive-hover);
}

/* Funil Kanban */
.crm-kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.crm-kanban-col {
    width: 290px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.crm-kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 8px;
}

.crm-kanban-col-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-kanban-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.crm-kanban-col-total {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.crm-kanban-cards-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.crm-deal-card {
    background: #f8faf8;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.15s ease;
}

.crm-deal-card:hover {
    background: #ffffff;
    border-color: var(--brand-olive);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.crm-deal-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.crm-deal-card-contact {
    font-size: 0.74rem;
    color: var(--text-dim);
}

.crm-deal-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.crm-deal-card-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-olive);
}

.crm-deal-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Responsividade do CRM */
@media (max-width: 960px) {
    .crm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .crm-inbox-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .crm-inbox-sidebar {
        max-height: 240px;
    }
}

/* Classes de Apoio do CRM (Zero Inline Styles) */
.crm-grid-2cols {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 960px) {
    .crm-grid-2cols {
        grid-template-columns: 1fr;
    }
}

.crm-table-preview-cell {
    display: block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-widget-body {
    padding: 10px 0;
}

.crm-widget-desc {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.crm-widget-info-box {
    background: #f4f7f4;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crm-widget-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crm-text-success {
    color: #059669;
    font-weight: 700;
}






/* ============================================================================
 * CRM Utilities, Canais WhatsApp & Multi-Tenant (Zero Inline Styles)
 * ============================================================================ */
.btn-block {
    width: 100%;
    display: block;
}

.crm-sim-result {
    display: none;
    margin-top: 14px;
}

.crm-sim-result.active {
    display: flex !important;
}

.crm-sim-output {
    margin: 4px 0 0;
    line-height: 1.45;
}

.crm-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.crm-status-pill.online {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.crm-status-pill.waiting {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.crm-status-pill.offline {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.crm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

.crm-status-pill.online .crm-status-dot {
    box-shadow: 0 0 0 2px rgba(22, 101, 52, 0.2);
    animation: crmPulse 2s infinite;
}

@keyframes crmPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.crm-qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 20px;
    background: #ffffff;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    text-align: center;
    margin: 16px 0;
}

.crm-qr-image {
    max-width: 220px;
    max-height: 220px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.crm-qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
}

.crm-qr-icon {
    font-size: 3rem;
}

.crm-webhook-box {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 6px;
}

.crm-webhook-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: #1e293b;
    outline: none;
}

.crm-btn-copy {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.crm-btn-copy:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.crm-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.crm-badge-env {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.crm-badge-env.active {
    background: #dbeafe;
    color: #1e40af;
}

.crm-badge-env.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* Multi-Canal e Instâncias WhatsApp */
.crm-instance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 18px;
}

.crm-instance-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.crm-instance-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.crm-instance-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.crm-instance-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.crm-instance-phone {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    font-family: ui-monospace, monospace;
    letter-spacing: -0.01em;
}

.crm-instance-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: #64748b;
}

.crm-badge-channel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.crm-badge-channel.vendas,
.crm-badge-channel-vendas {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.crm-badge-channel.financeiro,
.crm-badge-channel-financeiro {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.crm-badge-channel.recepcao,
.crm-badge-channel-recepcao {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.crm-badge-channel.suporte,
.crm-badge-channel-suporte {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.crm-badge-channel.geral,
.crm-badge-channel-geral {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.crm-channel-filter-wrap {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.crm-channel-filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.82rem;
    background: #ffffff;
    color: #1e293b;
    outline: none;
    font-weight: 600;
}

.crm-channel-filter-select:focus {
    border-color: #3f7859;
}

.crm-conv-item-channel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

/* Subitens e Seções do Menu Lateral Olivius */
.dash-nav-group-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 8px 12px 2px;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.dash-sidebar-drawer.expanded .dash-nav-group-title {
    opacity: 1;
}

.dash-nav-item.is-subitem {
    font-size: 0.82rem;
    padding: 8px 12px;
}

.dash-sidebar-drawer.expanded .dash-nav-item.is-subitem {
    padding-left: 24px;
}

.dash-nav-item.is-subitem .dash-nav-icon {
    font-size: 1.05rem;
    width: 20px;
}

/* Estilos dos Estágios Kanban sem inline styles */
.crm-kanban-col-stage-1 { border-top: 4px solid #3f7859; }
.crm-kanban-col-stage-2 { border-top: 4px solid #4d6958; }
.crm-kanban-col-stage-3 { border-top: 4px solid #777f4f; }
.crm-kanban-col-stage-4 { border-top: 4px solid #059669; }
.crm-kanban-col-stage-5 { border-top: 4px solid #166534; }
.crm-kanban-col-stage-6 { border-top: 4px solid #0284c7; }

/* ==========================================================================
   Estilos Padronizados para files.php (Layout Olivius 100% livre de inline styles)
   ========================================================================== */
.dicom-banner-card {
    background: #0f172a;
    border: 1px solid #0284c7;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 12px;
}
.dicom-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.dicom-banner-icon {
    font-size: 38px;
    line-height: 1;
}
.dicom-banner-info {
    display: flex;
    flex-direction: column;
}
.dicom-banner-title {
    color: #38bdf8;
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
}
.dicom-banner-desc {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.4;
}
.btn-dicom-viewer {
    background: #0284c7;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 18px;
    font-size: 14px;
    text-decoration: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
    transition: background 0.15s ease, transform 0.1s ease;
}
.btn-dicom-viewer:hover {
    background: #0369a1;
    color: #ffffff;
    transform: translateY(-1px);
}
.btn-dicom-action {
    background: #0284c7 !important;
    color: #ffffff !important;
    font-weight: 600;
}
.btn-dicom-action:hover {
    background: #0369a1 !important;
}
.file-item-hidden {
    display: none !important;
}
.lightbox-modal.is-open {
    display: flex !important;
}
.lightbox-loader.is-loading {
    display: flex !important;
}
.view-container.is-hidden {
    display: none !important;
}

/* ==========================================================================
   CARDS DE SELEÇÃO DINÂMICA DE FLUXO CLÍNICO & PAINEL DE INSERÇÃO (LAYOUT.MD)
   ========================================================================== */
.flow-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.flow-selection-card {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.flow-selection-card:hover {
    border-color: #0d9488;
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.12);
    transform: translateY(-2px);
}

.flow-selection-icon {
    font-size: 2rem;
    line-height: 1;
}

.flow-selection-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 4px 0;
}

.flow-selection-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.45;
    flex-grow: 1;
}

.journey-insert-panel {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.journey-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* ============================================================================
 * PERFORMA MÍNIMA & SIMULADOR DE CONTRATOS (layout.md - ZERO INLINE STYLES)
 * ============================================================================ */
.performa-banner-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.performa-banner-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.performa-banner-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: 2px;
}

.performa-banner-desc {
    font-size: 0.78rem;
    color: #15803d;
    line-height: 1.4;
}

.performa-caucao-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #fde68a;
}

.simulador-parcelas-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.simulador-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.simulador-header-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.simulador-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.simulador-table th {
    background: #e2e8f0;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
}

.simulador-table td {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    background: #ffffff;
}

.simulador-table tr:hover td {
    background: #f1f5f9;
}

.simulador-table td.text-right {
    text-align: right;
}

.simulador-table td.text-center {
    text-align: center;
}

.performa-progress-native {
    width: 100%;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    appearance: none;
    border: none;
    display: block;
    margin-top: 6px;
}
.performa-progress-native::-webkit-progress-bar {
    background-color: #e2e8f0;
    border-radius: 6px;
}
.performa-progress-native::-webkit-progress-value {
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 6px;
}
.performa-progress-native::-moz-progress-bar {
    background: #10b981;
    border-radius: 6px;
}

.input-action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-action-group .form-input {
    flex: 1;
}
.files-storage-badge-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.files-quick-action-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.15s ease;
    margin-bottom: 6px;
}
.files-quick-action-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #3f7859;
}

/* ==========================================================================
   Central de Configurações Unificada (settings.php)
   ========================================================================== */
.settings-nav-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
    padding: 0;
    border-bottom: none;
    overflow: visible;
}
.settings-tab-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #dbe4dd);
    border-radius: var(--radius-md, 12px);
    text-decoration: none;
    color: var(--text-dim, #4d6958);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(25, 46, 35, 0.05));
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    min-width: 0;
}
.settings-tab-link:hover {
    background: #ffffff;
    border-color: var(--brand-olive, #3f7859);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 16px -2px rgba(25, 46, 35, 0.06));
    color: var(--text-main, #192e23);
}
.settings-tab-link.active {
    background: linear-gradient(180deg, #ffffff 0%, #f6faf7 100%);
    border-color: var(--brand-olive, #3f7859);
    box-shadow: 0 4px 14px -2px rgba(63, 120, 89, 0.18), 0 2px 6px -1px rgba(63, 120, 89, 0.08);
    color: var(--brand-olive-active, #274d38);
}
.settings-tab-link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-olive, #3f7859) 0%, var(--brand-leaf, #777f4f) 100%);
    border-radius: var(--radius-md, 12px) var(--radius-md, 12px) 0 0;
}
.settings-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: var(--bg-main, #f4f7f4);
    border: 1px solid var(--border-subtle, #edf3ee);
    border-radius: 10px;
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.2s ease;
}
.settings-tab-link:hover .settings-tab-icon {
    background: var(--brand-leaf-soft, #eef2e6);
    border-color: rgba(63, 120, 89, 0.2);
    transform: scale(1.05);
}
.settings-tab-link.active .settings-tab-icon {
    background: var(--brand-leaf-soft, #eef2e6);
    border-color: rgba(63, 120, 89, 0.35);
    box-shadow: 0 2px 6px rgba(63, 120, 89, 0.12);
}
.settings-tab-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: left;
}
.settings-tab-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main, #192e23);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.settings-tab-link.active .settings-tab-title {
    color: var(--brand-olive-active, #274d38);
}
.settings-tab-desc {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted, #769181);
    line-height: 1.3;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.settings-tab-link.active .settings-tab-desc {
    color: var(--brand-olive, #3f7859);
}

@media (max-width: 1024px) {
    .settings-nav-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
@media (max-width: 580px) {
    .settings-nav-tabs {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .settings-tab-link {
        padding: 10px 12px;
    }
    .settings-tab-icon {
        width: 34px;
        height: 34px;
        font-size: 1.15rem;
    }
    .settings-tab-desc {
        display: none;
    }
}
.settings-tab-panel {
    display: none;
}
.settings-tab-panel.active {
    display: block;
}
.settings-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}
.settings-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 14px;
}
.settings-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.settings-card-desc {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 4px;
}
.settings-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.settings-form-row-full {
    margin-bottom: 16px;
}
.settings-status-box {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.settings-status-box.is-valid {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}
.settings-status-box.is-invalid {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.settings-btn-save {
    background: #3f7859;
    color: #ffffff;
    font-weight: 600;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
}
.settings-btn-save:hover {
    background: #315e45;
}
@media (max-width: 768px) {
    .settings-form-row {
        grid-template-columns: 1fr;
    }
}



/* ==========================================================================
   Monitor de Jornada de Trabalho & Prevenção de Hora Extra
   ========================================================================== */

/* Pílula flutuante de aviso (5 min antes do fim) */
.schedule-warning-pill {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 10px 18px;
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(180, 83, 9, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: schedulePillPulse 2s infinite ease-in-out;
}

@keyframes schedulePillPulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Modal de tolerância final (Horário limite atingido) */
.schedule-grace-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.schedule-grace-box {
    background: #ffffff;
    max-width: 520px;
    width: 100%;
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid #fecaca;
    text-align: center;
}

.schedule-grace-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}

.schedule-grace-icon {
    font-size: 2rem;
}

.schedule-grace-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #991b1b;
    font-weight: 700;
}

.schedule-grace-desc {
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.55;
    margin-bottom: 20px;
}

.schedule-countdown-wrapper {
    background: #fef2f2;
    border: 1px dashed #f87171;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 22px;
}

.schedule-countdown-label {
    display: block;
    font-size: 0.8rem;
    color: #7f1d1d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.schedule-countdown-clock {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 2.2rem;
    font-weight: 800;
    color: #dc2626;
    letter-spacing: 0.04em;
}

.schedule-grace-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Tabela e Modal de Gestão de Jornada em users.php */
.schedule-presets-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    align-items: center;
}

.schedule-presets-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dim);
}

.schedule-preset-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.schedule-preset-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}

.schedule-week-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.schedule-week-table th {
    background: #f8fafc;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.schedule-week-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    vertical-align: middle;
}

.schedule-week-table tr:last-child td {
    border-bottom: none;
}

.schedule-time-input {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #0f172a;
    width: 95px;
}

.schedule-time-input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Modal de Edição de Horários do Usuário */
.schedule-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.schedule-modal-overlay.active {
    display: flex;
}

.schedule-modal-box {
    background: #ffffff;
    max-width: 640px;
    width: 100%;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    max-height: 90vh;
    overflow-y: auto;
}

.schedule-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.schedule-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-color);
}

.schedule-modal-close {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #64748b;
    padding: 0 6px;
}

.schedule-modal-close:hover {
    color: #0f172a;
}

.schedule-badge-status {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 600;
}
.schedule-badge-open {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.schedule-badge-closed {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.schedule-badge-admin {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}


/* ==========================================================================
   WEBMAIL CORPORATIVO SOBERANO (IMAP ZERO-FOOTPRINT & SMTP)
   ========================================================================== */

.mail-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    margin-top: 15px;
}

@media (max-width: 992px) {
    .mail-layout {
        grid-template-columns: 1fr;
    }
}

.mail-sidebar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mail-account-badge {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mail-account-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.mail-account-address {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    word-break: break-all;
}

.mail-account-host {
    font-size: 0.75rem;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mail-compose-trigger {
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, transform 0.1s ease;
    width: 100%;
}

.mail-compose-trigger:hover {
    background: #0369a1;
}

.mail-folders-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mail-folder-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 0.86rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.mail-folder-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.mail-folder-btn.active {
    background: #e0f2fe;
    color: #0284c7;
    font-weight: 600;
}

.mail-folder-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mail-folder-count {
    background: #e2e8f0;
    color: #475569;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mail-folder-btn.active .mail-folder-count {
    background: #0284c7;
    color: #ffffff;
}

.mail-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    min-height: 600px;
    overflow: hidden;
}

.mail-toolbar {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #fafafa;
}

.mail-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mail-tool-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.mail-tool-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.mail-tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mail-search-input {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    width: 220px;
    outline: none;
}

.mail-search-input:focus {
    border-color: #0284c7;
}

.mail-table-wrap {
    flex: 1;
    overflow-y: auto;
}

.mail-table {
    width: 100%;
    border-collapse: collapse;
}

.mail-row {
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mail-row:hover {
    background: #f8fafc;
}

.mail-row.unread {
    background: #f0fdf4;
    font-weight: 600;
}

.mail-row.unread .mail-subject {
    color: #0f172a;
}

.mail-row.active {
    background: #e0f2fe;
}

.mail-cell {
    padding: 12px 14px;
    font-size: 0.85rem;
    color: #334155;
    vertical-align: middle;
}

.mail-cell-dot {
    width: 28px;
    text-align: center;
    padding-right: 0;
}

.mail-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0284c7;
}

.mail-cell-from {
    width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0f172a;
}

.mail-cell-subject {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-subject {
    color: #1e293b;
}

.mail-snippet {
    color: #64748b;
    font-weight: 400;
}

.mail-cell-date {
    width: 140px;
    text-align: right;
    white-space: nowrap;
    color: #64748b;
    font-size: 0.78rem;
}

.mail-cell-att {
    width: 32px;
    text-align: center;
}

.mail-empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
}

.mail-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.mail-reader-wrap {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.mail-reader-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 14px;
}

.mail-reader-subject {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.mail-reader-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}

.mail-reader-sender {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mail-sender-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.mail-sender-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.9rem;
}

.mail-sender-email {
    color: #64748b;
    font-size: 0.78rem;
}

.mail-reader-date {
    font-size: 0.8rem;
    color: #64748b;
}

.mail-attachments-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 8px;
}

.mail-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: #0f172a;
    text-decoration: none;
    transition: all 0.15s ease;
}

.mail-attachment-chip:hover {
    border-color: #0284c7;
    color: #0284c7;
    background: #f0f9ff;
}

.mail-iframe-container {
    flex: 1;
    min-height: 400px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.mail-body-iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
}

/* Modal do Compositor */
.mail-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.mail-modal-overlay.open {
    display: flex;
}

.mail-modal-card {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mail-modal-header {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mail-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.mail-modal-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #64748b;
}

.mail-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
}

.mail-field-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.mail-field-label {
    width: 80px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.mail-field-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.88rem;
    color: #0f172a;
}

.mail-textarea-body {
    width: 100%;
    min-height: 200px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    outline: none;
    resize: vertical;
}

.mail-textarea-body:focus {
    border-color: #0284c7;
}

.mail-modal-footer {
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mail-btn-send {
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 9px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
}

.mail-btn-send:hover {
    background: #0369a1;
}

.mail-btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mail-setup-box {
    max-width: 500px;
    margin: 40px auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    text-align: center;
}

.mail-setup-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.mail-setup-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.mail-setup-desc {
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}


/* ==========================================================================
   RECIBO SAÚDE (PESSOA FÍSICA & DEDUÇÃO IRPF) & CARNÊ-LEÃO
   ========================================================================== */

.receipt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.receipt-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.receipt-kpi-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.receipt-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

.receipt-kpi-value.green {
    color: #059669;
}

.receipt-kpi-sub {
    font-size: 0.78rem;
    color: #64748b;
}

.receipt-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 30px;
}

.receipt-table-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #fafafa;
}

.receipt-table-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.receipt-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 600;
}

.receipt-status-active {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.receipt-status-cancelled {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Folha A4 Oficial do Recibo Saúde */
.receipt-a4-sheet {
    max-width: 800px;
    margin: 20px auto 40px auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    padding: 48px 56px;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

.receipt-a4-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.receipt-a4-prof-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    margin: 0 0 4px 0;
}

.receipt-a4-prof-meta {
    font-size: 0.88rem;
    color: #334155;
    font-weight: 600;
}

.receipt-a4-prof-addr {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
}

.receipt-a4-badge-num {
    text-align: right;
}

.receipt-a4-num-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    display: block;
}

.receipt-a4-num-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.receipt-a4-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 24px 0 8px 0;
    color: #0f172a;
}

.receipt-a4-law-badge {
    text-align: center;
    font-size: 0.75rem;
    color: #475569;
    font-weight: 500;
    margin-bottom: 30px;
}

.receipt-a4-amount-box {
    background: #f8fafc;
    border: 2px dashed #94a3b8;
    border-radius: 8px;
    padding: 16px 20px;
    text-align: center;
    margin-bottom: 28px;
}

.receipt-a4-amount-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: #047857;
}

.receipt-a4-amount-words {
    font-size: 0.88rem;
    color: #334155;
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
}

.receipt-a4-body-text {
    font-size: 1rem;
    text-align: justify;
    line-height: 1.8;
    margin-bottom: 32px;
    color: #1e293b;
}

.receipt-a4-signature-box {
    margin-top: 50px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;
}

.receipt-a4-city-date {
    font-size: 0.92rem;
    color: #1e293b;
    font-weight: 500;
}

.receipt-a4-sig-line-wrap {
    text-align: center;
    width: 280px;
}

.receipt-a4-sig-line {
    border-top: 1px solid #0f172a;
    padding-top: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.receipt-a4-sig-sub {
    font-size: 0.78rem;
    color: #475569;
}

.receipt-a4-footer-audit {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #64748b;
}

/* Barra de Ações do Recibo */
.receipt-action-bar {
    max-width: 800px;
    margin: 20px auto 10px auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* Regras de Impressão */
@media print {
    body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .dash-header,
    .dash-sidebar-drawer,
    .dash-right-column,
    .apple-footer,
    .receipt-action-bar,
    .breadcrumb,
    .banner-alert {
        display: none !important;
    }
    .dash-workspace,
    .dash-main-content {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }
    .receipt-a4-sheet {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 20mm !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}


/* ============================================================================
 * MÓDULO: ESTOQUE & SUPRIMENTOS (PADRÃO ALLES V5) & JORNADA CLÍNICA ODONTOLÓGICA
 * Sem Estilos Inline — Clean Botanical & Healthcare
 * ============================================================================ */

/* Navegação e Seções da Sidebar */
.dash-nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 14px 16px 4px 16px;
    user-select: none;
}

/* Grids e Layouts */
.clinical-grid-kpis,
.inventory-grid-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.clinical-kpi-card,
.inventory-kpi-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clinical-kpi-card:hover,
.inventory-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.kpi-icon-olive {
    background-color: var(--brand-leaf-soft);
    color: var(--brand-olive);
}

.kpi-icon-danger {
    background-color: #fee2e2;
    color: var(--danger);
}

.kpi-icon-warning {
    background-color: #fef3c7;
    color: #b45309;
}

.kpi-icon-blue {
    background-color: #e0f2fe;
    color: #0369a1;
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-number {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Barra de Ações & Filtros */
.actions-bar-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.actions-bar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.actions-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-input-wrapper {
    position: relative;
    min-width: 260px;
    flex: 1;
    max-width: 420px;
}

.search-input-field {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-main);
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input-field:focus {
    border-color: var(--brand-olive);
}

.search-input-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.select-filter-field {
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-main);
    background-color: #ffffff;
    outline: none;
    cursor: pointer;
}

.select-filter-field:focus {
    border-color: var(--brand-olive);
}

/* Tabelas Padronizadas */
.table-responsive-box {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 30px;
}

.data-table-custom {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.data-table-custom thead {
    background-color: #fafbfa;
    border-bottom: 1px solid var(--border-color);
}

.data-table-custom th {
    padding: 12px 16px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.data-table-custom td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    vertical-align: middle;
}

.data-table-custom tbody tr:hover {
    background-color: var(--card-hover);
}

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

/* Badges e Status */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
}

.status-pill-ok {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.status-pill-low,
.status-pill-warning {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.status-pill-danger {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.status-pill-blue {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.status-pill-muted {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Stepper da Linha do Cuidado Odontológico */
.stepper-timeline-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.stepper-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.stepper-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stepper-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.stepper-subtitle {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.stepper-steps-track {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    overflow-x: auto;
    padding: 10px 0 20px 0;
}

.stepper-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 140px;
    position: relative;
    padding: 0 10px;
}

.stepper-step-item::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 3px;
    background-color: var(--border-color);
    z-index: 1;
}

.stepper-step-item:last-child::after {
    display: none;
}

.stepper-step-item.is-completed::after {
    background-color: var(--brand-olive);
}

.stepper-node-bubble {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    background-color: #ffffff;
    border: 3px solid var(--border-color);
    color: var(--text-muted);
    position: relative;
    z-index: 2;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.stepper-step-item.is-active .stepper-node-bubble {
    border-color: var(--brand-olive);
    background-color: var(--brand-olive);
    color: #ffffff;
    box-shadow: 0 0 0 4px var(--brand-leaf-soft);
}

.stepper-step-item.is-completed .stepper-node-bubble {
    border-color: var(--brand-olive);
    background-color: var(--brand-olive);
    color: #ffffff;
}

.stepper-step-item.is-blocked .stepper-node-bubble {
    border-color: var(--danger);
    background-color: #fef2f2;
    color: var(--danger);
    box-shadow: 0 0 0 4px #fee2e2;
}

.stepper-step-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.stepper-step-sublabel {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* Hard Gate Alert Box (Risco Cirúrgico Travado) */
.hard-gate-box-alert {
    background-color: #fff1f2;
    border: 2px solid #fecdd3;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.hard-gate-icon-large {
    font-size: 2.2rem;
    line-height: 1;
    color: #e11d48;
    flex-shrink: 0;
}

.hard-gate-content {
    flex: 1;
}

.hard-gate-headline {
    font-size: 1.05rem;
    font-weight: 700;
    color: #9f1239;
    margin-bottom: 4px;
}

.hard-gate-paragraph {
    font-size: 0.88rem;
    color: #be123c;
    margin-bottom: 12px;
    line-height: 1.4;
}

.hard-gate-pendencies-list {
    background-color: #ffffff;
    border: 1px solid #fecdd3;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 14px;
}

.hard-gate-pendency-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed #ffe4e6;
    font-size: 0.85rem;
    color: #881337;
}

.hard-gate-pendency-item:last-child {
    border-bottom: none;
}

.hard-gate-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Modais Padronizados */
.clinical-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.clinical-modal-overlay.open {
    visibility: visible;
    opacity: 1;
}

.clinical-modal-card {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease;
}

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

.clinical-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #fafbfa;
}

.clinical-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.clinical-modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.clinical-modal-close:hover {
    color: var(--danger);
}

.clinical-modal-body {
    padding: 24px;
    overflow-y: auto;
    font-size: 0.9rem;
    color: var(--text-main);
}

.clinical-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: #fafbfa;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Formulários em Grid */
.form-grid-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-group-col-12 { grid-column: span 12; }
.form-group-col-8  { grid-column: span 8; }
.form-group-col-6  { grid-column: span 6; }
.form-group-col-4  { grid-column: span 4; }
.form-group-col-3  { grid-column: span 3; }

.form-field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.form-field-input,
.form-field-select,
.form-field-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-main);
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-field-input:focus,
.form-field-select:focus,
.form-field-textarea:focus {
    border-color: var(--brand-olive);
}

.form-field-textarea {
    resize: vertical;
    min-height: 75px;
}

/* Dropzone de NF-e XML */
.xml-dropzone-box {
    border: 2px dashed var(--brand-olive);
    background-color: var(--brand-leaf-soft);
    border-radius: var(--radius-md);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 24px;
    position: relative;
}

.xml-dropzone-box:hover,
.xml-dropzone-box.dragover {
    background-color: #e5ede3;
    border-color: var(--brand-olive-hover);
}

.xml-dropzone-icon {
    font-size: 2.8rem;
    color: var(--brand-olive);
    margin-bottom: 12px;
}

.xml-dropzone-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.xml-dropzone-hint {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.xml-hidden-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Botões Padronizados Sem Inline */
.btn-action-primary {
    background-color: var(--brand-olive);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.btn-action-primary:hover {
    background-color: var(--brand-olive-hover);
}

.btn-action-secondary {
    background-color: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.btn-action-secondary:hover {
    background-color: #f8fafc;
}

.btn-action-danger {
    background-color: var(--danger);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.btn-action-danger:hover {
    background-color: var(--danger-hover);
}

.btn-action-warning {
    background-color: #d97706;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.btn-action-warning:hover {
    background-color: #b45309;
}

.btn-action-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}


/* Utilitários Sem Inline */
.display-none { display: none !important; }
.display-block { display: block !important; }
.display-flex { display: flex !important; }
.display-grid { display: grid !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.empty-state-cell {
    text-align: center;
    padding: 36px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}


/* ==========================================================
   CONSTRUTOR DE LINHAS DE CUIDADO (clinical_workflows.php)
   ZERO INLINE STYLES
   ========================================================== */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #334155;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.chip:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.chip-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.chip-active:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.workflow-steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

.workflow-step-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.workflow-step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.workflow-step-title-box {
    display: flex;
    align-items: center;
    gap: 16px;
}

.workflow-step-order {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50%;
}

.workflow-step-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.workflow-step-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 2px;
}

.workflow-step-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.workflow-step-body {
    padding: 16px 20px;
    background: #ffffff;
}

.req-title-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    margin-bottom: 12px;
}

.req-items-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.req-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 6px;
    gap: 12px;
}

.req-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.req-item-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.req-item-type {
    font-size: 0.8rem;
    color: #64748b;
}

.btn-link-danger {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.btn-link-danger:hover {
    background: #fee2e2;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
}


/* ==========================================================
   PARTICIPANTES E ENVOLVIDOS NA TAREFA (tasks.php)
   ZERO INLINE STYLES
   ========================================================== */
.task-participants-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.participant-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.participant-option-label:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.participant-option-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.participant-name-tag {
    font-weight: 600;
    color: #1e293b;
}

.participant-email-tag {
    color: #64748b;
    font-size: 0.78rem;
}

.task-form-helper {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 6px;
}

.task-participants-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.participant-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}


/* ==========================================================
   CUSTOM MULTI-SELECT DROPDOWN COM MARCAÇÃO (tasks.php)
   ZERO INLINE STYLES
   ========================================================== */
.custom-multiselect-container {
    position: relative;
    width: 100%;
}

.custom-multiselect-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 6px 12px;
    background-color: #ffffff;
    border: 1.5px solid #cbdad0;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.custom-multiselect-trigger:hover {
    border-color: #3f7859;
}

.custom-multiselect-container.is-active .custom-multiselect-trigger {
    border-color: #3f7859;
    box-shadow: 0 0 0 3px rgba(63, 120, 89, 0.18);
}

.custom-multiselect-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    flex: 1;
}

.custom-multiselect-tags .placeholder-text {
    color: #64748b;
    font-size: 0.88rem;
    user-select: none;
}

.selected-user-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef7f1;
    color: #235439;
    border: 1px solid #c2e2ce;
    border-radius: 14px;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.selected-user-tag .tag-remove-btn {
    background: none;
    border: none;
    color: #235439;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.selected-user-tag .tag-remove-btn:hover {
    color: #dc2626;
}

.custom-multiselect-arrow {
    font-size: 0.75rem;
    color: #64748b;
    transition: transform 0.2s ease;
    user-select: none;
}

.custom-multiselect-container.is-active .custom-multiselect-arrow {
    transform: rotate(180deg);
}

.custom-multiselect-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbdad0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow: hidden;
}

.custom-multiselect-container.is-active .custom-multiselect-dropdown {
    display: block;
}

.custom-multiselect-search {
    padding: 8px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.custom-multiselect-search input {
    height: 36px;
    font-size: 0.85rem;
}

.custom-multiselect-options {
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
}

.custom-multiselect-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.86rem;
    transition: background 0.15s ease;
    user-select: none;
}

.custom-multiselect-item:hover {
    background: #f1f5f9;
}

.custom-multiselect-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3f7859;
    cursor: pointer;
}

.custom-multiselect-item .item-name {
    font-weight: 600;
    color: #1e293b;
}

.custom-multiselect-item .item-email {
    color: #64748b;
    font-size: 0.78rem;
}


/* ==========================================================
   CONSTRUTOR DE FLUXOS NO PADRÃO OFICIAL OLIVIUS
   ZERO INLINE STYLES
   ========================================================== */
.clinical-container {
    width: 100%;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 24px 28px;
    box-sizing: border-box;
    flex: 1;
}

.clinical-box-card {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    overflow: hidden;
}

.clinical-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fbfdfb;
    border-bottom: 1px solid #edf2f7;
    flex-wrap: wrap;
    gap: 12px;
}

.clinical-box-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.clinical-box-subtitle {
    font-size: 0.84rem;
    color: #64748b;
    margin-top: 2px;
}

.badge-status-danger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-status-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-sla {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-gate-hard {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
}

.badge-gate-warn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
}

.badge-gate-soft {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
}

.req-empty-note {
    font-size: 0.85rem;
    color: #64748b;
    padding: 6px 0;
}

.req-item-desc {
    font-size: 0.8rem;
    color: #64748b;
}

.etapa-target-hint {
    display: inline-block;
    padding: 6px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #166534;
}

.checkbox-option-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.checkbox-option-box:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.checkbox-option-box input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3f7859;
    cursor: pointer;
}


/* ==========================================================
   MENU SECCIONAL, GESTOR AI, AGENDA, PERMISSÕES E TREINAMENTO
   PADRÃO OFICIAL OLIVIUS & ALLES MED - ZERO INLINE STYLES
   ========================================================== */

/* 1. SEÇÕES E ESTILO DO MENU LATERAL MODERNO COM ACCORDION DESDOBRÁVEL */
.dash-nav-section {
    display: flex;
    flex-direction: column;
}

.dash-nav-section-title {
    padding: 14px 16px 6px 16px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    margin-top: 6px;
    user-select: none;
}

.dash-nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px 6px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    margin-top: 4px;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s ease, background 0.15s ease;
    user-select: none;
    border-radius: 6px;
}

.dash-nav-section-header:hover {
    color: #0f172a;
    background: rgba(241, 245, 249, 0.6);
}

.dash-nav-section-title-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-nav-section-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: #94a3b8;
}

.dash-nav-section-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Quando sidebar estiver recolhida (ícones 64px) */
.dash-sidebar-drawer:not(.expanded) .dash-nav-section-header,
.dash-sidebar-drawer:not(.expanded) .dash-nav-section-title {
    display: none !important;
}

/* Quando expandida com accordion fechado */
.dash-sidebar-drawer.expanded .dash-nav-section:not(.open) .dash-nav-section-items {
    display: none;
}

.dash-sidebar-drawer.expanded .dash-nav-section:not(.open) .dash-nav-section-arrow {
    transform: rotate(-90deg);
}

.dash-nav-section-title:first-child,
.dash-nav-section:first-child .dash-nav-section-header {
    border-top: none;
    margin-top: 0;
}

/* 2. BOTÃO E DRAWER DO GESTOR AI */
.btn-ai-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #38bdf8;
    border: 1px solid #334155;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-ai-toggle:hover {
    background: linear-gradient(135deg, #0f172a, #0284c7);
    color: #ffffff;
    border-color: #38bdf8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.ai-drawer {
    position: fixed;
    top: 0;
    right: -460px;
    width: 440px;
    max-width: 90vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-drawer.active {
    right: 0;
}

.ai-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    border-bottom: 1px solid #334155;
}

.ai-drawer-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-brain-icon {
    font-size: 1.6rem;
}

.ai-drawer-title h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.ai-drawer-title small {
    display: block;
    font-size: 0.76rem;
    color: #94a3b8;
}

.ai-drawer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-refresh-ai {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-refresh-ai:hover {
    background: rgba(255, 255, 255, 0.22);
}

.ai-drawer-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s ease;
}

.ai-drawer-close:hover {
    color: #ffffff;
}

.ai-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
}

.ai-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.ai-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
}

.ai-kpi-val {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

.ai-kpi-lbl {
    font-size: 0.76rem;
    color: #64748b;
    margin-top: 2px;
}

.ai-insights-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-insights-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #334155;
    margin: 0 0 4px 0;
}

.ai-insight-box {
    background: #ffffff;
    border-radius: 8px;
    padding: 14px 16px;
    border-left: 4px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ai-insight-box.box-alerta {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.ai-insight-box.box-critico {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.ai-insight-box.box-sucesso {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.ai-insight-box.box-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.ai-box-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.ai-box-text {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.45;
    margin: 0;
}

/* 3. AGENDA CLÍNICA (saagendamentos) */
.agenda-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.agenda-date-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agenda-current-date-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.agenda-grid-container {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.agenda-table {
    width: 100%;
    border-collapse: collapse;
}

.agenda-table th {
    background: #f8fafc;
    padding: 12px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.agenda-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.86rem;
    color: #1e293b;
}

.agenda-table tr:hover {
    background: #f8fafc;
}

.badge-status-agendado {
    display: inline-flex;
    padding: 3px 8px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-status-confirmado {
    display: inline-flex;
    padding: 3px 8px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-status-sala_espera {
    display: inline-flex;
    padding: 3px 8px;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-status-em_atendimento {
    display: inline-flex;
    padding: 3px 8px;
    background: #faf5ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-status-atendido {
    display: inline-flex;
    padding: 3px 8px;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-status-faltou {
    display: inline-flex;
    padding: 3px 8px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 4. MATRIZ VISUAL DE PERMISSÕES GRANULARES (sgusuario_permissao) */
.permissions-matrix-box {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.permissions-matrix-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-matrix-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    text-align: center;
}

.permissions-matrix-table th.col-module {
    text-align: left;
}

.permissions-matrix-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    font-size: 0.86rem;
}

.permissions-matrix-table td.col-module {
    text-align: left;
    font-weight: 600;
    color: #0f172a;
}

.perm-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #3f7859;
    cursor: pointer;
}

/* 5. TRILHAS DE TREINAMENTO & DOSSIÊ DE DOCUMENTOS */
.trainings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.training-card {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.training-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.training-card-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 12px;
}

.training-card-desc {
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.45;
    margin-bottom: 16px;
}

.training-progress-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.training-progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.training-progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background-color: #e2e8f0;
    margin-bottom: 12px;
}

.training-progress-bar::-webkit-progress-bar {
    background-color: #e2e8f0;
    border-radius: 4px;
}

.training-progress-bar::-webkit-progress-value {
    background-color: #10b981;
    border-radius: 4px;
}

.training-progress-bar::-moz-progress-bar {
    background-color: #10b981;
    border-radius: 4px;
}

.doc-status-pendente {
    display: inline-flex;
    padding: 3px 8px;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.doc-status-aprovado {
    display: inline-flex;
    padding: 3px 8px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.doc-status-rejeitado {
    display: inline-flex;
    padding: 3px 8px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.doc-status-vencido {
    display: inline-flex;
    padding: 3px 8px;
    background: #fdf2f8;
    color: #9d174d;
    border: 1px solid #fbcfe8;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================================================
   ESTILOS ESPECÍFICOS: PACIENTES, PROCEDIMENTOS, PERMISSÕES E TREINAMENTO
   ZERO INLINE STYLES - 100% CLASSES CSS
   ============================================================================ */

/* Abas de Navegação (Tabs) */
.nav-tabs-clean {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.nav-tab-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.nav-tab-item:hover {
    color: #0f172a;
}

.nav-tab-item.active {
    color: #0d9488;
    border-bottom-color: #0d9488;
}

/* Tabela de Dados e Cards */
.data-table-card {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.data-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.data-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

/* Badges e Pílulas */
.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-pill-teal {
    background: #ccfbf1;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.badge-pill-blue {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-pill-amber {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-pill-purple {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.badge-pill-emerald {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge-pill-rose {
    background: #ffe4e6;
    color: #be123c;
    border: 1px solid #fecdd3;
}

/* Pacientes: Alertas de Saúde */
.patient-tag-alert {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.patient-contact-sub {
    font-size: 0.78rem;
    color: #64748b;
    display: block;
}

/* Grupos de Ações Rápidas */
.table-actions-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-icon-action:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-icon-action-primary:hover {
    background: #0d9488;
    color: #ffffff;
    border-color: #0d9488;
}

.btn-icon-action-danger:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* Formulários em Grid e Modais */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 14px;
}

@media (max-width: 768px) {
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }
}

.form-section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #64748b;
    margin: 16px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px dashed #cbd5e1;
}

/* Composição de Procedimentos (BOM) */
.composition-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    margin-top: 14px;
}

.composition-add-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.composition-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.composition-items-table th {
    background: #e2e8f0;
    padding: 8px 10px;
    text-align: left;
    color: #334155;
}

.composition-items-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

/* Perfis e Permissões Granulares */
.profile-pill-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.profile-pill-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.profile-pill-item:has(input:checked) {
    background: #ccfbf1;
    border-color: #14b8a6;
    color: #0f766e;
    font-weight: 600;
}

.permissions-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 12px;
}

.permissions-matrix-table td.col-checkbox {
    text-align: center;
}

/* Treinamentos: Lista de Aulas e Dossiê */
.lesson-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s ease;
}

.lesson-list-item:hover {
    background: #f8fafc;
}

.lesson-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lesson-title {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.9rem;
}

.lesson-sub {
    font-size: 0.78rem;
    color: #64748b;
}

.training-video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000000;
    margin-bottom: 16px;
}

.training-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============================================================================
   ODONTOGRAMA INTERATIVO, PRONTUÁRIO CLÍNICO & GRAVAÇÃO DE VOZ
   ZERO INLINE STYLES - 100% CLASSES CSS
   ============================================================================ */

/* Container Geral da Consulta Clínica */
.consultation-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

@media (max-width: 1100px) {
    .consultation-layout {
        grid-template-columns: 1fr;
    }
}

.patient-clinical-banner {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}

.patient-clinical-info h2 {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
    color: #065f46;
    font-weight: 700;
}

.patient-clinical-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: #166534;
}

/* 1. Odontograma Interativo Visual */
.odontograma-card {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.odontograma-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.odontograma-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.78rem;
    color: #475569;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.legend-dot-higido     { background: #ffffff; border: 1px solid #94a3b8; }
.legend-dot-carie      { background: #ef4444; }
.legend-dot-restaurado { background: #0284c7; }
.legend-dot-canal      { background: #f97316; }
.legend-dot-extraido   { background: #64748b; }
.legend-dot-implante   { background: #8b5cf6; }
.legend-dot-coroa      { background: #eab308; }

.odontograma-arcade {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 10px;
    overflow-x: auto;
}

.odontograma-arch-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.odontograma-quadrant-sep {
    width: 2px;
    background: #cbd5e1;
    margin: 0 8px;
}

.odonto-tooth-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.odonto-tooth-box:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.odonto-tooth-box.is-selected {
    background: #ccfbf1;
    outline: 2px solid #0d9488;
}

.odonto-tooth-num {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
}

.odonto-svg-tooth {
    width: 38px;
    height: 38px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}

.odonto-svg-tooth polygon,
.odonto-svg-tooth rect {
    fill: #ffffff;
    stroke: #94a3b8;
    stroke-width: 1.5;
    transition: fill 0.2s ease;
    cursor: pointer;
}

.odonto-svg-tooth polygon:hover,
.odonto-svg-tooth rect:hover {
    fill: #e2e8f0;
}

/* Cores dos status dentários aplicados nas faces */
.odonto-svg-tooth .is-carie      { fill: #ef4444 !important; stroke: #b91c1c !important; }
.odonto-svg-tooth .is-restaurado { fill: #0284c7 !important; stroke: #0369a1 !important; }
.odonto-svg-tooth .is-canal      { fill: #f97316 !important; stroke: #c2410c !important; }
.odonto-svg-tooth .is-extraido   { fill: #64748b !important; stroke: #334155 !important; }
.odonto-svg-tooth .is-implante   { fill: #8b5cf6 !important; stroke: #6d28d9 !important; }
.odonto-svg-tooth .is-coroa      { fill: #eab308 !important; stroke: #a16207 !important; }

/* 2. Paleta de Ações e Procedimentos Dentários */
.odonto-palette-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-top: 14px;
    align-items: center;
}

.btn-palette-tool {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-palette-tool:hover,
.btn-palette-tool.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* 3. Card de Gravação de Áudio e Transcrição com IA */
.voice-record-card {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.voice-record-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.btn-record-audio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    background: #ef4444;
    color: #ffffff;
}

.btn-record-audio:hover {
    background: #dc2626;
}

.btn-record-audio.is-recording {
    background: #0f172a;
    animation: pulseRecord 1.5s infinite;
}

@keyframes pulseRecord {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70%  { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.record-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
}

.btn-record-audio.is-recording .record-indicator {
    background: #ef4444;
}

.voice-timer {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.voice-transcription-box {
    width: 100%;
    min-height: 140px;
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
}

.voice-live-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #059669;
    font-weight: 600;
}

.audio-playback-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-top: 14px;
}

.audio-preview-player {
    display: block;
    width: 100%;
    max-width: 480px;
    margin-top: 6px;
    border-radius: 8px;
}

/* 4. Leitor de Exames e Anexos de Imagens */
.exam-upload-zone {
    border: 2px dashed #94a3b8;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s ease;
    margin-bottom: 14px;
}

.exam-upload-zone:hover {
    border-color: #0d9488;
    background: #f0fdfa;
}

.exam-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.exam-preview-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    text-align: center;
    padding: 8px;
    position: relative;
}

.exam-preview-thumb {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 6px;
}

/* 5. Chat com Seletor de Destinatário (Todos / Privado) */
.dash-chat-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.dash-chat-recipient-select {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    font-weight: 600;
}

.chat-badge-channel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #e0f2fe;
    color: #0369a1;
}

/* ==========================================================================
   Classes Utilitárias Sem Inline Styles (Users, Alerts, Profile)
   ========================================================================== */
.alert-box-success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
    margin-bottom: 20px;
}

.alert-box-error {
    margin-bottom: 20px;
}

.card-section-mb {
    margin-bottom: 22px;
}

.card-section-lg-mb {
    margin-bottom: 24px;
}

.permissions-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.permission-pill-card {
    padding: 12px;
    border-radius: 8px;
    background: #fdfefe;
    border: 1px solid var(--border-color);
}

.permission-pill-card-title-admin {
    color: #065f46;
}

.permission-pill-card-title-prof {
    color: #1e40af;
}

.permission-pill-card-title-colab {
    color: #b45309;
}

.permission-pill-card-title-assist {
    color: #6b7280;
}

.permission-pill-card-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.text-muted-desc-sm {
    font-size: 0.88rem;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.users-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.form-action-mt {
    margin-top: 14px;
}

.badge-self-user {
    font-size: 0.72rem;
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.form-inline-role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.select-role-sm {
    padding: 4px 8px;
    font-size: 0.82rem;
}

.schedule-cell-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.btn-schedule-sm {
    padding: 2px 8px;
    font-size: 0.76rem;
}

.user-status-active {
    color: #065f46;
    font-weight: 600;
    font-size: 0.82rem;
}

.user-status-blocked {
    color: #991b1b;
    font-weight: 600;
    font-size: 0.82rem;
}

.text-protected-muted {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.modal-subtext-dim {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.schedule-th-dia {
    width: 140px;
}

.schedule-th-acesso {
    width: 110px;
}

.schedule-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.84rem;
}

.modal-actions-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.btn-cancel-modal {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 8px 16px;
    border-radius: 6px;
}

.btn-submit-modal {
    padding: 8px 20px;
}

.card-grid-full {
    grid-column: 1 / -1;
}

.fiscal-form-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.fiscal-form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.input-uppercase {
    text-transform: uppercase;
}

.btn-ml-10 {
    margin-left: 10px;
}

/* ==========================================================================
   NOVA NAVEGAÇÃO: OLIVIUS SLIM DOCK (iMac) & MENU INICIAR (Windows 11)
   100% Classes Semânticas - Zero Inline Styles
   ========================================================================== */

/* 1. O Dock Lateral Estilo iMac */
.olivius-slim-dock {
    width: 68px;
    min-width: 68px;
    background: #ffffff;
    border-right: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0 16px 0;
    gap: 8px;
    position: relative;
    z-index: 100;
    user-select: none;
    box-shadow: 1px 0 10px rgba(0, 0, 0, 0.02);
}

/* Botão Iniciar Olivius no Topo do Dock */
.dock-start-trigger {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 6px;
    position: relative;
    padding: 0;
}

.dock-start-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

.dock-start-trigger:active {
    transform: scale(0.96);
}

.dock-start-logo-icon {
    font-size: 1.35rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.dock-start-kbd-hint {
    font-size: 0.58rem;
    color: #ecfdf5;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* Separador do Dock */
.dock-divider-line {
    width: 38px;
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

/* Itens de Navegação do Dock (Daily Drivers) */
.dock-nav-items-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex: 1;
}

.dock-item-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #475569;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    position: relative;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-item-btn:hover {
    background: #f1f5f9;
    color: var(--brand-olive, #059669);
    transform: scale(1.06);
}

.dock-item-btn.active {
    background: #ecfdf5;
    color: #059669;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.dock-item-btn.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: #059669;
}

.dock-item-btn-ai {
    background: #f5f3ff;
    color: #7c3aed;
}

.dock-item-btn-ai:hover {
    background: #ede9fe;
    color: #6d28d9;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.25);
}

/* Tooltip nativo em hover no Dock */
.dock-item-btn[data-dock-tooltip]::after {
    content: attr(data-dock-tooltip);
    position: absolute;
    left: 64px;
    background: #1e293b;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-6px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    z-index: 1000;
}

.dock-item-btn:hover[data-dock-tooltip]::after {
    opacity: 1;
    transform: translateX(0);
}

/* Área inferior do Dock */
.dock-footer-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* 2. Menu Iniciar Olivius (Flyout Modal Estilo Windows 11 / macOS Launchpad) */
.olivius-start-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.olivius-start-overlay.active {
    display: flex;
    opacity: 1;
}

.olivius-start-card {
    width: 100%;
    max-width: 980px;
    max-height: 88vh;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: startModalPop 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes startModalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Topo do Iniciar: Logo + Omnisearch + Fechar */
.start-topbar-header {
    padding: 20px 26px 14px 26px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #ffffff;
}

.start-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.start-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
}

.start-brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.start-brand-sub {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

.start-close-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #64748b;
    transition: all 0.15s ease;
}

.start-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Barra Omnisearch de Busca Global */
.start-omnisearch-box {
    position: relative;
    width: 100%;
}

.start-omnisearch-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
}

.start-omnisearch-input {
    width: 100%;
    height: 46px;
    padding: 0 44px 0 42px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 0.95rem;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.start-omnisearch-input:focus {
    background: #ffffff;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.start-omnisearch-kbd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    pointer-events: none;
}

/* Barra de Ações Rápidas Fixadas */
.start-quick-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.start-quick-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.start-quick-action-pill:hover {
    background: #e2e8f0;
    color: #059669;
}

/* Corpo com Rolagem dos 6 Domínios */
.start-modal-body-scroll {
    padding: 20px 26px 30px 26px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Seção de Domínio */
.start-domain-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.start-domain-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e2e8f0;
}

.start-domain-heading-icon {
    font-size: 1.05rem;
}

/* Grid de Cartões de Módulo */
.start-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* Cartão do Módulo Individual */
.start-module-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.start-module-card:hover {
    border-color: #a7f3d0;
    background: #fdfefe;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.08);
}

.start-module-icon-box {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.start-module-card:hover .start-module-icon-box {
    transform: scale(1.1);
    background: #ecfdf5;
}

.start-module-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.start-module-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.start-module-desc {
    font-size: 0.77rem;
    color: #64748b;
    line-height: 1.35;
}

/* Estado de Módulo Oculto pela Busca */
.start-module-card.search-hidden {
    display: none !important;
}

.start-domain-section.search-empty-domain {
    display: none !important;
}

/* Mensagem de Busca Vazia */
.start-no-results-box {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
}

.start-no-results-box.active {
    display: flex;
}

.start-no-results-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.start-no-results-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.start-no-results-sub {
    font-size: 0.84rem;
    color: #64748b;
    margin: 0;
}

/* Rodapé do Iniciar */
.start-modal-footer {
    padding: 12px 26px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #64748b;
}

.start-footer-hint {
    display: flex;
    align-items: center;
    gap: 6px;
}

.start-footer-hint kbd {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #334155;
}

/* ==========================================================
   DESATIVAÇÃO PERMANENTE DO BOTÃO TOGGLE (REDUNDANTE COM O DOCK)
   ZERO INLINE STYLES
   ========================================================== */
.btn-sidebar-toggle {
    display: none !important;
}

/* ==========================================================
   DASHBOARD BENTO GRID COCKPIT CLÍNICO
   DESIGN SINGLE-SCREEN / TUDO À VISTA EM 15 POLEGADAS
   ZERO INLINE STYLES
   ========================================================== */
.dashboard-body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-body .dash-workspace {
    flex: 1;
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
    overflow: hidden;
}

.dashboard-body .apple-footer {
    display: none !important;
}

.bento-dashboard-main {
    flex: 1;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* 1. Hero Cockpit Contextual Compacto */
.bento-hero-banner {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    gap: 12px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.bento-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bento-greeting-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bento-greeting-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.bento-hero-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.01em;
}

.bento-hero-subtitle {
    display: none;
}

.bento-quick-kpis {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bento-kpi-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #334155;
}

.bento-kpi-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.bento-kpi-dot.dot-warn { background: #f59e0b; }
.bento-kpi-dot.dot-danger { background: #ef4444; }
.bento-kpi-dot.dot-success { background: #10b981; }
.bento-kpi-dot.dot-info { background: #3b82f6; }

.bento-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.bento-hero-actions .btn-primary,
.bento-hero-actions .btn-secondary {
    padding: 5px 12px;
    font-size: 0.78rem;
    border-radius: 8px;
    font-weight: 600;
}

/* 2. Container Bento Grid 3 Colunas com Altura Travada no Viewport */
.bento-grid-container {
    display: grid;
    grid-template-columns: 1.05fr 1.15fr 0.8fr;
    gap: 10px;
    flex: 1;
    min-height: 0;
    height: calc(100% - 50px);
    width: 100%;
    box-sizing: border-box;
}

.bento-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 0;
    min-width: 0;
}

/* Cards Bento */
.bento-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.bento-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

/* Distribuição de Altura na Coluna 1 (Webmail 50% + Chat 50%) */
.bento-col-comms .bento-card-mail {
    flex: 1 1 50%;
    min-height: 0;
}

.bento-col-comms .bento-card-chat {
    flex: 1 1 50%;
    min-height: 0;
}

/* Distribuição de Altura na Coluna 2 (Post-its 100%) */
.bento-col-notes .bento-card-notes {
    height: 100%;
    min-height: 0;
    flex: 1;
}

/* Distribuição de Altura na Coluna 3 (Performance Compacto + Tarefas 1fr) */
.bento-col-operations .bento-card-perf {
    flex-shrink: 0;
}

.bento-col-operations .bento-card-tasks {
    flex: 1;
    min-height: 0;
}

/* Cabeçalho Compacto dos Cards */
.bento-card-header {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.bento-card-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.bento-card-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.bento-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.bento-card-sub {
    font-size: 0.72rem;
    color: #64748b;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.bento-card-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.bento-link-more {
    font-size: 0.74rem;
    font-weight: 600;
    color: #059669;
    text-decoration: none;
    transition: color 0.15s ease;
}

.bento-link-more:hover {
    color: #047857;
    text-decoration: underline;
}

.bento-icon-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.15s ease;
}

.bento-icon-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.bento-counter-badge {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Corpo do Webmail com Rolagem Interna sem Estourar a Tela */
.bento-mail-body {
    padding: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #ffffff;
}

.bento-mail-list {
    display: flex;
    flex-direction: column;
}

.bento-mail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
    cursor: pointer;
}

.bento-mail-item:last-child {
    border-bottom: none;
}

.bento-mail-item:hover {
    background: #f8fafc;
}

.bento-mail-item.is-unread {
    background: #f0fdf4;
    border-left: 3px solid #10b981;
}

.bento-mail-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bento-mail-info {
    flex: 1;
    min-width: 0;
}

.bento-mail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 2px;
}

.bento-mail-sender {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bento-mail-item.is-unread .bento-mail-sender {
    color: #0f172a;
    font-weight: 700;
}

.bento-mail-time {
    font-size: 0.68rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.bento-mail-subject {
    font-size: 0.74rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.bento-mail-item.is-unread .bento-mail-subject {
    color: #334155;
    font-weight: 500;
}

.bento-mail-empty {
    padding: 18px 14px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

.bento-mail-empty-icon {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 4px;
}

.bento-loading-state {
    padding: 18px 14px;
    text-align: center;
    color: #64748b;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Rodapé do Card */
.bento-card-footer {
    padding: 6px 12px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.bento-footer-btn {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bento-footer-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

/* ==========================================================
   CHAT DA EQUIPE ULTRA-MODERNO (PADRÃO APPLE iMESSAGE / SLACK)
   ZERO INLINE STYLES
   ========================================================== */
.bento-chat-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bento-chat-recipient-select {
    appearance: none;
    -webkit-appearance: none;
    background: #f8fafc url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%2364748b'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='6%209%2012%2015%2018%209'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 8px center;
    background-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 3px 26px 3px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s ease;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bento-chat-recipient-select:hover,
.bento-chat-recipient-select:focus {
    border-color: #10b981;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    outline: none;
}

.bento-chat-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    max-width: 88%;
}

.bento-chat-row.is-me {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bento-chat-row.is-other {
    align-self: flex-start;
}

.bento-chat-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.bento-chat-bubble-box {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bento-chat-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.bento-chat-author {
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bento-chat-timestamp {
    font-size: 0.64rem;
    color: #94a3b8;
}

.bento-chat-bubble-content {
    padding: 7px 11px;
    font-size: 0.8rem;
    line-height: 1.35;
    word-break: break-word;
    border-radius: 12px;
}

.bento-chat-row.is-other .bento-chat-bubble-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-top-left-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.bento-chat-row.is-me .bento-chat-bubble-content {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    border-top-right-radius: 3px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.bento-chat-meta.is-me-meta {
    justify-content: flex-end;
    margin-top: 2px;
    margin-bottom: 0;
}

.bento-chat-ticks {
    font-size: 0.62rem;
    color: #10b981;
    font-weight: 700;
}

/* Cápsula de Envio do Chat */
.bento-chat-input-capsule {
    display: flex;
    align-items: center;
    width: 100%;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 2px 4px 2px 12px;
    transition: all 0.15s ease;
}

.bento-chat-input-capsule:focus-within {
    background: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.bento-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.78rem;
    color: #1e293b;
    outline: none;
    padding: 6px 0;
}

.bento-chat-input::placeholder {
    color: #94a3b8;
}

.bento-chat-btn-send {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.72rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.bento-chat-btn-send:hover {
    transform: scale(1.06);
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

/* Chat da Equipe com Altura Flexível e Rolagem Interna */
.bento-chat-messages-area {
    padding: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bento-chat-form {
    padding: 6px 10px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.bento-chat-send-btn {
    background: #059669;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bento-chat-send-btn:hover {
    background: #047857;
}

/* Quadro de Post-its Bento Compacto e com Rolagem Interna */
.bento-notes-scroll-board {
    padding: 10px;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    overflow-y: auto;
    background: #fdfdfd;
    align-content: start;
}

.bento-notes-scroll-board .apple-postit {
    min-height: 120px;
    max-height: 160px;
    padding: 8px 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.bento-notes-scroll-board .postit-header {
    margin-bottom: 4px;
}

.bento-notes-scroll-board .postit-textarea {
    min-height: 55px;
    max-height: 90px;
    font-size: 0.82rem;
    line-height: 1.35;
}

.bento-notes-scroll-board .postit-footer {
    margin-top: 4px;
    padding-top: 4px;
}

.bento-notes-scroll-board .color-dot {
    width: 13px;
    height: 13px;
}

.bento-notes-scroll-board .postit-time {
    font-size: 0.65rem;
}

/* Bloco de Produtividade Compacto */
.bento-card-perf .perf-score-container {
    padding: 6px 14px;
    gap: 10px;
}

.bento-card-perf .perf-score-circle {
    width: 44px;
    height: 44px;
}

.bento-card-perf .perf-score-number {
    font-size: 0.9rem;
}

.bento-card-perf .perf-score-badge {
    padding: 1px 8px;
    font-size: 0.7rem;
}

.bento-card-perf .perf-score-desc {
    font-size: 0.72rem;
    margin: 2px 0 0 0;
}

.bento-card-perf .perf-stats-row {
    padding: 6px 14px;
    gap: 8px;
}

.bento-card-perf .perf-stat-item strong {
    font-size: 0.95rem;
}

.bento-card-perf .perf-stat-item span {
    font-size: 0.68rem;
}

/* Lista de Tarefas Compacta e com Rolagem Interna */
.bento-tasks-list-wrapper {
    padding: 8px 12px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.bento-tasks-list-wrapper .dash-task-section {
    margin-bottom: 0;
}

.bento-tasks-list-wrapper .dash-task-subtitle {
    font-size: 0.76rem;
    margin-bottom: 4px;
}

.bento-tasks-list-wrapper .dash-mini-task-item {
    padding: 5px 8px;
    margin-bottom: 4px;
    border-radius: 6px;
}

.bento-tasks-list-wrapper .dash-mini-task-title {
    font-size: 0.76rem;
}

.bento-tasks-list-wrapper .dash-mini-task-meta {
    font-size: 0.68rem;
}

.bento-tasks-list-wrapper .dash-empty-tasks-text {
    font-size: 0.74rem;
    padding: 6px 0;
}

/* Fallback Responsivo para Telas Menores que 960px ou Mobile */
@media (max-width: 960px), (max-height: 560px) {
    .dashboard-body {
        height: auto;
        max-height: none;
        overflow-y: auto;
    }
    .dashboard-body .dash-workspace {
        height: auto;
        max-height: none;
        overflow: visible;
    }
    .bento-dashboard-main {
        height: auto;
        max-height: none;
        overflow: visible;
    }
    .bento-grid-container {
        height: auto;
        grid-template-columns: 1fr;
    }
    .bento-col {
        height: auto;
    }
    .bento-hero-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .bento-hero-actions {
        width: 100%;
    }
    .bento-hero-actions button,
    .bento-hero-actions a {
        flex: 1;
    }
}

/* Scrollbars Discretos para Áreas Bento */
.bento-mail-body::-webkit-scrollbar,
.bento-chat-messages-area::-webkit-scrollbar,
.bento-notes-scroll-board::-webkit-scrollbar,
.bento-tasks-list-wrapper::-webkit-scrollbar {
    width: 5px;
}

.bento-mail-body::-webkit-scrollbar-thumb,
.bento-chat-messages-area::-webkit-scrollbar-thumb,
.bento-notes-scroll-board::-webkit-scrollbar-thumb,
.bento-tasks-list-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.bento-mail-body::-webkit-scrollbar-thumb:hover,
.bento-chat-messages-area::-webkit-scrollbar-thumb:hover,
.bento-notes-scroll-board::-webkit-scrollbar-thumb:hover,
.bento-tasks-list-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================
   DRAWER LATERAL DESLIZANTE OFICIAL (SLIDE-OVER / SHEET)
   SUBSTITUTO OFICIAL DE FORMULÁRIOS EM MODAIS FLUTUANTES
   ZERO INLINE STYLES
   ========================================================== */
.olivius-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.olivius-drawer-backdrop.active {
    display: flex;
    opacity: 1;
}

body.drawer-locked {
    overflow: hidden !important;
}

.olivius-slide-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 520px;
    max-width: 92vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
}

.olivius-drawer-backdrop.active .olivius-slide-drawer {
    transform: translateX(0);
}

.drawer-header {
    padding: 16px 22px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.drawer-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.drawer-header-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.drawer-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.drawer-subtitle {
    font-size: 0.76rem;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.drawer-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.drawer-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.drawer-form-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #ffffff;
}

.drawer-footer {
    padding: 14px 22px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.drawer-footer .btn-primary,
.drawer-footer .btn-secondary {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ==========================================================
   AGENDA COMPLETA MULTIDISCIPLINAR (GRADE MENSAL BENTO)
   ZERO INLINE STYLES
   ========================================================== */
.clinical-calendar-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.clinical-calendar-table th {
    text-align: center;
    background: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 4px;
    border-bottom: 1px solid #e2e8f0;
}

.clinical-calendar-table td {
    vertical-align: top;
    height: 110px;
    padding: 6px;
    border: 1px solid #f1f5f9;
    background: #ffffff;
    transition: background 0.15s ease;
}

.clinical-calendar-table td.calendar-day-empty {
    background: #f8fafc;
    border-color: #f1f5f9;
}

.clinical-calendar-table td.calendar-day-cell:hover {
    background: #fcfcfd;
}

.clinical-calendar-table td.is-today {
    background: #f0fdf4;
    border-color: #86efac;
}

.calendar-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.calendar-day-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.is-today .calendar-day-num {
    background: #059669;
    color: #ffffff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.calendar-btn-add {
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    line-height: 1;
    opacity: 0;
    transition: all 0.15s ease;
}

.calendar-day-cell:hover .calendar-btn-add {
    opacity: 1;
}

.calendar-btn-add:hover {
    background: #059669;
    color: #ffffff;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-event-pill {
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 0.72rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
    transition: transform 0.12s ease;
}

.calendar-event-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.calendar-event-pill.badge-status-agendado {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.calendar-event-pill.badge-status-confirmado {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.calendar-event-pill.badge-status-aguardando,
.calendar-event-pill.badge-status-sala_espera {
    background: #fefce8;
    color: #a16207;
    border-color: #fde047;
}

.calendar-event-pill.badge-status-em_atendimento {
    background: #faf5ff;
    color: #7e22ce;
    border-color: #e9d5ff;
}

.calendar-event-pill.badge-status-concluido,
.calendar-event-pill.badge-status-atendido {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

.calendar-event-pill.badge-status-falta,
.calendar-event-pill.badge-status-faltou {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.calendar-event-pill.badge-status-cancelado {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
    text-decoration: line-through;
}

.cal-time {
    font-weight: 700;
    font-size: 0.68rem;
    flex-shrink: 0;
}

.cal-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-more-link {
    font-size: 0.68rem;
    color: #059669;
    font-weight: 600;
    text-decoration: none;
    margin-top: 2px;
}

.cal-more-link:hover {
    text-decoration: underline;
}

/* ============================================================================
 * CONTRATOS, TERMOS & PROPOSTAS COMERCIAIS (PADRÃO OLIVIUS A4)
 * ============================================================================ */
.receipt-action-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: #ffffff;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.receipt-info-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.receipt-doc-badge {
    background: #f1f5f9;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.receipt-patient-name {
    font-size: 0.88rem;
    color: #1e293b;
}

.receipt-amount-badge {
    background: #ecfdf5;
    color: #065f46;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #a7f3d0;
}

.receipt-model-selector-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.receipt-select-inline {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
}

.contract-body-text {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #1e293b;
    margin: 24px 0;
}

.contract-body-text h3 {
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    color: #0f172a;
    letter-spacing: 0.02em;
    margin-bottom: 24px;
    border-bottom: 2px solid #059669;
    padding-bottom: 12px;
}

.contract-body-text h4 {
    font-size: 0.98rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #0f172a;
    margin: 20px 0 8px 0;
}

.contract-body-text p {
    margin-bottom: 14px;
    text-align: justify;
}

.contract-items-table-wrap {
    margin: 16px 0 20px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.contract-date-signature-row {
    margin-top: 36px;
    margin-bottom: 24px;
    text-align: right;
    font-size: 0.9rem;
    color: #334155;
}

.contract-signatures-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 48px;
    page-break-inside: avoid;
}

.contract-witnesses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 36px;
    page-break-inside: avoid;
}

.contract-signature-block {
    text-align: center;
}

.signature-line {
    border-top: 1px solid #475569;
    margin-bottom: 8px;
}

.signature-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0f172a;
    margin: 0;
}

.signature-role {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    margin: 2px 0 0 0;
}

.signature-doc {
    font-size: 0.75rem;
    color: #64748b;
    margin: 2px 0 0 0;
}

@media print {
    .contract-signatures-grid,
    .contract-witnesses-grid {
        page-break-inside: avoid;
    }
}

/* ============================================================================
 * COMPONENTE: SELETOR DE MÚLTIPLOS RESPONSÁVEIS COM BUSCA E CHECKBOXES
 * ============================================================================ */
.assignee-dropdown-wrap {
    position: relative;
    width: 100%;
}

.assignee-dropdown-btn {
    width: 100%;
    min-height: 42px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    font-size: 0.88rem;
    color: #1e293b;
    transition: all 0.2s ease;
}

.assignee-dropdown-btn:hover {
    border-color: #059669;
}

.assignee-dropdown-btn.is-active {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.assignee-btn-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    overflow: hidden;
}

.assignee-btn-placeholder {
    color: #94a3b8;
}

.assignee-btn-pill {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.assignee-btn-count-badge {
    background: #059669;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

.assignee-dropdown-arrow {
    font-size: 0.72rem;
    color: #64748b;
    transition: transform 0.2s ease;
}

.assignee-dropdown-btn.is-active .assignee-dropdown-arrow {
    transform: rotate(180deg);
}

.assignee-dropdown-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    z-index: 1050;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.assignee-dropdown-panel.is-open {
    display: flex;
}

.assignee-dropdown-search-wrap {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.assignee-search-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82rem;
    outline: none;
    background: #ffffff;
}

.assignee-search-input:focus {
    border-color: #059669;
}

.assignee-dropdown-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 6px 0;
}

.assignee-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
}

.assignee-dropdown-item:hover {
    background-color: #f1f5f9;
}

.assignee-dropdown-item.is-selected {
    background-color: #f0fdf4;
}

.assignee-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.assignee-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #059669;
    cursor: pointer;
}

.assignee-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.assignee-user-info {
    display: flex;
    flex-direction: column;
}

.assignee-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
}

.assignee-user-role {
    font-size: 0.72rem;
    color: #64748b;
}

.assignee-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.assignee-primary-radio-label {
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.assignee-primary-radio-label:hover {
    border-color: #cbd5e1;
}

.assignee-dropdown-footer {
    padding: 8px 12px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #64748b;
}

.assignee-btn-done {
    background: #059669;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.assignee-btn-done:hover {
    background: #047857;
}

/* Pilha de Avatares na Tabela e Kanban */
.assignee-stack-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.assignee-stack-avatars {
    display: flex;
    align-items: center;
}

.assignee-stack-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #059669;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    margin-left: -6px;
}

.assignee-stack-avatar:first-child {
    margin-left: 0;
}

.assignee-stack-count {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

.is-hidden {
    display: none !important;
}

/* ==========================================================================
   CARDS DE SELEÇÃO DINÂMICA DE FLUXO CLÍNICO & PAINEL DE INSERÇÃO (LAYOUT.MD)
   ========================================================================== */
.flow-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.flow-selection-card {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.flow-selection-card:hover {
    border-color: #0d9488;
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.12);
    transform: translateY(-2px);
}

.flow-selection-icon {
    font-size: 2rem;
    line-height: 1;
}

.flow-selection-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 4px 0;
}

.flow-selection-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.45;
    flex-grow: 1;
}

.journey-insert-panel {
    background: #ffffff;
    border: 1px solid #dbe6df;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.journey-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* ============================================================================
 * PERFORMA MÍNIMA & SIMULADOR DE CONTRATOS (layout.md - ZERO INLINE STYLES)
 * ============================================================================ */
.performa-banner-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.performa-banner-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.performa-banner-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: 2px;
}

.performa-banner-desc {
    font-size: 0.78rem;
    color: #15803d;
    line-height: 1.4;
}

.performa-caucao-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #fde68a;
}

.simulador-parcelas-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.simulador-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.simulador-header-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.simulador-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.simulador-table th {
    background: #e2e8f0;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
}

.simulador-table td {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    background: #ffffff;
}

.simulador-table tr:hover td {
    background: #f1f5f9;
}

.simulador-table td.text-right {
    text-align: right;
}

.simulador-table td.text-center {
    text-align: center;
}

.performa-progress-native {
    width: 100%;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    appearance: none;
    border: none;
    display: block;
    margin-top: 6px;
}
.performa-progress-native::-webkit-progress-bar {
    background-color: #e2e8f0;
    border-radius: 6px;
}
.performa-progress-native::-webkit-progress-value {
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 6px;
}
.performa-progress-native::-moz-progress-bar {
    background: #10b981;
    border-radius: 6px;
}

.input-action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-action-group .form-input {
    flex: 1;
}








