* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f4f8;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 2px;
}

.app-container {
    display: flex;
    min-height: 100vh;
    background: #f0f4f8;
    flex-direction: row;
    justify-content: flex-start;
}

/* ========================================
   SIDEBAR - MENU LATERAL (AZUL ESCURO)
   ======================================== */
.app-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e2a3a 0%, #0f1724 100%);
    color: #e2e8f0;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.sidebar-header h2 i {
    color: #60a5fa;
    margin-right: 10px;
}

.sidebar-header p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 5px;
}

.user-info-sidebar {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    margin: 20px;
    border-radius: 12px;
    text-align: center;
}

.user-info-sidebar i {
    font-size: 2rem;
    color: #60a5fa;
    margin-bottom: 10px;
}

.user-info-sidebar .user-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #f1f5f9;
}

.user-info-sidebar .user-type {
    font-size: 0.75rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 80px 0;
}

.sidebar-menu li {
    margin: 5px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 10px;
    margin: 0 12px;
}

.sidebar-menu li a:hover {
    background: rgba(96, 165, 250, 0.15);
    color: white;
}

.sidebar-menu li a.active {
    background: rgba(96, 165, 250, 0.2);
    color: white;
    border-left: 3px solid #60a5fa;
}

.sidebar-menu li a i {
    width: 28px;
    font-size: 1.2rem;
    margin-right: 12px;
    color: #60a5fa;
    transition: all 0.3s;
}

.sidebar-menu li a:hover i,
.sidebar-menu li a.active i {
    color: #93c5fd;
}

.sidebar-menu li a span {
    flex: 1;
    font-size: 0.9rem;
}

.sidebar-menu .menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 15px 20px;
}

.sidebar-menu .menu-title {
    padding: 15px 20px 5px;
    color: #64748b;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logout-btn {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: rgba(96, 165, 250, 0.15);
    color: #f1f5f9;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s;
    margin: 20px 12px;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
}

.logout-btn i {
    margin-right: 12px;
    color: #60a5fa;
}

.logout-btn:hover i {
    color: white;
}

/* ========================================
   CONTEÚDO PRINCIPAL
   ======================================== */
.app-main {
    flex: 1;
    margin-left: 260px;
    padding: 25px;
    width: 100%;
    max-width: 100%;
    background: #f0f4f8;
}

/* Mobile Top Bar */
.mobile-top-bar {
    display: none;
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 999;
    align-items: center;
    justify-content: space-between;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #334155;
    cursor: pointer;
    display: none;
}

.mobile-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-user i {
    font-size: 1.8rem;
    color: #3b82f6;
}

.mobile-user-info {
    text-align: right;
}

.mobile-user-info .name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.mobile-user-info .type {
    font-size: 0.7rem;
    color: #64748b;
}

/* Header */
.header {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 20px 30px;
    border-radius: 16px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.header h1 {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.header h1 i {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 18px;
    border-radius: 40px;
}

.user-info i {
    font-size: 1.2rem;
}

/* Botões */
.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #3b82f6;
    color: #3b82f6;
}

.btn-outline:hover {
    background: #3b82f6;
    color: white;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 24px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    color: #475569;
    font-size: 0.9rem;
}

.tab:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.tab.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.tab-content {
    display: none;
}

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

/* Cards de Resumo */
.resumo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.resumo-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.3s;
    border: 1px solid #e2e8f0;
}

.resumo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.resumo-card.receita {
    border-top: 4px solid #10b981;
}

.resumo-card.despesa {
    border-top: 4px solid #ef4444;
}

.resumo-card.saldo {
    border-top: 4px solid #3b82f6;
}

.resumo-card h3 {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resumo-card .valor {
    font-size: 1.8rem;
    font-weight: 700;
}

.resumo-card .valor.positivo {
    color: #10b981;
}

.resumo-card .valor.negativo {
    color: #ef4444;
}

/* Período Info */
.periodo-info {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.periodo-info i {
    color: #3b82f6;
    font-size: 1.3rem;
}

.periodo-info span {
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
}

/* Tabelas */
.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
}

.table-container thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.table-container th {
    color: #475569;
    padding: 15px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.table-container td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
}

.table-container tbody tr:hover {
    background: #f8fafc;
}

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

/* Formulários */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    max-width: 1000px;
    margin: 0 auto;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
    font-size: 0.85rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input.error,
select.error {
    border-color: #ef4444;
}

.help-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 5px;
}

/* Footer da Tabela */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 15px;
}

.record-info {
    color: #64748b;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-info i {
    color: #3b82f6;
}

.search-box {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box input {
    width: 280px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
}

/* Paginação */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 20px 0;
}

.pagination .btn {
    min-width: 40px;
    padding: 8px;
    justify-content: center;
}

/* Filtros */
.filter-bar {
    background: white;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    font-size: 0.8rem;
    margin-bottom: 5px;
    color: #475569;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fed7aa;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert i {
    font-size: 1.2rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: #fed7aa;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Loading */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.loading.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Menu Cards */
.menu-item {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 16px;
    text-decoration: none;
    color: #334155;
    transition: all 0.3s;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.menu-item:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.menu-item i {
    font-size: 2rem;
    color: #3b82f6;
    transition: transform 0.3s;
}

.menu-item:hover i {
    transform: scale(1.1);
}

.menu-item span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    border: 1px solid #e2e8f0;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.dashboard-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dashboard-card .card-header h3 {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
}

.dashboard-card .card-header i {
    font-size: 1.8rem;
    opacity: 0.4;
    color: #3b82f6;
}

.dashboard-card .card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

.dashboard-card .card-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: #64748b;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeIn {
    animation: fadeIn 0.4s ease forwards;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: #1e293b;
    color: white;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 8px);
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 15px 20px;
    }

    .header h1 {
        font-size: 1.4rem;
    }
}

@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.active {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .mobile-top-bar {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .app-main {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        border-radius: 12px;
    }

    .header h1 {
        justify-content: center;
    }

    .user-info {
        width: 100%;
        justify-content: center;
    }

    .btn-group {
        justify-content: center;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .table-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-container {
        padding: 20px;
    }

    .resumo-cards {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        text-align: center;
    }

    .pagination {
        justify-content: center;
    }

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

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.2rem;
    }

    .header h1 i {
        font-size: 1.3rem;
    }

    .periodo-info {
        flex-direction: column;
        text-align: center;
    }

    .record-info {
        flex-direction: column;
        text-align: center;
    }

    .dashboard-card .card-value {
        font-size: 1.4rem;
    }

    .resumo-card .valor {
        font-size: 1.4rem;
    }
}

/* ========================================
   IMPRESSÃO
   ======================================== */
@media print {

    .app-sidebar,
    .mobile-top-bar,
    .btn-group,
    .pagination,
    .table-footer,
    .search-box,
    .tabs,
    .filter-bar,
    .quick-actions-bar {
        display: none !important;
    }

    .app-main {
        margin: 0 !important;
        padding: 0 !important;
    }

    .container {
        padding: 0;
    }

    .table-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .table-container th {
        background: #f5f5f5 !important;
        color: #333 !important;
    }

    .print-header {
        display: block !important;
    }

    .print-footer {
        display: block !important;
    }
}

.print-header,
.print-footer {
    display: none;
}























/* =========================================================
   EULA — Contrato de Licença de Usuário Final
   ========================================================= */

.eula-wrapper {
    --eula-primary: #6366f1;
    --eula-primary-2: #8b5cf6;
    --eula-text: #1e293b;
    --eula-muted: #64748b;
    --eula-border: #e2e8f0;
    --eula-bg: #ffffff;
    --eula-bg-soft: #f8fafc;
    --eula-warn-bg: #fef3c7;
    --eula-warn-brd: #fcd34d;
    --eula-warn-text: #78350f;

    /* 👇 Tamanho do memo — ajuste conforme a tela */
    --eula-memo-height: 380px;

    max-width: 880px;
    margin: 40px auto;
    padding: 0 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--eula-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.eula-container {
    background: var(--eula-bg);
    border-radius: 16px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 20px 40px -20px rgba(15, 23, 42, .15);
    overflow: hidden;
    border: 1px solid var(--eula-border);
    display: flex;
    flex-direction: column;
    /* 👇 limita a altura total do card */
    max-height: calc(100vh - 80px);
}

/* ---------- Cabeçalho FIXO ---------- */
.eula-header {
    background: linear-gradient(135deg, var(--eula-primary) 0%, var(--eula-primary-2) 100%);
    color: #fff;
    padding: 28px 28px 24px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
    /* 👈 não encolhe */
}

.eula-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .15), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, .1), transparent 50%);
    pointer-events: none;
}

.eula-badge {
    display: inline-block;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .25);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.eula-header h1 {
    font-size: clamp(17px, 2.6vw, 22px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    position: relative;
    z-index: 1;
}

.eula-header h2 {
    font-size: clamp(13px, 1.8vw, 15px);
    font-weight: 500;
    opacity: .92;
    margin: 0 0 10px;
    position: relative;
    z-index: 1;
}

.eula-data {
    font-size: 12px;
    opacity: .85;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* =========================================================
   📜 ÁREA ROLÁVEL (MEMO)
   ========================================================= */
.eula-memo {
    height: var(--eula-memo-height);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 28px;

    /* Rolagem suave nativa */
    scroll-behavior: smooth;

    /* Rolagem inercial no iOS */
    -webkit-overflow-scrolling: touch;

    /* Impede que o scroll "vaze" para o body em mobile */
    overscroll-behavior: contain;

    /* Foco visual ao clicar/tab */
    outline: none;

    /* Fundo levemente diferenciado do cabeçalho */
    background:
        linear-gradient(to bottom, #ffffff, #fbfcfe);

    /* Máscara suave no topo e no rodapé do memo */
    mask-image: linear-gradient(to bottom,
            transparent 0,
            #000 12px,
            #000 calc(100% - 12px),
            transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom,
            transparent 0,
            #000 12px,
            #000 calc(100% - 12px),
            transparent 100%);

    flex: 1 1 auto;
    min-height: 0;
    /* 👈 essencial para o flex respeitar o scroll */
}

/* Foco acessível */
.eula-memo:focus-visible {
    box-shadow: inset 0 0 0 2px var(--eula-primary);
}

/* ---------- Scrollbar customizada (desktop) ---------- */
.eula-memo::-webkit-scrollbar {
    width: 10px;
}

.eula-memo::-webkit-scrollbar-track {
    background: transparent;
}

.eula-memo::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    border: 3px solid #ffffff;
    background-clip: padding-box;
}

.eula-memo::-webkit-scrollbar-thumb:hover {
    background: var(--eula-primary);
    background-clip: padding-box;
    border: 3px solid #ffffff;
}

/* Firefox */
.eula-memo {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* ---------- Índice ---------- */
.eula-toc {
    background: var(--eula-bg-soft);
    border: 1px solid var(--eula-border);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.eula-toc h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--eula-muted);
    margin: 0 0 10px;
}

.eula-toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 20px;
    counter-reset: toc;
}

.eula-toc li {
    counter-increment: toc;
    font-size: 13px;
}

.eula-toc li::before {
    content: counter(toc) ".";
    color: var(--eula-primary);
    font-weight: 600;
    margin-right: 6px;
}

.eula-toc a {
    color: var(--eula-text);
    text-decoration: none;
    transition: color .15s;
}

.eula-toc a:hover {
    color: var(--eula-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Corpo ---------- */
.eula-body section {
    padding: 18px 0;
    border-bottom: 1px solid var(--eula-border);
    scroll-margin-top: 10px;
}

.eula-body section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.eula-body section:first-child {
    padding-top: 0;
}

.eula-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--eula-text);
    margin: 0 0 12px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.eula-body h3 .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--eula-primary), var(--eula-primary-2));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    flex-shrink: 0;
}

.eula-body h4 {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--eula-primary);
    margin: 18px 0 6px;
    letter-spacing: -0.005em;
}

.eula-body p {
    font-size: 13.5px;
    margin: 0 0 10px;
    color: #334155;
}

.eula-body strong {
    color: var(--eula-text);
    font-weight: 600;
}

.eula-body ul {
    padding-left: 0;
    list-style: none;
    margin: 6px 0 12px;
}

.eula-body ul ul {
    margin: 6px 0 6px 22px;
    padding-left: 14px;
    border-left: 2px solid var(--eula-border);
}

.eula-body li {
    font-size: 13px;
    margin-bottom: 7px;
    padding-left: 20px;
    position: relative;
    color: #334155;
}

.eula-body li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--eula-primary);
    opacity: .6;
}

.eula-body ul ul li::before {
    background: var(--eula-muted);
    opacity: .5;
    width: 4px;
    height: 4px;
}

/* ---------- Alertas ---------- */
.eula-alert {
    background: var(--eula-warn-bg);
    border-left: 4px solid var(--eula-warn-brd);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
}

.eula-alert p {
    margin: 0;
    font-size: 13px;
    color: var(--eula-warn-text);
    line-height: 1.6;
}

.eula-alert strong {
    color: var(--eula-warn-text);
}

/* ---------- Rodapé FIXO ---------- */
.eula-footer {
    background: var(--eula-bg-soft);
    border-top: 1px solid var(--eula-border);
    padding: 20px 28px 24px;
    flex-shrink: 0;
    /* 👈 não encolhe */
}

.eula-assinatura {
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--eula-border);
    margin-bottom: 14px;
}

.eula-assinatura strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--eula-text);
    margin-bottom: 3px;
}

.eula-assinatura span {
    font-size: 12px;
    color: var(--eula-muted);
}

.eula-aceite {
    background: linear-gradient(135deg, var(--eula-primary), var(--eula-primary-2));
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    text-align: center;
}

.eula-aceite p {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    line-height: 1.5;
    text-transform: uppercase;
    color: #fff;
}

/* ---------- Responsivo ---------- */
@media (max-width: 640px) {
    .eula-wrapper {
        margin: 16px auto;
        padding: 0 10px;
        --eula-memo-height: 320px;
        /* 👈 menor no celular */
    }

    .eula-container {
        max-height: calc(100vh - 40px);
    }

    .eula-header {
        padding: 20px 18px;
    }

    .eula-memo {
        padding: 18px 18px;
    }

    .eula-footer {
        padding: 16px 18px;
    }

    .eula-toc ol {
        grid-template-columns: 1fr;
    }

    .eula-body h3 {
        font-size: 15px;
    }

    .eula-body h3 .num {
        min-width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .eula-body p,
    .eula-body li {
        font-size: 13px;
    }
}

/* ---------- Impressão ---------- */
@media print {
    body {
        background: #fff;
    }

    .eula-wrapper {
        max-width: 100%;
        margin: 0;
        padding: 0;
        --eula-memo-height: auto;
    }

    .eula-container {
        box-shadow: none;
        border: none;
        max-height: none;
        display: block;
    }

    .eula-memo {
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        mask-image: none !important;
        -webkit-mask-image: none !important;
    }

    .eula-header {
        background: #f1f5f9 !important;
        color: #0f172a !important;
    }

    .eula-header::after {
        display: none;
    }

    .eula-body section {
        page-break-inside: avoid;
    }
}








/* =========================================================
   BOTÃO SAIR
   ========================================================= */
.btn-logout {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);

    color: #e2e8f0;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.01em;

    padding: 9px 16px;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(239, 68, 68, 1);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -6px rgba(239, 68, 68, 0.5);
}

.btn-logout:active {
    transform: translateY(0);
}

.btn-logout svg {
    transition: transform 0.2s ease;
}

.btn-logout:hover svg {
    transform: translateX(2px);
}

/* Mobile: só o ícone */
@media (max-width: 640px) {
    .btn-logout {
        top: 12px;
        right: 12px;
        padding: 10px;
        border-radius: 50%;
    }

    .btn-logout span {
        display: none;
    }
}















/* =========================================================
   PÁGINA ANALISES.PHP — filtros, resumo, grid, paginação
   ========================================================= */

/* Botão do hero (reutilizado em index.php e analises.php) */
.hero-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-hero:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.35);
}

.btn-hero svg {
    transition: transform 0.2s ease;
}

.btn-hero:hover svg {
    transform: translateY(-1px) scale(1.08);
}

.hero-compact h1 {
    font-size: 1.5rem;
}

.hero-compact p {
    font-size: 13.5px;
}

/* Painel de filtros */
.filtros-panel {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.filtro-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.filtro-field input,
.filtro-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    transition: .18s;
}

.filtro-field input:focus,
.filtro-field select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.filtro-field-wide {
    grid-column: span 2;
}

@media (max-width: 720px) {
    .filtro-field-wide {
        grid-column: span 1;
    }
}

.filtros-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.filtros-atalhos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}

.chip-mini {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: .15s;
    font-family: inherit;
}

.chip-mini:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

/* Resumo */
.resumo-analises {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.resumo-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.resumo-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.resumo-valor {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -.02em;
}

.resumo-ok {
    color: #059669;
}

.resumo-erro {
    color: #dc2626;
}

/* Loading */
.app-hist-loading {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.app-hist-loading .spinner {
    display: inline-block;
    width: 38px;
    height: 38px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.app-hist-loading p {
    margin: 0;
    font-size: 14px;
}

/* Paginação */
.paginacao {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding: 16px;
}

.pag-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    color: #334155;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
    font-family: inherit;
}

.pag-btn:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #f5f8ff;
}

.pag-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pag-info {
    font-size: 13.5px;
    color: #475569;
}

.pag-info strong {
    color: #1e293b;
}

/* Responsivo — filtros em mobile */
@media (max-width: 640px) {
    .filtros-panel {
        padding: 16px 16px;
    }

    .filtros-atalhos {
        margin-left: 0;
        width: 100%;
    }

    .filtros-actions .btn-primary,
    .filtros-actions .btn-ghost {
        flex: 1;
    }

    .pag-btn span {
        display: none;
    }
}


/* ===== Botão "Ver todas as análises" no hero ===== */
.hero-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-hero:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.35);
}

.btn-hero svg {
    transition: transform 0.2s ease;
}

.btn-hero:hover svg {
    transform: translateY(-1px) scale(1.08);
}





















/* =========================================================
   PÁGINA ANALISES.PHP — filtros, resumo, grid, paginação
   ========================================================= */

/* Botão do hero (reutilizado em index.php e analises.php) */
.hero-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-hero:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.35);
}

.btn-hero svg {
    transition: transform 0.2s ease;
}

.btn-hero:hover svg {
    transform: translateY(-1px) scale(1.08);
}

.hero-compact h1 {
    font-size: 1.5rem;
}

.hero-compact p {
    font-size: 13.5px;
}

/* Painel de filtros */
.filtros-panel {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.filtro-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.filtro-field input,
.filtro-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    transition: .18s;
}

.filtro-field input:focus,
.filtro-field select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.filtro-field-wide {
    grid-column: span 2;
}

@media (max-width: 720px) {
    .filtro-field-wide {
        grid-column: span 1;
    }
}

.filtros-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.filtros-atalhos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}

.chip-mini {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: .15s;
    font-family: inherit;
}

.chip-mini:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

/* Resumo */
.resumo-analises {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.resumo-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.resumo-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.resumo-valor {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -.02em;
}

.resumo-ok {
    color: #059669;
}

.resumo-erro {
    color: #dc2626;
}

/* Loading */
.app-hist-loading {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.app-hist-loading .spinner {
    display: inline-block;
    width: 38px;
    height: 38px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.app-hist-loading p {
    margin: 0;
    font-size: 14px;
}

/* Paginação */
.paginacao {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding: 16px;
}

.pag-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    color: #334155;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
    font-family: inherit;
}

.pag-btn:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #f5f8ff;
}

.pag-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pag-info {
    font-size: 13.5px;
    color: #475569;
}

.pag-info strong {
    color: #1e293b;
}

/* Responsivo — filtros em mobile */
@media (max-width: 640px) {
    .filtros-panel {
        padding: 16px 16px;
    }

    .filtros-atalhos {
        margin-left: 0;
        width: 100%;
    }

    .filtros-actions .btn-primary,
    .filtros-actions .btn-ghost {
        flex: 1;
    }

    .pag-btn span {
        display: none;
    }
}

.btn-logout {
    /* Reset de button */
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
    margin: 0;
    color: inherit;
    text-align: inherit;
    line-height: inherit;

    /* Seu estilo original vai aqui (o que já existe no style.css) */
    /* ... */
}



.app-hist-ext[data-ext="pdf" i] {
    background: #ef4444;
}

.app-hist-ext[data-ext="docx" i] {
    background: #2563eb;
}

.app-hist-ext[data-ext="doc" i] {
    background: #1d4ed8;
}

.app-hist-ext[data-ext="xlsx" i] {
    background: #16a34a;
}

.app-hist-ext[data-ext="xls" i] {
    background: #15803d;
}

.app-hist-ext[data-ext="pptx" i] {
    background: #ea580c;
}

.app-hist-ext[data-ext="ppt" i] {
    background: #c2410c;
}

.app-hist-ext[data-ext="txt" i] {
    background: #64748b;
}

.app-hist-ext[data-ext="csv" i] {
    background: #0891b2;
}

.app-hist-ext[data-ext="rtf" i] {
    background: #7c3aed;
}

.app-hist-ext[data-ext="odt" i] {
    background: #0d9488;
}

.app-hist-ext[data-ext="html" i] {
    background: #0ea5e9;
}

.app-hist-ext[data-ext="md" i] {
    background: #334155;
}