/* =========================================================
   DASHBOARD LCA COMERCIAL
   Paleta: #007EDA, #3B4D63, #FFFFFF e #000000
   ========================================================= */

:root {
    --azul: #007EDA;
    --azul-escuro: #006AB8;
    --cinza-azulado: #3B4D63;
    --cinza-escuro: #29394D;
    --branco: #FFFFFF;
    --preto: #000000;
    --fundo: #F4F7FA;
    --borda: #E4EAF0;
    --texto-suave: #718096;
    --largura-menu: 276px;
    --largura-menu-fechado: 86px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: #17212F;
    background: var(--fundo);
    font-family: Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-small {
    width: 17px;
    height: 17px;
}

.icon-mini {
    width: 14px;
    height: 14px;
}

.svg-library {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 200;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--branco);
    background: var(--azul);
}

.skip-link:focus {
    top: 12px;
}

/* MENU LATERAL */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: var(--largura-menu);
    flex-direction: column;
    overflow: hidden;
    color: var(--branco);
    background:
        radial-gradient(circle at 15% 94%, rgba(0, 126, 218, .22), transparent 32%),
        linear-gradient(180deg, #3B4D63 0%, #304157 54%, #29394D 100%);
    box-shadow: 8px 0 32px rgba(28, 42, 57, .12);
    transition: width .25s ease, transform .25s ease;
}

.brand-area {
    position: relative;
    display: grid;
    min-height: 118px;
    place-items: center;
    padding: 20px 18px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .11);
}

.brand-full {
    display: grid;
    width: 100%;
    height: 76px;
    place-items: center;
    padding: 13px 16px;
    border-radius: 14px;
    background: var(--branco);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .15);
}

.brand-full img {
    display: block;
    width: 100%;
    height: 50px;
    object-fit: contain;
}

.brand-mini {
    display: none;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: var(--azul);
    background: var(--branco);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.mobile-close {
    display: none;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 16px 20px;
}

.menu-caption {
    display: block;
    padding: 0 14px 12px;
    color: rgba(255, 255, 255, .52);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.menu-list {
    display: grid;
    gap: 4px;
}

.menu-link,
.submenu-link {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    gap: 13px;
    border-radius: 11px;
    color: rgba(255, 255, 255, .78);
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.menu-link {
    padding: 0 13px;
}

.menu-link:hover,
.submenu-link:hover,
.menu-link:focus-visible,
.submenu-link:focus-visible {
    color: var(--branco);
    background: rgba(255, 255, 255, .08);
    outline: none;
}

.menu-icon {
    display: grid;
    min-width: 23px;
    place-items: center;
}

.menu-text {
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.menu-chevron {
    display: grid;
    margin-left: auto;
    transition: transform .2s ease;
}

.menu-group[aria-expanded="true"] .menu-chevron {
    transform: rotate(90deg);
}

.submenu {
    display: grid;
    max-height: 0;
    gap: 2px;
    overflow: hidden;
    opacity: 0;
    transition: max-height .25s ease, opacity .2s ease, padding .25s ease;
}

.submenu.is-open {
    max-height: 250px;
    padding: 4px 0 8px;
    opacity: 1;
}

.submenu-link {
    min-height: 42px;
    padding: 0 12px 0 21px;
}

.submenu-link.is-active {
    color: var(--branco);
    background: rgba(0, 126, 218, .34);
}

.submenu-icon {
    display: none;
}

.submenu-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    margin-right: 10px;
    border: 1px solid rgba(255, 255, 255, .54);
    border-radius: 50%;
}

.submenu-link.is-active .submenu-dot {
    border-color: var(--azul);
    background: var(--azul);
    box-shadow: 0 0 0 4px rgba(0, 126, 218, .16);
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    padding: 14px 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.logout-link {
    color: var(--branco);
    background: rgba(255, 255, 255, .06);
}

.logout-link:hover {
    background: rgba(244, 83, 83, .15);
}

.collapse-button {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .52);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
}

.collapse-button:hover {
    color: var(--branco);
    background: rgba(255, 255, 255, .06);
}

/* TOPO E CONTEÚDO */
.page-area {
    min-height: 100vh;
    margin-left: var(--largura-menu);
    transition: margin-left .25s ease;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    height: 78px;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    border-bottom: 1px solid var(--borda);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 4px 18px rgba(32, 47, 65, .035);
    backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-actions,
.user-profile,
.search-box {
    display: flex;
    align-items: center;
}

.topbar-left {
    gap: 14px;
}

.mobile-menu {
    display: none;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 10px;
    color: var(--cinza-azulado);
    background: #EDF2F6;
    cursor: pointer;
}

.breadcrumb {
    margin-right: 5px;
    color: #9AA7B6;
    font-size: 13px;
}

.current-page {
    color: var(--cinza-azulado);
    font-size: 13px;
}

.topbar-actions {
    gap: 14px;
}

.search-box {
    width: 270px;
    height: 42px;
    gap: 9px;
    padding: 0 11px;
    border: 1px solid var(--borda);
    border-radius: 11px;
    color: #8B98A8;
    background: #F8FAFC;
}

.search-box:focus-within {
    border-color: rgba(0, 126, 218, .55);
    box-shadow: 0 0 0 3px rgba(0, 126, 218, .08);
}

.search-box input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    color: #27384B;
    background: transparent;
    font-size: 13px;
}

.search-box kbd {
    padding: 3px 6px;
    border: 1px solid #DBE3EA;
    border-radius: 5px;
    color: #93A0AE;
    background: var(--branco);
    font-size: 10px;
}

.notification-button {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--borda);
    border-radius: 11px;
    color: var(--cinza-azulado);
    background: var(--branco);
    cursor: pointer;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 7px;
    height: 7px;
    border: 2px solid var(--branco);
    border-radius: 50%;
    background: var(--azul);
}

.user-divider {
    width: 1px;
    height: 32px;
    background: var(--borda);
}

.user-profile {
    gap: 10px;
    color: var(--cinza-azulado);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.avatar {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 11px;
    color: var(--branco);
    background: linear-gradient(145deg, var(--azul), #40A8ED);
    box-shadow: 0 6px 14px rgba(0, 126, 218, .2);
    font-size: 12px;
    font-weight: 800;
}

.user-copy {
    display: grid;
    gap: 2px;
}

.user-copy strong {
    font-size: 12px;
}

.user-copy small {
    color: #8A98A8;
    font-size: 10px;
}

.profile-chevron {
    display: grid;
    transform: rotate(90deg);
}

.main-content {
    width: min(1520px, 100%);
    margin: 0 auto;
    padding: 34px;
}

.welcome-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.eyebrow,
.panel-kicker {
    color: var(--azul);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .15em;
}

.welcome-row h1 {
    margin: 7px 0 5px;
    color: #223145;
    font-size: clamp(27px, 2.4vw, 36px);
    line-height: 1.15;
    letter-spacing: -.03em;
}

.welcome-row h1 span {
    font-size: .72em;
}

.welcome-row p {
    margin: 0;
    color: var(--texto-suave);
    font-size: 14px;
}

.date-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid var(--borda);
    border-radius: 11px;
    color: var(--cinza-azulado);
    background: var(--branco);
    font-size: 12px;
    text-transform: capitalize;
}

.date-icon {
    display: grid;
    place-items: center;
    color: var(--azul);
}

/* CARDS DE INDICADORES */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.stat-card {
    position: relative;
    display: flex;
    min-height: 142px;
    align-items: center;
    gap: 15px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--borda);
    border-radius: 16px;
    background: var(--branco);
    box-shadow: 0 9px 25px rgba(48, 65, 87, .045);
}

.stat-card::after {
    position: absolute;
    right: -26px;
    bottom: -38px;
    width: 105px;
    height: 105px;
    border-radius: 50%;
    background: rgba(0, 126, 218, .035);
    content: "";
}

.stat-icon {
    display: grid;
    width: 49px;
    height: 49px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 13px;
}

.stat-icon-blue {
    color: var(--azul);
    background: rgba(0, 126, 218, .11);
}

.stat-icon-slate {
    color: var(--cinza-azulado);
    background: rgba(59, 77, 99, .1);
}

.stat-copy {
    display: grid;
    gap: 5px;
}

.stat-copy > span {
    color: var(--texto-suave);
    font-size: 12px;
}

.stat-copy > strong {
    color: #202F42;
    font-size: 25px;
    line-height: 1;
    letter-spacing: -.02em;
}

.stat-copy small {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #21966B;
    font-size: 10px;
    font-weight: 700;
}

.card-arrow {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    color: #A3AFBB;
    background: transparent;
    cursor: pointer;
    transition: .18s ease;
}

.card-arrow:hover {
    color: var(--azul);
    background: rgba(0, 126, 218, .08);
    transform: translateX(2px);
}

/* PAINÉIS */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(310px, .75fr);
    gap: 20px;
    margin-bottom: 20px;
}

.panel {
    border: 1px solid var(--borda);
    border-radius: 17px;
    background: var(--branco);
    box-shadow: 0 10px 27px rgba(48, 65, 87, .045);
}

.sales-panel,
.quick-panel {
    min-height: 402px;
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.panel-header h2 {
    margin: 5px 0 0;
    color: #243348;
    font-size: 18px;
    letter-spacing: -.02em;
}

.panel-header select {
    padding: 8px 30px 8px 11px;
    border: 1px solid var(--borda);
    border-radius: 9px;
    outline: 0;
    color: var(--cinza-azulado);
    background: #F8FAFC;
    font-size: 11px;
}

.sales-summary {
    display: flex;
    align-items: flex-end;
    gap: 13px;
    margin-top: 23px;
}

.sales-summary > div {
    display: grid;
    gap: 5px;
}

.sales-summary div span {
    color: var(--texto-suave);
    font-size: 11px;
}

.sales-summary strong {
    color: #17283C;
    font-size: 24px;
}

.positive-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
    padding: 4px 7px;
    border-radius: 6px;
    color: #13805A;
    background: #EAF8F2;
    font-size: 10px;
    font-weight: 700;
}

.chart-wrap {
    position: relative;
    height: 245px;
    margin-top: 12px;
    padding: 0 0 25px 42px;
}

.chart-axis {
    position: absolute;
    inset: 0 auto 25px 0;
    display: flex;
    width: 35px;
    flex-direction: column;
    justify-content: space-between;
    color: #A0ADBA;
    font-size: 9px;
}

.sales-chart {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.grid-lines path {
    fill: none;
    stroke: #EDF1F5;
    stroke-width: 1;
}

.area-path {
    fill: url(#chartFill);
}

.line-path {
    fill: none;
    stroke: var(--azul);
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
}

.sales-chart circle {
    fill: var(--branco);
    stroke: var(--azul);
    stroke-width: 2.3;
    vector-effect: non-scaling-stroke;
}

.chart-months {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 42px;
    display: flex;
    justify-content: space-between;
    color: #8E9BAA;
    font-size: 9px;
}

.quick-list {
    display: grid;
    gap: 9px;
    margin-top: 20px;
}

.quick-list button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--cinza-azulado);
    background: #F7F9FB;
    cursor: pointer;
    text-align: left;
    transition: .18s ease;
}

.quick-list button:hover {
    border-color: rgba(0, 126, 218, .18);
    background: #F2F8FC;
    transform: translateX(2px);
}

.quick-list button > span:nth-child(2) {
    display: grid;
    flex: 1;
    gap: 3px;
}

.quick-list button strong {
    color: #2A3B50;
    font-size: 12px;
}

.quick-list button small {
    color: #8C99A8;
    font-size: 10px;
}

.quick-icon {
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border-radius: 10px;
    color: var(--azul);
    background: rgba(0, 126, 218, .1);
}

.quick-icon-filled {
    color: var(--branco);
    background: var(--azul);
}

.goal-card {
    margin-top: 16px;
    padding: 15px;
    border-radius: 12px;
    color: var(--branco);
    background: linear-gradient(135deg, var(--cinza-azulado), #28394D);
}

.goal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
}

.goal-top strong {
    font-size: 15px;
}

.goal-track {
    height: 6px;
    margin: 11px 0 8px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, .16);
}

.goal-track span {
    display: block;
    width: 76%;
    height: 100%;
    border-radius: inherit;
    background: var(--azul);
}

.goal-card small {
    color: rgba(255, 255, 255, .66);
    font-size: 9px;
}

/* TABELA */
.orders-panel {
    overflow: hidden;
}

.orders-heading {
    padding: 22px 24px 17px;
}

.text-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--azul);
    background: rgba(0, 126, 218, .08);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 12px 20px;
    color: #8492A2;
    background: #F8FAFC;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

td {
    padding: 13px 20px;
    border-top: 1px solid #EDF1F4;
    color: #58687A;
    font-size: 11px;
    white-space: nowrap;
}

tbody tr:hover {
    background: #FBFDFF;
}

.order-id {
    color: var(--azul);
}

.client-cell {
    display: flex;
    align-items: center;
    gap: 9px;
}

.client-cell > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    color: var(--cinza-azulado);
    background: #EAF0F5;
    font-size: 9px;
    font-weight: 800;
}

.client-cell strong,
td > strong {
    color: #29394C;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
}

.status-concluido {
    color: #17815C;
    background: #E9F7F1;
}

.status-analise {
    color: #946D10;
    background: #FFF6DC;
}

.status-pendente {
    color: #B24C4C;
    background: #FFEDED;
}

.row-action {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 8px;
    color: #9EABB8;
    background: transparent;
    cursor: pointer;
}

.row-action:hover {
    color: var(--azul);
    background: #EDF7FD;
}

.page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 34px 24px;
    color: #8E9BAA;
    font-size: 10px;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    max-width: min(360px, calc(100vw - 32px));
    padding: 13px 17px;
    border-left: 4px solid var(--azul);
    border-radius: 10px;
    color: var(--branco);
    background: var(--cinza-escuro);
    box-shadow: 0 14px 35px rgba(0, 0, 0, .22);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity .2s ease, transform .2s ease;
    font-size: 13px;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.sidebar-backdrop {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* MENU RECOLHIDO NO COMPUTADOR */
body.sidebar-collapsed .sidebar {
    width: var(--largura-menu-fechado);
}

body.sidebar-collapsed .page-area {
    margin-left: var(--largura-menu-fechado);
}

body.sidebar-collapsed .brand-full,
body.sidebar-collapsed .menu-caption,
body.sidebar-collapsed .menu-text,
body.sidebar-collapsed .menu-chevron,
body.sidebar-collapsed .collapse-button span {
    display: none;
}

body.sidebar-collapsed .brand-mini {
    display: flex;
}

body.sidebar-collapsed .sidebar-content,
body.sidebar-collapsed .sidebar-footer {
    padding-inline: 13px;
}

body.sidebar-collapsed .menu-link,
body.sidebar-collapsed .submenu-link {
    justify-content: center;
    padding: 0;
}

body.sidebar-collapsed .submenu-dot {
    display: none;
}

body.sidebar-collapsed .submenu-icon {
    display: grid;
}

/* RESPONSIVIDADE */
@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid {
        grid-template-columns: minmax(0, 1.45fr) minmax(290px, .75fr);
    }

    .search-box {
        width: 210px;
    }
}

@media (max-width: 920px) {
    .sidebar,
    body.sidebar-collapsed .sidebar {
        width: min(290px, 88vw);
        transform: translateX(-102%);
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    body.mobile-menu-open .sidebar {
        transform: translateX(0);
    }

    .page-area,
    body.sidebar-collapsed .page-area {
        margin-left: 0;
    }

    .mobile-menu {
        display: grid;
    }

    .mobile-close {
        position: absolute;
        top: 8px;
        right: 8px;
        z-index: 2;
        display: grid;
        width: 32px;
        height: 32px;
        place-items: center;
        border-radius: 8px;
        color: var(--cinza-azulado);
        background: #EDF2F6;
        cursor: pointer;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 45;
        display: block;
        visibility: hidden;
        opacity: 0;
        background: rgba(20, 30, 42, .48);
        cursor: pointer;
        transition: .2s ease;
    }

    body.mobile-menu-open .sidebar-backdrop {
        visibility: visible;
        opacity: 1;
    }

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

    .quick-panel {
        min-height: auto;
    }

    body.sidebar-collapsed .brand-full {
        display: grid;
    }

    body.sidebar-collapsed .brand-mini {
        display: none;
    }

    body.sidebar-collapsed .menu-caption {
        display: block;
    }

    body.sidebar-collapsed .menu-text,
    body.sidebar-collapsed .menu-chevron {
        display: initial;
    }

    body.sidebar-collapsed .menu-link,
    body.sidebar-collapsed .submenu-link {
        justify-content: flex-start;
        padding: 0 13px;
    }

    body.sidebar-collapsed .submenu-link {
        padding-left: 21px;
    }

    body.sidebar-collapsed .submenu-dot {
        display: block;
    }

    body.sidebar-collapsed .submenu-icon {
        display: none;
    }

    .collapse-button {
        display: none;
    }
}

@media (max-width: 700px) {
    .topbar {
        height: 68px;
        padding: 0 18px;
    }

    .search-box,
    .user-divider,
    .profile-chevron,
    .user-copy,
    .breadcrumb {
        display: none;
    }

    .main-content {
        padding: 24px 18px;
    }

    .welcome-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .date-chip {
        align-self: stretch;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        min-height: 115px;
    }

    .sales-panel,
    .quick-panel {
        padding: 19px;
    }

    .chart-wrap {
        height: 220px;
    }

    .orders-heading {
        align-items: center;
    }

    .page-footer {
        align-items: flex-start;
        flex-direction: column;
        padding-inline: 18px;
    }

    .toast {
        right: 16px;
        bottom: 16px;
        left: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
