/* ============================================
   MARKETPLACE MANAGER — CSS PRINCIPAL
   Estética: Industrial refinado + dark mode
   Fontes: Syne (display) + DM Sans (corpo)
   ============================================ */

:root {
    --bg-base:        #0f1117;
    --bg-surface:     #181c27;
    --bg-card:        #1e2333;
    --bg-hover:       #252b3b;
    --bg-input:       #13161f;

    --border:         #2a3045;
    --border-light:   #333d55;

    --text-primary:   #e8ecf4;
    --text-secondary: #8b95b0;
    --text-muted:     #525e78;

    --accent:         #4f7fff;
    --accent-hover:   #3d6ef0;
    --accent-glow:    rgba(79, 127, 255, 0.15);

    --success:        #22c97a;
    --warning:        #f5a623;
    --danger:         #ff4d6a;
    --info:           #38bdf8;

    --sidebar-w:      240px;
    --topbar-h:       64px;
    --radius:         10px;
    --radius-sm:      6px;
    --shadow:         0 4px 24px rgba(0,0,0,0.4);
    --transition:     0.18s ease;

    /* Status cores */
    --recebido:   #f5a623;
    --producao:   #38bdf8;
    --expedicao:  #a78bfa;
    --enviado:    #22c97a;
    --cancelado:  #ff4d6a;
    --rascunho:   #525e78;
    --ativo:      #22c97a;
    --pausado:    #f5a623;
    --encerrado:  #ff4d6a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ============================================
   LAYOUT
   ============================================ */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 22px;
    color: var(--accent);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 8px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(79,127,255,0.2);
}

.nav-icon {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    color: var(--text-muted);
    font-size: 16px;
    transition: color var(--transition);
}
.btn-logout:hover { color: var(--danger); }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title h1 {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.topbar-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-notif {
    position: relative;
    font-size: 18px;
    color: var(--text-secondary);
    padding: 4px;
}

.notif-badge {
    position: absolute;
    top: 0; right: 0;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   PAGE BODY
   ============================================ */
.page-body {
    padding: 28px;
    flex: 1;
}

/* ============================================
   FLASH MESSAGES
   ============================================ */
.flash {
    margin: 0 28px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid;
}

.flash-success {
    background: rgba(34,201,122,0.1);
    border-color: var(--success);
    color: var(--success);
}

.flash-error {
    background: rgba(255,77,106,0.1);
    border-color: var(--danger);
    color: var(--danger);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   STAT CARDS (DASHBOARD)
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition);
}

.stat-card:hover { border-color: var(--border-light); }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--stat-color, var(--accent));
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-family: 'Syne', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}
.btn-secondary:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(255,77,106,0.1);
    color: var(--danger);
    border-color: rgba(255,77,106,0.3);
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-success {
    background: rgba(34,201,122,0.1);
    color: var(--success);
    border-color: rgba(34,201,122,0.3);
}
.btn-success:hover {
    background: var(--success);
    color: #fff;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-icon {
    padding: 6px 8px;
    font-size: 14px;
}

.btn-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================
   TABELAS
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--bg-surface);
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

tbody td {
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 13.5px;
    vertical-align: middle;
}

.td-muted { color: var(--text-muted); font-size: 12px; }

/* ============================================
   BADGES / STATUS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge::before { content: '●'; font-size: 8px; }

.badge-recebido  { background: rgba(245,166,35,0.12);  color: var(--recebido);  }
.badge-producao  { background: rgba(56,189,248,0.12);  color: var(--producao);  }
.badge-expedicao { background: rgba(167,139,250,0.12); color: var(--expedicao); }
.badge-enviado   { background: rgba(34,201,122,0.12);  color: var(--enviado);   }
.badge-cancelado { background: rgba(255,77,106,0.12);  color: var(--cancelado); }
.badge-rascunho  { background: rgba(82,94,120,0.2);    color: var(--text-muted); }
.badge-ativo     { background: rgba(34,201,122,0.12);  color: var(--ativo);     }
.badge-pausado   { background: rgba(245,166,35,0.12);  color: var(--pausado);   }
.badge-encerrado { background: rgba(255,77,106,0.12);  color: var(--encerrado); }

/* ============================================
   FILTROS
   ============================================ */
.filtros-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.filtro-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 140px;
}

.filtro-group label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.filtros-bar .btn-group {
    margin-left: auto;
    align-self: flex-end;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full { grid-column: 1 / -1; }

label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 9px 12px;
    font-size: 13.5px;
    font-family: 'DM Sans', sans-serif;
    width: 100%;
    transition: border-color var(--transition);
    outline: none;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b95b0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea { resize: vertical; min-height: 100px; }

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

/* ============================================
   IMAGENS UPLOAD
   ============================================ */
.upload-area {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.upload-area:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.upload-area input[type="file"] {
    display: none;
}

.imagens-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.img-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.img-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-preview-item .img-remove {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(0,0,0,0.7);
    color: var(--danger);
    border: none;
    width: 22px; height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   PLATAFORMAS CHECKBOXES
   ============================================ */
.plataformas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.plataforma-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition);
}

.plataforma-item.ativa {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.plataforma-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-surface);
    cursor: pointer;
    user-select: none;
}

.plataforma-header input[type="checkbox"] {
    width: auto;
    accent-color: var(--accent);
}

.plataforma-nome {
    font-weight: 600;
    font-size: 13.5px;
    flex: 1;
}

.plataforma-cor {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.plataforma-campos {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--border);
}

/* ============================================
   THUMBNAIL NA TABELA
   ============================================ */
.produto-thumb {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--bg-surface);
}

.produto-thumb-placeholder {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 18px;
}

/* ============================================
   ETIQUETA TAG
   ============================================ */
.tag-impressa {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    background: rgba(34,201,122,0.1);
    padding: 3px 8px;
    border-radius: 20px;
}

.tag-nao-impressa {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* ============================================
   ESTOQUE
   ============================================ */
.estoque-ok    { color: var(--success); font-weight: 600; }
.estoque-baixo { color: var(--warning); font-weight: 600; }
.estoque-zero  { color: var(--danger);  font-weight: 600; }

/* ============================================
   PAGINAÇÃO
   ============================================ */
.paginacao {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 24px;
}

.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.pag-btn:hover, .pag-btn.ativo {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(79,127,255,0.06) 0%, transparent 60%);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    font-size: 40px;
    color: var(--accent);
    display: block;
    margin-bottom: 8px;
}

.login-logo h1 {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.login-logo p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-family: 'Syne', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    margin-bottom: 20px;
}

/* ============================================
   UTILIDADES
   ============================================ */
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.gap-4 { gap: 16px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--text-muted); font-size: 12px; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }

/* ============================================
   BOTÃO HAMBURGUER (só aparece no mobile)
   ============================================ */
#btn-fechar-sidebar { display: none; }

.btn-menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 18px;
    flex-shrink: 0;
    transition: background var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-menu:hover { background: var(--border-light); }

/* Overlay escuro atrás da sidebar no mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.ativo { display: block; }

/* ============================================
   RESPONSIVE — TABLET  (≤ 1024px)
   ============================================ */
@media (max-width: 1024px) {
    :root { --sidebar-w: 220px; }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   RESPONSIVE — MOBILE  (≤ 768px)
   ============================================ */
@media (max-width: 768px) {

    /* ── LAYOUT ── */
    .main-content {
        margin-left: 0;
    }

    /* ── SIDEBAR ── */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 200;
        width: 280px;
        box-shadow: 4px 0 32px rgba(0,0,0,0.5);
    }
    .sidebar.aberta {
        transform: translateX(0);
    }

    /* ── TOPBAR ── */
    .topbar {
        padding: 0 16px;
        height: 56px;
        gap: 10px;
    }
    .topbar-title h1 { font-size: 15px; }
    .topbar-subtitle  { display: none; }
    .btn-menu         { display: flex; }
    #btn-fechar-sidebar { display: block; }

    /* ── PAGE BODY ── */
    .page-body {
        padding: 14px;
    }
    .flash {
        margin: 0 14px;
        font-size: 13px;
    }

    /* ── CARDS ── */
    .card { padding: 16px; }
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 14px;
        padding-bottom: 12px;
    }
    .card-header .btn { font-size: 12px; padding: 6px 10px; }

    /* ── STAT CARDS ── */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }
    .stat-card   { padding: 14px; }
    .stat-value  { font-size: 22px !important; }

    /* ── TABELAS — scroll horizontal ── */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius);
    }
    table { min-width: 560px; }

    /* Ocultar colunas menos importantes em telas pequenas */
    .col-hide-mobile { display: none !important; }

    /* ── FORMULÁRIOS ── */
    .form-grid,
    .form-grid-2 {
        grid-template-columns: 1fr !important;
    }
    .form-group.full { grid-column: 1; }

    /* ── FILTROS ── */
    .filtros-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px;
    }
    .filtro-group    { min-width: unset; width: 100%; }
    .filtros-bar .btn-group {
        margin-left: 0;
        justify-content: stretch;
    }
    .filtros-bar .btn-group .btn { flex: 1; justify-content: center; }

    /* ── BOTÕES ── */
    .btn-group { flex-wrap: wrap; }
    .topbar-actions .btn { display: none; } /* esconde btn de ação no topbar */
    .topbar-actions .btn-mobile-show { display: inline-flex !important; }

    /* ── GRIDS DE PÁGINA (inline style overrides) ── */
    /* Páginas que usam style="display:grid;grid-template-columns:1fr 340px" */
    .page-body [style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
    }
    /* Grids inline nas páginas de dashboard, relatorios, etc */
    .page-body > [style*="display:grid"] {
        display: flex !important;
        flex-direction: column !important;
    }

    /* ── PLATAFORMAS GRID ── */
    .plataformas-grid {
        grid-template-columns: 1fr;
    }

    /* ── IMAGENS PREVIEW ── */
    .imagens-preview {
        grid-template-columns: repeat(3, 1fr);
    }
    .upload-area { padding: 20px 16px; }

    /* ── PAGINAÇÃO ── */
    .paginacao { flex-wrap: wrap; gap: 6px; }

    /* ── LOGIN ── */
    .login-box {
        padding: 28px 20px;
        margin: 16px;
        border-radius: 12px;
    }

    /* ── MINI STATUS CARDS (vendas) ── */
    .page-body > div[style*="display:flex"] {
        flex-wrap: wrap;
    }

    /* ── ATRIBUTOS ── */
    .atributo-row {
        grid-template-columns: 1fr 1fr 36px !important;
        gap: 6px !important;
    }

    /* ── SIDEBAR FOOTER ── */
    .user-name { font-size: 12px; }
}

/* ============================================
   RESPONSIVE — EXTRA SMALL (≤ 420px)
   ============================================ */
@media (max-width: 420px) {

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat-value { font-size: 20px !important; }
    .stat-label { font-size: 10px; }

    .topbar { padding: 0 12px; }
    .page-body { padding: 10px; }
    .card { padding: 12px; }

    .badge { font-size: 10px; padding: 2px 7px; }

    .btn { padding: 7px 12px; font-size: 12px; }
    .btn-sm { padding: 4px 8px; font-size: 11px; }

    .imagens-preview {
        grid-template-columns: repeat(2, 1fr);
    }

    table { min-width: 480px; }

    /* Login ainda mais compacto */
    .login-box { margin: 10px; padding: 24px 16px; }
    .login-logo .logo-icon { font-size: 32px; }
    .login-logo h1 { font-size: 18px; }

    /* Ocultar texto de badges de status em telas muito pequenas */
    .tag-impressa span,
    .tag-nao-impressa span { display: none; }

    .paginacao .pag-btn { width: 30px; height: 30px; font-size: 12px; }
}