@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #052767 0%, #3a0647 100%);
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 380px;
}

.login-card h2 {
    margin-bottom: 0.25rem;
}

.login-card .text-muted {
    margin-bottom: 1.5rem;
}

.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #0F1117;
}

.auth-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 4px;
    color: #6C63FF;
}

.login-validation {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #ef4444;
}

.login-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

/* Sidebar: links em branco (override do global) */
.sidebar-nav a,
.sidebar-nav .btn-link {
    color: white;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-back {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    color: #374151;
}

.btn-back:hover {
    background: #f9fafb;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.page-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Metric Cards */
.metrics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metrics-cards--compact {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.metrics-cards--summary {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.dashboard-filters {
    flex-wrap: wrap;
}

.dashboard-filters .filter-group {
    flex-direction: column;
    align-items: flex-start;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.charts-grid--full {
    grid-template-columns: 1fr;
}

.chart-card {
    min-width: 0;
}

.text-success { color: #166534 !important; }
.text-danger { color: #991b1b !important; }

.metric-card {
    background: white;
    border-radius: 12px;
    border: 2px solid;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.metric-card--green { border-color: #22c55e; }
.metric-card--blue { border-color: #3b82f6; }
.metric-card--orange { border-color: #f97316; }
.metric-card--gray { border-color: #9ca3af; }

.metric-card--simple {
    border: 1px solid #e5e7eb;
}

.metric-card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.metric-badge {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.metric-badge--green { background: #dcfce7; color: #166534; }
.metric-badge--blue { background: #dbeafe; color: #1e40af; }
.metric-badge--orange { background: #ffedd5; color: #c2410c; }
.metric-badge--gray { background: #f3f4f6; color: #6b7280; }

.metric-card-body {
    padding: 1rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.875rem;
}

.metric-label {
    color: #6b7280;
}

.metric-value {
    font-weight: 600;
    color: #111827;
}

.metric-value--large {
    font-size: 1.5rem;
    display: block;
    margin-top: 0.25rem;
}

/* Data Section */
.data-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.data-section-header {
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-box {
    position: relative;
    max-width: 280px;
}

.search-box .oi {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
}

.search-box .form-control {
    padding-left: 2.25rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th.sortable {
    cursor: pointer;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.badge-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pill--green  { background: #dcfce7; color: #166534; }
.badge-pill--yellow { background: #fef9c3; color: #854d0e; }
.badge-pill--red    { background: #fee2e2; color: #991b1b; }
.badge-pill--gray   { background: #f3f4f6; color: #6b7280; }
.badge-pill--blue   { background: #dbeafe; color: #1d4ed8; }
.badge-pill--orange { background: #fed7aa; color: #9a3412; }

/* ── Tabela redimensionável ────────────────────────────────────── */
.data-table--resizable th {
    position: relative;
    white-space: nowrap;
    /* overflow: visible é obrigatório para que o tooltip ::after não seja cortado */
    overflow: visible;
}

.data-table--resizable th.col-resizable:first-child {
    max-width: 650px;
    min-width: 200px;
}

.col-resizer {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 5px;
    cursor: col-resize;
    user-select: none;
    z-index: 1;
}

.col-resizer:hover,
.col-resizer:active {
    background: rgba(99, 102, 241, 0.4);
}

/* ── Tooltip de coluna ─────────────────────────────────────────── */
/*
 * O tooltip usa position: fixed para escapar de qualquer overflow: hidden
 * nos ancestrais (th, table, etc.). As coordenadas são calculadas em JS
 * via orizon360.positionTooltip chamado no mouseenter.
 * O fallback CSS (sem JS) continua funcionando via ::after mas pode ser cortado.
 */
.col-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid currentColor;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.6;
    flex-shrink: 0;
    /* overflow: visible garante que o ::after não seja cortado pelo th */
    overflow: visible;
}

.col-tooltip:hover {
    opacity: 1;
}

/* Tooltip flutuante via JS — div#col-tooltip-popup injetado no <body> */
#col-tooltip-popup {
    position: fixed;
    background: #1e293b;
    color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: normal;
    width: 260px;
    line-height: 1.4;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    pointer-events: none;
    display: none;
}

#col-tooltip-popup.visible {
    display: block;
}

/* Fallback CSS puro (funciona quando overflow:visible no th) */
.col-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: normal;
    width: 260px;
    line-height: 1.4;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    pointer-events: none;
    display: none;
}

.col-tooltip:hover::after {
    display: block;
}

/* ── Célula de produto com imagem ──────────────────────────────── */
.product-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 650px;
}

.product-thumb {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.product-thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1.1rem;
}

.product-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-info strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 560px;
}

/* ── Toggle de texto expandido na coluna Produto ──────────────── */
.product-info--wrap strong {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}

/* Quando texto expande, alinha ao topo da célula */
.product-cell--wrap {
    align-items: flex-start;
}

/* Botão de toggle de texto na toolbar da tabela */
.btn-toggle-texto {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-toggle-texto:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.btn-toggle-texto.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    color: #6366f1;
}

/* Dark mode */
.theme-dark .btn-toggle-texto {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

.theme-dark .btn-toggle-texto:hover,
.theme-dark .btn-toggle-texto.active {
    border-color: #6366f1;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.15);
}

/* ── Dark theme overrides ──────────────────────────────────────── */
/* ── Skeleton Loader ─────────────────────────────────────────── */
@keyframes skeleton-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.skeleton {
    background: linear-gradient(90deg, #ececec 25%, #e0e0e0 37%, #ececec 63%);
    background-size: 600px 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
    border-radius: 4px;
    display: block;
}

.skeleton-img   { width: 48px; height: 48px; border-radius: 6px; }
.skeleton-text  { height: 14px; border-radius: 3px; }
.skeleton-badge { height: 22px; width: 60px; border-radius: 12px; }

.skeleton-row td {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    vertical-align: middle;
}

.curve-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
}

.curve-badge--green { background: #22c55e; color: white; }
.curve-badge--blue { background: #3b82f6; color: white; }

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-top: 1rem;
}

.btn-pagination {
    min-width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
}

.btn-pagination:hover:not(:disabled) {
    background: #f9fafb;
}

.btn-pagination--active {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pagination bar */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0.25rem 0.25rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pagination-per-page {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.pagination-per-page select {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    font-size: 0.8125rem;
    color: #374151;
    background: white;
    cursor: pointer;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.page-btn {
    min-width: 2rem;
    height: 2rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8125rem;
    color: #374151;
    padding: 0 0.4rem;
    transition: background 0.15s;
}

.page-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.page-btn--active {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
    font-weight: 600;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 0.25rem;
    color: #9ca3af;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.35rem;
    cursor: pointer;
    color: #6b7280;
    border-radius: 6px;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Config Section */
.config-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.config-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.config-title {
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    margin: 0;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.config-body {
    padding: 1.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Support Cards */
.support-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.support-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.support-icon {
    font-size: 2rem;
    color: #3b82f6;
    margin-bottom: 0.75rem;
}

.support-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.support-card p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* Produtos Page */
.produtos-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.produtos-section {
    margin-bottom: 1rem;
}

.section-desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin: -0.5rem 0 1rem 0;
}

.marketplace-group {
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.marketplace-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    text-align: left;
}

.marketplace-header:hover {
    background: #f3f4f6;
}

.marketplace-header .oi {
    font-size: 0.9rem;
    color: #6b7280;
}

.marketplace-name {
    flex: 1;
}

.marketplace-count {
    font-size: 0.875rem;
    font-weight: 400;
    color: #6b7280;
}

.marketplace-body {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.marketplace-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-right: 0.25rem;
}

.marketplace-badge--amazon { background: #ff9900; color: white; }
.marketplace-badge--mercadolivre { background: #ffe600; color: #333; }
.marketplace-badge--shopee { background: #ee4d2d; color: white; }

/* 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;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content--lg {
    max-width: 900px;
}

.preco-venda-badge {
    display: block;
    font-size: 0.75rem;
    color: #374151;
}

.input-inline {
    display: inline-block;
}

.comparativo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.comparativo-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.comparativo-card-header {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.comparativo-card-body {
    padding: 0.75rem 1rem;
}

.comparativo-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.8rem;
}

.comparativo-row span {
    color: #6b7280;
}

.comparativo-row--lucro {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Modal Vendas por Plataforma */
.vendas-resumo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.vendas-resumo-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vendas-resumo-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.vendas-resumo-valor {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.vendas-comparativo {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vendas-comparativo-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.vendas-comparativo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.vendas-comparativo-pct {
    font-size: 0.8rem;
    color: #6b7280;
}

.vendas-comparativo-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.vendas-comparativo-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.vendas-comparativo-footer {
    font-size: 0.8rem;
    color: #6b7280;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h4 {
    margin: 0;
    font-size: 1.25rem;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0 0.5rem;
}

.btn-close-modal:hover {
    color: #111827;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.produtos-selecao {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem;
}

.produto-check-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
}

.produto-check-item:hover {
    background: #f9fafb;
}

.produto-check-item small {
    color: #6b7280;
}

.produto-check-item--disabled {
    opacity: 0.5;
    pointer-events: none;
}

.produtos-selecao-grupo {
    margin-bottom: 0.75rem;
}

.produtos-selecao-grupo:last-child {
    margin-bottom: 0;
}

.produtos-selecao-grupo-titulo {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

/* Inventário: subpainéis e tabela de equivalência */
.inventario-layout .marketplace-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.inventario-subpanel {
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.inventario-subpanel:last-child {
    margin-bottom: 0;
}

.inventario-subpanel-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fafafa;
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    text-align: left;
}

.inventario-subpanel-header:hover {
    background: #f3f4f6;
}

.inventario-subpanel-header .oi {
    font-size: 0.8rem;
    color: #6b7280;
}

.inventario-subpanel-title {
    min-width: 120px;
}

.inventario-subpanel-desc {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #6b7280;
}

.inventario-subpanel-count {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #6b7280;
}

.inventario-subpanel-body {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.data-table--equivalencia {
    font-size: 0.875rem;
}

.data-table--equivalencia th {
    white-space: nowrap;
}

.spin {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.inventario-row-baixo {
    background: #fef2f2 !important;
}

.estoque-mkp {
    display: inline-block;
    min-width: 2rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: center;
}

.estoque-mkp--baixo {
    background: #fee2e2;
    color: #991b1b;
}

.alert {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ── Global Dark Theme Overrides ── */

.theme-dark .page-title,
.theme-dark .section-title,
.theme-dark .metric-value,
.theme-dark .vendas-resumo-valor,
.theme-dark .config-title,
.theme-dark .modal-header h4 {
    color: #f3f4f6;
}

.theme-dark .filter-label,
.theme-dark .metric-label,
.theme-dark .section-desc,
.theme-dark .vendas-resumo-label,
.theme-dark .vendas-comparativo-pct,
.theme-dark .vendas-comparativo-footer,
.theme-dark .comparativo-row span {
    color: #9ca3af;
}

.theme-dark .metric-card,
.theme-dark .data-section,
.theme-dark .config-card,
.theme-dark .support-card,
.theme-dark .marketplace-body,
.theme-dark .marketplace-group,
.theme-dark .modal-content,
.theme-dark .comparativo-card,
.theme-dark .vendas-comparativo-item,
.theme-dark .chart-card {
    background: #1A1D27;
    border-color: #2D3243;
}

.theme-dark .line-chart-title {
    color: #f3f4f6;
}

.theme-dark .metric-card-header,
.theme-dark .comparativo-card-header,
.theme-dark .modal-header,
.theme-dark .config-title {
    background: #1A1D27;
    border-color: #2d3243;
    color: #f3f4f6;
}

.theme-dark .marketplace-header {
    background: #232836;
    color: #e5e7eb;
}

.theme-dark .marketplace-header:hover {
    background: #2d3243;
}

.theme-dark .data-table th {
    background: #232836;
    color: #d1d5db;
    border-color: #2d3243;
}

.theme-dark .data-table td {
    color: #d1d5db;
    border-color: #2d3243;
}

.theme-dark .data-table tbody tr:hover {
    background: #232836;
}

.theme-dark .col-tooltip::after {
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #334155;
}

.theme-dark .product-thumb {
    border-color: #2d3243;
    background: #232836;
}

.theme-dark .product-thumb--placeholder {
    color: #6b7280;
}

.theme-dark .badge-pill--orange { background: #431407; color: #fb923c; }

.theme-dark .form-control,
.theme-dark .form-select {
    background-color: #232836;
    border-color: #373e51;
    color: #e5e7eb;
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    background-color: #1A1D27;
    color: #e5e7eb;
    border-color: #3b82f6;
}

.theme-dark .btn-pagination,
.theme-dark .page-btn {
    background-color: #232836;
    border-color: #373e51;
    color: #d1d5db;
}

.theme-dark .btn-pagination:hover:not(:disabled),
.theme-dark .page-btn:hover:not(:disabled) {
    background-color: #2d3243;
}

.theme-dark .btn-back {
    background-color: #232836;
    border-color: #373e51;
    color: #e5e7eb;
}

.theme-dark .btn-back:hover {
    background-color: #2d3243;
}

.theme-dark .vendas-resumo-card {
    background: #232836;
}

.theme-dark .modal-footer {
    border-color: #2d3243;
}

.theme-dark .btn-close-modal {
    color: #9ca3af;
}

.theme-dark .btn-close-modal:hover {
    color: #f3f4f6;
}

.theme-dark .produtos-selecao {
    border-color: #2d3243;
}

.theme-dark .produto-check-item {
    border-color: #2d3243;
}

.theme-dark .produto-check-item:hover {
    background: #232836;
}

.theme-dark .comparativo-row--lucro {
    border-color: #2d3243;
}

/* ── Badges de estoque baixo ─────────────────────────────── */
.badge-estoque {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.4;
}

.badge-estoque--baixo {
    background: #fff3cd;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.badge-estoque--zero {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

.theme-dark .badge-estoque--baixo {
    background: #422006;
    color: #fbbf24;
    border-color: #92400e;
}

.theme-dark .badge-estoque--zero {
    background: #450a0a;
    color: #f87171;
    border-color: #991b1b;
}

/* ── Colunas ordenáveis ──────────────────────────────────── */
.th-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.th-sortable:hover {
    background: rgba(0,0,0,0.04);
}

.sort-icon {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 0.75rem;
    vertical-align: middle;
}

.sort-icon--none {
    opacity: 0.35;
}

.sort-icon--active {
    color: #f97316;
    opacity: 1;
}

.theme-dark .th-sortable:hover {
    background: rgba(255,255,255,0.05);
}
