.app-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.12), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #eef3f8 100%);
}

.app-navbar {
    background: linear-gradient(90deg, #0d3b66 0%, #0b5ed7 100%);
}

.app-navbar .dropdown-menu {
    min-width: 16rem;
}

.section-kicker {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0d6efd;
}

.dashboard-hero {
    border: 1px solid rgba(13, 110, 253, 0.08);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 247, 255, 0.98)),
        #ffffff;
    box-shadow: 0 20px 40px rgba(13, 30, 66, 0.08);
}

.page-section .card {
    border-radius: 1.25rem;
}

.summary-table-card,
.future-alerts-placeholder {
    border-radius: 1.25rem;
}

.future-alerts-placeholder {
    padding: 1rem 1.25rem;
    border: 1px dashed rgba(13, 110, 253, 0.22);
    background: rgba(255, 255, 255, 0.88);
}

.future-alerts-title {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0d6efd;
}

.table > :not(caption) > * > * {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.dataTables_wrapper .dataTables_paginate .pagination {
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_paginate .page-link {
    border-radius: 0.8rem !important;
    padding: 0.45rem 0.8rem;
    color: #0d6efd;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

table.dataTable thead .dt-column-order,
table.dataTable thead .dt-column-order:before,
table.dataTable thead .dt-column-order:after {
    display: none !important;
}

table.dataTable thead > tr > th,
table.dataTable thead > tr > td {
    cursor: default !important;
}

.reajuste-custo-preview {
    font-size: 0.85rem;
    line-height: 1.25;
    margin-top: 0.2rem;
}

.pagination-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.swal2-popup.swal-wide {
    border-radius: 1.25rem;
}

.swal2-container .swal2-html-container {
    margin-top: 1rem;
}

.comparison-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 1rem;
    background: #f8f9fa;
}

.comparison-row {
    padding: 0.75rem;
    border: 1px solid #edf2f7;
    border-radius: 1rem;
    background: #fbfdff;
}

.product-thumb,
.product-image-preview {
    display: block;
    object-fit: cover;
    border: 1px solid rgba(13, 110, 253, 0.12);
    background: #fff;
}

.product-thumb {
    width: 58px;
    height: 58px;
    border-radius: 0.9rem;
}

.js-open-gallery {
    cursor: zoom-in;
    transition: opacity 0.15s;
}
.js-open-gallery:hover {
    opacity: 0.82;
}

/* Galeria de imagens (modal) */
.gallery-modal-inner { text-align: center; }
.gallery-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 0.75rem;
    min-height: 300px;
    max-height: 460px;
    overflow: hidden;
}
.gallery-main-img {
    max-width: 100%;
    max-height: 460px;
    object-fit: contain;
    border-radius: 0.5rem;
}
.gallery-thumb-mini {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s, border-color 0.15s;
}
.gallery-thumb-mini:hover,
.gallery-thumb-mini.active {
    opacity: 1;
    border-color: #0d6efd;
}

.product-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.9rem;
}

.product-image-card {
    padding: 0.65rem;
    border: 1px solid #edf2f7;
    border-radius: 1rem;
    background: #fbfdff;
}

.product-image-preview {
    width: 100%;
    height: 110px;
    border-radius: 0.85rem;
}

.order-sheet-selection-table-wrap {
    max-height: 560px;
    overflow: auto;
}

.order-sheet-product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #6c757d;
}

.order-sheet-preview-card {
    min-height: 100%;
}

.order-sheet-paper {
    min-height: 420px;
}

.order-sheet-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #dbe7f7;
    min-height: 100px;
}

.order-sheet-header-left {
    text-align: left;
}

.order-sheet-header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.order-sheet-header-right {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: right;
    font-size: 0.9rem;
}

.order-sheet-cliente-cor {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.order-sheet-client-info,
.order-sheet-color-info {
    background: #ffffff;
    color: #000000;
    padding: 0.8rem 1.2rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e2e2;
    font-size: 1rem;
    min-width: 130px;
    text-align: center;
    box-shadow: none;
}

.order-sheet-label {
    font-weight: 700;
    margin-right: 0.35rem;
}

.order-sheet-preview-table {
    font-size: 0.95rem;
    table-layout: auto;
    width: 100%;
}

.order-sheet-preview-table thead th {
    background: #eef4fc;
    white-space: nowrap;
}

.order-sheet-desc-cell {
    word-break: break-word;
    min-width: 120px;
    max-width: 260px;
}

.order-sheet-quantity-input,
.order-sheet-unit-input,
.order-sheet-larg-alt-input {
    width: 100%;
    min-width: 0;
    display: block;
}

.order-sheet-switch {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 3.5rem;
    margin: 0;
    padding: 0.85rem 1rem 0.85rem 4rem;
    border: 1px solid #e7eef8;
    border-radius: 1rem;
    background: #fbfdff;
}

.order-sheet-switch .form-check-input {
    position: absolute;
    top: 50%;
    left: 1rem;
    margin: 0;
    float: none;
    transform: translateY(-50%);
}

.order-sheet-switch .form-check-label {
    display: block;
    width: 100%;
    margin: 0;
    line-height: 1.2;
}

.order-sheet-image-cell {
    width: 90px;
}

.order-sheet-preview-image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 0.8rem;
    border: 1px solid rgba(13, 110, 253, 0.12);
    background: #fff;
}

.order-sheet-qty-input {
    min-width: 180px;
    min-height: 44px;
    border: 1px solid #d7e2ef;
    border-radius: 0.8rem;
    background: #fff;
}

.order-sheet-qty-input:focus {
    box-shadow: none;
    border-color: #86b7fe;
}

.order-sheet-unit-input {
    border: 1px solid #d7e2ef;
    border-radius: 0.8rem;
    background: #fff;
}

.order-sheet-unit-input:focus {
    box-shadow: none;
    border-color: #86b7fe;
}

.order-sheet-unit-cell {
    width: 70px !important;
    max-width: 70px !important;
}

.order-sheet-unit-cell .order-sheet-unit-input {
    min-width: 0 !important;
}

/* ── Logo na navbar ─────────────────────────────── */
.navbar-logo {
    max-height: 38px;
    width: auto;
    object-fit: contain;
}

.navbar-brand-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.01em;
}

/* ── Cabeçalho de impressão (oculto na tela) ────── */
.order-sheet-print-header {
    display: none;
}

/* Coluna de custo: visível na tela, oculta na impressão */
.order-sheet-cost-col {
    background-color: #fff8e1;
    vertical-align: middle;
}

.order-sheet-cost-cell {
    line-height: 1.25;
    white-space: nowrap;
}

.order-sheet-cost-cell small {
    display: block;
    font-size: 0.75rem;
}

@media print {
    @page order-sheet-landscape {
        size: 297mm 210mm;
        margin: 10mm;
    }

    @page order-sheet-portrait {
        size: 210mm 297mm;
        margin: 10mm;
    }

    html.order-sheet-print-landscape {
        page: order-sheet-landscape;
    }

    html.order-sheet-print-portrait {
        page: order-sheet-portrait;
    }

    .order-sheet-cost-col,
    .order-sheet-cost-total {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .order-sheet-print-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid #dee2e6;
    }

    .order-sheet-print-header-brand {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .order-sheet-print-header-meta {
        font-size: 0.88rem;
        color: #1a1a2e;
        text-align: right;
        white-space: nowrap;
    }

    .order-sheet-logo-print {
        max-height: 56px;
        max-width: 180px;
        width: auto;
        object-fit: contain;
    }

    .order-sheet-print-title {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
    }

    .order-sheet-brand-name {
        font-size: 1.1rem;
        font-weight: 700;
        color: #1a1a2e;
        line-height: 1.2;
    }

    .order-sheet-doc-label {
        font-size: 0.75rem;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

    .app-navbar,
    .no-print {
        display: none !important;
    }

    main,
    .container-fluid,
    .page-section,
    .card,
    .card-body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
        border: 0 !important;
    }

    .order-sheet-page .col-12,
    .order-sheet-page .col-xl-7 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .order-sheet-paper {
        min-height: auto;
    }

    .order-sheet-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .order-sheet-print-time {
        font-size: 0.88rem;
        color: #495057;
        margin-top: 0.15rem;
    }

    .order-sheet-preview-table {
        font-size: 0.82rem;
    }

    body.order-sheet-print-portrait .order-sheet-preview-table {
        font-size: 0.72rem;
    }

    body.order-sheet-print-portrait .order-sheet-preview-image {
        width: 44px;
        height: 44px;
    }

    .order-sheet-preview-table th,
    .order-sheet-preview-table td {
        padding: 0.45rem !important;
    }

    .order-sheet-preview-image {
        width: 52px;
        height: 52px;
    }

    .order-sheet-qty-input,
    .order-sheet-quantity-input,
    .order-sheet-unit-input,
    .order-sheet-larg-alt-input {
        min-width: 0;
        min-height: 36px;
        border: 0 !important;
        border-bottom: 1px solid #8a98aa !important;
        border-radius: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }
}

@media (max-width: 991px) {
    .app-navbar .navbar-text {
        display: none;
    }

    .order-sheet-header {
        flex-direction: column;
    }
}
