/* Operlync — padrão leve aprovado em 01/11/2026.
   Camada visual compartilhada. Cores de marca, estados e impressão preservados.
   !important apenas nas propriedades tipográficas/visuais que substituem os
   pesos e cabeçalhos específicos dos módulos e do CSS isolado do Blazor. */
@media screen {
    :root {
        --fincore-background: #f4f7fb;
        --fincore-border: #dce4ed;
        --fincore-muted: #586b80;
        --fincore-shadow: 0 4px 18px rgba(15, 35, 60, .035);
        --fincore-shadow-hover: 0 8px 24px rgba(15, 35, 60, .07);
    }
    body { font-family: "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.5; }
    h1, .feature-title { font-size: clamp(25px, 2.1vw, 30px) !important; font-weight: 600 !important; letter-spacing: -.025em !important; line-height: 1.25 !important; }
    h2, .feature-table-title, .form-section-title { font-size: 21px !important; font-weight: 600 !important; letter-spacing: -.015em !important; line-height: 1.35 !important; }
    h3 { font-size: 17px !important; font-weight: 600 !important; line-height: 1.4 !important; }
    :is(.module-header,.page-header,.feature-header,.finance-page-header,.dashboard-header) { gap: 20px; }
    :is(.module-subtitle,.feature-subtitle,.page-header p,.module-header p,.finance-page-header p) { font-size: 14px; line-height: 1.5; }
    :is(.summary-card,.feature-card,.finance-summary-card,.dashboard-summary-card) { border-radius: 16px; padding: 20px; gap: 16px; }
    :is(.summary-card,.finance-summary-card,.dashboard-summary-card) strong,
    .feature-card-value { font-weight: 600 !important; font-size: clamp(22px, 1.8vw, 28px) !important; line-height: 1.2 !important; }
    :is(.summary-card,.finance-summary-card,.dashboard-summary-card) span:not([class*="icon"]),
    .feature-card-label { font-size: 13px; font-weight: 500 !important; line-height: 1.4; }
    :is(.table-header,.table-card-header,.feature-table-header,.finance-table-header) { padding: 20px 24px; gap: 16px; }
    :is(.table-header,.table-card-header,.finance-table-header) > span,
    :is(.table-header,.table-card-header,.finance-table-header) > div > span { font-size: 13px; font-weight: 400 !important; }

    :is(.data-table,.app-table,.feature-table,.finance-table,.table.table-striped) thead,
    :is(.data-table,.app-table,.feature-table,.finance-table,.table.table-striped) thead th {
        background: #f3f6fa !important; color: #43566c !important;
        border-bottom: 1px solid #dce4ed;
    }
    :is(.data-table,.app-table,.feature-table,.finance-table,.table.table-striped) th {
        font-size: 12px !important; font-weight: 600 !important; line-height: 1.4;
        padding: 14px 16px; letter-spacing: .15px; text-transform: none;
    }
    :is(.data-table,.app-table,.feature-table,.finance-table,.table.table-striped) td {
        font-size: 14px; line-height: 1.5; padding: 18px 16px; border-bottom-color: #e8edf3;
    }
    :is(.data-table,.app-table,.feature-table,.finance-table) td strong { font-weight: 600 !important; line-height: 1.45 !important; }
    :is(.data-table,.app-table,.feature-table,.finance-table) tbody tr:not([class]):nth-child(even) { background: #fafbfd; }
    :is(.data-table,.app-table,.feature-table,.finance-table) tbody tr:not([class]):hover { background: #f0f5fd; }
    :is(.entity-subtitle,.finance-description-cell span,.finance-row-subtitle) { font-size: 13px; line-height: 1.45; }
    :is(.money-cell,.currency-cell) { font-variant-numeric: tabular-nums; }
    :is(.status-pill,.badge,.type-badge,.feature-badge,.finance-status,.unit-status-badge,.finance-type-pill) { font-size: 12px !important; font-weight: 600 !important; line-height: 1.4 !important; }

    :is(.form-grid,.form-grid-two,.form-grid-three,.finance-form-grid) { gap: 18px 20px; }
    label, .form-label { font-size: 13px !important; font-weight: 500 !important; line-height: 1.4; }
    :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]) {
        font-family: inherit; font-size: 14px; font-weight: 400; border-radius: 9px; border-color: #cbd7e5;
    }
    input::placeholder, textarea::placeholder { color: #687c92; }
    :is(.primary-button,.secondary-button,.danger-button,.success-button,.form-button-primary,.form-button-secondary,.form-button-danger,.btn,.btn-primary,.btn-secondary) {
        font-size: 14px !important; font-weight: 600 !important; border-radius: 9px; box-shadow: none; line-height: 1.4;
    }
    :is(.secondary-button,.form-button-secondary,.btn-secondary) { background: #fff; color: #2454ab; border: 1px solid #d4dfec; }
    :is(.secondary-button,.form-button-secondary,.btn-secondary):hover { background: #eef4ff; border-color: #9eb8e0; }
    .kebab-button {
        display: inline-flex !important; align-items: center; justify-content: center;
        width: 32px !important; height: 32px !important; min-width: 32px !important; min-height: 32px !important;
        padding: 0 !important; border-radius: 6px !important; border: 1px solid #d4dfec;
        background: #fff; color: #315b97; box-shadow: none !important; font-size: 21px; line-height: 1;
    }
    .kebab-button:hover { background: #edf3fc; border-color: #a3bbdd; }
    .kebab-button:focus-visible { outline: 2px solid #2454ab; outline-offset: 3px; }
    :is(.kebab-menu,.app-action-popover) { border-radius: 10px !important; padding: 6px !important; border: 1px solid #dce4ed; box-shadow: 0 8px 26px #102b491a; }
    :is(.kebab-menu,.app-action-popover) > button { min-height: 38px; padding: 9px 12px !important; font-size: 14px !important; font-weight: 500 !important; line-height: 1.4; border-radius: 6px !important; text-align: left; }
    .table-footer { font-size: 13px; font-weight: 400; padding: 16px 24px; }
    /* Balões têm contraste próprio, sem herdar a cor dos parágrafos comuns. */
    .chat-bubble.sent p { color: #fff; }
    .chat-bubble.received p { color: #142d49; }
}
@media screen and (max-width:700px) {
    :is(.summary-card,.feature-card,.finance-summary-card,.dashboard-summary-card) { padding: 16px; gap: 12px; }
    :is(.table-header,.table-card-header,.feature-table-header,.finance-table-header) { padding: 16px; }
    h2, .feature-table-title, .form-section-title { font-size: 19px !important; }
}
@media screen and (pointer:coarse) {
    .kebab-button { width:44px !important; height:44px !important; }
}

.operlync-nav-icon { display:inline-block; flex-shrink:0; vertical-align:middle; }
.sidebar-icon:has(.operlync-nav-icon) { display:inline-flex; align-items:center; justify-content:center; }

/* Navegação móvel: botão sempre acessível, menu com rolagem própria. */
.menu-toggle, .sidebar-close { display:none; }
@media screen and (max-width:900px) {
    .menu-toggle { display:inline-flex; align-items:center; justify-content:center; flex:0 0 44px; width:44px; height:44px; }
    .sidebar-close { display:flex; align-items:center; justify-content:center; position:absolute; top:8px; right:8px; z-index:2; width:44px; height:44px; border:1px solid #56718f; border-radius:8px; color:#fff; background:#102c50; cursor:pointer; }
    .fincore-sidebar { width:min(300px,calc(100vw - 52px)); visibility:hidden; }
    .fincore-sidebar.is-open { visibility:visible; }
    .fincore-sidebar .sidebar-brand { padding-right:54px; }
    .fincore-header { gap:10px; padding:0 12px; }
    .header-left { gap:10px; min-width:0; flex:1; }
    .header-left > div:last-child { min-width:0; }
    .header-product { font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .header-actions { flex-shrink:0; gap:8px; }
    .header-company-logo { flex-shrink:0; }
    body:has(.fincore-sidebar.is-open) { overflow:hidden; }
    .sidebar-navigation { overscroll-behavior:contain; }
}
@media screen and (max-width:480px) {
    .header-company-logo { display:none; }
}
@media (prefers-reduced-motion:reduce) { .fincore-sidebar { transition:none; } }

/* Segunda etapa: seleção de módulos, relatórios e janelas de cadastro. */
@media screen {
    .module-grid,.reports-grid { gap:20px !important; }
    .module-selection > p { font-size:15px !important; margin-bottom:24px !important; }
    .module-card {
        background:linear-gradient(125deg,var(--card-color,#1d4ed8),color-mix(in srgb,var(--card-color,#1d4ed8) 82%,#102b49)) !important; color:#fff !important;
        border:1px solid transparent;
        border-radius:16px !important; padding:24px !important;
        box-shadow:var(--fincore-shadow) !important;
    }
    .module-card:hover { transform:translateY(-2px) !important; box-shadow:var(--fincore-shadow-hover) !important; }
    .module-card .card-main { gap:20px !important; min-height:130px !important; }
    .module-card .card-icon { width:60px !important; height:60px !important; font-size:26px !important; border:0 !important; border-radius:14px !important; background:#ffffff20 !important; color:#fff !important; }
    .module-card h2 { color:#fff !important; text-shadow:none !important; margin-bottom:8px !important; }
    .module-card .card-main p { color:#fff !important; font-size:14px; font-weight:400 !important; line-height:1.5 !important; }
    .module-card .card-status { background:#f0f4f9 !important; color:#43566c !important; font-weight:500 !important; font-size:12px !important; }
    .module-card .card-action { color:#fff !important; border-top:1px solid #ffffff60 !important; margin-top:20px !important; padding-top:16px !important; font-size:14px; font-weight:600 !important; }
    .report-module-card { background:#fff !important; color:#203a56 !important; border:1px solid #dce4ed !important; border-top:3px solid var(--area-color,#1d4ed8) !important; grid-template-columns:56px minmax(0,1fr) !important; min-height:200px !important; padding:24px !important; box-shadow:var(--fincore-shadow) !important; }
    .report-financeiro { --area-color:#2454ab; }
    .report-custos { --area-color:#087c7c; }
    .report-manutencao { --area-color:#a85800; }
    .report-contratos { --area-color:#08784b; }
    .report-documentos { --area-color:#4859ae; }
    .report-pessoal { --area-color:#77549c; }
    .report-module-icon { width:52px !important; height:52px !important; font-size:25px !important; color:var(--area-color,#2454ab) !important; background:color-mix(in srgb,var(--area-color,#2454ab) 10%,white) !important; border:0 !important; border-radius:12px !important; }
    .report-module-content strong { font-size:18px !important; font-weight:600 !important; line-height:1.4 !important; }
    .report-module-content > span { color:#586b80 !important; font-size:14px !important; }
    .report-module-content small { background:#f0f4f9 !important; font-weight:500 !important; }
    .report-module-action { border-top:1px solid #e5ebf2 !important; color:#2454ab !important; font-weight:600 !important; }
    .report-module-card:focus-visible { outline:2px solid #2454ab !important; outline-offset:3px; }
    .report-choice strong,.available-report-row strong,.access-tab,.details-button { font-weight:600 !important; }
    .report-choice { box-shadow:none !important; }
    .report-choice small { font-size:13px !important; line-height:1.5 !important; }
    :is(.invoice-modal,.request-form-modal,.maintenance-modal,.supplier-modal,.classification-modal,.access-modal,.report-modal,.finance-payment-dialog) { border-radius:16px !important; box-shadow:0 16px 48px #102b4924 !important; }
    :is(.invoice-modal-overlay,.request-form-overlay,.maintenance-modal-overlay,.supplier-modal-overlay,.classification-modal-overlay,.report-modal-backdrop) { background:rgba(15,30,50,.46) !important; backdrop-filter:blur(2px) !important; }
    :is(.filter-card,.feature-filters,.finance-filter-card,.finance-filters-card) { background:#f8fafc; box-shadow:none; }
    :is(.form-card-header,.form-section-header,.permissions-heading) { margin-bottom:20px; }
    :is(.form-help,.access-required-note,.form-section-description) { font-size:13px; line-height:1.5; }
    .sidebar-link { font-size:14px; font-weight:500; }
    .sidebar-link span:last-child { font-weight:500; }
    .chat-person h2,.chat-contacts h2 { font-size:17px !important; }
}
@media screen and (max-width:700px) {
    .module-card,.report-module-card { padding:18px !important; }
    .module-card .card-main { gap:14px !important; }
    .module-card .card-icon { width:44px !important; height:44px !important; font-size:22px !important; }
    .report-module-card { grid-template-columns:44px minmax(0,1fr) !important; }
    .report-module-icon { width:40px !important; height:40px !important; font-size:22px !important; }
    :is(.supplier-modal-overlay,.classification-modal-overlay) { padding:12px !important; }
    :is(.supplier-modal,.classification-modal) { width:100% !important; max-height:calc(100dvh - 24px) !important; }
}
.sidebar-link .chat-nav-count { margin-left:auto; flex-shrink:0; border-radius:12px; padding:2px 7px; background:#dbeafe; color:#123e95; font-size:12px; font-weight:700; line-height:1.5; }
.notification-group-title { margin:0; padding:10px 16px; background:#f3f6fa; color:#42566d; font-size:13px; font-weight:600; }

/* Tabelas extensas não devem comprimir palavras nem alargar a página. */
@media screen {
    :is(.payment-requests-page,.credit-cards-page,.accounts-page,.financial-classifications-page) .table-responsive {
        width:100%; max-width:100%; min-width:0; overflow:auto;
    }
    :is(.payment-requests-page,.accounts-page,.financial-classifications-page) .data-table,
    .credit-cards-page .app-table { table-layout:auto; }
    .payment-requests-page .data-table { min-width:1200px; }
    .credit-cards-page .app-table { min-width:1100px; }
    .accounts-page .data-table { min-width:1050px; }
    .financial-classifications-page .data-table { min-width:850px; }
    :is(.payment-requests-page,.credit-cards-page,.accounts-page,.financial-classifications-page) :is(th,td) {
        word-break:normal; overflow-wrap:normal;
    }
    :is(.payment-requests-page,.credit-cards-page,.accounts-page,.financial-classifications-page) .table-responsive:has(.is-open) { padding-bottom:180px; }
}
@media screen and (max-width:900px) {
    .auth-shell { grid-template-columns:minmax(0,1fr); min-height:100dvh; }
    .auth-brand-panel { min-height:0; padding:20px; gap:0; }
    .auth-brand-message { display:none; }
    .auth-content { padding:20px 16px; min-width:0; align-items:start; }
    .auth-card { width:100%; max-width:460px; margin:0 auto; }
    .auth-form input { font-size:16px; }
}
