:root {
    --bg: #f0f2f8;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.65);
    --bg-glass-strong: rgba(255, 255, 255, 0.85);
    --text: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --accent: #3b82f6;
    --accent-2: #6366f1;
    --accent-light: rgba(59, 130, 246, 0.08);
    --accent-glow: rgba(59, 130, 246, 0.25);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: rgba(226, 232, 240, 0.9);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.10);
    --shadow-xl: 0 24px 48px rgba(0,0,0,0.14);
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
    --transition-fast: all 0.15s ease;
    --gradient-main: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    --gradient-green: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.orders-body {
    margin: 0;
    font-family: "Inter",system-ui,-apple-system,sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.orders-body::before {
    content: "";
    position: fixed;
    top: -50%;
    right: -30%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(59,130,246,0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body.orders-body::after {
    content: "";
    position: fixed;
    bottom: -40%;
    left: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(99,102,241,0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

.is-hidden {
    display: none !important;
}

body.orders-lock-scroll {
    overflow: hidden;
}

.orders-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 14px 0 10px;
    background: rgba(240,242,248,.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.orders-header-container,
.orders-page-shell {
    position: relative;
    z-index: 1;
}

.orders-header-container {
    max-width: 1580px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: .9rem;
}

.orders-logo-area {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.orders-logo-area img {
    height: 34px;
    max-width: 110px;
    object-fit: contain;
    flex-shrink: 0;
}

.orders-logo-text strong {
    display: block;
    font-size: .98rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text);
}

.orders-logo-text span {
    display: block;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 4px;
    white-space: nowrap;
}

.orders-header-total {
    background: var(--gradient-main);
    color: #fff;
    padding: .42rem 1rem;
    border-radius: var(--radius-pill);
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(59,130,246,.30);
}

.orders-header-total strong {
    font-size: 1.1rem;
}

.orders-page-shell {
    max-width: 1580px;
    margin: 0 auto;
    padding: 18px 16px 120px;
}

.orders-preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
}

.orders-action {
    appearance: none;
    border: 1px solid var(--border);
    outline: 0;
    cursor: pointer;
    min-height: 42px;
    padding: 0 .95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border-radius: var(--radius-pill);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.orders-action:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--border);
    transform: translateY(-1px);
}

.orders-action.primary {
    background: var(--gradient-main);
    border-color: transparent;
    color: #fff;
}

.orders-action.primary:hover {
    color: #fff;
    filter: brightness(1.02);
    background: var(--gradient-main);
}

.orders-action.orders-reset {
    color: #b42318;
    background: rgba(239,68,68,.05);
    border-color: rgba(239,68,68,.18);
}

.orders-action.orders-reset:hover {
    background: rgba(239,68,68,.09);
    color: #b42318;
}

.orders-action:disabled {
    opacity: .65;
    cursor: default;
    transform: none;
}

.orders-preview-card {
    padding: 18px;
}

.orders-preview-frame {
    min-height: calc(100vh - 270px);
    overflow: auto;
    padding: 6px 4px 70px;
}

.orders-document {
    width: fit-content;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
    transform-origin: top center;
    transition: transform .2s ease;
}

.orders-sheet-shell {
    width: 794px;
    height: 1123px;
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(226,232,240,.95);
}

.orders-sheet {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #fff;
    color: var(--text);
}

.orders-sheet::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../img/logo/logotabela.webp");
    background-repeat: no-repeat;
    background-position: center 56%;
    background-size: 62%;
    opacity: .03;
    pointer-events: none;
}

.orders-sheet::after {
    content: "TABELAPELICULAS.COM.BR";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%) rotate(-34deg);
    font-size: 50px;
    font-weight: 900;
    letter-spacing: 1px;
    color: rgba(59,130,246,.05);
    white-space: nowrap;
    pointer-events: none;
}

.orders-sheet-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 22px 28px 18px;
}

.orders-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eef2f6;
}

.orders-page-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.orders-page-logo {
    width: 74px;
    height: 74px;
    object-fit: contain;
    flex-shrink: 0;
}

.orders-page-title {
    margin: 0;
    color: #18212d;
    font-size: 26px;
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -.6px;
}

.orders-page-title span {
    color: var(--accent);
}

.orders-page-number {
    align-self: flex-end;
    padding-bottom: 2px;
    color: #7a8795;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.orders-brand {
    margin-bottom: 12px;
    break-inside: avoid;
}

.orders-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    overflow: hidden;
    border: 1px solid #d7dde5;
    border-radius: 14px;
    background: #fff;
}

.orders-table col.orders-qty-col {
    width: 140px;
}

.orders-brand-name {
    text-align: left;
    padding: 8px 13px;
    color: #15202b;
    font-size: 16px;
    font-weight: 900;
    background: linear-gradient(180deg,#f9fbfc 0%,#f2f5f8 100%);
    border-bottom: 1px solid #dde4eb;
}

.orders-qty-header {
    text-align: center;
    padding: 8px;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .85px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.orders-table tbody tr:nth-child(odd) td {
    background: #fbfcfd;
}

.orders-table tbody tr:nth-child(even) td {
    background: #fff;
}

.orders-table tbody td {
    height: 27px;
    border-bottom: 1px solid #edf1f5;
}

.orders-table tbody tr:last-child td {
    border-bottom: 0;
}

.orders-model-cell {
    padding: 4px 13px;
    font-size: 12.5px;
    font-weight: 600;
    color: #273342;
}

.orders-qty-cell {
    padding: 0;
    border-left: 1px solid #e5ebf0;
    text-align: center;
}

.orders-qty-input {
    width: 100%;
    height: 27px;
    border: 0;
    outline: 0;
    background: transparent;
    text-align: center;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
}

.orders-qty-input:focus {
    background: #f5f9ff;
    box-shadow: inset 0 0 0 2px rgba(59,130,246,.14);
}

body:not(.orders-editing) .orders-qty-input {
    pointer-events: none;
}

.orders-page-footer {
    margin-top: auto;
    padding-top: 10px;
}

.orders-total-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    overflow: hidden;
    border: 1px solid #d7dde5;
    border-radius: 14px;
    background: #fff;
}

.orders-total-table col.orders-qty-col {
    width: 140px;
}

.orders-total-label {
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 900;
    color: #15202b;
    background: linear-gradient(180deg,#f9fbfc 0%,#f2f5f8 100%);
}

.orders-total-value {
    text-align: center;
    color: #fff;
    background: var(--gradient-main);
    font-size: 20px;
    font-weight: 900;
}

.orders-footer-bottom {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #6d7a89;
    font-size: 10px;
}

.orders-footer-bottom strong {
    color: var(--accent);
}

.orders-floating-nav {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1300;
    min-height: 54px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 16px;
    background: rgba(15,23,42,.92);
    color: #fff;
    box-shadow: 0 16px 34px rgba(15,23,42,.24);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.08);
}

.orders-page-now {
    min-width: 34px;
    text-align: center;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,.10);
    font-size: 13px;
    font-weight: 800;
}

.orders-page-total {
    color: #d1dae4;
    font-size: 13px;
    font-weight: 700;
}

.orders-divider {
    width: 1px;
    height: 26px;
    display: block;
    margin: 0 2px;
    background: rgba(255,255,255,.15);
}

.orders-floating-nav button {
    width: 38px;
    height: 38px;
    border: 0;
    outline: 0;
    cursor: pointer;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    transition: background .18s ease;
}

.orders-floating-nav button:hover {
    background: rgba(255,255,255,.08);
}

.orders-floating-nav button:disabled {
    opacity: .3;
    cursor: default;
}

.orders-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15,23,42,.38);
    backdrop-filter: blur(8px);
}

.orders-dialog {
    position: relative;
    width: min(100%,520px);
    background: #fff;
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(15,23,42,.20);
    padding: 28px 26px 22px;
    color: #0f172a;
}

.orders-dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    background: #f8fafc;
    color: #0f172a;
}

.orders-dialog-close:hover {
    background: #eef2f7;
}

.orders-dialog-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 24px;
    margin-bottom: 16px;
    background: #f8fafc;
    color: #0f172a;
}

.orders-dialog-icon.info {
    background: rgba(37,99,235,.10);
    color: #2563eb;
}

.orders-dialog-icon.success {
    background: rgba(16,185,129,.12);
    color: #10b981;
}

.orders-dialog-icon.warning {
    background: rgba(245,158,11,.12);
    color: #f59e0b;
}

.orders-dialog-icon.danger {
    background: rgba(239,68,68,.12);
    color: #ef4444;
}

.orders-dialog-body h2 {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.06;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -.03em;
}

.orders-dialog-message {
    color: #475467;
    font-size: 15px;
    line-height: 1.65;
}

.orders-dialog-message p {
    margin: 0;
}

.orders-dialog-message p+p {
    margin-top: 10px;
}

.orders-dialog-textarea {
    width: 100%;
    min-height: 160px;
    margin-top: 14px;
    padding: 14px 15px;
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,.10);
    background: #f8fafc;
    color: #0f172a;
    resize: vertical;
    font: inherit;
}

.orders-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.orders-dialog-btn {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    border: 0;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
}

.orders-dialog-btn.primary {
    background: var(--gradient-main);
    color: #fff;
}

.orders-dialog-btn.secondary {
    background: #f5f8fb;
    color: #0f172a;
}

.orders-dialog-btn.secondary:hover {
    background: #edf2f7;
}

.orders-toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1700;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.orders-toast {
    min-width: 280px;
    max-width: 360px;
    padding: 14px 15px;
    border-radius: 16px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    background: #fff;
    color: #0f172a;
    border: 1px solid rgba(15,23,42,.08);
    box-shadow: 0 18px 44px rgba(15,23,42,.14);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}

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

.orders-toast.success .orders-toast-icon {
    color: #10b981;
}

.orders-toast.warning .orders-toast-icon {
    color: #f59e0b;
}

.orders-toast.danger .orders-toast-icon {
    color: #ef4444;
}

.orders-toast-icon {
    font-size: 18px;
    line-height: 1.2;
    padding-top: 1px;
}

.orders-toast-text {
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
}

.orders-empty {
    max-width: 680px;
    margin: 90px auto 0;
    padding: 38px 26px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(15,23,42,.08);
    text-align: center;
    color: #0f172a;
    box-shadow: var(--shadow-md);
}

.orders-empty h2 {
    margin: 0 0 10px;
    font-size: 28px;
}

.orders-empty p {
    margin: 0;
    color: #475467;
}

@media (max-width:1450px) {
    .orders-header-container {
        flex-wrap: wrap;
    }

    .orders-header-total {
        margin-left: auto;
    }
}

@media (max-width:900px) {
    .orders-logo-text {
        display: none;
    }

    .orders-header-total {
        display: none;
    }
}

@media (max-width:760px) {
    .orders-site-header {
        padding: 10px 0 8px;
    }

    .orders-header-container,
    .orders-page-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .orders-preview-card {
        padding: 10px;
    }

    .orders-preview-frame {
        padding: 4px 0 82px;
    }

    .orders-action {
        padding: 0 .85rem;
        font-size: .78rem;
    }

    .orders-floating-nav {
        bottom: 12px;
        min-height: 50px;
        padding: 6px 10px;
    }

    .orders-toast-stack {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .orders-toast {
        min-width: 0;
        max-width: none;
    }

    .orders-dialog-backdrop {
        padding: 14px;
    }

    .orders-dialog {
        padding: 24px 18px 18px;
        border-radius: 20px;
    }

    .orders-dialog-body h2 {
        font-size: 22px;
    }
}

/* v1.6 - topo simplificado e sem menu público */

.orders-header-container {
    max-width: 1580px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: nowrap;
}

.orders-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.orders-header-total {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.orders-header-total strong {
    color: var(--accent);
}

.orders-page-shell {
    padding-top: 18px;
}

.orders-preview-card {
    margin-top: 0;
}

/* remove a marca d'água textual que passava por cima do conteúdo */

.orders-sheet::after {
    display: none !important;
    content: none !important;
}

@media (max-width:1200px) {
    .orders-header-container {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .orders-header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
}

@media (max-width:760px) {
    .orders-header-actions {
        gap: 7px;
    }

    .orders-header-total {
        width: 100%;
        justify-content: center;
    }

    .orders-action {
        flex: 1 1 auto;
    }
}

/* ===== Lista compartilhada: somente leitura ===== */

.orders-readonly-badge {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 0 .95rem;
    border-radius: 999px;
    background: rgba(59,130,246,.08);
    color: #2563eb;
    border: 1px solid rgba(59,130,246,.16);
    font-size: .8rem;
    font-weight: 900;
    white-space: nowrap;
}

body.orders-readonly .orders-qty-input {
    pointer-events: none;
    user-select: none;
    color: #0f172a;
    background: transparent;
}

body.orders-readonly .orders-qty-cell {
    background: #f8fafc !important;
}

/* =========================================================
   v1.8 — MOBILE FIRST / RESPONSIVIDADE REAL
   No celular a lista deixa de simular uma folha A4 reduzida
   e passa a usar a largura real da tela.
========================================================= */

@media (max-width: 760px) {
    html,
    body.orders-body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body.orders-body {
        min-height: 100dvh;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .orders-site-header {
        position: sticky;
        top: 0;
        padding: max(9px, env(safe-area-inset-top, 0px))
            0
            9px;
        background: rgba(240,242,248,.96);
        backdrop-filter: blur(18px);
    }

    .orders-header-container {
        width: 100%;
        padding-left: 10px;
        padding-right: 10px;
        display: grid;
        grid-template-columns: minmax(0,1fr) auto;
        align-items: center;
        gap: 9px 8px;
    }

    .orders-logo-area {
        min-width: 0;
        gap: .6rem;
    }

    .orders-logo-area img {
        width: 44px;
        height: 44px;
        max-width: 44px;
        object-fit: contain;
        border-radius: 12px;
        background: #fff;
        padding: 5px;
        box-shadow: var(--shadow-sm);
    }

    .orders-logo-text {
        display: block !important;
        min-width: 0;
    }

    .orders-logo-text strong {
        font-size: .9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .orders-logo-text span {
        margin-top: 2px;
        font-size: .66rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 190px;
    }

    .orders-header-total {
        width: auto !important;
        min-height: 40px;
        padding: 0 .75rem;
        justify-content: center;
        font-size: .7rem;
        border-radius: 999px;
        white-space: nowrap;
    }

    .orders-header-total strong {
        font-size: 1rem;
    }

    .orders-header-actions {
        grid-column: 1 / -1;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 7px;
        margin: 0;
    }

    .orders-readonly-badge {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 40px;
        justify-content: center;
        border-radius: 13px;
    }

    .orders-action {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        padding: 0 10px;
        border-radius: 13px;
        font-size: .76rem;
        gap: .45rem;
        box-shadow: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .orders-action i {
        flex: 0 0 auto;
        font-size: .9rem;
    }

    .orders-action span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Em telas muito estreitas, Fechar ocupa a largura inteira. */

    #ordersCloseBtn:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .orders-page-shell {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 10px 8px calc(88px + env(safe-area-inset-bottom, 0px));
    }

    .orders-preview-card {
        width: 100%;
        padding: 0;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }

    .orders-preview-frame {
        width: 100%;
        min-height: 0;
        overflow: visible;
        padding: 0;
    }

    .orders-document {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        gap: 10px;
        transform: none !important;
        transform-origin: initial !important;
    }

    .orders-sheet-shell {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
    }

    .orders-sheet {
        width: 100%;
        height: auto !important;
        min-height: 0;
        overflow: visible;
    }

    .orders-sheet::before {
        background-size: 72%;
        background-position: center 50%;
        opacity: .018;
    }

    .orders-sheet::after {
        display: none !important;
    }

    .orders-sheet-content {
        width: 100%;
        height: auto !important;
        min-height: 0;
        padding: 13px 10px 12px;
    }

    .orders-page-header {
        gap: 8px;
        margin-bottom: 10px;
        padding: 0 1px 10px;
        align-items: center;
    }

    .orders-page-header-left {
        min-width: 0;
        gap: 8px;
        flex: 1;
    }

    .orders-page-logo {
        width: 46px;
        height: 46px;
    }

    .orders-page-title {
        font-size: 15px;
        line-height: 1.15;
        letter-spacing: -.2px;
    }

    .orders-page-title span {
        display: block;
        margin-top: 2px;
        font-size: 12px;
    }

    .orders-page-number {
        align-self: center;
        padding: 0;
        font-size: 9px;
        white-space: nowrap;
    }

    .orders-brand {
        margin-bottom: 10px;
        break-inside: auto;
    }

    .orders-table {
        width: 100%;
        border-radius: 11px;
    }

    .orders-table col.orders-qty-col,
    .orders-total-table col.orders-qty-col {
        width: 92px;
    }

    .orders-brand-name {
        height: 42px;
        padding: 9px 10px;
        font-size: 14px;
    }

    .orders-qty-header {
        height: 42px;
        padding: 8px 4px;
        font-size: 8px;
        letter-spacing: .55px;
    }

    .orders-table tbody td {
        height: 44px;
    }

    .orders-model-cell {
        padding: 8px 10px;
        font-size: 13px;
        line-height: 1.25;
        word-break: break-word;
    }

    .orders-qty-cell {
        width: 92px;
    }

    .orders-qty-input {
        min-height: 44px;
        height: 44px;
        font-size: 16px;
        border-radius: 0;
        -moz-appearance: textfield;
        touch-action: manipulation;
    }

    .orders-qty-input::-webkit-outer-spin-button,
    .orders-qty-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    body.orders-editing .orders-qty-cell {
        background: #f4f8ff !important;
    }

    body.orders-editing .orders-qty-input {
        box-shadow: inset 0 0 0 1px rgba(59,130,246,.12);
    }

    .orders-page-footer {
        margin-top: 12px;
        padding-top: 0;
    }

    .orders-total-table {
        border-radius: 11px;
    }

    .orders-total-label {
        min-height: 46px;
        padding: 12px 10px;
        font-size: 13px;
    }

    .orders-total-value {
        min-height: 46px;
        font-size: 17px;
    }

    .orders-footer-bottom {
        margin-top: 7px;
        font-size: 9px;
        gap: 6px;
    }

    .orders-floating-nav {
        left: 50%;
        bottom: max(10px, env(safe-area-inset-bottom, 0px));
        width: auto;
        max-width: calc(100vw - 20px);
        min-height: 52px;
        padding: 6px 9px;
        border-radius: 15px;
        gap: 5px;
    }

    .orders-floating-nav button {
        width: 42px;
        height: 42px;
        min-width: 42px;
        touch-action: manipulation;
    }

    .orders-page-now {
        min-width: 34px;
    }

    /* Zoom não é necessário no layout fluido mobile. */

    #ordersZoomIn,
    #ordersZoomOut {
        display: none !important;
    }

    .orders-floating-nav .orders-divider:last-of-type {
        display: none;
    }

    .orders-dialog-backdrop {
        align-items: flex-end;
        padding: 10px 10px max(10px, env(safe-area-inset-bottom, 0px));
    }

    .orders-dialog {
        width: 100%;
        max-height: calc(100dvh - 24px);
        overflow: auto;
        padding: 22px 16px 16px;
        border-radius: 20px;
    }

    .orders-dialog-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 12px;
    }

    .orders-dialog-body h2 {
        padding-right: 34px;
        font-size: 21px;
    }

    .orders-dialog-message {
        font-size: 14px;
        line-height: 1.5;
    }

    .orders-dialog-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 18px;
    }

    .orders-dialog-btn {
        width: 100%;
        min-height: 46px;
    }

    .orders-dialog-btn.primary:only-child {
        grid-column: 1 / -1;
    }

    .orders-dialog-textarea {
        min-height: 140px;
        font-size: 14px;
    }

    .orders-toast-stack {
        left: 10px;
        right: 10px;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    .orders-toast {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
}

@media (max-width: 390px) {
    .orders-header-container {
        grid-template-columns: minmax(0,1fr);
    }

    .orders-header-total {
        grid-row: 2;
        width: 100% !important;
    }

    .orders-header-actions {
        grid-row: 3;
    }

    .orders-logo-text span {
        max-width: 220px;
    }

    .orders-action {
        font-size: .72rem;
    }

    .orders-table col.orders-qty-col,
    .orders-total-table col.orders-qty-col,
    .orders-qty-cell {
        width: 82px;
    }

    .orders-model-cell {
        font-size: 12.5px;
    }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
    .orders-site-header {
        position: relative;
    }

    .orders-header-container {
        grid-template-columns: minmax(0,1fr) auto;
    }

    .orders-logo-text span {
        display: none;
    }

    .orders-header-actions {
        grid-template-columns: repeat(5, minmax(0,1fr));
    }

    .orders-action {
        min-height: 42px;
    }

    .orders-page-shell {
        padding-top: 8px;
    }
}

/* v2.0 - dados do pedido e ações para fornecedor */

.orders-meta-card {
    max-width: 1100px;
    margin: 0 auto 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    padding: 16px 18px;
}

.orders-meta-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.orders-meta-heading strong {
    display: block;
    font-size: 15px;
}

.orders-meta-heading span {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.orders-meta-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.orders-meta-fields label {
    display: block;
}

.orders-meta-fields label.wide {
    grid-column: 1/-1;
}

.orders-meta-fields span,
.orders-meta-readonly span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.orders-meta-fields input {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.orders-meta-fields input:focus {
    outline: 2px solid rgba(59,130,246,.16);
    border-color: var(--accent);
}

.orders-meta-readonly {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.orders-meta-readonly .wide {
    grid-column: 1/-1;
}

.orders-meta-readonly strong {
    font-size: 14px;
    line-height: 1.45;
}

@media (max-width:760px) {
    .orders-meta-card {
        padding: 14px;
        margin-bottom: 10px;
        border-radius: 15px;
    }

    .orders-meta-fields,
    .orders-meta-readonly {
        grid-template-columns: 1fr;
    }

    .orders-meta-fields label.wide,
    .orders-meta-readonly .wide {
        grid-column: auto;
    }

    .orders-meta-heading span {
        font-size: 11px;
    }

    .orders-header-actions {
        display: grid !important;
        grid-template-columns: repeat(2,minmax(0,1fr));
        width: 100%;
    }

    .orders-header-actions .orders-action {
        width: 100%;
        padding: 0 .6rem;
    }

    .orders-readonly-badge {
        grid-column: 1/-1;
    }
}

/* v2.1.1 - informações opcionais do pedido recolhidas por padrão */

.orders-meta-collapsible {
    padding: 0;
    overflow: hidden;
}

.orders-meta-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.orders-meta-toggle:hover {
    background: rgba(59,130,246,.045);
}

.orders-meta-toggle:focus-visible {
    outline: 2px solid rgba(59,130,246,.28);
    outline-offset: -2px;
}

.orders-meta-toggle-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.orders-meta-toggle-main i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(59,130,246,.10);
    color: var(--accent);
    font-size: 12px;
    transition: transform .2s ease;
}

.orders-meta-toggle-main strong {
    font-size: 14px;
    line-height: 1.2;
}

.orders-meta-toggle-help {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
    text-align: right;
}

.orders-meta-collapsible.is-open .orders-meta-toggle-main i {
    transform: rotate(45deg);
}

.orders-meta-content {
    border-top: 1px solid var(--border);
    padding: 15px 18px 18px;
}

.orders-meta-content[hidden] {
    display: none !important;
}

@media (max-width:760px) {
    .orders-meta-toggle {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        padding: 13px 14px;
    }

    .orders-meta-toggle-help {
        text-align: left;
        padding-left: 38px;
        font-size: 11px;
    }

    .orders-meta-content {
        padding: 13px 14px 15px;
    }
}

/* =========================================================
   v2.1.2 — refinamento visual da Lista de pedidos
   Hierarquia clara, toolbar organizada e preview central.
========================================================= */

.orders-site-header {
    padding: 10px 0;
    background: rgba(245,247,252,.94);
    box-shadow: 0 1px 0 rgba(15,23,42,.05);
}

.orders-header-container {
    max-width: 1480px;
    padding: 0 22px;
    display: grid;
    grid-template-columns: minmax(320px,auto) minmax(0,1fr);
    align-items: center;
    gap: 18px 28px;
}

.orders-header-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 18px;
}

.orders-logo-area {
    gap: 12px;
    flex: 0 1 auto;
}

.orders-logo-area img {
    height: 38px;
    max-width: 116px;
}

.orders-logo-text strong {
    font-size: 1.02rem;
    letter-spacing: -.015em;
}

.orders-logo-text span {
    font-size: .72rem;
    margin-top: 5px;
}

.orders-header-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.orders-header-total {
    min-height: 42px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: var(--text);
    border: 1px solid rgba(148,163,184,.22);
    box-shadow: 0 4px 14px rgba(15,23,42,.05);
    font-size: .78rem;
}

.orders-header-total strong {
    font-size: 1rem;
    color: var(--accent);
}

.orders-summary-models,
.orders-summary-units {
    white-space: nowrap;
    font-weight: 800;
}

.orders-summary-separator {
    width: 1px;
    height: 17px;
    background: #e2e8f0;
}

.orders-header-actions {
    min-width: 0;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: nowrap;
}

.orders-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.orders-action-group-main {
    justify-content: flex-end;
    flex: 1 1 auto;
}

.orders-action-group-utility {
    flex: 0 0 auto;
    padding-left: 12px;
    border-left: 1px solid rgba(148,163,184,.24);
}

.orders-action {
    min-height: 42px;
    padding: 0 15px;
    border-radius: 13px;
    box-shadow: none;
    border-color: rgba(148,163,184,.22);
    background: rgba(255,255,255,.92);
    font-size: .8rem;
    white-space: nowrap;
}

.orders-action i {
    font-size: .82rem;
}

.orders-action:hover {
    box-shadow: 0 6px 16px rgba(15,23,42,.07);
    transform: translateY(-1px);
}

.orders-action.primary {
    box-shadow: 0 7px 18px rgba(79,70,229,.18);
}

.orders-action.orders-close {
    background: #f8fafc;
}

.orders-page-shell {
    max-width: 1260px;
    padding: 20px 22px 112px;
}

.orders-meta-card {
    max-width: 1120px;
    margin: 0 auto 14px;
    border-radius: 16px;
    border-color: rgba(148,163,184,.20);
    box-shadow: 0 6px 22px rgba(15,23,42,.045);
}

.orders-meta-toggle {
    padding: 14px 16px;
}

.orders-meta-toggle-main i {
    width: 30px;
    height: 30px;
    border-radius: 10px;
}

.orders-meta-toggle-main strong {
    font-size: 13.5px;
}

.orders-meta-toggle-help {
    max-width: 510px;
    font-size: 11.5px;
}

.orders-preview-card {
    max-width: 1120px;
    margin: 0 auto;
    padding: 22px;
    border-radius: 20px;
    background: linear-gradient(180deg,#f8fafc 0%,#f2f5fa 100%);
    border: 1px solid rgba(148,163,184,.18);
    box-shadow: 0 12px 34px rgba(15,23,42,.07);
}

.orders-preview-frame {
    min-height: calc(100vh - 245px);
    padding: 4px 8px 82px;
    overflow: auto;
    scrollbar-gutter: stable both-edges;
}

.orders-document {
    gap: 20px;
}

.orders-sheet-shell {
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(15,23,42,.13),0 0 0 1px rgba(15,23,42,.025);
}

.orders-floating-nav {
    min-height: 48px;
    padding: 6px 9px;
    gap: 5px;
    border-radius: 14px;
    background: rgba(15,23,42,.90);
    box-shadow: 0 12px 30px rgba(15,23,42,.22);
}

.orders-floating-nav button {
    width: 36px;
    height: 36px;
    border-radius: 9px;
}

.orders-page-now {
    min-width: 32px;
    padding: 5px 7px;
}

@media (max-width: 1320px) {
    .orders-header-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .orders-header-identity {
        justify-content: space-between;
    }

    .orders-header-actions {
        justify-content: flex-start;
    }

    .orders-action-group-main {
        justify-content: flex-start;
        flex: 0 1 auto;
    }
}

@media (max-width: 900px) {
    .orders-header-container {
        padding: 0 14px;
    }

    .orders-header-identity {
        gap: 10px;
    }

    .orders-logo-text {
        display: block;
    }

    .orders-header-summary {
        margin-left: auto;
    }

    .orders-header-actions {
        gap: 8px;
        flex-wrap: wrap;
    }

    .orders-action-group-main {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        width: 100%;
        flex: 1 1 100%;
    }

    .orders-action-group-utility {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        width: 100%;
        padding: 8px 0 0;
        border-left: 0;
        border-top: 1px solid rgba(148,163,184,.20);
    }

    .orders-action {
        width: 100%;
    }

    .orders-page-shell {
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media (max-width:760px) {
    .orders-site-header {
        padding: max(8px,env(safe-area-inset-top,0px)) 0 9px;
    }

    .orders-header-container {
        display: block;
        padding-left: 10px;
        padding-right: 10px;
    }

    .orders-header-identity {
        display: grid;
        grid-template-columns: minmax(0,1fr) auto;
        align-items: center;
        margin-bottom: 9px;
    }

    .orders-logo-area img {
        height: 34px;
    }

    .orders-logo-text strong {
        font-size: .9rem;
    }

    .orders-logo-text span {
        font-size: .66rem;
        white-space: normal;
    }

    .orders-header-summary {
        margin-left: 0;
    }

    .orders-header-total {
        min-height: 38px;
        padding: 0 10px;
        gap: 7px;
        font-size: .7rem;
    }

    .orders-header-total strong {
        font-size: .86rem;
    }

    .orders-summary-separator {
        height: 14px;
    }

    .orders-readonly-badge {
        min-height: 38px;
        padding: 0 .7rem;
        font-size: .7rem;
    }

    .orders-header-actions {
        display: flex !important;
        width: 100%;
        gap: 7px;
    }

    .orders-action-group-main,
    .orders-action-group-utility {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        width: 100%;
        gap: 7px;
    }

    .orders-action-group-utility {
        padding-top: 7px;
        margin-top: 0;
    }

    .orders-action {
        min-height: 43px;
        padding: 0 8px;
        border-radius: 12px;
        font-size: .73rem;
    }

    .orders-page-shell {
        padding-top: 12px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .orders-meta-card {
        margin-bottom: 10px;
        border-radius: 14px;
    }

    .orders-meta-toggle {
        padding: 12px;
    }

    .orders-meta-toggle-help {
        padding-left: 40px;
    }

    .orders-preview-card {
        padding: 8px;
        border-radius: 16px;
        background: #f7f9fc;
    }

    .orders-preview-frame {
        padding: 2px 0 76px;
        min-height: auto;
    }

    .orders-sheet-shell {
        border-radius: 13px;
    }
}

@media (max-width:420px) {
    .orders-header-summary {
        margin-top: 8px;
        width: 100%;
    }

    .orders-header-total {
        width: 100% !important;
        justify-content: center;
    }

    .orders-header-actions {
        margin-top: 0;
    }
}

/* =========================================================
   v2.1.3 — header da Lista de pedidos alinhado ao menu do site
========================================================= */

.orders-site-header {
    padding: .62rem 0;
    background: rgba(255,255,255,.85);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.orders-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.orders-header-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 1 auto;
}

.orders-logo-area {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.orders-logo-area img {
    height: 42px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.orders-logo-text strong {
    display: block;
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.orders-logo-text span {
    display: block;
    margin-top: 1px;
    font-size: .65rem;
    color: var(--text-muted);
    letter-spacing: .02em;
    line-height: 1.25;
}

.orders-header-summary {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-shrink: 0;
}

.orders-header-total {
    min-height: 36px;
    padding: .4rem .95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59,130,246,.28);
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

.orders-header-total strong {
    font-size: .88rem;
    color: #fff;
}

.orders-summary-separator {
    width: 1px;
    height: 14px;
    background: rgba(255,255,255,.36);
}

.orders-summary-models,
.orders-summary-units {
    color: #fff;
    font-weight: 800;
}

.orders-readonly-badge {
    min-height: 36px;
    padding: .4rem .85rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(59,130,246,.16);
    background: var(--accent-light);
    color: var(--accent);
    box-shadow: none;
}

.orders-header-actions {
    width: auto;
    min-width: 0;
    margin-left: auto;
    padding: .2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .2rem;
    flex-wrap: nowrap;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,.72);
    box-shadow: var(--shadow-sm);
}

.orders-action-group {
    display: flex;
    align-items: center;
    gap: .05rem;
    min-width: 0;
}

.orders-action-group-main {
    flex: 0 1 auto;
    justify-content: flex-end;
}

.orders-action-group-utility {
    flex: 0 0 auto;
    padding-left: .18rem;
    margin-left: .08rem;
    border-left: 1px solid var(--border);
}

.orders-action {
    min-height: 36px;
    padding: .42rem .76rem;
    gap: .35rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    box-shadow: none;
    font-size: .74rem;
    font-weight: 800;
    white-space: nowrap;
}

.orders-action i {
    font-size: .78rem;
}

.orders-action:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--border);
    box-shadow: none;
    transform: translateY(-1px);
}

.orders-action.primary,
.orders-action.primary:hover {
    background: var(--gradient-main);
    color: #fff;
    border-color: transparent;
    box-shadow: none;
}

.orders-action.orders-reset {
    color: #b42318;
    background: transparent;
    border-color: transparent;
}

.orders-action.orders-reset:hover {
    color: #b42318;
    background: rgba(239,68,68,.07);
    border-color: rgba(239,68,68,.12);
}

.orders-action.orders-close {
    color: var(--text-muted);
    background: transparent;
}

.orders-action.orders-close:hover {
    color: var(--text);
    background: rgba(148,163,184,.10);
}

@media (max-width:1320px) {
    .orders-header-container {
        flex-wrap: wrap;
        gap: .65rem;
    }

    .orders-header-identity {
        width: 100%;
        justify-content: space-between;
    }

    .orders-header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .orders-header-actions::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width:900px) {
    .orders-header-container {
        padding: 0 14px;
    }

    .orders-header-actions {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: .35rem;
        padding: .35rem;
        border-radius: 18px;
        overflow: visible;
    }

    .orders-action-group-main,
    .orders-action-group-utility {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: .35rem;
    }

    .orders-action-group-utility {
        padding: .35rem 0 0;
        margin: 0;
        border-left: 0;
        border-top: 1px solid var(--border);
    }

    .orders-action {
        width: 100%;
        min-height: 42px;
        justify-content: center;
        padding: .5rem .65rem;
        border-radius: 13px;
    }
}

@media (max-width:760px) {
    .orders-site-header {
        padding: max(.5rem,env(safe-area-inset-top,0px)) 0 .5rem;
    }

    .orders-header-container {
        display: block;
        padding: 0 .75rem;
    }

    .orders-header-identity {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0,1fr) auto;
        align-items: center;
        gap: .6rem;
        margin: 0 0 .5rem;
    }

    .orders-logo-area img {
        height: 36px;
    }

    .orders-logo-text strong {
        font-size: .94rem;
    }

    .orders-logo-text span {
        font-size: .62rem;
    }

    .orders-header-summary {
        margin: 0;
    }

    .orders-header-total {
        min-height: 36px;
        padding: .35rem .7rem;
        font-size: .66rem;
        gap: .35rem;
    }

    .orders-header-total strong {
        font-size: .78rem;
    }

    .orders-header-actions {
        width: 100%;
        margin: 0;
    }

    .orders-action {
        font-size: .72rem;
    }
}

@media (max-width:420px) {
    .orders-header-identity {
        grid-template-columns: 1fr;
    }

    .orders-header-summary {
        width: 100%;
        margin-top: .15rem;
    }

    .orders-header-total {
        width: 100%;
        justify-content: center;
    }
}
