:root {
    --color-bg: #fcfcf9;
    --color-surface: #fffffe;
    --color-text: #134252;
    --color-text-secondary: #626c71;
    --color-primary: #21808d;
    --color-primary-hover: #1d7480;
    --color-success: #2ecc71;
    --color-warning: #f1c40f;
    --color-danger: #e74c3c;
    --color-border: rgba(94, 82, 64, 0.2);
    --color-card-border: rgba(94, 82, 64, 0.12);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #1f2121;
        --color-surface: #262828;
        --color-text: #f5f5f5;
        --color-text-secondary: rgba(167, 169, 169, 0.7);
        --color-primary: #32b8c6;
        --color-primary-hover: #2da6b2;
        --color-border: rgba(119, 124, 124, 0.3);
        --color-card-border: rgba(119, 124, 124, 0.2);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* Local utility classes used by Razor views. These replace the Tailwind CDN in production. */
.min-h-screen { min-height: 100vh; }
.h-screen { height: 100vh; }
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.relative { position: relative; }
.block { display: block; }
.hidden { display: none; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-16 { padding-top: 4rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.ml-auto { margin-left: auto; }
.mr-2 { margin-right: 0.5rem; }
.mr-auto { margin-right: auto; }
.gap-2 { gap: 0.5rem; }
.flex-grow-1 { flex-grow: 1; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-top: 2rem; }
.bg-opacity-70 { --local-bg-opacity: 0.7; }
.hover\:underline:hover { text-decoration: underline; }

/* --- T-Drop overrides (botões e badges) --- */
:root {
    --tdrop-orange: #ff7a00;
    --tdrop-dark: #0b0b0f;
    --mud-palette-primary: #ff7a00;
    --mud-palette-primary-rgb: 255, 122, 0;
    --mud-palette-primary-text: #0b0b0f;
    --mud-palette-primary-contrast-text: #0b0b0f;
    --mud-palette-primary-hover: #ff8b1f;
    --mud-palette-text-primary: #ff7a00;
}

[data-theme="dark"],
.dark-theme {
    --tdrop-orange: #ff7a00;
    --tdrop-dark: #0b0b0f;
    --mud-palette-primary: #ff7a00;
    --mud-palette-primary-rgb: 255, 122, 0;
    --mud-palette-primary-text: #0b0b0f;
    --mud-palette-primary-contrast-text: #0b0b0f;
    --mud-palette-primary-hover: #ff8b1f;
    --mud-palette-text-primary: #ff7a00;
}

@media (prefers-color-scheme: dark) {
    :root {
        --tdrop-orange: #ff7a00;
        --tdrop-dark: #0b0b0f;
        --mud-palette-primary: #ff7a00;
        --mud-palette-primary-rgb: 255, 122, 0;
        --mud-palette-primary-text: #0b0b0f;
        --mud-palette-primary-contrast-text: #0b0b0f;
        --mud-palette-primary-hover: #ff8b1f;
        --mud-palette-text-primary: #ff7a00;
    }
}

.btn-primary-tdrop {
    background: var(--tdrop-orange) !important;
    color: var(--tdrop-dark) !important;
    border: 1px solid transparent !important;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 15px 40px rgba(255, 122, 0, 0.35), 0 0 0 8px rgba(255, 122, 0, 0.08) !important;
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.btn-primary-tdrop:hover {
    background: #ff8b1f !important;
    box-shadow: 0 20px 50px rgba(255, 122, 0, 0.45), 0 0 0 10px rgba(255, 122, 0, 0.12) !important;
    transform: translateY(-2px) scale(1.01);
}

.btn-outline-tdrop {
    background: transparent !important;
    color: var(--tdrop-orange) !important;
    border: 2px solid var(--tdrop-orange) !important;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: none !important;
    transition: background 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.btn-outline-tdrop:hover {
    background: rgba(255, 122, 0, 0.08) !important;
    border: 2px solid var(--tdrop-orange) !important;
    transform: translateY(-2px);
}

.badge-primary-tdrop {
    background: var(--tdrop-orange) !important;
    color: var(--tdrop-dark) !important;
    border: 1px solid transparent !important;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(255, 122, 0, 0.35) !important;
}

.badge-secondary-tdrop {
    background: rgba(255, 122, 0, 0.08) !important;
    color: var(--tdrop-orange) !important;
    border: 1.5px solid rgba(255, 122, 0, 0.5) !important;
    font-weight: 700;
    box-shadow: none !important;
}

/* --- MudBlazor primary overrides (global) --- */
.mud-button-filled-primary,
.mud-button-filled-default {
    background: var(--tdrop-orange) !important;
    color: var(--tdrop-dark) !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    box-shadow: 0 15px 40px rgba(255, 122, 0, 0.35), 0 0 0 8px rgba(255, 122, 0, 0.08) !important;
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.mud-button-filled-primary:hover,
.mud-button-filled-default:hover {
    background: #ff8b1f !important;
    box-shadow: 0 20px 50px rgba(255, 122, 0, 0.45), 0 0 0 10px rgba(255, 122, 0, 0.12) !important;
    transform: translateY(-2px) scale(1.01);
}

.mud-button-outlined-primary,
.mud-button-outlined-default {
    background: transparent !important;
    color: var(--tdrop-orange) !important;
    border: 2px solid var(--tdrop-orange) !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    transition: background 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.mud-button-outlined-primary:hover,
.mud-button-outlined-default:hover {
    background: rgba(255, 122, 0, 0.08) !important;
    border-color: var(--tdrop-orange) !important;
    transform: translateY(-2px);
}

.mud-button-text-primary,
.mud-button-text-default {
    color: var(--tdrop-orange) !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
}

.mud-button-text-primary:hover,
.mud-button-text-default:hover {
    color: var(--tdrop-orange) !important;
    background: rgba(255, 122, 0, 0.08) !important;
    border-radius: 12px !important;
}

.mud-primary {
    background-color: var(--tdrop-orange) !important;
    color: var(--tdrop-dark) !important;
}

.mud-primary-text,
.mud-text-primary {
    color: var(--tdrop-orange) !important;
}

.nav-link {
    color: var(--tdrop-orange) !important;
    font-weight: 700 !important;
}

.mud-chip-filled-primary {
    background: var(--tdrop-orange) !important;
    color: var(--tdrop-dark) !important;
    border: 1px solid transparent !important;
    font-weight: 700 !important;
    box-shadow: 0 12px 30px rgba(255, 122, 0, 0.35) !important;
}

.mud-chip-outlined-primary {
    background: rgba(255, 122, 0, 0.08) !important;
    color: var(--tdrop-orange) !important;
    border: 1.5px solid rgba(255, 122, 0, 0.5) !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    font-size: 32px;
    color: var(--color-text);
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Botões */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

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

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-secondary);
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: var(--color-success);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: var(--color-danger);
}

.alert-warning {
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.3);
    color: var(--color-warning);
}

.alert-info {
    background: rgba(33, 128, 141, 0.1);
    border: 1px solid rgba(33, 128, 141, 0.3);
    color: var(--color-primary);
}

/* Filtros */
.filters-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.input {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
}

.input-sm {
    padding: 4px 8px;
    font-size: 13px;
}

/* Cards de Estatísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 128, 141, 0.1);
    border-radius: 10px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 5px;
}

.stat-value.lucro {
    color: var(--color-success);
}

.stat-detail {
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 5px;
}

.badge-success {
    background: rgba(46, 204, 113, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.badge-warning {
    background: rgba(241, 196, 15, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(241, 196, 15, 0.25);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(231, 76, 60, 0.25);
}

.badge-secondary {
    background: rgba(149, 165, 166, 0.15);
    color: var(--color-text-secondary);
    border: 1px solid rgba(149, 165, 166, 0.25);
}

/* Gráficos */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 20px;
}

.chart-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--color-text);
}

.chart-card canvas {
    max-height: 300px;
}

/* Tabela */
.table-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.table-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--color-text);
}

.table-actions {
    margin-bottom: 15px;
}

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

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

.table thead th {
    background: var(--color-bg);
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
}

.table tbody td {
    padding: 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
}

.table tbody tr:hover {
    background: var(--color-bg);
}

.mono {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
}

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

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

.text-center {
    text-align: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--color-surface);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    font-size: 20px;
    color: var(--color-text);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-text);
}

.contas-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.conta-item {
    background: var(--color-bg);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conta-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.conta-actions {
    display: flex;
    gap: 8px;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsividade */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-responsive {
        font-size: 12px;
    }
}

/* Estilos para página de Etiquetas */
.batch-actions-card {
    background: var(--color-surface);
    border: 1px solid var(--color-primary);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.batch-info {
    font-size: 16px;
    color: var(--color-text);
}

.batch-buttons {
    display: flex;
    gap: 10px;
}

.row-selected {
    background: rgba(33, 128, 141, 0.1) !important;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cliente-info,
.produto-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cliente-info small,
.produto-info small {
    color: var(--color-text-secondary);
    font-size: 11px;
}

.codigo-rastreio {
    background: var(--color-bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    display: inline-block;
}

.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 10px;
}

.contas-lista-ml {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.conta-item-ml {
    background: var(--color-bg);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.conta-status-badges {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.modal-small {
    max-width: 500px;
}

.modal-large {
    max-width: 900px;
}

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

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.detail-section {
    background: var(--color-bg);
    padding: 15px;
    border-radius: 8px;
}

.detail-section.full-width {
    grid-column: 1 / -1;
}

.detail-section h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 8px;
}

.detail-section p {
    margin-bottom: 8px;
    font-size: 13px;
}

.btn-secondary {
    background: var(--color-text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--color-text);
}

.info-box {
    background: rgba(33, 128, 141, 0.1);
    border-left: 4px solid var(--color-primary);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.info-box ol {
    margin: 0;
    padding-left: 20px;
}

.info-box a {
    color: var(--color-primary);
    text-decoration: none;
}

.info-box a:hover {
    text-decoration: underline;
}

/* Responsividade para detalhes */
@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .batch-actions-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .batch-buttons {
        width: 100%;
    }
    
    .batch-buttons button {
        flex: 1;
    }
}

/* Blazor Error UI */
#blazor-error-ui {
    background: var(--color-danger);
    color: white;
    padding: 15px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Recuperação do circuito Blazor durante falha de rede, restart ou implantação. */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 10, 18, 0.78);
    backdrop-filter: blur(3px);
    pointer-events: auto;
}

#components-reconnect-modal.is-visible {
    display: flex;
}

.circuit-recovery-card {
    display: flex;
    width: min(100%, 440px);
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px;
    border: 1px solid var(--app-border, #273244);
    border-radius: 14px;
    background: var(--app-surface, #111827);
    color: var(--app-text, #cbd5e1);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.circuit-recovery-card strong {
    color: var(--app-title, #e2e8f0);
    font-size: 1.15rem;
}

.circuit-recovery-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--app-border, #273244);
    border-top-color: var(--app-primary, #ff7a00);
    border-radius: 50%;
    animation: circuit-recovery-spin 0.9s linear infinite;
}

#components-reconnect-modal.is-failed .circuit-recovery-spinner {
    display: none;
}

#components-reconnect-reload {
    margin-top: 4px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--app-primary, #ff7a00);
    color: var(--app-primary-contrast, #fff);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

#components-reconnect-reload:focus-visible {
    outline: 3px solid var(--app-info, #3b82f6);
    outline-offset: 3px;
}

@keyframes circuit-recovery-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    #components-reconnect-modal {
        padding: 16px;
    }

    .circuit-recovery-card {
        padding: 22px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .circuit-recovery-spinner {
        animation-duration: 1.8s;
    }
}

/* Estilos para a página de login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--color-bg);
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background-color: var(--color-surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}


/* ===== Theme System (Dark Default + Light Toggle) ===== */
:root {
    --app-bg: #0b0f14;
    --app-surface: #111827;
    --app-surface-alt: #0f172a;
    --app-border: #273244;
    --app-title: #e2e8f0;
    --app-text: #cbd5e1;
    --app-text-muted: #94a3b8;
    --app-placeholder: #64748b;
    --app-link: #a7b3c4;
    --app-navbar-bg: #0f172a;
    --app-navbar-border: #1f2937;
    --app-primary: #ff7a00;
    --app-primary-hover: #ff8c1a;
    --app-primary-contrast: #ffffff;
    --app-success: #22c55e;
    --app-error: #ef4444;
    --app-warning: #f59e0b;
    --app-info: #3b82f6;
    --app-shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --app-shadow-card-hover: 0 16px 40px rgba(0, 0, 0, 0.5);
    --app-input-bg: #0f172a;
    --app-input-border: #334155;
}

.theme-light {
    --app-bg: #f4f6f8;
    --app-surface: #ffffff;
    --app-surface-alt: #ffffff;
    --app-border: #e6e8eb;
    --app-title: #0f172a;
    --app-text: #334155;
    --app-text-muted: #64748b;
    --app-placeholder: #94a3b8;
    --app-link: #475569;
    --app-navbar-bg: #ffffff;
    --app-navbar-border: #e6e8eb;
    --app-primary: #ff7a00;
    --app-primary-hover: #ff8c1a;
    --app-primary-contrast: #ffffff;
    --app-success: #22c55e;
    --app-error: #ef4444;
    --app-warning: #f59e0b;
    --app-info: #3b82f6;
    --app-shadow-card: 0 10px 30px rgba(0, 0, 0, 0.06);
    --app-shadow-card-hover: 0 16px 40px rgba(0, 0, 0, 0.1);
    --app-input-bg: #ffffff;
    --app-input-border: #e2e8f0;
}

html,
body,
.mud-main-content,
.app-main-content,
.mud-layout {
    background: var(--app-bg) !important;
    color: var(--app-text) !important;
}

/* Keep viewport/background aligned with selected theme to avoid dark strips in light mode */
.mud-layout {
    min-height: 100vh;
}

.app-main-content {
    min-height: calc(100vh - 72px);
}

body:has(.theme-light) {
    background: #f4f6f8 !important;
}

body:has(.theme-dark) {
    background: #0b0f14 !important;
}

h1, h2, h3, h4, h5, h6,
.mud-typography-h1,
.mud-typography-h2,
.mud-typography-h3,
.mud-typography-h4,
.mud-typography-h5,
.mud-typography-h6,
.text-white {
    color: var(--app-title) !important;
}

p,
.mud-typography,
.mud-typography-body1,
.mud-typography-body2,
.text-gray-400,
.text-gray-300,
.text-zinc-500,
.text-gray-500,
.text-gray-600 {
    color: var(--app-text-muted) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--app-placeholder) !important;
}

.app-navbar {
    background: var(--app-navbar-bg) !important;
    color: var(--app-link) !important;
    min-height: 72px !important;
    border-bottom: 1px solid var(--app-navbar-border);
    box-shadow: none !important;
}

.app-logo {
    color: var(--app-primary) !important;
    font-weight: 800 !important;
}

.top-nav-menu {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.top-nav-link {
    color: var(--app-link) !important;
    font-weight: 600 !important;
    margin-right: 6px;
    border-bottom: 2px solid transparent;
    border-radius: 0 !important;
}

.top-nav-link:hover,
.top-nav-link.active {
    color: var(--app-primary) !important;
    border-bottom-color: rgba(255, 122, 0, 0.45);
}

.app-drawer {
    background: var(--app-surface-alt) !important;
    border-right: 1px solid var(--app-border);
}

.app-drawer .mud-nav-link {
    color: var(--app-link) !important;
    border-radius: 10px;
}

.app-drawer .mud-nav-link.active,
.app-drawer .mud-nav-link:hover {
    color: var(--app-primary) !important;
    background: rgba(255, 122, 0, 0.08) !important;
}

.mud-button-filled-primary,
.btn-primary,
.btn-primary-tdrop {
    background: var(--app-primary) !important;
    color: var(--app-primary-contrast) !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(255, 122, 0, 0.25) !important;
}

.mud-button-filled-primary:hover,
.btn-primary:hover,
.btn-primary-tdrop:hover {
    background: var(--app-primary-hover) !important;
    box-shadow: 0 8px 24px rgba(255, 122, 0, 0.25) !important;
    transform: translateY(-1px);
}

.mud-button-filled-primary,
.mud-button-filled-primary span,
.btn-primary-tdrop,
.btn-primary-tdrop span {
    color: var(--app-primary-contrast) !important;
}

.mud-button-outlined-primary,
.btn-outline-tdrop {
    background: transparent !important;
    color: var(--app-primary) !important;
    border: 2px solid var(--app-primary) !important;
    border-radius: 12px !important;
}

.mud-button-outlined-primary:hover,
.btn-outline-tdrop:hover {
    background: rgba(255, 122, 0, 0.08) !important;
}

.mud-button-filled-default,
.btn-secondary,
.btn-neutral {
    background: #eef1f4 !important;
    color: #1f2937 !important;
    border: 1px solid var(--app-input-border) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

.theme-dark .mud-button-filled-default,
.theme-dark .btn-secondary,
.theme-dark .btn-neutral {
    background: #1f2937 !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}

.mud-button-filled-default,
.mud-button-filled-default span {
    color: #1f2937 !important;
}

.theme-dark .mud-button-filled-default,
.theme-dark .mud-button-filled-default span {
    color: #cbd5e1 !important;
}

.mud-button-outlined-default,
.mud-button-outlined-default span,
.mud-button-outlined-primary,
.mud-button-outlined-primary span,
.btn-outline-tdrop,
.btn-outline-tdrop span {
    color: var(--app-primary) !important;
}

/* Index: force CTA classes to stay orange/outlined even when Color.Default is used */
.mud-button-filled-default.btn-primary-tdrop,
.mud-button-filled-default.btn-glow {
    background: var(--app-primary) !important;
    color: var(--app-primary-contrast) !important;
    border: 1px solid transparent !important;
    box-shadow: 0 8px 24px rgba(255, 122, 0, 0.25) !important;
}

.mud-button-filled-default.btn-primary-tdrop span,
.mud-button-filled-default.btn-glow span {
    color: var(--app-primary-contrast) !important;
}

.mud-button-outlined-default.btn-outline-tdrop,
.mud-button-outlined-default.btn-ghost {
    background: transparent !important;
    border: 2px solid var(--app-primary) !important;
    color: var(--app-primary) !important;
}

.mud-button-outlined-default.btn-outline-tdrop span,
.mud-button-outlined-default.btn-ghost span {
    color: var(--app-primary) !important;
}

.landing-page .top-actions .nav-link {
    color: var(--app-link) !important;
}

.landing-page .top-actions .nav-link:hover {
    color: var(--app-primary) !important;
}

/* Index: contrast by section */
.landing-page .hero,
.landing-page .hero .mud-typography,
.landing-page .hero .mud-typography-h1,
.landing-page .hero .mud-typography-h2,
.landing-page .hero .mud-typography-h3,
.landing-page .hero .mud-typography-h4,
.landing-page .hero .mud-typography-h5,
.landing-page .hero .mud-typography-h6,
.landing-page .hero .mud-typography-body1,
.landing-page .hero .mud-typography-body2,
.landing-page .hero .mud-typography-caption,
.landing-page .how,
.landing-page .how .mud-typography,
.landing-page .how .mud-typography-h1,
.landing-page .how .mud-typography-h2,
.landing-page .how .mud-typography-h3,
.landing-page .how .mud-typography-h4,
.landing-page .how .mud-typography-h5,
.landing-page .how .mud-typography-h6,
.landing-page .how .mud-typography-body1,
.landing-page .how .mud-typography-body2,
.landing-page .how .mud-typography-caption {
    color: #ffffff !important;
}

.landing-page .btn-primary-tdrop,
.landing-page .btn-primary-tdrop span,
.landing-page .btn-primary-tdrop .mud-button-label,
.landing-page .btn-glow,
.landing-page .btn-glow span,
.landing-page .btn-glow .mud-button-label,
.landing-page .btn-outline-tdrop,
.landing-page .btn-outline-tdrop span,
.landing-page .btn-outline-tdrop .mud-button-label,
.landing-page .btn-ghost,
.landing-page .btn-ghost span,
.landing-page .btn-ghost .mud-button-label {
    color: #ffffff !important;
}

/* Landing light sections */
.landing-page .why .section-title {
    color: #0f172a !important;
}

.landing-page .how {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, rgba(255, 122, 0, 0.22), transparent 35%),
                radial-gradient(circle at 80% 0%, rgba(255, 122, 0, 0.16), transparent 30%),
                linear-gradient(135deg, #111117 0%, #0b0b0f 50%, #0b0b0f 100%) !important;
    border-top: 0 !important;
}

.landing-page .hero {
    position: relative;
    overflow: hidden;
}

.landing-page .how::before,
.landing-page .how::after,
.landing-page .hero::before,
.landing-page .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.landing-page .hero::before,
.landing-page .how::before {
    background:
        radial-gradient(circle at 10% 22%, rgba(255, 122, 0, 0.55) 0 2px, transparent 3px),
        radial-gradient(circle at 26% 68%, rgba(255, 122, 0, 0.45) 0 1.8px, transparent 3px),
        radial-gradient(circle at 44% 35%, rgba(255, 122, 0, 0.5) 0 2px, transparent 3px),
        radial-gradient(circle at 62% 74%, rgba(255, 122, 0, 0.4) 0 1.8px, transparent 3px),
        radial-gradient(circle at 78% 18%, rgba(255, 122, 0, 0.5) 0 2px, transparent 3px),
        radial-gradient(circle at 90% 56%, rgba(255, 122, 0, 0.45) 0 2px, transparent 3px);
    animation: landingParticleDriftA 16s ease-in-out infinite;
}

.landing-page .hero::after,
.landing-page .how::after {
    background: linear-gradient(180deg, rgba(11, 11, 15, 0.2) 0%, rgba(11, 11, 15, 0.65) 100%);
    animation: landingParticleDriftB 20s ease-in-out infinite;
}

.landing-page .particle {
    width: 10px !important;
    height: 10px !important;
    background: rgba(255, 122, 0, 0.7) !important;
    box-shadow:
        18vw 8vh rgba(255, 122, 0, 0.45),
        36vw 22vh rgba(255, 122, 0, 0.35),
        58vw 6vh rgba(255, 122, 0, 0.45),
        74vw 28vh rgba(255, 122, 0, 0.35);
}

.landing-page .hero-container,
.landing-page .how > .mud-container {
    position: relative;
    z-index: 2;
}

@keyframes landingParticleDriftA {
    0% { transform: translateY(0) translateX(0); opacity: 0.8; }
    50% { transform: translateY(-10px) translateX(6px); opacity: 1; }
    100% { transform: translateY(0) translateX(0); opacity: 0.8; }
}

@keyframes landingParticleDriftB {
    0% { transform: translateY(0); opacity: 0.9; }
    50% { transform: translateY(8px); opacity: 1; }
    100% { transform: translateY(0); opacity: 0.9; }
}

.landing-page .footer {
    background: #f6f7fb !important;
    border-top: 1px solid #e6e8eb !important;
}

.landing-page .footer .brand-name {
    color: #0f172a !important;
}

.landing-page .footer .footer-text {
    color: #334155 !important;
}

.landing-page .footer .footer-copy {
    color: #64748b !important;
}

.mud-paper,
.mud-card,
.filters-card,
.table-card,
.chart-card,
.stat-card,
.login-box,
.bg-gray-800,
.bg-black {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--app-shadow-card) !important;
}

.mud-paper:hover,
.mud-card:hover,
.stat-card:hover,
.chart-card:hover,
.table-card:hover,
.bg-gray-800:hover {
    box-shadow: var(--app-shadow-card-hover) !important;
}

.bg-zinc-900,
.bg-gray-900 {
    background: var(--app-bg) !important;
}

.text-amber-400 {
    color: var(--app-primary) !important;
}

.mud-input-slot,
.mud-input > input,
.mud-input > textarea,
.mud-select-input {
    color: var(--app-text) !important;
}

.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--app-input-border) !important;
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--app-input-border) !important;
}

.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--app-primary) !important;
    border-width: 1px !important;
}

.mud-input-outlined.mud-input-focused {
    border-radius: 12px !important;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

.mud-input-filled {
    background: var(--app-input-bg) !important;
    border: 1px solid var(--app-input-border) !important;
    border-radius: 12px !important;
}

.mud-input-filled:before,
.mud-input-filled:after {
    display: none !important;
}

.mud-table,
.table {
    background: var(--app-surface) !important;
}

.table thead th,
.mud-table-head .mud-table-cell {
    color: var(--app-title) !important;
    border-bottom: 1px solid var(--app-border) !important;
}

.table tbody td,
.mud-table-body .mud-table-cell {
    color: var(--app-text) !important;
    border-bottom: 1px solid var(--app-border) !important;
}

.alert-success,
.mud-alert-filled-success {
    background: rgba(34, 197, 94, 0.1) !important;
    color: var(--app-success) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

.alert-danger,
.mud-alert-filled-error {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--app-error) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.alert-warning,
.mud-alert-filled-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    color: var(--app-warning) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.alert-info,
.mud-alert-filled-info {
    background: rgba(59, 130, 246, 0.1) !important;
    color: var(--app-info) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* ===== Mercado Livre labels workspace ===== */
.ml-labels-workspace {
    --mlp-accent: #ff7a00;
    --mlp-accent-hover: #ff941f;
    --mlp-accent-soft: rgba(255, 122, 0, 0.14);
    --mlp-panel: #0b0f14;
    --mlp-panel-soft: #0f172a;
    --mlp-surface: #111827;
    --mlp-text-strong: rgba(255, 255, 255, 0.94);
    --mlp-text-muted: rgba(226, 232, 240, 0.72);
    --mlp-text-faint: rgba(226, 232, 240, 0.38);
    --mlp-border: rgba(148, 163, 184, 0.18);
    --mlp-border-strong: rgba(148, 163, 184, 0.38);
    --mlp-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --mlp-hover: rgba(255, 255, 255, 0.08);
    --mlp-radius: 6px;
    --mlp-warn: #ff7733;
    --mlp-danger: #f23d4f;
    --mlp-ok: #00a650;
    --mlp-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    width: min(100%, 1240px);
    min-width: 0;
    margin: 0 auto;
    padding: 24px 16px 40px;
    color: var(--mlp-text-strong);
    font-family: var(--mlp-font);
    font-size: 14px;
    background: var(--mlp-panel);
    box-shadow: 0 0 0 100vmax var(--mlp-panel);
    clip-path: inset(0 -100vmax);
    overflow-x: clip;
}

.theme-light .ml-labels-workspace {
    --mlp-accent: #3483fa;
    --mlp-accent-hover: #2968c8;
    --mlp-accent-soft: rgba(65, 137, 230, 0.1);
    --mlp-panel: #ededed;
    --mlp-panel-soft: #f5f5f5;
    --mlp-surface: #ffffff;
    --mlp-text-strong: rgba(0, 0, 0, 0.9);
    --mlp-text-muted: rgba(0, 0, 0, 0.55);
    --mlp-text-faint: rgba(0, 0, 0, 0.25);
    --mlp-border: rgba(0, 0, 0, 0.1);
    --mlp-border-strong: rgba(0, 0, 0, 0.25);
    --mlp-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12);
    --mlp-hover: rgba(0, 0, 0, 0.07);
    --mlp-warn: #ff7733;
    --mlp-danger: #f23d4f;
    --mlp-ok: #00a650;
}

.ml-labels-workspace *,
.ml-labels-workspace *::before,
.ml-labels-workspace *::after {
    box-sizing: border-box;
}

.ml-labels-workspace h1,
.ml-labels-workspace h2,
.ml-labels-workspace h3,
.ml-labels-workspace h4,
.ml-labels-workspace h5,
.ml-labels-workspace h6 {
    color: var(--mlp-text-strong) !important;
}

.ml-labels-workspace p {
    color: var(--mlp-text-muted) !important;
}

.ml-labels-workspace .mlp-summary {
    color: var(--mlp-text-strong) !important;
}

/* ---- Utilitarios ---- */
.mlp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--mlp-radius);
    background: transparent;
    color: var(--mlp-accent);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    line-height: 18px;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mlp-btn:hover:not(:disabled) {
    background: var(--mlp-accent-soft);
}

.mlp-btn:disabled {
    color: var(--mlp-text-faint);
    cursor: default;
}

.mlp-btn--primary {
    background: var(--mlp-accent);
    color: #fff;
    font-weight: 600;
}

.mlp-btn--primary:hover:not(:disabled) {
    background: var(--mlp-accent-hover);
}

.mlp-btn--primary:disabled {
    background: var(--mlp-panel);
    color: var(--mlp-text-faint);
}

.mlp-btn--wide {
    min-width: 190px;
}

.mlp-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--mlp-border);
    border-radius: 24px;
    background: var(--mlp-surface);
    box-shadow: var(--mlp-shadow);
    color: var(--mlp-accent);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.mlp-pill-btn:hover:not(:disabled) {
    color: var(--mlp-accent-hover);
}

.mlp-pill-btn:disabled {
    color: var(--mlp-text-faint);
    cursor: default;
}

.mlp-link {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    color: var(--mlp-accent);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
}

.mlp-link:hover {
    color: var(--mlp-accent-hover);
    text-decoration: underline;
}

.mlp-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--mlp-text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.mlp-icon-btn:hover:not(:disabled) {
    background: var(--mlp-hover);
    color: var(--mlp-text-strong);
}

.mlp-icon-btn:disabled {
    color: var(--mlp-text-faint);
    cursor: default;
}

.mlp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 3px 10px;
    border: 1px solid var(--mlp-border-strong);
    border-radius: 24px;
    background: var(--mlp-surface);
    color: var(--mlp-text-strong);
    font-size: 13px;
    white-space: nowrap;
}

.mlp-chip-x {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--mlp-text-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.mlp-chip-x:hover {
    background: var(--mlp-hover);
    color: var(--mlp-text-strong);
}

.mlp-check {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 2px solid var(--mlp-border-strong);
    border-radius: 2px;
    background: var(--mlp-surface);
    cursor: pointer;
    flex-shrink: 0;
}

.mlp-check:hover:not(:disabled) {
    border-color: var(--mlp-accent);
}

.mlp-check:checked,
.mlp-check.partial {
    border-color: var(--mlp-accent);
    background: var(--mlp-accent);
}

.mlp-check:checked::after {
    content: "";
    position: absolute;
    top: 0;
    left: 3px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.mlp-check.partial:not(:checked)::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 2px;
    width: 8px;
    height: 2px;
    background: #fff;
}

.mlp-check:disabled {
    border-color: var(--mlp-border);
    cursor: default;
}

.mlp-sep {
    padding: 0 8px;
    color: var(--mlp-border-strong);
}

/* ---- Cabecalho ---- */
.mlp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.mlp-header h1 {
    margin: 0;
    color: var(--mlp-text-strong);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

.mlp-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mlp-detail-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

/* ---- Painel de tabs ---- */
.mlp-panel {
    padding: 12px 16px 0;
    border-radius: var(--mlp-radius);
    background: var(--mlp-panel);
}

.mlp-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.mlp-tab {
    appearance: none;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 24px;
    background: transparent;
    color: var(--mlp-text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.mlp-tab:hover {
    color: var(--mlp-text-strong);
}

.mlp-tab.active {
    border-color: var(--mlp-border-strong);
    background: var(--mlp-surface);
    box-shadow: var(--mlp-shadow);
    color: var(--mlp-text-strong);
}

.mlp-postsale {
    margin-left: auto;
}

.mlp-summary {
    margin: 0;
    padding: 40px 16px;
    color: var(--mlp-text-strong);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.mlp-dispatch-summary {
    width: min(100%, 620px);
    margin: 0 0 24px;
}

.mlp-dispatch-card {
    min-width: 0;
    border-left: 4px solid var(--mlp-accent);
    border-radius: var(--mlp-radius);
    background: var(--mlp-surface);
    box-shadow: var(--mlp-shadow);
    overflow: hidden;
}

.mlp-dispatch-card-head {
    position: relative;
    display: grid;
    gap: 8px;
    width: 100%;
    min-height: 112px;
    padding: 18px 64px 16px 20px;
    border: 0;
    border-bottom: 1px solid var(--mlp-border);
    background: transparent;
    color: var(--mlp-text-strong);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.mlp-dispatch-card-head:hover {
    background: var(--mlp-hover);
}

.mlp-dispatch-card-head strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
}

.mlp-dispatch-eyebrow {
    color: var(--mlp-text-muted);
    font-size: 12px;
    line-height: 16px;
}

.mlp-dispatch-total {
    position: absolute;
    top: 18px;
    right: 20px;
    color: var(--mlp-text-strong);
    font-size: 18px;
    font-weight: 600;
}

.mlp-dispatch-tasks {
    display: grid;
}

.mlp-dispatch-task {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 42px;
    padding: 9px 20px;
    border: 0;
    border-bottom: 1px solid var(--mlp-border);
    background: transparent;
    color: var(--mlp-text-muted);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.mlp-dispatch-task:last-child {
    border-bottom: 0;
}

.mlp-dispatch-task:hover,
.mlp-dispatch-task.active {
    background: var(--mlp-accent-soft);
    color: var(--mlp-text-strong);
}

.mlp-dispatch-task span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.mlp-dispatch-task strong {
    color: var(--mlp-text-strong);
    font-weight: 600;
}

/* ---- Toolbar ---- */
.mlp-toolbar {
    display: flex;
    align-items: center;
    gap: 8px 16px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.mlp-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(320px, 100%);
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--mlp-border-strong);
    border-radius: 24px;
    background: var(--mlp-surface);
    color: var(--mlp-text-muted);
}

.mlp-search:focus-within {
    border-color: var(--mlp-accent);
}

.mlp-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--mlp-text-strong);
    font: inherit;
    font-size: 14px;
    outline: none;
}

.mlp-search input::placeholder {
    color: var(--mlp-text-faint);
}

.mlp-dropdown {
    position: relative;
}

.mlp-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: none;
    border-radius: var(--mlp-radius);
    background: transparent;
    color: var(--mlp-text-strong);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    white-space: nowrap;
}

.mlp-dropdown-trigger:hover {
    background: var(--mlp-hover);
}

.mlp-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 230px;
    padding: 6px 0;
    border: 1px solid var(--mlp-border);
    border-radius: var(--mlp-radius);
    background: var(--mlp-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.mlp-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    color: var(--mlp-text-strong);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    text-align: left;
}

.mlp-dropdown-item:hover {
    background: var(--mlp-accent-soft);
}

.mlp-dropdown-item.selected {
    color: var(--mlp-accent);
    font-weight: 600;
}

.mlp-overlay {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: transparent;
}

.mlp-count {
    margin-left: auto;
    color: var(--mlp-text-muted);
    font-size: 14px;
    white-space: nowrap;
}

/* ---- Barra de acoes em massa ---- */
.mlp-massive {
    position: sticky;
    top: 8px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    margin: 16px 0 0;
    padding: 8px 8px 8px 16px;
    border-radius: var(--mlp-radius);
    background: var(--mlp-surface);
    box-shadow: var(--mlp-shadow);
}

.mlp-massive-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mlp-massive-hint {
    color: var(--mlp-text-faint);
    font-size: 14px;
}

.mlp-massive-status {
    color: var(--mlp-text-strong);
    font-size: 14px;
    font-weight: 600;
}

.mlp-massive-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mlp-divider {
    width: 1px;
    height: 20px;
    background: var(--mlp-border);
    margin: 0 4px;
    flex-shrink: 0;
}

/* ---- Lista / card de venda ---- */
.mlp-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.mlp-card {
    border: 1px solid var(--mlp-border);
    border-radius: var(--mlp-radius);
    background: var(--mlp-surface);
    box-shadow: var(--mlp-shadow);
}

.mlp-card:hover {
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.16);
}

.mlp-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--mlp-border);
    color: var(--mlp-text-muted);
    font-size: 14px;
}

.mlp-card-head-left {
    display: flex;
    align-items: center;
    min-width: 0;
    flex-wrap: wrap;
    gap: 4px 0;
}

.mlp-card-head-left .mlp-check {
    margin-right: 10px;
}

.mlp-card-id {
    color: var(--mlp-text-strong);
    font-weight: 600;
}

.mlp-store-pill {
    display: inline-block;
    max-width: 125px;
    overflow: hidden;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--mlp-panel);
    color: var(--mlp-text-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.mlp-card-head-right {
    color: var(--mlp-text-muted);
    white-space: nowrap;
}

.mlp-card-product {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 48px 0;
    padding: 12px;
    border-radius: var(--mlp-radius);
    background: var(--mlp-panel-soft);
    color: var(--mlp-text-muted);
}

.mlp-thumb {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--mlp-border);
    border-radius: 2px;
    background: var(--mlp-surface);
    color: var(--mlp-text-faint);
    flex-shrink: 0;
    overflow: hidden;
}

/* Foto real do anuncio; em erro de carga o onerror esconde a img e o placeholder reaparece. */
.mlp-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
}

.mlp-product-info {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.mlp-product-title {
    overflow: hidden;
    color: var(--mlp-text-strong);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mlp-product-meta {
    color: var(--mlp-text-muted);
    font-size: 13px;
}

.mlp-card-status {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 16px 20px 48px;
}

.mlp-status-stack {
    flex: 1 1 0;
    min-width: 0;
}

.mlp-status-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--mlp-text-strong);
}

.mlp-status--warn {
    color: var(--mlp-warn);
}

.mlp-status--danger {
    color: var(--mlp-danger);
}

.mlp-status--ok {
    color: var(--mlp-ok);
}

.mlp-status--info {
    color: var(--mlp-accent);
}

.mlp-status--neutral {
    color: var(--mlp-text-muted);
}

.mlp-substatus {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
    color: var(--mlp-text-muted);
    font-size: 12px;
}

.mlp-substatus--urgent {
    color: var(--mlp-danger);
    font-weight: 600;
}

.mlp-price {
    color: var(--mlp-text-muted);
    font-size: 14px;
    white-space: nowrap;
}

.mlp-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Empty / loading ---- */
.mlp-empty,
.mlp-loading {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 260px;
    padding: 48px 24px;
    border-radius: var(--mlp-radius);
    background: var(--mlp-panel);
    color: var(--mlp-text-muted);
    text-align: center;
}

.mlp-empty-illustration {
    color: var(--mlp-text-faint);
    margin-bottom: 8px;
}

.mlp-empty h2 {
    margin: 0;
    max-width: 340px;
    color: var(--mlp-text-strong);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.mlp-empty p {
    margin: 0;
    max-width: 340px;
    font-size: 14px;
    line-height: 1.4;
}

/* ---- Paginacao (numerada, padrao Andes) ---- */
.mlp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    color: var(--mlp-text-muted);
    font-size: 14px;
}

.mlp-page-nav,
.mlp-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: none;
    border-radius: 16px;
    background: none;
    color: var(--mlp-text-strong);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
}

.mlp-page-nav {
    color: var(--mlp-accent);
}

.mlp-page-nav:hover:not(:disabled),
.mlp-page-num:hover:not(:disabled) {
    background: var(--mlp-hover);
}

.mlp-page-nav:disabled {
    color: var(--mlp-text-faint);
    cursor: default;
}

.mlp-page-num.active {
    background: var(--mlp-accent-soft);
    color: var(--mlp-accent);
    font-weight: 600;
}

.mlp-page-ellipsis {
    min-width: 24px;
    color: var(--mlp-text-faint);
    text-align: center;
}

/* ---- Drawer "Detalhe dos envios" ---- */
.mlp-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.4);
}

.mlp-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1201;
    display: flex;
    flex-direction: column;
    width: min(420px, 92vw);
    padding: 20px 24px 24px;
    background: var(--mlp-surface);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    animation: mlp-slide-in 0.2s ease;
    color: var(--mlp-text-strong);
    font-family: var(--mlp-font);
}

@keyframes mlp-slide-in {
    from {
        transform: translateX(48px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mlp-drawer-close {
    align-self: flex-end;
}

.mlp-drawer h2 {
    margin: 4px 0 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--mlp-text-strong);
}

.mlp-drawer-updated {
    margin: 4px 0 24px;
    color: var(--mlp-text-muted);
    font-size: 12px;
}

.mlp-drawer-label {
    margin: 0 0 12px;
    color: var(--mlp-text-muted);
    font-size: 14px;
}

/* Contadores de envios a despachar por modalidade logistica. */
.mlp-drawer-counts {
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.mlp-drawer-counts li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--mlp-border);
    color: var(--mlp-text-strong);
    font-size: 14px;
}

.mlp-drawer-count {
    color: var(--mlp-text-strong);
    font-weight: 600;
}

.mlp-agency-card {
    padding: 16px;
    border: 1px solid var(--mlp-border);
    border-radius: var(--mlp-radius);
}

.mlp-agency-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    color: var(--mlp-text-strong);
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

.mlp-agency-head .mlp-chevron {
    color: var(--mlp-accent);
    transition: transform 0.15s ease;
}

.mlp-agency-head .mlp-chevron.open {
    transform: rotate(180deg);
}

.mlp-agency-body {
    margin: 12px 0 0;
    color: var(--mlp-text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.mlp-agency-next {
    display: block;
    margin-bottom: 12px;
    color: var(--mlp-text-strong);
    font-size: 14px;
    font-weight: 600;
}

.mlp-drawer-footer {
    margin-top: auto;
    padding-top: 24px;
    text-align: center;
}

/* ---- Modal "Filtrar e ordenar" ---- */
.mlp-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
}

.mlp-modal {
    width: min(560px, 100%);
    max-height: 90vh;
    padding: 24px;
    border-radius: var(--mlp-radius);
    background: var(--mlp-surface);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    color: var(--mlp-text-strong);
    font-family: var(--mlp-font);
}

.mlp-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.mlp-modal h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--mlp-text-strong);
}

.mlp-context-notice {
    margin: 0 0 20px;
    padding: 12px;
    border-left: 3px solid var(--mlp-accent);
    background: var(--mlp-accent-soft);
    color: var(--mlp-text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.mlp-field {
    margin-bottom: 16px;
}

.mlp-field-label {
    display: block;
    margin-bottom: 6px;
    color: var(--mlp-text-muted);
    font-size: 13px;
}

.mlp-select,
.mlp-date {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--mlp-border-strong);
    border-radius: var(--mlp-radius);
    background: var(--mlp-surface);
    color: var(--mlp-text-strong);
    font: inherit;
    font-size: 14px;
}

.mlp-select:focus,
.mlp-date:focus {
    border-color: var(--mlp-accent);
    outline: none;
}

.mlp-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mlp-radio-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mlp-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--mlp-text-strong);
    cursor: pointer;
    font-size: 14px;
}

.mlp-radio input[type="radio"] {
    accent-color: var(--mlp-accent);
    margin: 0;
}

.mlp-task-radios .mlp-radio {
    min-height: 36px;
}

.mlp-task-radios .mlp-radio span {
    min-width: 0;
    flex: 1;
}

.mlp-task-radios .mlp-radio strong {
    color: var(--mlp-text-muted);
    font-weight: 400;
}

.mlp-modal-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
}

/* Modal de confirmacao do lote misto */
.mlp-modal--confirm {
    width: min(440px, 100%);
}

.mlp-confirm-text {
    margin: 0;
    color: var(--mlp-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* ---- Responsivo ---- */
@media (max-width: 960px) {
    .mlp-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .mlp-card-product {
        margin: 16px 16px 0;
    }

    .mlp-card-status {
        flex-wrap: wrap;
        margin: 16px;
    }

    .mlp-massive {
        flex-wrap: wrap;
        padding: 8px 12px;
    }

    .mlp-massive-actions {
        flex-wrap: wrap;
    }

    .mlp-toolbar .mlp-count {
        margin-left: 0;
        width: 100%;
    }

    .mlp-btn--wide {
        min-width: 0;
        flex: 1;
    }

    .mlp-postsale {
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .ml-labels-workspace {
        padding: 12px 10px 24px;
    }

    .mlp-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .mlp-search {
        width: 100%;
    }

    .mlp-dispatch-summary {
        width: 100%;
    }

    .mlp-toolbar > .mlp-dropdown,
    .mlp-toolbar > .mlp-btn {
        max-width: 100%;
    }

    .mlp-dropdown-trigger {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mlp-card-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .mlp-card-head-right {
        white-space: normal;
    }

    .mlp-summary {
        padding: 24px 8px;
    }

    .mlp-field-row {
        grid-template-columns: 1fr;
    }

    .mlp-modal-overlay {
        align-items: end;
        padding: 0;
    }

    .mlp-modal {
        width: 100%;
        max-height: 82vh;
        padding: 20px 16px max(16px, env(safe-area-inset-bottom));
        border-radius: var(--mlp-radius) var(--mlp-radius) 0 0;
    }

    .mlp-modal-actions {
        position: sticky;
        bottom: -16px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 20px -16px -16px;
        padding: 12px 16px 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        border-top: 1px solid var(--mlp-border);
        background: var(--mlp-surface);
    }

    .mlp-modal-actions .mlp-btn,
    .mlp-modal-actions .mlp-link {
        min-height: 40px;
    }
}
