:root {
    --orange: #f58216;
    --orange-dark: #d96c08;
    --green: #39b86a;
    --ink: #172033;
    --muted: #697386;
    --bg: #f4f7fb;
    --line: #e6eaf0;
    --sidebar: #111827;
    --sidebar-hover: #263247;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font: 14px Inter, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
}

a {
    color: #1e66d0;
    text-decoration: none;
}

h1,
h2,
h3 {
    margin-top: 0;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 22px 0;
}

.shell {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    min-height: 100vh;
}

.side {
    background: var(--sidebar);
    color: #fff;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    max-width: 190px;
    margin: 2px 10px 30px;
}

.nav a {
    display: block;
    color: #cbd5e1;
    padding: 12px 14px;
    border-radius: 10px;
    margin: 4px 0;
}

.nav a:hover,
.nav a.on {
    background: var(--sidebar-hover);
    color: #fff;
}

.main {
    padding: 28px;
    min-width: 0;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(20, 35, 60, 0.05);
    padding: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat {
    border-top: 4px solid var(--orange);
}

.stat strong {
    font-size: 30px;
    display: block;
    margin-top: 8px;
}

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

th,
td {
    text-align: left;
    padding: 13px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
}

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

.table-card {
    padding: 0;
}

.table-card .table-wrap {
    padding: 8px 20px 0;
}

.table-card .pager {
    padding: 0 20px 20px;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #fff3e7;
    color: #a44b00;
    font-weight: 700;
    font-size: 12px;
}

.badge.ml {
    background: #fff6a8;
    color: #4b4300;
}

.badge.shopee {
    background: #ffe8df;
    color: #a63c13;
}

.btn {
    border: 0;
    border-radius: 9px;
    padding: 10px 14px;
    background: var(--orange);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
}

.btn:hover {
    background: var(--orange-dark);
    color: #fff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.secondary {
    background: #eef2f7;
    color: #263247;
}

.btn.secondary:hover {
    background: #dfe6ef;
}

.row {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

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

.field label {
    font-weight: 600;
}

.field input,
.field select,
.field textarea,
select {
    border: 1px solid #d7dde6;
    border-radius: 9px;
    padding: 10px;
    min-width: 180px;
    background: #fff;
    color: var(--ink);
}

.flash {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 16px;
    background: #e7f8ed;
    color: #176b37;
}

.flash.err {
    background: #ffeaea;
    color: #9b1c1c;
}

.order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 18px;
    align-items: start;
}

.order-head-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

.status-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

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

.order-data-box {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    min-width: 0;
}

.order-data-box h3 {
    margin-bottom: 12px;
}

.data-line {
    line-height: 1.5;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.order-actions {
    margin-top: 18px;
}

.section {
    margin-bottom: 18px;
}

.items img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background: #f4f7fb;
}

.item-row {
    align-items: center;
}

.order-total {
    text-align: right;
    margin-top: 16px;
    font-size: 16px;
}

.additional-item {
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.additional-item:last-child {
    border-bottom: 0;
}

.additional-item strong,
.additional-item span {
    display: block;
}

.additional-item strong {
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
}

.file-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.file-item:last-child {
    border-bottom: 0;
}

.note-item {
    padding: 12px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 9px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.note-item:last-child {
    margin-bottom: 0;
}

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #fff7ee, #f3f7fb);
}

.login .box {
    width: min(440px, 92vw);
}

.login .logo {
    display: block;
    margin: 0 auto 24px;
    max-width: 260px;
}

.muted {
    color: var(--muted);
}

.pager {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.sync-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    padding: 16px;
    margin: 20px 0;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.sync-status strong {
    width: 100%;
}

.checkbox-line {
    display: block;
    margin: 16px 0;
}

.actions {
    margin-top: 18px;
}

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

    .order-data-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .side {
        position: relative;
        height: auto;
    }

    .grid,
    .settings-grid,
    .order-data-grid {
        grid-template-columns: 1fr;
    }

    .main {
        padding: 16px;
    }

    .order-head-row {
        flex-direction: column;
    }

    .top {
        align-items: flex-start;
    }
}

/* ==========================================================
 * Meu Drop Admin 1.0.5 - Pedidos
 * ========================================================== */

.status-badge {
    border: 0;
    font-weight: 700;
    letter-spacing: 0;
}

.status-processing {
    background: #c6e1c6;
    color: #2c4700;
}

.status-pending {
    background: #ffc6c6;
    color: #3c434a;
}

.status-completed {
    background: #c8d7e1;
    color: #003d66;
}

.status-packing {
    background: #a7f8e7;
    color: #1a2f86;
}

.status-default {
    background: #e5e5e5;
    color: #3c434a;
}

.order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 22px;
    align-items: start;
}

.order-main-column,
.order-sidebar {
    min-width: 0;
}

.modern-order-head {
    padding: 24px;
}

.order-title-block {
    min-width: 0;
}

.order-eyebrow {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.order-title-line {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.order-title-line h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -.02em;
}

.order-meta-line {
    display: flex;
    gap: 8px 18px;
    flex-wrap: wrap;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.order-meta-line strong {
    color: #475569;
}

.status-panel {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8fafc;
}

.status-panel .field {
    min-width: 205px;
}

.status-panel select {
    min-width: 205px;
}

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

.order-data-box {
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    box-shadow: 0 3px 14px rgba(15, 23, 42, .04);
}

.panel-title-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 16px 18px;
    border-bottom: 1px solid #edf1f5;
    background: linear-gradient(180deg, #fbfcfe 0%, #f8fafc 100%);
}

.panel-title-row h3 {
    margin: 0 0 2px;
    font-size: 15px;
}

.panel-title-row small {
    color: var(--muted);
    font-size: 11px;
}

.panel-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    border-radius: 10px;
    background: #fff3e7;
    color: var(--orange-dark);
    font-weight: 800;
}

.info-row {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid #f0f3f7;
}

.info-row:last-child {
    border-bottom: 0;
}

.info-label {
    color: #748094;
    font-size: 12px;
    font-weight: 700;
}

.info-value {
    min-width: 0;
    color: #1f2937;
    font-size: 13px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.order-actions-card {
    padding: 18px 20px;
}

.section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-title h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.section-title.compact {
    margin-bottom: 12px;
}

.cached-mark {
    display: inline-flex;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.2);
    font-size: 10px;
}

.items {
    padding: 20px;
}

.order-items-table th {
    background: #fafbfd;
}

.order-items-table td {
    vertical-align: middle;
}

.item-product {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 260px;
}

.item-product img,
.item-image-placeholder {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e7ebf0;
    background: #f5f7fa;
}

.item-image-placeholder {
    display: grid;
    place-items: center;
    color: #94a3b8;
}

.item-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.item-copy strong {
    line-height: 1.35;
}

.item-copy span {
    color: var(--muted);
    font-size: 11px;
}

.item-copy .item-meta {
    color: #64748b;
}

.order-total-modern {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    padding: 18px 4px 2px;
}

.order-total-modern span {
    color: var(--muted);
    font-size: 13px;
}

.order-total-modern strong {
    font-size: 20px;
}

.order-sidebar .side-panel {
    padding: 18px;
}

.additional-item {
    display: grid;
    grid-template-columns: minmax(115px, 42%) minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
}

.additional-item strong {
    margin: 0;
    color: #748094;
    font-size: 11px;
    line-height: 1.35;
}

.additional-item span {
    color: #253044;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.file-item {
    padding: 12px 0;
}

.file-copy {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.file-copy > div {
    min-width: 0;
}

.file-copy strong,
.file-copy small {
    display: block;
    overflow-wrap: anywhere;
}

.file-copy small {
    margin-top: 3px;
    color: var(--muted);
}

.file-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    flex: 0 0 32px;
    border-radius: 9px;
    background: #eef2f7;
    color: #475569;
    font-weight: 800;
}

.local-file-label {
    color: #24824d !important;
    font-weight: 700;
}

.btn.mini {
    min-height: 31px;
    padding: 7px 10px;
    font-size: 11px;
}

.note-item {
    padding: 13px 14px;
    border-left: 3px solid #d8dee8;
    background: #fafbfd;
}

.note-content {
    margin-bottom: 7px;
    color: #273244;
}

.note-item small {
    color: var(--muted);
}

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

    .order-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .order-sidebar .section {
        margin-bottom: 0;
    }
}

@media (max-width: 980px) {
    .order-data-grid {
        grid-template-columns: 1fr;
    }

    .order-sidebar {
        grid-template-columns: 1fr;
    }

    .order-head-row {
        flex-direction: column;
    }

    .status-panel {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .info-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .additional-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* ==========================================================
   Pedidos - paginação, logística e quantidades (v1.0.7)
   ========================================================== */

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    padding: 18px 20px;
    border-top: 1px solid var(--line);
}

.pager-page,
.pager-arrow {
    min-width: 38px;
    height: 38px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9e0e9;
    border-radius: 9px;
    background: #fff;
    color: #334155;
    font-weight: 700;
    transition: .18s ease;
}

.pager-page:hover,
.pager-arrow:hover {
    border-color: var(--orange);
    color: var(--orange-dark);
    background: #fff8f1;
}

.pager-page.current {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.pager-arrow.disabled {
    pointer-events: none;
    opacity: .35;
}

.pager-total {
    padding: 0 5px;
    color: var(--muted);
    font-weight: 600;
}

.logistics-card {
    border-left: 4px solid var(--orange);
}

.logistics-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.logistics-field {
    min-width: 260px;
    max-width: 420px;
    flex: 1;
}

.quantity-cell {
    width: 92px;
    text-align: center;
}

.item-quantity {
    display: inline-flex;
    min-width: 48px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    font-weight: 700;
    color: #243247;
}

.item-quantity.above-one {
    color: #d63638;
}

.remote-mark {
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: #faea2e;
    color: #292500;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

@media (max-width: 760px) {
    .pager {
        justify-content: center;
    }

    .logistics-form {
        align-items: stretch;
    }

    .logistics-field {
        max-width: none;
        min-width: 100%;
    }
}

/* Arquivos enviados: preview visual */
.file-preview-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #e8edf3;
}

.file-preview-card:last-child {
    border-bottom: 0;
}

.file-preview-thumb {
    position: relative;
    display: flex;
    width: 118px;
    height: 150px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #dce3ec;
    border-radius: 12px;
    background: #f5f7fa;
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.06);
    text-decoration: none;
}

.file-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.18s ease;
}

.file-preview-thumb:hover img {
    transform: scale(1.03);
}

.preview-hover {
    position: absolute;
    right: 8px;
    bottom: 8px;
    left: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    opacity: 0;
    transform: translateY(4px);
    transition: 0.18s ease;
}

.file-preview-thumb:hover .preview-hover {
    opacity: 1;
    transform: translateY(0);
}

.file-preview-thumb.placeholder {
    flex-direction: column;
    gap: 7px;
    color: #778195;
    text-align: center;
}

.file-preview-thumb.placeholder small {
    max-width: 92px;
    font-size: 10px;
    line-height: 1.3;
}

.file-preview-pdf {
    display: grid;
    width: 48px;
    height: 56px;
    place-items: center;
    border-radius: 8px;
    background: #eef2f7;
    color: #596579;
    font-size: 12px;
    font-weight: 800;
}

.file-preview-info {
    min-width: 0;
    align-self: center;
}

.file-preview-info > strong,
.file-preview-info > small {
    display: block;
    overflow-wrap: anywhere;
}

.file-preview-info > strong {
    margin-bottom: 5px;
    color: #202938;
    font-size: 13px;
    line-height: 1.35;
}

.file-preview-info > small {
    margin-top: 3px;
    color: var(--muted);
}

.file-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

@media (max-width: 520px) {
    .file-preview-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .file-preview-thumb {
        width: 92px;
        height: 118px;
    }
}


/* =========================================================
   Reembolso de DropCoin
   ========================================================= */

.refund-card {
    border: 1px solid #e4e7ec;
}

.refund-warning {
    margin: 14px 0 18px;
    padding: 13px 15px;
    border: 1px solid #ffd8a8;
    border-radius: 10px;
    background: #fff8ef;
    color: #6b4f1d;
    font-size: 13px;
    line-height: 1.5;
}

.refund-form {
    display: grid;
    gap: 18px;
}

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

.refund-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 78px;
    padding: 14px;
    border: 1px solid #dfe3e8;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.refund-option:has(input:checked) {
    border-color: #7d8ca3;
    box-shadow: 0 0 0 2px rgba(79, 96, 120, 0.08);
}

.refund-option input {
    margin-top: 3px;
}

.refund-option span {
    display: grid;
    gap: 4px;
}

.refund-option small,
.refund-fields small,
.refund-footer p {
    color: #667085;
    font-size: 12px;
    line-height: 1.45;
}

.refund-fields {
    max-width: 480px;
}

.money-input {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.money-input > span {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: #f8fafc;
    color: #475467;
    font-weight: 700;
}

.money-input input {
    border-radius: 0 8px 8px 0 !important;
}

.money-input.readonly input {
    background: #f4f4f5;
    cursor: not-allowed;
    font-weight: 700;
}

.refund-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 4px;
}

.refund-footer p {
    max-width: 620px;
    margin: 0;
}

.btn.danger {
    background: #b42318;
    border-color: #b42318;
    color: #fff;
}

.btn.danger:hover {
    background: #912018;
    border-color: #912018;
}

@media (max-width: 700px) {
    .refund-options {
        grid-template-columns: 1fr;
    }

    .refund-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .refund-footer .btn {
        width: 100%;
    }
}


/* Reembolso assíncrono */
.refund-processing-badge {display:inline-flex;align-items:center;min-height:28px;padding:5px 10px;border-radius:999px;background:#fff1c6;color:#665200;font-size:12px;font-weight:700;line-height:1;white-space:nowrap;}
.order-title-line {flex-wrap:wrap;}
.refund-pending-card {border-color:#ead88f;}
.refund-pending-message {display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 16px;border-radius:12px;background:#fffaf0;color:#3c434a;}

/* Preview assíncrono de anexos */
.preview-async-placeholder {
    position: relative;
    overflow: hidden;
}

.preview-loading-wrap {
    width: min(160px, 82%);
    margin-top: 10px;
}

.preview-loading-bar {
    position: relative;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.preview-loading-bar > span {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -45%;
    width: 45%;
    border-radius: inherit;
    background: #1f6fb2;
    animation: preview-loading-slide 1.15s ease-in-out infinite;
}

.preview-loading-text {
    display: block;
    margin-top: 8px;
    color: #667085;
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
}

.preview-async-placeholder.preview-error .preview-loading-bar {
    display: none;
}

.preview-async-placeholder.preview-error .preview-loading-text {
    color: #b42318;
}

@keyframes preview-loading-slide {
    0% {
        left: -45%;
    }

    100% {
        left: 100%;
    }
}


/* ==========================================================
   Pedidos - contagem filtrada (v1.0.20)
   ========================================================== */

.filtered-count {
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.filtered-count strong {
    color: var(--text);
    font-weight: 700;
}

.filtered-count-top {
    align-self: flex-end;
    padding: 10px 4px;
}

.orders-list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-left: 20px;
    border-top: 1px solid var(--line);
}

.orders-list-footer .pager {
    border-top: 0;
    padding-left: 0;
}

.filtered-count-bottom {
    flex: 0 0 auto;
}

@media (max-width: 820px) {
    .orders-list-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 20px 20px;
    }

    .orders-list-footer .pager {
        width: 100%;
        justify-content: flex-start;
        padding: 0;
    }

    .filtered-count-top {
        width: 100%;
        padding-top: 0;
    }
}

/* Pedidos: filtros, detalhes expansíveis e scroll horizontal superior */
.orders-scroll-top {
    overflow-x: auto;
    overflow-y: hidden;
    height: 17px;
    margin: 0 0 4px;
    border-bottom: 1px solid #eef1f5;
}

.orders-scroll-top-spacer {
    height: 1px;
}

.orders-table-wrap {
    overflow-x: auto;
}

.orders-table {
    min-width: 1080px;
}

.order-expand-col,
.order-expand-cell {
    width: 42px;
    min-width: 42px;
    text-align: center;
}

.order-expand-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #d9dee7;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .18s ease;
}

.order-expand-btn:hover {
    background: #f4f6f9;
    border-color: #c7ced9;
}

.order-expand-chevron {
    display: block;
    font-size: 24px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .18s ease;
}

.order-expand-btn.is-open .order-expand-chevron {
    transform: rotate(90deg);
}

.order-expand-empty {
    color: #a8afb9;
}

.order-items-child-row > td {
    padding: 0 !important;
    background: #f7f8fa;
    border-top: 0;
}

.order-items-child-panel {
    padding: 16px 20px 20px 62px;
    border-top: 1px solid #e5e8ee;
    border-bottom: 1px solid #e5e8ee;
}

.order-items-child-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.order-items-child-title span {
    color: #707782;
    font-size: 13px;
}

.order-items-child-list {
    display: grid;
    gap: 9px;
}

.order-list-item {
    display: grid;
    grid-template-columns: 54px minmax(220px, 1fr) minmax(85px, auto) minmax(120px, auto) minmax(120px, auto);
    gap: 14px;
    align-items: center;
    padding: 11px 13px;
    background: #fff;
    border: 1px solid #e5e8ee;
    border-radius: 10px;
}

.order-list-item-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-list-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-list-item-main {
    min-width: 0;
}

.order-list-item-main > strong {
    display: block;
    margin-bottom: 5px;
}

.order-list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: #6e7681;
    font-size: 12px;
}

.order-list-item-number {
    display: grid;
    gap: 3px;
    text-align: right;
    white-space: nowrap;
}

.order-list-item-number small {
    color: #7b828d;
    font-size: 11px;
}

.item-qty-highlight {
    color: #d63638;
    font-size: 20px;
}

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

@media (max-width: 900px) {
    .order-items-child-panel {
        padding-left: 14px;
        padding-right: 14px;
    }

    .order-list-item {
        grid-template-columns: 50px minmax(180px, 1fr) repeat(3, minmax(105px, auto));
        min-width: 760px;
    }

    .order-items-child-list {
        overflow-x: auto;
    }
}

/* ========================= Auditoria ========================= */
.nav-group {
    margin: 10px 0 4px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
}

.nav-group-title {
    padding: 6px 10px 8px;
    color: #9ea6b2;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav .nav-sub {
    margin: 2px 0;
    padding-left: 18px;
    font-size: 13px;
}

.audit-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
}

.audit-intro h2 {
    margin: 4px 0 6px;
    font-size: 24px;
}

.audit-intro p {
    margin: 0;
    color: #707782;
    max-width: 820px;
    line-height: 1.55;
}

.audit-kicker {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #424a57;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.audit-filter-card {
    margin-bottom: 16px;
}

.audit-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(160px, .7fr) minmax(180px, .8fr) auto;
    gap: 14px;
    align-items: end;
}

.product-audit-filters {
    grid-template-columns: minmax(300px, 2fr) minmax(180px, .7fr) auto;
}

.audit-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 42px;
}

.btn.ghost {
    background: #fff;
    border: 1px solid #d9dee7;
    color: #4b5563;
}

.audit-summary {
    margin: 8px 2px 12px;
    color: #6f7782;
    font-size: 13px;
}

.audit-summary strong {
    color: #1f2937;
    font-size: 16px;
}

.audit-table-card {
    padding: 0;
    overflow: hidden;
}

.audit-table-wrap {
    overflow: auto;
    width: 100%;
}

.audit-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
}

.audit-table th,
.audit-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf0f4;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

.audit-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fb;
    color: #596170;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.audit-table tbody tr:hover {
    background: #fbfcfe;
}

.audit-nowrap {
    white-space: nowrap;
}

.audit-product-name {
    min-width: 180px;
    max-width: 320px;
    font-weight: 600;
    color: #303744;
}

.audit-source,
.audit-count,
.audit-file,
.audit-movement {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.audit-source {
    background: #eef2f7;
    color: #4f5967;
}

.audit-count {
    min-width: 28px;
    justify-content: center;
    background: #eef3ff;
    color: #3156a3;
}

.audit-file {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    background: #f5f6f8;
    color: #596170;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.audit-movement.positive {
    background: #ecfdf3;
    color: #177245;
}

.audit-movement.negative {
    background: #fff0f0;
    color: #b42318;
}

.audit-movement.neutral {
    background: #f3f4f6;
    color: #6b7280;
}

.audit-pagination {
    padding: 14px 16px;
    border-top: 1px solid #edf0f4;
    background: #fafbfc;
}

.audit-empty {
    padding: 34px !important;
    text-align: center !important;
}

.audit-error-card {
    border-left: 4px solid #d97706;
}

.audit-error-card strong {
    display: block;
    margin-bottom: 5px;
}

.audit-error-card p {
    color: #6f7782;
}

.settings-section-title {
    margin: 26px 0 12px;
    padding-top: 20px;
    border-top: 1px solid #e7eaf0;
}

.settings-section-title h3 {
    margin: 0 0 4px;
}

.settings-section-title p {
    margin: 0;
    color: #737b87;
    font-size: 13px;
}

.audit-connection-status {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 14px 0;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
}

.audit-connection-status.ok {
    background: #ecfdf3;
    color: #176a42;
}

.audit-connection-status.warn {
    background: #fff7e8;
    color: #8a5b13;
}

@media (max-width: 1000px) {
    .audit-filter-grid,
    .product-audit-filters {
        grid-template-columns: 1fr 1fr;
    }

    .audit-search-wide {
        grid-column: 1 / -1;
    }

    .audit-intro {
        flex-direction: column;
    }
}

/* Menu expansível: Auditoria */
.nav-group {
    margin: 4px 0;
}

.nav-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    padding: 12px 14px;
    border-radius: 10px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.nav-group-toggle:hover,
.nav-group-toggle.on,
.nav-group.open > .nav-group-toggle {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-group-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    transition: transform .18s ease;
    transform-origin: center;
}

.nav-group.open .nav-group-chevron {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    padding: 4px 0 4px 12px;
}

.nav-group.open .nav-submenu {
    display: block;
}

.nav a.nav-sub {
    position: relative;
    margin: 2px 0;
    padding: 9px 14px 9px 28px;
    font-size: 13px;
    border-radius: 9px;
}

.nav a.nav-sub::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .55;
}

/* Relatórios customizados */
.report-shell {
    display: grid;
    gap: 16px;
}

.report-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.report-intro h2 {
    margin: 3px 0 7px;
}

.report-intro p {
    margin: 0;
    color: var(--muted);
    max-width: 850px;
}

.report-filter-card {
    padding: 18px 20px;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 14px;
    align-items: end;
}

.report-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.report-help {
    padding: 14px 18px;
    background: #fbfcfe;
}

.report-help p {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.report-message {
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #d8e0ea;
    background: #f8fafc;
}

.report-message.error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

.report-progress {
    padding: 16px 18px;
}

.report-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.report-progress-track {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}

.report-progress-track > div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--orange), #ffad61);
    transition: width .25s ease;
}

.report-progress p {
    margin: 9px 0 0;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 12px;
}

.report-stats-small {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.report-stat {
    padding: 15px 16px;
    border-top: 3px solid var(--orange);
}

.report-stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.report-stat strong {
    display: block;
    font-size: 19px;
    line-height: 1.25;
}

.report-cache-note {
    color: var(--muted);
    font-size: 12px;
    margin: 2px 0 10px;
}

.report-result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.report-result-actions .btn {
    gap: 7px;
}

.report-table-card {
    padding: 0;
    overflow: hidden;
}

.report-table-card .table-wrap {
    padding: 4px 14px 10px;
}

.report-table-card table {
    min-width: 900px;
}

.report-profile {
    min-width: 150px;
}

.profile-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 0;
}

.profile-line small {
    color: var(--muted);
}

.report-top-products ol {
    margin: 0;
    padding-left: 22px;
}

.report-top-products li {
    padding: 9px 3px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.report-top-products li:last-child {
    border-bottom: 0;
}

.report-remote-field {
    position: relative;
}

.report-remote-results {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d7dde6;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .13);
    padding: 5px;
}

.report-remote-results button,
.report-remote-empty {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 9px 10px;
    border-radius: 7px;
    color: var(--ink);
}

.report-remote-results button {
    cursor: pointer;
}

.report-remote-results button:hover {
    background: #f3f6fa;
}

.report-remote-empty {
    color: var(--muted);
}

@media (max-width: 1300px) {
    .report-stats {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

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

@media (max-width: 650px) {
    .report-filter-grid,
    .report-stats,
    .report-stats-small {
        grid-template-columns: 1fr;
    }
}
