
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #101114;
    color: #f5f5f5;
    font-family: Arial, sans-serif;
}

.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: #17181c;
    border-right: 1px solid #292a2e;
    padding: 30px 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 55px;
}

.logo span {
    color: #aaa;
}

.menu-title {
    color: #777;
    font-size: 11px;
    margin-bottom: 18px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

nav a, .sidebar-bottom a {
    text-decoration: none;
    color: #aaa;
    padding: 13px;
    border-radius: 6px;
    font-size: 14px;
}

nav a:hover, nav a.active {
    background: #292a2e;
    color: white;
}

.sidebar-bottom {
    position: absolute;
    bottom: 25px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-bottom p {
    color: #666;
    font-size: 10px;
    padding: 15px 12px;
}

.content {
    margin-left: 250px;
    padding: 35px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.topbar h2 {
    font-size: 23px;
}

.topbar p, .section-header p {
    color: #888;
    font-size: 13px;
    margin-top: 7px;
}

.user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.avatar {
    background: #333;
    padding: 12px 15px;
    border-radius: 50%;
}

.welcome {
    background: linear-gradient(110deg, #292a2e, #191a1e);
    border: 1px solid #38393e;
    border-radius: 10px;
    padding: 35px;
    margin-bottom: 25px;
}

.welcome p {
    color: #aaa;
    font-size: 11px;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.welcome h1 {
    font-size: 30px;
    margin-bottom: 10px;
}

.welcome span {
    color: #aaa;
    font-size: 14px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}

.card {
    background: #191a1e;
    border: 1px solid #303136;
    border-radius: 9px;
    padding: 23px;
}

.card p {
    color: #aaa;
    font-size: 13px;
}

.card h2 {
    font-size: 27px;
    margin: 20px 0 10px;
}

.card span {
    color: #777;
    font-size: 11px;
}

.activity {
    background: #191a1e;
    border: 1px solid #303136;
    border-radius: 9px;
    padding: 25px;
}

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

.section-header h3 {
    font-size: 17px;
}

button {
    background: #dedede;
    color: #111;
    border: none;
    padding: 12px 18px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.button-link {
    display: inline-block;
    background: #dedede;
    color: #111;
    border-radius: 5px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
}

.button-link:hover {
    background: white;
}

.menu-toggle {
    display: none;
}

.field-hint {
    color: #888;
    font-size: 12px;
    line-height: 1.5;
}

.settings-section {
    max-width: 720px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 460px;
}

.settings-form label {
    color: #bbb;
    font-size: 13px;
}

.settings-form input {
    width: 100%;
    padding: 12px;
    background: #101114;
    border: 1px solid #38393e;
    border-radius: 5px;
    color: white;
}

.save-message {
    min-height: 18px;
    color: #9bd3aa;
    font-size: 13px;
}

.backup-section {
    margin-top: 24px;
}

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

.backup-file-label {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #38393e;
    border-radius: 5px;
    background: #303136;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
}

#arquivoBackup {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

#btnRestaurarBackup:disabled {
    opacity: .45;
    cursor: not-allowed;
}

@media (max-width: 650px) {
    .backup-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .backup-actions button,
    .backup-file-label {
        justify-content: center;
        width: 100%;
        text-align: center;
    }
}

.parts-fieldset {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #38393e;
    border-radius: 6px;
}

.parts-fieldset legend {
    padding: 0 6px;
    color: #ddd;
    font-size: 14px;
}

.parts-fieldset select,
.parts-fieldset input {
    width: 100%;
    min-width: 0;
    padding: 10px;
    background: #101114;
    border: 1px solid #38393e;
    border-radius: 5px;
    color: white;
}

.part-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.part-entry label {
    grid-column: 1 / -1;
}

.order-parts-list,
.status-history {
    display: grid;
    gap: 8px;
    padding-left: 20px;
}

.order-parts-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #ccc;
    font-size: 12px;
}

.status-history li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #303136;
}

.status-history time {
    color: #999;
    font-size: 12px;
}

.print-only {
    display: none;
}

.report-filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}

.filter-field {
    display: grid;
    gap: 6px;
}

.filter-field label,
.expense-form label {
    color: #aaa;
    font-size: 12px;
}

.filter-field input,
.expense-form input {
    min-width: 0;
    padding: 10px;
    background: #101114;
    border: 1px solid #38393e;
    border-radius: 5px;
    color: white;
}

.financial-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.financial-cards .card {
    min-width: 0;
}

.financial-cards .card h2 {
    overflow-wrap: anywhere;
    font-size: 21px;
}

.expense-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 22px;
}

.expense-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.expense-field input {
    width: 100%;
}

.report-section {
    margin-top: 24px;
}

button:hover {
    background: white;
}

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

th, td {
    padding: 17px 12px;
    border-bottom: 1px solid #303136;
    font-size: 12px;
}

th {
    color: #888;
}

td {
    color: #aaa;
    text-align: center;
}

@media (max-width: 1000px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .sidebar {
        display: none;
        position: fixed;
        top: var(--menu-top, 120px);
        left: var(--menu-left, 18px);
        width: min(280px, calc(100vw - 36px));
        height: auto;
        max-height: calc(100dvh - var(--menu-top, 120px) - 16px);
        padding: 24px 18px;
        overflow-y: auto;
        z-index: 101;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
        border: 1px solid #303136;
        border-radius: 8px;
    }

    .sidebar.menu-visible {
        display: block;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-top: 12px;
        padding: 9px 12px;
        font-size: 13px;
    }

    .sidebar .logo {
        margin-bottom: 22px;
    }

    .sidebar nav {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .sidebar nav a {
        padding: 12px;
        font-size: 14px;
    }

    .sidebar-bottom {
        position: static;
        margin-top: 12px;
    }

    .sidebar-bottom p {
        padding: 10px 12px;
    }

    .content {
        margin-left: 0;
        padding: 18px;
    }

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

    .welcome h1 {
        font-size: 23px;
    }

    .user span {
        display: none;
    }

    .table-container {
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }

    .table-container table,
    .table-container tbody,
    .table-container tr,
    .table-container td {
        display: block;
        width: 100%;
    }

    .table-container table {
        min-width: 0;
    }

    .table-container thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .table-container tbody {
        display: grid;
        gap: 12px;
    }

    .table-container tr {
        margin-bottom: 12px;
        padding: 8px 14px;
        background: #101114;
        border: 1px solid #303136;
        border-radius: 8px;
    }

    .table-container td {
        display: grid;
        grid-template-columns: minmax(82px, 0.35fr) minmax(0, 1fr);
        gap: 10px;
        padding: 10px 0;
        text-align: left;
        overflow-wrap: anywhere;
    }

    .table-container td::before {
        content: attr(data-label);
        color: #888;
        font-size: 11px;
    }

    .table-container td.client-name {
        font-size: 16px;
        font-weight: bold;
    }

    .table-container td[data-label="Ações"] {
        display: flex;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .table-container td[colspan] {
        display: block;
        text-align: center;
    }

    .table-container td[colspan]::before {
        content: none;
    }

    .activity,
    .content-section {
        padding: 16px;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .section-header button {
        max-width: 100%;
        white-space: normal;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 18px;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .content-section .section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }
}

/* MODULO DE CLIENTES */

.client-summary {
    margin-bottom: 25px;
}

.client-summary .card {
    max-width: 300px;
}

.search-input {
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    background: #101114;
    border: 1px solid #38393e;
    border-radius: 6px;
    color: white;
    outline: none;
}

.search-input:focus,
.modal input:focus {
    border-color: #aaa;
}

.empty-message {
    color: #888;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: #191a1e;
    border: 1px solid #38393e;
    border-radius: 10px;
    width: 100%;
    max-width: 500px;
    padding: 28px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 20px;
}

.close-button {
    background: transparent;
    color: white;
    font-size: 25px;
    padding: 2px 10px;
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal label {
    color: #bbb;
    font-size: 13px;
    margin-top: 8px;
}

.modal input {
    width: 100%;
    padding: 12px;
    background: #101114;
    border: 1px solid #38393e;
    border-radius: 5px;
    color: white;
    outline: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.cancel-button {
    background: #303136;
    color: white;
}

.action-button {
    padding: 8px 12px;
    margin: 0 3px;
    font-size: 11px;
}

.delete-button {
    background: #d92d3f;
    color: #fff;
    border: 1px solid #f06a78;
}

.delete-button:hover,
.delete-button:focus-visible {
    background: #b42333;
    color: #fff;
}

/* MODULO DE VEICULOS */

.modal select {
    width: 100%;
    padding: 12px;
    background: #101114;
    border: 1px solid #38393e;
    border-radius: 5px;
    color: white;
    outline: none;
}

.modal select:focus {
    border-color: #aaa;
}

#placaVeiculo {
    text-transform: uppercase;
}

@media (max-width: 650px) {
    .modal-content {
        padding: 20px;
    }

    .modal-actions {
        flex-wrap: wrap;
    }
}

/* MODULO DE ORDENS DE SERVICO */

.modal textarea {
    width: 100%;
    padding: 12px;
    background: #101114;
    border: 1px solid #38393e;
    border-radius: 5px;
    color: white;
    font-family: Arial, sans-serif;
    resize: vertical;
    outline: none;
}

.modal textarea:focus {
    border-color: #aaa;
}

.modal input:disabled,
.modal select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status {
    display: inline-block;
    padding: 6px 9px;
    border-radius: 5px;
    font-size: 11px;
    white-space: nowrap;
}

.status-aberta {
    background: #39332a;
    color: #e5c58a;
}

.status-andamento {
    background: #293642;
    color: #9bc9ed;
}

.status-concluida {
    background: #293a30;
    color: #9bd3aa;
}

.status-cancelada {
    background: #422d2d;
    color: #e6a0a0;
}

/* MODULO DE ESTOQUE */

.main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-width: 0;
    box-sizing: border-box;
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 24px;
}

.page-header p,
.content-section .section-header p {
    color: #888;
    font-size: 13px;
    margin-top: 7px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.stat-card,
.content-section {
    background: #191a1e;
    border: 1px solid #303136;
    border-radius: 9px;
    padding: 23px;
}

.stat-card h3 {
    color: #aaa;
    font-size: 13px;
    font-weight: normal;
}

.stat-card h2 {
    font-size: 27px;
    margin-top: 18px;
}

.content-section {
    margin-bottom: 24px;
}

.search-container input {
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    background: #101114;
    border: 1px solid #38393e;
    border-radius: 6px;
    color: white;
}

.content-section .section-header {
    margin-bottom: 22px;
}

.content-section .section-header h2 {
    font-size: 17px;
}

.content-section .section-header button {
    white-space: nowrap;
}

.content-section .action-button {
    margin: 3px;
}

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

    .financial-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .expense-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 18px;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .financial-cards,
    .expense-form {
        grid-template-columns: 1fr;
    }

    .report-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .report-filters button {
        width: 100%;
    }

    .part-entry {
        grid-template-columns: 1fr;
    }

    .part-entry label {
        grid-column: auto;
    }

    .order-parts-list li {
        align-items: flex-start;
        flex-direction: column;
    }

    .content-section .section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }
}

@media print {
    body > :not(#areaImpressao) {
        display: none !important;
    }

    #areaImpressao {
        display: block !important;
        color: #111;
        font: 12pt Arial, sans-serif;
    }

    #areaImpressao h1 {
        margin-bottom: 18px;
        font-size: 20pt;
    }

    #areaImpressao h2 {
        margin: 18px 0 6px;
        font-size: 14pt;
    }

    #areaImpressao p {
        margin: 6px 0;
        white-space: pre-wrap;
    }
}

/* DASHBOARD */
body.dashboard-page {
    min-height: 100vh;
    overflow-x: hidden;
    background: #f3f6fc;
    color: #172a4a;
    font-family: "Segoe UI", sans-serif;
}

body.dashboard-page .dashboard-sidebar {
    display: flex;
    flex-direction: column;
    width: 222px;
    padding: 22px 14px 14px;
    background: #10254a;
    border: 0;
    color: #fff;
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 4px 34px;
    color: #fff;
    text-decoration: none;
}

.brand-symbol {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: #1672f8;
    color: white;
    font-size: 28px;
}

.dashboard-brand strong,
.dashboard-brand small,
.workshop-switch strong,
.workshop-switch small {
    display: block;
}

.dashboard-brand strong {
    font-size: 18px;
}

.dashboard-brand small {
    margin-top: 2px;
    color: #aab8d1;
    font-size: 9px;
}

body.dashboard-page .dashboard-sidebar .menu-title {
    margin: 0 10px 12px;
    color: #8799b8;
    font-size: 10px;
    font-weight: 700;
}

body.dashboard-page .dashboard-nav {
    gap: 5px;
}

body.dashboard-page .dashboard-nav a {
    display: flex;
    align-items: center;
    min-height: 46px;
    gap: 14px;
    padding: 11px 12px;
    border-radius: 8px;
    color: #c4cfe0;
    font-size: 14px;
    transition: background-color 140ms ease, color 140ms ease;
}

body.dashboard-page .dashboard-nav a > span.menu-icon {
    display: grid;
    width: 22px;
    place-items: center;
    color: #9fb0cc;
    font-size: 17px;
}

body.dashboard-page .dashboard-nav a .menu-icon,
body.app-page .sidebar nav a .menu-icon {
    display: grid;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    place-items: center;
    color: currentColor;
}

body.dashboard-page .dashboard-nav a .menu-icon svg,
body.app-page .sidebar nav a .menu-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

body.dashboard-page .dashboard-nav a .menu-label,
body.app-page .sidebar nav a .menu-label {
    min-width: 0;
}

body.dashboard-page .dashboard-nav a:hover,
body.dashboard-page .dashboard-nav a.active {
    background: #1473f8;
    color: #fff;
}

body.dashboard-page .dashboard-nav a:hover > span,
body.dashboard-page .dashboard-nav a.active > span {
    color: #fff;
}

body.dashboard-page .dashboard-sidebar .sidebar-bottom {
    position: static;
    display: grid;
    gap: 14px;
    margin-top: auto;
}

.dashboard-plan {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(133, 170, 230, .2);
    border-radius: 10px;
    background: #183664;
    color: #fff;
    text-decoration: none;
}

.plan-icon {
    color: #ffc94a;
    font-size: 20px;
}

.dashboard-plan strong {
    font-size: 12px;
}

.dashboard-plan small {
    color: #bdcbe0;
    font-size: 10px;
    line-height: 1.4;
}

.plan-link {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
    color: #8dbaff;
    font-size: 10px;
    font-weight: 700;
}

.workshop-switch {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 4px 0;
    border-top: 1px solid rgba(255,255,255,.12);
    color: #fff;
    text-decoration: none;
}

.workshop-icon {
    font-size: 22px;
}

.workshop-switch strong {
    font-size: 11px;
}

.workshop-switch small {
    margin-top: 2px;
    color: #9fafc9;
    font-size: 9px;
}

.workshop-chevron {
    margin-left: auto;
    color: #a9bad4;
}

body.dashboard-page .dashboard-content {
    width: calc(100% - 222px);
    max-width: none;
    min-width: 0;
    margin-left: 222px;
    padding: 0 20px 26px;
}

body.dashboard-page .dashboard-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 68px;
    margin: 0 -20px 20px;
    padding: 0 24px;
    border-bottom: 1px solid #e8edf5;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
}

.global-search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(560px, 60%);
    height: 40px;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid #e3eaf5;
    border-radius: 9px;
    background: #f7f9fd;
    color: #6f7f98;
}

.global-search > span:first-child {
    font-size: 21px;
    line-height: 1;
}

.global-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #172a4a;
    font: inherit;
    font-size: 12px;
}

.global-search input::placeholder {
    color: #8290a6;
}

.search-shortcut {
    display: grid;
    width: 20px;
    height: 22px;
    place-items: center;
    border: 1px solid #dfe6f0;
    border-radius: 5px;
    background: #fff;
    font-size: 11px;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 50;
    width: 100%;
    max-height: 330px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #e5eaf2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(20, 42, 75, .14);
}

.search-results a {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border-radius: 7px;
    color: #1c3154;
    text-decoration: none;
}

.search-results a:hover {
    background: #f2f6fd;
}

.search-results a small,
.search-results a span,
.search-results p {
    color: #7d8ba1;
    font-size: 10px;
}

.search-results a strong {
    font-size: 12px;
}

.search-results p {
    margin: 0;
    padding: 12px;
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #1c3154;
}

.user-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 2px solid #e6edf7;
    border-radius: 50%;
    background: #dce8f8;
    color: #174e9e;
    font-size: 13px;
    font-weight: 700;
}

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

.dashboard-user strong {
    font-size: 11px;
}

.dashboard-user small {
    margin-top: 2px;
    color: #8390a3;
    font-size: 10px;
}

.dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
}

.dashboard-welcome h1 {
    margin: 0;
    color: #14284a;
    font-size: 24px;
    font-weight: 700;
}

.dashboard-welcome p {
    margin: 5px 0 0;
    color: #78869d;
    font-size: 12px;
}

.welcome-date {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #e4eaf3;
    border-radius: 8px;
    background: #fff;
    color: #53647e;
    font-size: 11px;
    white-space: nowrap;
}

body.dashboard-page .dashboard-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 16px;
}

body.dashboard-page .dashboard-kpi {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 105px;
    gap: 11px;
    margin: 0;
    padding: 15px 13px;
    border: 1px solid #e6ebf3;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(24, 46, 79, .035);
}

.kpi-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    color: white;
    font-size: 21px;
    font-weight: 700;
}

.kpi-blue { background: #176cf0; }
.kpi-green { background: #13a476; }
.kpi-amber { background: #f0a120; }
.kpi-violet { background: #7562ec; }

.kpi-copy {
    min-width: 0;
}

body.dashboard-page .kpi-copy p {
    margin: 0 0 5px;
    color: #53647f;
    font-size: 10px;
    line-height: 1.35;
}

body.dashboard-page .kpi-copy h2 {
    margin: 0;
    color: #14284a;
    font-size: 21px;
    line-height: 1.2;
}

body.dashboard-page .kpi-copy span {
    display: block;
    margin-top: 4px;
    color: #8491a4;
    font-size: 9px;
}

.kpi-mark {
    align-self: flex-start;
    margin-left: auto;
    color: #8da1bd;
    font-size: 15px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-panel {
    min-width: 0;
    padding: 17px;
    border: 1px solid #e5eaf2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(24, 46, 79, .035);
}

.financial-chart-panel { grid-column: span 8; }
.recent-panel { grid-column: span 4; }
.services-panel,
.inventory-panel,
.dashboard-promo { grid-column: span 4; }

.panel-heading,
.panel-title {
    display: flex;
    align-items: center;
}

.panel-heading {
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
}

.panel-title {
    min-width: 0;
    gap: 9px;
}

.panel-title > div {
    min-width: 0;
}

.panel-title h2 {
    margin: 0;
    color: #1b3155;
    font-size: 13px;
}

.panel-title p {
    margin: 3px 0 0;
    color: #8491a4;
    font-size: 10px;
}

.panel-icon {
    display: grid;
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 7px;
    background: #edf4ff;
    color: #176cf0;
    font-size: 16px;
    font-weight: 700;
}

.warning-icon {
    background: #fff0ef;
    color: #e85c53;
}

.panel-link {
    flex: none;
    color: #176cf0;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.panel-link span {
    margin-left: 3px;
}

.chart-tabs {
    display: flex;
    flex: none;
    gap: 3px;
    padding: 3px;
    border-radius: 20px;
    background: #f2f5fa;
}

.chart-tabs button {
    padding: 7px 10px;
    border-radius: 16px;
    background: transparent;
    color: #697991;
    font-size: 10px;
    font-weight: 600;
}

.chart-tabs button:hover {
    background: #e7edf7;
}

.chart-tabs button.active {
    background: #176cf0;
    color: #fff;
}

.chart-wrap {
    width: 100%;
    height: 190px;
}

#graficoFinanceiro {
    display: block;
    width: 100%;
    height: 100%;
}

.chart-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid #eff2f7;
    color: #66758d;
    font-size: 10px;
}

.chart-legend > span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.chart-legend strong {
    color: #1b3155;
    font-size: 13px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #176cf0;
}

.activity-list,
.inventory-list,
.service-legend {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-list li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    border-bottom: 1px solid #f0f2f6;
}

.activity-list li:last-child,
.inventory-list li:last-child {
    border-bottom: 0;
}

.activity-icon {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 50%;
    background: #edf4ff;
    color: #2377eb;
    font-size: 13px;
    font-weight: 700;
}

.activity-icon.complete { background: #e5f7ef; color: #139b70; }
.activity-icon.stock { background: #fff2df; color: #d78a1c; }
.activity-icon.money { background: #f0edff; color: #7160d9; }

.activity-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.activity-copy strong {
    overflow: hidden;
    color: #253959;
    font-size: 10px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-copy small,
.activity-list time {
    overflow: hidden;
    color: #8491a4;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-list time {
    text-align: right;
}

.dashboard-empty {
    margin: 18px 0 6px;
    color: #8491a4;
    font-size: 11px;
    text-align: center;
}

.service-summary {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 14px;
    min-height: 156px;
}

.service-donut {
    position: relative;
    display: grid;
    flex: 0 0 128px;
    width: 128px;
    height: 128px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#e9edf4 0 100%);
}

.service-donut::before {
    position: absolute;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: #fff;
    content: "";
}

.service-donut > div {
    position: relative;
    display: grid;
    width: 74px;
    gap: 3px;
    text-align: center;
}

.service-donut strong {
    color: #1b3155;
    font-size: 20px;
}

.service-donut span {
    overflow: hidden;
    color: #78869d;
    font-size: 8px;
    text-overflow: ellipsis;
}

.service-legend {
    flex: 1;
}

.service-legend li {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    color: #54647e;
    font-size: 9px;
}

.service-legend i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.service-legend span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-legend strong {
    color: #344967;
    font-size: 9px;
}

.inventory-list li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    border-bottom: 1px solid #f0f2f6;
}

.inventory-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid #e9edf4;
    border-radius: 7px;
    background: #f5f7fa;
    color: #526882;
    font-size: 13px;
    font-weight: 700;
}

.inventory-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.inventory-copy strong {
    overflow: hidden;
    color: #2a3e5e;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-copy small {
    color: #8390a3;
    font-size: 9px;
}

.stock-badge {
    padding: 5px 7px;
    border-radius: 12px;
    font-size: 8px;
    font-weight: 700;
}

.stock-badge.low { background: #fff2e4; color: #ce7712; }
.stock-badge.critical { background: #ffe9e8; color: #d84c45; }

.dashboard-promo {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border-radius: 10px;
    background: #10254a;
    box-shadow: 0 3px 12px rgba(24, 46, 79, .08);
}

.dashboard-promo img,
.promo-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.dashboard-promo img {
    object-fit: cover;
    object-position: center;
}

.promo-shade {
    background: linear-gradient(90deg, rgba(9, 29, 61, .94) 0%, rgba(9, 29, 61, .72) 58%, rgba(9, 29, 61, .12) 100%);
}

.promo-copy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    color: #fff;
}

.promo-kicker {
    color: #89b8ff;
    font-size: 9px;
    font-weight: 800;
}

.promo-copy h2 {
    max-width: 230px;
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
}

.promo-copy a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 7px;
    background: #1473f8;
    color: white;
    font-size: 9px;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-secondary-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 14px;
    padding: 12px 16px;
    border: 1px solid #e5eaf2;
    border-radius: 9px;
    background: #fff;
}

.dashboard-secondary-stats > div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #718099;
    font-size: 10px;
}

.dashboard-secondary-stats strong {
    color: #1c3154;
    font-size: 13px;
}

.dashboard-secondary-stats a {
    color: #176cf0;
    font-size: 9px;
    text-decoration: none;
}

.dashboard-secondary-stats .new-order-link {
    margin-left: auto;
    padding: 8px 11px;
    border-radius: 7px;
    background: #176cf0;
    color: white;
    font-size: 10px;
    font-weight: 700;
}

@media (max-width: 1100px) {
    body.dashboard-page .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .financial-chart-panel,
    .recent-panel {
        grid-column: span 12;
    }

    .services-panel,
    .inventory-panel,
    .dashboard-promo {
        grid-column: span 4;
    }
}

@media (max-width: 650px) {
    body.dashboard-page {
        display: block;
    }

    body.dashboard-page .dashboard-sidebar {
        display: none;
        top: var(--menu-top, 120px);
        left: var(--menu-left, 14px);
        width: min(280px, 86vw);
        height: auto;
        max-height: calc(100dvh - var(--menu-top, 120px) - 14px);
        padding: 20px 14px;
        overflow-y: auto;
        border: 1px solid #2a4168;
        border-radius: 10px;
        box-shadow: 0 18px 40px rgba(11, 31, 63, .25);
    }

    body.dashboard-page .dashboard-sidebar.menu-visible {
        display: flex;
    }

    body.dashboard-page .dashboard-content {
        width: 100%;
        margin: 0;
        padding: 0 13px 20px;
    }

    body.dashboard-page .dashboard-topbar {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        grid-template-rows: 52px 44px;
        height: auto;
        gap: 8px;
        margin: 0 -13px 16px;
        padding: 8px 13px 10px;
    }

    body.dashboard-page .dashboard-topbar .menu-toggle {
        position: static;
        display: inline-flex;
        grid-column: 1;
        grid-row: 1;
        width: auto;
        height: 42px;
        justify-content: center;
        margin: 0;
        padding: 0 10px;
        border: 1px solid #e5eaf2;
        background: #fff;
        color: #1b3155;
        font-size: 11px;
    }

    body.dashboard-page .dashboard-topbar .menu-toggle::before {
        width: 15px;
        height: 12px;
        background: linear-gradient(to bottom, #1b3155 0 2px, transparent 2px 5px, #1b3155 5px 7px, transparent 7px 10px, #1b3155 10px 12px);
        content: "";
    }

    .global-search {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        height: 40px;
    }

    .dashboard-user {
        grid-column: 3;
        grid-row: 1;
    }

    .dashboard-user > span:last-child {
        display: none;
    }

    .dashboard-welcome {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .dashboard-welcome h1 {
        font-size: 21px;
    }

    .dashboard-welcome p {
        font-size: 11px;
    }

    .welcome-date {
        padding: 7px 9px;
    }

    body.dashboard-page .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    body.dashboard-page .dashboard-kpi {
        min-height: 106px;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 10px;
    }

    .kpi-icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    body.dashboard-page .kpi-copy p {
        font-size: 10px;
    }

    body.dashboard-page .kpi-copy h2 {
        font-size: 17px;
    }

    body.dashboard-page .kpi-copy span {
        font-size: 10px;
    }

    .kpi-mark {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 11px;
    }

    .financial-chart-panel,
    .recent-panel,
    .services-panel,
    .inventory-panel,
    .dashboard-promo {
        grid-column: 1;
    }

    .dashboard-panel {
        padding: 14px;
    }

    .panel-title h2 {
        font-size: 14px;
    }

    .panel-title p,
    .panel-link {
        font-size: 11px;
    }

    .panel-heading {
        align-items: flex-start;
    }

    .chart-tabs button {
        padding: 7px 8px;
        font-size: 10px;
    }

    .chart-wrap {
        height: 195px;
    }

    .service-summary {
        justify-content: flex-start;
        gap: 20px;
    }

    .activity-copy strong,
    .inventory-copy strong {
        font-size: 11px;
    }

    .activity-copy small,
    .activity-list time,
    .inventory-copy small,
    .service-legend li {
        font-size: 10px;
    }

    .dashboard-promo {
        min-height: 190px;
    }

    .dashboard-secondary-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .dashboard-secondary-stats > div {
        display: grid;
        gap: 4px;
    }

    .dashboard-secondary-stats .new-order-link {
        grid-column: 1 / -1;
        width: 100%;
        margin: 0;
        text-align: center;
    }
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid #e3eaf3;
    border-radius: 8px;
    background: #fff;
    color: #53647e;
    font-size: 10px;
    font-weight: 650;
    white-space: nowrap;
}

.theme-toggle:hover {
    background: #f3f6fb;
}

.theme-toggle-icon {
    color: #53647e;
    font-size: 17px;
    line-height: 1;
}

body.dashboard-page.theme-dark {
    background: #0c1422;
    color: #e4ecf8;
}

body.dashboard-page.theme-dark .dashboard-topbar {
    border-color: #26344a;
    background: rgba(15, 25, 42, .96);
}

body.dashboard-page.theme-dark .global-search {
    border-color: #2a3a53;
    background: #131f33;
    color: #a9bad1;
}

body.dashboard-page.theme-dark .global-search input {
    color: #e4ecf8;
}

body.dashboard-page.theme-dark .global-search input::placeholder,
body.dashboard-page.theme-dark .dashboard-user small {
    color: #8fa0b8;
}

body.dashboard-page.theme-dark .search-shortcut,
body.dashboard-page.theme-dark .search-results {
    border-color: #2b3a51;
    background: #17243a;
    color: #dce6f4;
}

body.dashboard-page.theme-dark .search-results a {
    color: #e1eafa;
}

body.dashboard-page.theme-dark .search-results a:hover {
    background: #20314c;
}

body.dashboard-page.theme-dark .search-results a small,
body.dashboard-page.theme-dark .search-results a span,
body.dashboard-page.theme-dark .search-results p {
    color: #a3b2c8;
}

body.dashboard-page.theme-dark .dashboard-user,
body.dashboard-page.theme-dark .dashboard-welcome h1 {
    color: #e6edf8;
}

body.dashboard-page.theme-dark .dashboard-welcome p,
body.dashboard-page.theme-dark .dashboard-empty {
    color: #98a9c1;
}

body.dashboard-page.theme-dark .welcome-date,
body.dashboard-page.theme-dark .dashboard-kpi,
body.dashboard-page.theme-dark .dashboard-panel,
body.dashboard-page.theme-dark .dashboard-secondary-stats {
    border-color: #26364f;
    background: #121e31;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
    color: #dce6f4;
}

body.dashboard-page.theme-dark .welcome-date,
body.dashboard-page.theme-dark .dashboard-secondary-stats > div {
    color: #aab9ce;
}

body.dashboard-page.theme-dark .kpi-copy p,
body.dashboard-page.theme-dark .panel-title p,
body.dashboard-page.theme-dark .activity-copy small,
body.dashboard-page.theme-dark .activity-list time,
body.dashboard-page.theme-dark .inventory-copy small,
body.dashboard-page.theme-dark .service-donut span {
    color: #9aabc2;
}

body.dashboard-page.theme-dark .kpi-copy h2,
body.dashboard-page.theme-dark .panel-title h2,
body.dashboard-page.theme-dark .chart-legend strong,
body.dashboard-page.theme-dark .activity-copy strong,
body.dashboard-page.theme-dark .inventory-copy strong,
body.dashboard-page.theme-dark .service-donut strong,
body.dashboard-page.theme-dark .service-legend strong {
    color: #e3ecf8;
}

body.dashboard-page.theme-dark .kpi-copy span,
body.dashboard-page.theme-dark .kpi-mark,
body.dashboard-page.theme-dark .chart-legend,
body.dashboard-page.theme-dark .service-legend li {
    color: #96a7bf;
}

body.dashboard-page.theme-dark .chart-tabs {
    background: #1b2a41;
}

body.dashboard-page.theme-dark .chart-tabs button {
    color: #b4c1d3;
}

body.dashboard-page.theme-dark .chart-tabs button:hover {
    background: #273952;
}

body.dashboard-page.theme-dark .chart-tabs button.active {
    background: #176cf0;
    color: white;
}

body.dashboard-page.theme-dark .chart-legend,
body.dashboard-page.theme-dark .activity-list li,
body.dashboard-page.theme-dark .inventory-list li {
    border-color: #26364f;
}

body.dashboard-page.theme-dark .service-donut::before {
    background: #121e31;
}

body.dashboard-page.theme-dark .service-donut[style*="e9edf4"] {
    background: conic-gradient(#293750 0 100%) !important;
}

body.dashboard-page.theme-dark .inventory-icon {
    border-color: #2b3a51;
    background: #1a2a42;
    color: #b2c3dc;
}

body.dashboard-page.theme-dark .dashboard-secondary-stats strong {
    color: #e3ecf8;
}

body.dashboard-page.theme-dark .theme-toggle {
    border-color: #31415b;
    background: #1a2940;
    color: #d5e0ef;
}

body.dashboard-page.theme-dark .theme-toggle:hover {
    background: #243650;
}

body.dashboard-page.theme-dark .theme-toggle-icon {
    color: #f5c46b;
}

@media (max-width: 650px) {
    body.dashboard-page .dashboard-topbar .theme-toggle {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        min-height: 38px;
        padding: 0 8px;
        font-size: 0;
    }

    body.dashboard-page .dashboard-topbar .theme-toggle-icon {
        font-size: 18px;
    }
}

/* SISTEMA VISUAL DOS MODULOS */
body.app-page {
    min-height: 100vh;
    overflow-x: hidden;
    background: #f3f6fc;
    color: #172a4a;
    font-family: "Segoe UI", sans-serif;
}

body.app-page .sidebar {
    display: flex;
    flex-direction: column;
    width: 222px;
    height: 100vh;
    padding: 22px 14px 14px;
    background: #10254a;
    border: 0;
    color: #fff;
}

body.app-page .sidebar .logo {
    margin: 0 4px 34px;
    color: #fff;
    font-size: 19px;
    letter-spacing: 0;
}

body.app-page .sidebar .logo span {
    color: #76aaff;
}

body.app-page .sidebar .menu-title {
    margin: 0 10px 12px;
    color: #8799b8;
    font-size: 10px;
    font-weight: 700;
}

body.app-page .sidebar nav {
    gap: 5px;
}

body.app-page .sidebar nav a {
    display: flex;
    align-items: center;
    min-height: 46px;
    gap: 14px;
    padding: 11px 12px;
    border-radius: 8px;
    color: #c4cfe0;
    font-size: 14px;
    transition: background-color 140ms ease, color 140ms ease;
}

body.app-page .sidebar nav a:hover,
body.app-page .sidebar nav a.active {
    background: #1473f8;
    color: #fff;
}

body.app-page .sidebar .sidebar-bottom {
    position: static;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.12);
}

body.app-page .sidebar .sidebar-bottom p {
    padding: 13px 10px 3px;
    color: #9fafc9;
    font-size: 10px;
}

body.app-page .content,
body.app-page .main-content {
    width: calc(100% - 222px);
    min-width: 0;
    margin-left: 222px;
    padding: 0 22px 28px;
    color: #172a4a;
}

body.app-page .topbar,
body.app-page .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 80px;
    margin: 0 -22px 22px;
    padding: 14px 24px;
    border-bottom: 1px solid #e8edf5;
    background: #fff;
}

body.app-page .topbar > div:first-child h2,
body.app-page .page-header h1 {
    color: #172a4a;
    font-size: 21px;
    font-weight: 700;
}

body.app-page .topbar p,
body.app-page .page-header p {
    margin-top: 4px;
    color: #78869d;
    font-size: 11px;
}

body.app-page .user {
    flex: none;
    color: #1c3154;
    font-size: 11px;
}

body.app-page .avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 2px solid #e6edf7;
    background: #dce8f8;
    color: #174e9e;
    font-weight: 700;
}

body.app-page .menu-toggle {
    display: none;
}

body.app-page .theme-toggle {
    margin-left: auto;
}

body.app-page .card,
body.app-page .activity,
body.app-page .stat-card,
body.app-page .content-section {
    border: 1px solid #e5eaf2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(24, 46, 79, .035);
}

body.app-page .card {
    padding: 20px;
}

body.app-page .card p,
body.app-page .stat-card h3 {
    color: #687992;
}

body.app-page .card h2,
body.app-page .stat-card h2 {
    color: #172a4a;
}

body.app-page .card span {
    color: #8491a4;
}

body.app-page .activity,
body.app-page .content-section {
    padding: 20px;
}

body.app-page .section-header {
    gap: 16px;
}

body.app-page .section-header h3,
body.app-page .content-section .section-header h2 {
    color: #1b3155;
}

body.app-page .section-header p,
body.app-page .content-section .section-header p {
    color: #8491a4;
}

body.app-page button:not(.cancel-button):not(.delete-button):not(.close-button):not(.action-button):not(.theme-toggle):not(.menu-toggle) {
    background: #176cf0;
    color: #fff;
}

body.app-page button:not(.cancel-button):not(.delete-button):not(.close-button):not(.action-button):not(.theme-toggle):not(.menu-toggle):hover {
    background: #0c5fdc;
}

body.app-page .button-link {
    background: #176cf0;
    color: #fff;
}

body.app-page .button-link:hover {
    background: #0c5fdc;
}

body.app-page .search-input,
body.app-page .search-container input,
body.app-page .settings-form input,
body.app-page .expense-form input,
body.app-page .filter-field input {
    border-color: #e0e7f1;
    background: #f8fafd;
    color: #172a4a;
}

body.app-page .search-input::placeholder,
body.app-page .search-container input::placeholder {
    color: #8a97aa;
}

body.app-page .modal-content {
    border-color: #e3eaf3;
    border-radius: 12px;
    background: #fff;
    color: #172a4a;
    box-shadow: 0 18px 50px rgba(17, 38, 70, .2);
}

body.app-page .modal-header h2 {
    color: #172a4a;
}

body.app-page .modal label,
body.app-page .settings-form label,
body.app-page .expense-form label,
body.app-page .filter-field label {
    color: #53647e;
}

body.app-page .modal input,
body.app-page .modal select,
body.app-page .modal textarea,
body.app-page .parts-fieldset input,
body.app-page .parts-fieldset select {
    border-color: #dfe6f0;
    background: #f8fafd;
    color: #172a4a;
}

body.app-page .modal .field-hint,
body.app-page .field-hint,
body.app-page .empty-message {
    color: #7d8ba1;
}

body.app-page table {
    color: #243a5b;
}

body.app-page th {
    color: #718099;
}

body.app-page td {
    border-color: #edf1f6;
    color: #3d506d;
}

body.app-page .status-aberta { background: #fff3dc; color: #9a6715; }
body.app-page .status-andamento { background: #e7f1ff; color: #2869b7; }
body.app-page .status-concluida { background: #e3f6ed; color: #19754e; }
body.app-page .status-cancelada { background: #fde9e8; color: #a63d38; }

body.app-page .parts-fieldset {
    border-color: #dfe6f0;
}

body.app-page .parts-fieldset legend {
    color: #1b3155;
}

body.app-page .order-parts-list li {
    color: #53647e;
}

body.app-page .status-history li {
    border-color: #edf1f6;
}

body.app-page .status-history time {
    color: #7d8ba1;
}

body.app-page .report-filters,
body.app-page .financial-cards .card {
    box-shadow: 0 3px 12px rgba(24, 46, 79, .035);
}

body.app-page .backup-file-label {
    border-color: #d4dfef;
    background: #183664;
    color: #fff;
}

body.app-page .save-message {
    color: #18805c;
}

@media (max-width: 650px) {
    body.app-page .sidebar {
        display: none;
        top: var(--menu-top, 120px);
        left: var(--menu-left, 14px);
        width: min(280px, 86vw);
        height: auto;
        max-height: calc(100dvh - var(--menu-top, 120px) - 14px);
        padding: 20px 14px;
        overflow-y: auto;
        z-index: 101;
        border: 1px solid #2a4168;
        border-radius: 10px;
        box-shadow: 0 18px 40px rgba(11, 31, 63, .25);
    }

    body.app-page .sidebar.menu-visible {
        display: flex;
    }

    body.app-page .content,
    body.app-page .main-content {
        width: 100%;
        margin-left: 0;
        padding: 0 14px 22px;
    }

    body.app-page .topbar,
    body.app-page .page-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 8px;
        min-height: 100px;
        margin: 0 -14px 16px;
        padding: 12px 14px;
    }

    body.app-page .topbar > div:first-child,
    body.app-page .page-header > div:first-child {
        grid-column: 1 / -1;
    }

    body.app-page .topbar h2,
    body.app-page .page-header h1 {
        font-size: 19px;
    }

    body.app-page .menu-toggle {
        display: inline-flex;
        min-height: 38px;
        margin-top: 8px;
        padding: 0 10px;
        border: 1px solid #e1e8f2;
        border-radius: 7px;
        background: #f8fafd;
        color: #1b3155;
    }

    body.app-page .theme-toggle {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        min-height: 38px;
        margin: 8px 0 0;
        padding: 0 9px;
        font-size: 0;
    }

    body.app-page .theme-toggle-icon {
        font-size: 17px;
    }

    body.app-page .user {
        grid-column: 3;
        grid-row: 2;
    }

    body.app-page .user span:not(.avatar) {
        display: none;
    }

    body.app-page .client-summary .card {
        max-width: none;
    }

    body.app-page .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.app-page .card {
        min-width: 0;
        padding: 15px;
    }

    body.app-page .card h2,
    body.app-page .stat-card h2 {
        font-size: 21px;
        overflow-wrap: anywhere;
    }

    body.app-page .activity,
    body.app-page .content-section {
        padding: 15px;
    }

    body.app-page .stats-container {
        grid-template-columns: 1fr;
    }

    body.app-page .financial-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.app-page .expense-form {
        grid-template-columns: 1fr;
    }

    body.app-page .report-filters {
        align-items: stretch;
        flex-direction: column;
    }

    body.app-page .report-filters button {
        width: 100%;
    }

    body.app-page .modal-content {
        padding: 18px;
    }
}

body.app-page.theme-dark {
    background: #0c1422;
    color: #e4ecf8;
}

body.app-page.theme-dark .content,
body.app-page.theme-dark .main-content {
    color: #e4ecf8;
}

body.app-page.theme-dark .topbar,
body.app-page.theme-dark .page-header {
    border-color: #26344a;
    background: #0f192a;
}

body.app-page.theme-dark .topbar > div:first-child h2,
body.app-page.theme-dark .page-header h1 {
    color: #edf3fc !important;
}

body.app-page.theme-dark .topbar > div:first-child p,
body.app-page.theme-dark .page-header p,
body.app-page.theme-dark .user {
    color: #aab9ce !important;
}

body.app-page.theme-dark .topbar h2,
body.app-page.theme-dark .page-header h1,
body.app-page.theme-dark .section-header h3,
body.app-page.theme-dark .content-section .section-header h2,
body.app-page.theme-dark .card h2,
body.app-page.theme-dark .stat-card h2,
body.app-page.theme-dark .modal-header h2,
body.app-page.theme-dark .parts-fieldset legend {
    color: #e4ecf8;
}

body.app-page.theme-dark .topbar p,
body.app-page.theme-dark .page-header p,
body.app-page.theme-dark .section-header p,
body.app-page.theme-dark .content-section .section-header p,
body.app-page.theme-dark .card p,
body.app-page.theme-dark .card span,
body.app-page.theme-dark .stat-card h3,
body.app-page.theme-dark .field-hint,
body.app-page.theme-dark .empty-message {
    color: #98a9c1;
}

body.app-page.theme-dark .activity,
body.app-page.theme-dark .content-section,
body.app-page.theme-dark .card,
body.app-page.theme-dark .stat-card,
body.app-page.theme-dark .modal-content {
    border-color: #26364f;
    background: #121e31;
    color: #dce6f4;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
}

body.app-page.theme-dark .search-input,
body.app-page.theme-dark .search-container input,
body.app-page.theme-dark .settings-form input,
body.app-page.theme-dark .expense-form input,
body.app-page.theme-dark .filter-field input,
body.app-page.theme-dark .modal input,
body.app-page.theme-dark .modal select,
body.app-page.theme-dark .modal textarea,
body.app-page.theme-dark .parts-fieldset input,
body.app-page.theme-dark .parts-fieldset select {
    border-color: #30415b;
    background: #17243a;
    color: #e4ecf8;
}

body.app-page.theme-dark .search-input::placeholder,
body.app-page.theme-dark .search-container input::placeholder {
    color: #91a2ba;
}

body.app-page.theme-dark th,
body.app-page.theme-dark td,
body.app-page.theme-dark .modal label,
body.app-page.theme-dark .settings-form label,
body.app-page.theme-dark .expense-form label,
body.app-page.theme-dark .filter-field label,
body.app-page.theme-dark .order-parts-list li,
body.app-page.theme-dark .status-history time {
    border-color: #26364f;
    color: #acbbcf;
}

body.app-page.theme-dark .table-container tr {
    background: #17243a;
    border-color: #2b3a51;
}

body.app-page.theme-dark .backup-file-label {
    border-color: #32425b;
    background: #203553;
}

body.app-page.theme-dark .menu-toggle,
body.app-page.theme-dark .theme-toggle {
    border-color: #31415b;
    background: #1a2940;
    color: #d5e0ef;
}

body.app-page.theme-dark .save-message {
    color: #85d0ad;
}

.cloud-load-error {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 300;
    max-width: min(460px, calc(100vw - 32px));
    padding: 12px 14px;
    border: 1px solid #e8b2af;
    border-radius: 8px;
    background: #fff3f2;
    color: #8c302c;
    font-size: 13px;
    box-shadow: 0 8px 26px rgba(0,0,0,.16);
}

.cloud-signout {
    min-height: 34px;
    margin-left: 4px;
    padding: 0 10px;
    border: 1px solid #e0e7f1;
    border-radius: 7px;
    background: #f7f9fd;
    color: #3d506d;
    font-size: 10px;
}

.auth-page {
    min-height: 100vh;
    background: #f3f6fc;
    color: #172a4a;
    font-family: "Segoe UI", sans-serif;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(380px, 1.1fr);
    min-height: 100vh;
}

.auth-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(24px, 5vw, 64px);
    background: #10254a;
    color: #fff;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 19px;
    text-decoration: none;
}

.auth-brand > span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 12px;
    background: #1473f8;
    font-size: 25px;
}

.auth-brand-copy {
    max-width: 430px;
}

.auth-brand-copy p,
.auth-eyebrow {
    color: #1673f8;
    font-size: 10px;
    font-weight: 800;
}

.auth-brand-copy p {
    color: #8dbaff;
}

.auth-brand-copy h1 {
    margin: 18px 0 12px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
}

.auth-brand-copy span {
    color: #bfcbdd;
    font-size: 14px;
    line-height: 1.6;
}

.auth-version {
    color: #91a4c1;
    font-size: 10px;
}

.auth-form-panel {
    display: grid;
    place-items: center;
    padding: 32px 22px;
}

.auth-form-wrap {
    width: min(100%, 430px);
    padding: 28px;
    border: 1px solid #e3eaf3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(23, 42, 74, .08);
}

.auth-form-wrap h2 {
    margin-top: 8px;
    color: #172a4a;
    font-size: 24px;
}

.auth-intro {
    margin: 6px 0 22px;
    color: #7d8ba1;
    font-size: 12px;
}

.auth-form {
    display: grid;
    gap: 9px;
}

.auth-form label {
    margin-top: 5px;
    color: #475b78;
    font-size: 11px;
    font-weight: 650;
}

.auth-form label span {
    color: #8996a9;
    font-weight: 400;
}

.auth-form input {
    width: 100%;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid #dfe6f0;
    border-radius: 7px;
    background: #f8fafd;
    color: #172a4a;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 2px;
    color: #8a97aa;
    font-size: 10px;
}

.auth-divider::before,
.auth-divider::after {
    flex: 1;
    height: 1px;
    background: #e8edf4;
    content: "";
}

.auth-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 12px;
}

.auth-actions button {
    min-height: 42px;
    border-radius: 7px;
    background: #176cf0;
    color: #fff;
    font-size: 12px;
}

.auth-actions .auth-secondary {
    border: 1px solid #dfe6f0;
    background: #fff;
    color: #3d506d;
}

.auth-status {
    min-height: 36px;
    margin: 4px 0 0;
    color: #61728a;
    font-size: 11px;
    line-height: 1.5;
}

.auth-status[data-type="error"] { color: #b13d38; }
.auth-status[data-type="success"] { color: #19754e; }
.auth-status[data-type="warning"] { color: #9a6715; }

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

    .auth-brand-panel {
        min-height: 210px;
        padding: 20px 22px;
    }

    .auth-brand-copy {
        margin-top: 24px;
    }

    .auth-brand-copy h1 {
        margin: 10px 0 7px;
        font-size: 28px;
    }

    .auth-brand-copy span,
    .auth-version {
        display: none;
    }

    .auth-form-panel {
        padding: 20px 14px;
    }

    .auth-form-wrap {
        padding: 22px 18px;
    }
}
