/*
    Estilos globais

    1. Estilos personalizados dos componentes de formulário
    2. Estilos da barra de rolagem
*/


/* Start:: 1. Estilos personalizados dos componentes de formulário */
/* Start:: 1. Estilos personalizados dos componentes de formulário */
/* Start:: 1. Estilos personalizados dos componentes de formulário */

.input-container .input {
    font-size: 1em;
    padding: 0.5em 1em;
    border: none;
    border-radius: 6px;
    background-color: var(--form-control-bg);
    border: 1px solid var(--input-border);
    color: var(--default-text-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    max-width: 210px;
}

    .input-container .input:focus {
        outline: none;
        border-color: var(--primary05);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .input-container .input::placeholder {
        color: #999;
    }

/* Para navegadores Webkit (Chrome, Safari, Edge) */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Para Firefox */
input[type=number] {
    -moz-appearance: textfield;
}

/* End:: 1. Estilos personalizados dos componentes de formulário */
/* End:: 1. Estilos personalizados dos componentes de formulário */
/* End:: 1. Estilos personalizados dos componentes de formulário */



/* Start:: 2. Estilos da barra de rolagem */
/* Start:: 2. Estilos da barra de rolagem */
/* Start:: 2. Estilos da barra de rolagem */

/* Estiliza a barra de rolagem geral da página */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0.25rem;
    height: 0.25rem;
    -webkit-transition: all ease 0.05s;
    transition: all ease 0.05s;
    background: rgb(var(--light-rgb));
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: var(--primary05);
    -webkit-transition: background 0.3s ease;
    transition: background 0.3s ease;
}

    html::-webkit-scrollbar-thumb:hover,
    body::-webkit-scrollbar-thumb:hover {
        background: rgb(var(--primary-rgb));
    }

/* Mantém o estilo das barras de rolagem de elementos internos */
body *::-webkit-scrollbar {
    width: 0.35rem;
    height: 0.35rem;
    -webkit-transition: all ease 0.05s;
    transition: all ease 0.05s;
    background: rgb(var(--light-rgb));
}

body *::-webkit-scrollbar-thumb {
    background: var(--primary05);
    -webkit-transition: background 0.3s ease;
    transition: background 0.3s ease;
}

    body *::-webkit-scrollbar-thumb:hover {
        background: rgb(var(--primary-rgb));
    }


.tv-scrollbar::-webkit-scrollbar,
body.tv-scrollbar *::-webkit-scrollbar {
    width: 0.7rem;
    height: 0.7rem;
}

.tv-scrollbar::-webkit-scrollbar-thumb,
body.tv-scrollbar *::-webkit-scrollbar-thumb {
    background: var(--primary05);
}

/* End:: 2. Estilos da barra de rolagem */
/* End:: 2. Estilos da barra de rolagem */
/* End:: 2. Estilos da barra de rolagem */

/* Start:: 3. Dashboards — destaque na linha (faixa na primeira coluna) */
/*
   Uso: aplique o modificador no <tr> (ex.: SimpleList RowClass).
   Cores via variáveis Bootstrap (--bs-*). Para listas em <div>, use
   .dash-stack-item + .dash-stack-item--accent-* (borda à esquerda no próprio bloco).
*/
tr.dash-table-row--accent-danger > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--bs-danger);
}

tr.dash-table-row--accent-warning > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--bs-warning);
}

tr.dash-table-row--accent-success > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--bs-success);
}

tr.dash-table-row--accent-primary > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--bs-primary);
}

tr.dash-table-row--accent-info > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--bs-info);
}

tr.dash-table-row--accent-secondary > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--bs-secondary);
}

.dash-stack-item {
    border-inline-start: 3px solid transparent;
}

.dash-stack-item--accent-danger {
    border-inline-start-color: var(--bs-danger);
}

.dash-stack-item--accent-warning {
    border-inline-start-color: var(--bs-warning);
}

.dash-stack-item--accent-success {
    border-inline-start-color: var(--bs-success);
}

.dash-stack-item--accent-primary {
    border-inline-start-color: var(--bs-primary);
}

.dash-stack-item--accent-info {
    border-inline-start-color: var(--bs-info);
}

.dash-stack-item--accent-secondary {
    border-inline-start-color: var(--bs-secondary);
}

/* End:: 3. Dashboards — destaque na linha */

/* Start:: 4. Estruturas reutilizáveis de dashboards */
.card.custom-card.dashboard-sticky-panel {
    position: sticky;
    top: 4.75rem;
    z-index: 2;
}

.card.custom-card.dashboard-selector-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 5.75rem) !important;
    height: calc(100dvh - 5.75rem) !important;
    min-height: calc(100vh - 5.75rem);
    min-height: calc(100dvh - 5.75rem);
    max-height: calc(100vh - 5.75rem);
    max-height: calc(100dvh - 5.75rem);
    overflow: hidden;
}

.dashboard-selector-panel > .card-header {
    flex: 0 0 auto;
    min-height: 6.25rem;
}

.dashboard-selector-panel > .card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.dashboard-selector-toolbar {
    flex: 0 0 auto;
    padding: .75rem 1.25rem;
}

.dashboard-selector-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.dashboard-selector-panel .dashboard-selector-option {
    padding-inline: 1.25rem;
}

.dashboard-selection-summary > .card-body {
    min-height: 6.25rem;
}

.dashboard-selector-option,
.dashboard-filter-option {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    margin: 0;
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--default-border);
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
}

.dashboard-selector-option:last-of-type,
.dashboard-filter-option:last-of-type {
    border-bottom: 0;
}

.dashboard-selector-option:hover,
.dashboard-selector-option.is-selected,
.dashboard-filter-option:hover {
    background-color: var(--primary005);
}

.dashboard-metric-tile {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 72px;
    padding: .75rem;
    border-inline-end: 1px solid var(--default-border);
    border-bottom: 1px solid var(--default-border);
}

.dashboard-metric-tile--featured {
    min-height: 82px;
}

.dashboard-metric-tile--compact {
    min-height: 68px;
}

.dashboard-summary-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--default-border);
    font-size: .78rem;
}

.dashboard-summary-list > div:last-child,
.dashboard-list-row:last-child,
.dashboard-progress-item:last-child {
    border-bottom: 0;
}

.dashboard-list-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--default-border);
}

.dashboard-progress-item {
    padding: .7rem 0;
    border-bottom: 1px solid var(--default-border);
}

.dashboard-detail-table thead th {
    padding-block: .65rem;
    background-color: rgb(var(--light-rgb));
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.dashboard-detail-table tbody td {
    padding-block: .7rem;
}

.dashboard-detail-table tbody tr:hover {
    background-color: var(--primary005);
}

.dashboard-screen-only {
    display: block;
}

.dashboard-refresh-region {
    position: relative;
}

.dashboard-refresh-content {
    transition: opacity 160ms ease, filter 160ms ease;
}

.dashboard-refresh-region.is-refreshing .dashboard-refresh-content {
    opacity: .58;
    filter: saturate(.78);
    pointer-events: none;
    user-select: none;
}

.dashboard-refresh-status {
    position: sticky;
    top: calc(50vh - 2.2rem);
    z-index: 12;
    display: flex;
    align-items: center;
    gap: .9rem;
    width: min(32rem, calc(100% - 2rem));
    min-height: 4.4rem;
    margin: 0 auto -4.4rem;
    padding: .8rem 1rem;
    border: 1px solid var(--default-border);
    border-radius: .45rem;
    background: var(--custom-white);
    color: var(--default-text-color);
    pointer-events: none;
}

.dashboard-refresh-status .spinner-border {
    width: 1.35rem;
    height: 1.35rem;
    border-width: .14rem;
    flex: 0 0 auto;
}

.dashboard-refresh-status__copy {
    display: block;
    min-width: 0;
    line-height: 1.2;
}

.dashboard-refresh-status__copy strong,
.dashboard-refresh-status__copy small {
    display: block;
}

.dashboard-refresh-status__copy strong {
    font-size: .8rem;
    font-weight: 700;
}

.dashboard-refresh-status__copy small {
    margin-top: .18rem;
    color: var(--text-muted);
    font-size: .7rem;
    line-height: 1.3;
}

.dashboard-print-report {
    display: none;
}

@media (max-width: 575.98px) {
    .dashboard-metric-tile {
        min-height: 66px;
        padding: .6rem;
    }

    .dashboard-list-row {
        align-items: flex-start;
    }

}

@media (prefers-reduced-motion: reduce) {
    .dashboard-selector-option,
    .dashboard-filter-option,
    .dashboard-refresh-content {
        transition: none;
    }

    .dashboard-refresh-status .spinner-border {
        animation: none;
    }
}

/* End:: 4. Estruturas reutilizáveis de dashboards */

/* Start:: 5. Relatórios impressos de dashboards */
@page dashboard-report {
    size: A4 landscape;
    margin: 9mm 10mm;
}

@media print {
    body.print-mode {
        background: #fff !important;
        color: #172033 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.print-mode #app-header,
    body.print-mode #sidebar,
    body.print-mode .page > .footer,
    body.print-mode .offcanvas,
    body.print-mode .offcanvas-backdrop,
    body.print-mode .modal,
    body.print-mode .tooltip,
    body.print-mode .scrollToTop,
    body.print-mode .dashboard-screen-only {
        display: none !important;
    }

    body.print-mode #main-content {
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.print-mode #main-content > .container-fluid {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.print-mode .dashboard-print-report {
        display: block !important;
        width: 100%;
        color: #172033;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 8.5pt;
        line-height: 1.25;
    }

    body.print-mode .dashboard-report-page {
        display: flex;
        flex-direction: column;
        min-height: 186mm;
        overflow: visible;
        page: dashboard-report;
        break-after: page;
        page-break-after: always;
    }

    body.print-mode .dashboard-report-page > * {
        flex-shrink: 0;
    }

    body.print-mode .dashboard-report-page--last {
        break-after: auto;
        page-break-after: auto;
    }

    body.print-mode .dashboard-report-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12mm;
        padding-bottom: 4mm;
        border-bottom: .7mm solid #0f6cbd;
    }

    body.print-mode .dashboard-report-eyebrow {
        display: block;
        margin-bottom: 1mm;
        color: #0f6cbd;
        font-size: 7pt;
        font-weight: 700;
        letter-spacing: .14em;
    }

    body.print-mode .dashboard-report-header h1 {
        margin: 0;
        color: #172033;
        font-size: 18pt;
        font-weight: 700;
        line-height: 1.05;
    }

    body.print-mode .dashboard-report-header p {
        margin: 1.5mm 0 .5mm;
        font-size: 10pt;
        font-weight: 700;
    }

    body.print-mode .dashboard-report-header small,
    body.print-mode .dashboard-report-header-meta span,
    body.print-mode .dashboard-report-header-meta small {
        color: #5e6878;
        font-size: 7.5pt;
    }

    body.print-mode .dashboard-report-header-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: .7mm;
        text-align: right;
        white-space: nowrap;
    }

    body.print-mode .dashboard-report-header-meta strong {
        color: #172033;
        font-size: 9pt;
    }

    body.print-mode .dashboard-report-metric-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2.5mm;
        margin-top: 4mm;
    }

    body.print-mode .dashboard-report-metric-grid--compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5mm;
        margin-top: 0;
    }

    body.print-mode .dashboard-report-metric-grid,
    body.print-mode .dashboard-report-columns,
    body.print-mode .dashboard-report-metric,
    body.print-mode .dashboard-report-key-value {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.print-mode .dashboard-report-metric {
        min-width: 0;
        padding: 2.5mm 3mm;
        border: .25mm solid #d9dee7;
        border-radius: 1.5mm;
        background: #f7f9fc;
    }

    body.print-mode .dashboard-report-metric span,
    body.print-mode .dashboard-report-metric small {
        display: block;
        overflow: hidden;
        color: #667085;
        font-size: 7pt;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.print-mode .dashboard-report-metric strong {
        display: block;
        margin: .8mm 0;
        color: #172033;
        font-size: 11pt;
        white-space: nowrap;
    }

    body.print-mode .dashboard-report-metric-grid--compact .dashboard-report-metric {
        padding: 1.8mm 2mm;
    }

    body.print-mode .dashboard-report-metric-grid--compact .dashboard-report-metric strong {
        margin-bottom: 0;
        font-size: 9pt;
    }

    body.print-mode .dashboard-report-metric-grid--compact .dashboard-report-metric span {
        min-height: 4.5mm;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    body.print-mode .dashboard-report-section {
        margin-top: 4mm;
    }

    body.print-mode .dashboard-report-section-title {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 4mm;
        margin-bottom: 1.5mm;
        break-after: avoid;
        page-break-after: avoid;
    }

    body.print-mode .dashboard-report-section-title h2 {
        margin: 0;
        color: #172033;
        font-size: 10pt;
        font-weight: 700;
    }

    body.print-mode .dashboard-report-section-title span {
        color: #667085;
        font-size: 7pt;
    }

    body.print-mode .dashboard-report-columns {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5mm;
    }

    body.print-mode .dashboard-report-table,
    body.print-mode .dashboard-report-key-value {
        width: 100%;
        border-collapse: collapse;
        color: #172033;
    }

    body.print-mode .dashboard-report-table--activity {
        table-layout: fixed;
    }

    body.print-mode .dashboard-report-table--activity th:first-child,
    body.print-mode .dashboard-report-table--activity td:first-child {
        width: 58%;
    }

    body.print-mode .dashboard-report-table--sales th:nth-child(2),
    body.print-mode .dashboard-report-table--sales td:nth-child(2),
    body.print-mode .dashboard-report-table--clients th:nth-child(3),
    body.print-mode .dashboard-report-table--clients td:nth-child(3) {
        width: 17%;
    }

    body.print-mode .dashboard-report-table--sales th:nth-child(3),
    body.print-mode .dashboard-report-table--sales td:nth-child(3),
    body.print-mode .dashboard-report-table--clients th:nth-child(2),
    body.print-mode .dashboard-report-table--clients td:nth-child(2) {
        width: 25%;
    }

    body.print-mode .dashboard-report-table--activity td:first-child strong,
    body.print-mode .dashboard-report-table--activity td:first-child small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.print-mode .dashboard-report-table thead {
        display: table-header-group;
    }

    body.print-mode .dashboard-report-table tr,
    body.print-mode .dashboard-report-key-value tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.print-mode .dashboard-report-table th,
    body.print-mode .dashboard-report-table td {
        padding: 1.4mm 1.7mm;
        border: .25mm solid #d9dee7;
        vertical-align: middle;
    }

    body.print-mode .dashboard-report-table .text-end,
    body.print-mode .dashboard-report-key-value th {
        white-space: nowrap;
    }

    body.print-mode .dashboard-report-table thead th,
    body.print-mode .dashboard-report-table tfoot th {
        background: #eaf2fb;
        color: #24324a;
        font-size: 7pt;
        font-weight: 700;
    }

    body.print-mode .dashboard-report-table tbody tr:nth-child(even) td {
        background: #f8fafc;
    }

    body.print-mode .dashboard-report-table small {
        color: #667085;
        font-size: 6.5pt;
    }

    body.print-mode .dashboard-report-key-value td,
    body.print-mode .dashboard-report-key-value th {
        padding: 1.2mm 0;
        border-bottom: .25mm solid #e5e8ee;
    }

    body.print-mode .dashboard-report-key-value td {
        color: #5e6878;
        font-weight: 400;
    }

    body.print-mode .dashboard-report-key-value th {
        text-align: right;
    }

    body.print-mode .dashboard-report-footer {
        display: flex;
        justify-content: space-between;
        margin-top: auto;
        padding-top: 3mm;
        border-top: .25mm solid #d9dee7;
        color: #667085;
        font-size: 6.5pt;
    }
}

/* End:: 5. Relatórios impressos de dashboards */
