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

/* ── CHAT WIDGET ── */
#chat-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9000;
}

#chat-btn {
    width: 54px;
    height: 54px;
    border-radius: 99px;
    background: #1a1916;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.2s;
    color: white;
    position: relative;
}

#chat-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

#chat-btn:active {
    transform: scale(0.95);
}

#chat-btn.tem-novas {
    background: #e03a2f;
    animation: pulsar 2s infinite;
}

@keyframes pulsar {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(224, 58, 47, 0.35);
    }

    50% {
        box-shadow: 0 6px 28px rgba(224, 58, 47, 0.6);
    }
}

#chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e03a2f;
    color: white;
    font-size: 10px;
    font-weight: 900;
    min-width: 20px;
    height: 20px;
    border-radius: 99px;
    padding: 0 5px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2.5px solid white;
    font-family: 'Montserrat', sans-serif;
}

#chat-badge.show {
    display: flex;
}

#chat-panel {
    display: none;
    position: absolute;
    bottom: 66px;
    right: 0;
    width: 340px;
    background: white;
    border: 1px solid #e4e7ee;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    animation: chatIn 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes chatIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#chat-panel.show {
    display: block;
}

.chat-header {
    padding: 14px 16px 12px;
    background: #1a1916;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.2px;
}

.chat-header-badge {
    font-size: 10px;
    font-weight: 900;
    background: #e03a2f;
    color: white;
    padding: 2px 8px;
    border-radius: 99px;
}

.chat-refresh {
    width: 30px;
    height: 30px;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.15s;
}

.chat-refresh:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.chat-refresh:active {
    transform: scale(0.9);
}

.chat-refresh.spin svg {
    animation: spin 0.8s linear infinite;
}

.chat-lista {
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.chat-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid #f0f2f7;
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
}

.chat-item:hover {
    background: #f8f9fc;
}

.chat-item:last-child {
    border-bottom: none;
}

.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 99px;
    background: #ffe225;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    color: #7a6500;
    flex-shrink: 0;
    text-transform: uppercase;
    border: 2px solid #f0e060;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-nome {
    font-size: 13px;
    font-weight: 800;
    color: #1a1916;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.chat-preview {
    font-size: 11px;
    color: #717990;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.chat-preview.de-comprador {
    color: #1a1916;
    font-weight: 700;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.chat-tempo {
    font-size: 10px;
    color: #a8aab8;
    font-weight: 600;
    white-space: nowrap;
}

.chat-unread-dot {
    width: 9px;
    height: 9px;
    border-radius: 99px;
    background: #e03a2f;
}

.chat-empty {
    padding: 36px 16px;
    text-align: center;
    color: #a8aab8;
}

.chat-empty p {
    font-size: 12px;
    font-weight: 700;
    margin-top: 10px;
}

.chat-footer {
    padding: 10px 16px;
    border-top: 1px solid #f0f2f7;
    background: #fafbfc;
    text-align: center;
}

.chat-footer a {
    font-size: 11px;
    font-weight: 800;
    color: #2d6be4;
    text-decoration: none;
    letter-spacing: -0.1px;
}

.chat-footer a:hover {
    text-decoration: underline;
}

#notif-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
    max-width: 320px;
}

.notif-toast {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    pointer-events: all;
    animation: notifIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.notif-toast.saindo {
    animation: notifOut 0.3s ease forwards;
}

@keyframes notifIn {
    from {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
    }

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

@keyframes notifOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
        max-height: 100px;
        margin: 0;
    }

    to {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
        max-height: 0;
        margin: -5px;
        padding: 0;
    }
}

.notif-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    animation: notifProgress 5s linear forwards;
    border-radius: 0 0 14px 14px;
}

@keyframes notifProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.notif-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-sub {
    font-size: 11px;
    color: var(--ink2);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-close {
    width: 20px;
    height: 20px;
    border-radius: 99px;
    border: none;
    background: var(--bg);
    color: var(--ink3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 12px;
    transition: background 0.15s;
}

.notif-close:hover {
    background: var(--line);
    color: var(--ink);
}

:root {
    --ink: #000f34;
    --ink2: #3d4451;
    --ink3: #717990;
    --line: #e4e7ee;
    --line2: #f0f2f7;
    --surface: #ffffff;
    --bg: #f5f6fa;
    --accent: #2d6be4;
    --accent-light: rgba(45, 107, 228, .1);
    --green: #0fa85a;
    --green-light: rgba(15, 168, 90, .1);
    --amber: #e08c00;
    --amber-light: rgba(224, 140, 0, .1);
    --red: #e03a2f;
    --red-light: rgba(224, 58, 47, .1);
    --yellow: #ffe600;
    --sidebar: 260px;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(17, 19, 24, .07);
    --shadow-lg: 0 8px 32px rgba(17, 19, 24, .12);
    --shadow-sm: 0 1px 4px rgba(17, 19, 24, .06);
    --t: .18s cubic-bezier(.4, 0, .2, 1);
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

/* ── PAINEL DE STATUS CANAIS (canto inferior esquerdo) ── */
.mini-status {
    background: white;
    border: 1px solid var(--line);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.btn-sync-manual {
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.btn-sync-manual:hover {
    transform: scale(1.05);
    background: #1a52c5;
}

/* ── CARD SELECIONADO ── */
.pedido-card {
    position: relative;
    transition: all 0.2s ease;
}

.pedido-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(45, 107, 228, 0.15);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.pedido-card.selecionado::after {
    opacity: 1;
}

/* ── LUCIDE ICONS ── */
.lucide {
    vertical-align: middle;
    stroke-width: 2;
}

.icon-xs {
    width: 14px;
    height: 14px;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-md {
    width: 20px;
    height: 20px;
}

.icon-lg {
    width: 32px;
    height: 32px;
    stroke-width: 1.5;
}

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

.spin {
    animation: spin 1.2s linear infinite;
}

/* ── LAYOUT ── */
.app {
    display: grid;
    grid-template-columns: var(--sidebar) 1fr;
    min-height: 100vh;
}

/* ── SIDEBAR RETRÁTIL (expande no hover) ──
   Recolhida: o grid fixa a coluna em 72px (SEM animar grid, que trava).
   A sidebar vira absoluta e anima só a WIDTH — barato e suave. Ao expandir,
   ela cresce POR CIMA do conteúdo (não empurra), sem barra de rolagem piscando. */
.app.sidebar-recolhida {
    grid-template-columns: 72px 1fr;
}
.app.sidebar-recolhida .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    width: 72px;
    z-index: 200;
    overflow: hidden;                   /* sem barras (H nem V) — cabe sem scroll */
    will-change: width;
    transition: width .24s cubic-bezier(.4, 0, .2, 1);
}
/* garante contexto de posicionamento para a sidebar absoluta */
.app { position: relative; }

/* Como a sidebar vira absoluta (sai do grid), o .main precisa ficar
   FIXO na 2ª coluna — senão o grid o joga para a 1ª (72px) e a página
   "some" atrás da sidebar (tela branca). */
.app.sidebar-recolhida .main {
    grid-column: 2;
}

/* Ao passar o mouse NA SIDEBAR (classe .nav-hover via JS), cresce por cima */
.app.sidebar-recolhida.nav-hover .sidebar {
    width: var(--sidebar);
    box-shadow: 6px 0 24px rgba(0, 0, 0, .28);
}

/* Estado ESTREITO = sidebar recolhida e SEM hover NELA. Tudo condicionado à
   própria .sidebar:not(:hover), para o conteúdo da página nunca ser afetado. */
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-nav { padding: 16px 10px; }
.app.sidebar-recolhida:not(.nav-hover) .sidebar .nav-group-label,
.app.sidebar-recolhida:not(.nav-hover) .sidebar .nav-txt,
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-logo .logo-name,
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-logo .logo-sub,
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-bottom > div {
    display: none;
}
.app.sidebar-recolhida:not(.nav-hover) .sidebar .nav-link {
    justify-content: center;
    gap: 0;
    position: relative;
}
/* Badge vira pontinho no canto do ícone quando estreito */
.app.sidebar-recolhida:not(.nav-hover) .sidebar .nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    margin: 0;
    min-width: 8px;
    width: 8px;
    height: 8px;
    padding: 0;
    font-size: 0;
    border-radius: 50%;
}
/* Botões de baixo: só o ícone centralizado quando estreito */
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-bottom { padding: 16px 12px 40px; }
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-bottom .sync-btn,
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-bottom .btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    margin: 0 auto 12px !important;
    border-radius: 10px;
}
/* Trava o ícone (i ou svg já renderizado) centralizado, sem margens herdadas */
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-bottom .sync-btn i,
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-bottom .sync-btn svg,
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-bottom .btn i,
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-bottom .btn svg {
    margin: 0 !important;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
/* Logo maior no estado estreito (fica proporcional ao espaço) */
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-logo { padding: 18px 8px 16px; }
.app.sidebar-recolhida:not(.nav-hover) .sidebar .sidebar-logo img { width: 52px !important; }

/* Botão de toggle no topbar */
.btn-toggle-nav {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--ink2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    transition: var(--t);
    flex-shrink: 0;
}
.btn-toggle-nav:hover { background: var(--line); color: var(--ink); }

/* ── SIDEBAR ── */
.sidebar {
    background: #001b82;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-logo .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-mark {
    width: 40px;
    height: 40px;
    background: var(--yellow);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 18px;
    color: var(--ink);
    flex-shrink: 0;
}

.logo-name {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.logo-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, .4);
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-group {
    margin-bottom: 16px;
}

.nav-group-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(255, 255, 255, .6);
    padding: 0 12px;
    margin-bottom: 6px;
}

/* Nav-links: blocos translúcidos, ativo branco/azul, hover amarelo deslizando */
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 0;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    background: rgba(255, 255, 255, .08);
    margin-bottom: 6px;
    transition: transform .12s ease, background .12s;
    cursor: pointer;
}

.nav-link:hover {
    background: #ffc107;
    color: #000;
    transform: translateX(3px);
}

.nav-link.active {
    background: #fff;
    color: #001b82;
    font-weight: 800;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 0;
}

.sidebar-bottom {
    padding: 16px 12px 60px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.sync-btn {
    width: 100%;
    padding: 11px;
    background: #0fa85a;
    border: none;
    border-radius: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--t);
    font-family: 'Montserrat', sans-serif;
}

.sync-btn:hover {
    background: #0c9450;
    color: #fff;
}

.sync-status {
    font-size: 11px;
    color: rgba(255, 255, 255, .35);
    text-align: center;
    margin-top: 8px;
}

/* ── MAIN & TOPBAR ── */
.main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: scroll;
    background: var(--bg);
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 10px 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left h1 {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.topbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ── FILTROS & BOTÕES ── */
.filters-row {
    padding: 16px 32px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

select.flt,
input.flt {
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid var(--line);
    border-radius: 7px;
    font-size: 13px;
    background: white;
    color: var(--ink);
    cursor: pointer;
    transition: var(--t);
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

select.flt:focus,
input.flt:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.flt-spacer {
    flex: 1;
}

.btn {
    height: 36px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--t);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
}

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

.btn-primary:hover {
    background: #2259c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 107, 228, .3);
}

.btn-secondary {
    background: var(--line2);
    color: var(--ink2);
    border-color: var(--line);
}

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

.btn-sm {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
}

.btn-icon {
    height: 30px;
    width: 30px;
    padding: 0;
    justify-content: center;
    background: var(--line2);
    color: var(--ink2);
    border-color: var(--line);
}

.btn-icon:hover {
    background: var(--line);
}

/* ── STATS ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 32px 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: var(--t);
}

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

.stat-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--ink3);
    margin-bottom: 10px;
}

.stat-val {
    font-family: 'Syne', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
}

.stat-sub {
    font-size: 12px;
    color: var(--ink3);
    margin-top: 8px;
}

.stat-card.s-blue .stat-val {
    color: var(--accent);
}

.stat-card.s-green .stat-val {
    color: var(--green);
}

.stat-card.s-amber .stat-val {
    color: var(--amber);
}

.stat-card.s-red .stat-val {
    color: var(--red);
}

/* ── TABELA & CARDS DE PEDIDO ── */
.table-wrap {
    flex: 1;
    margin: 0 32px 32px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table-head-bar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.table-head-bar h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pedido-card {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    background: white;
    border-bottom: 1px solid var(--line2);
    border-left: 10px solid transparent;
    border-radius: 12px;
    margin: 8px;
    gap: 20px;
    transition: background 0.2s;
    min-height: 120px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.pedido-card:hover {
    background: #eeeeee67;
}

.pedido-card:last-child {
    border-bottom: none;
}

/* Checkbox */
.card-chk {
    flex-shrink: 0;
}

.card-chk input[type=checkbox] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Thumbnail */
.card-thumb {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    background: var(--line2);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-thumb:hover .card-thumb-ov {
    opacity: 1;
}

.card-thumb-ov {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--t);
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-align: center;
}

/* Info principal */
.card-info-main {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.card-cliente-nome {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
}

.card-cliente-end {
    font-size: 14px;
    color: var(--ink3);
    margin: 0;
    line-height: 1.4;
}

.card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Data Limite */
.card-deadline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    margin-top: 4px;
    width: fit-content;
}

.dl-ok {
    background: var(--line2);
    color: var(--ink3);
}

.dl-urgente {
    background: var(--amber-light);
    color: var(--amber);
}

.dl-atrasado {
    background: var(--red-light);
    color: var(--red);
}

/* Info produto */
.card-info-produto {
    flex: 2;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-end;
    min-width: 250px;
}

.card-produto-nome {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    margin: 0;
    line-height: 1.4;
    white-space: normal;
    text-align: right;
}

.card-status-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ── BADGE DE STATUS (canto inferior fixo) ── */
.status-badge {
    background: #fff;
    padding: 6px 12px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--line);
    transition: all 0.3s ease;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    transition: background 0.3s ease;
}

/* ── STATUS INDICATOR (bolinha no card) ── */
.status-indicator {
    padding: 5px 10px;
    border-radius: 30px;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.status-indicator .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* ── KEBAB MENU ── */
.kebab-wrap {
    position: relative;
}

.kebab-btn {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--ink3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t);
}

.kebab-btn:hover {
    background: var(--line2);
    color: var(--ink);
}

.kebab-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: white;
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 6px 0;
    z-index: 200;
    min-width: 200px;
    display: none;
    flex-direction: column;
    transform-origin: top right;
    animation: menuFade 0.15s ease;
}

.kebab-menu.show {
    display: flex;
}

@keyframes menuFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.kebab-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    transition: var(--t);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.kebab-item:hover {
    background: #f5f6fa;
    color: var(--accent);
}

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

.kebab-item:disabled:hover {
    background: transparent;
    color: var(--ink);
}

/* ── BADGES DE CANAIS ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-canal-mercadolivre {
    background: #ffe225;
    color: #333;
}

.badge-canal-shopee {
    background: #ee4d2d;
    color: #fff;
}

.badge-canal-whatsapp {
    background: #25D366;
    color: #fff;
}

.badge-canal-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
}

.badge-canal-site {
    background: #004aff;
    color: rgb(255, 242, 0);
}

.badge-canal-outro {
    background: var(--line2);
    color: var(--ink3);
}

.badge-img-ok {
    background: var(--green-light);
    color: var(--green);
}

.badge-img-nao {
    background: var(--amber-light);
    color: var(--amber);
}

/* ── FORMULÁRIO MANUAL ── */
.form-panel {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 40px auto;
}

.form-panel-header {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
}

.form-panel-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.form-section-title {
    font-weight: 700;
    color: #4b5563;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
    margin: 24px 0 16px 0;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    grid-column: 1 / -1;
}

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

.form-col-2 {
    grid-column: span 2;
}

.form-col-3 {
    grid-column: span 3;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Montserrat', sans-serif;
    color: var(--ink);
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    background: #f9fafb;
    transition: var(--t);
    color: var(--ink3);
    font-size: 14px;
    font-weight: 500;
}

.upload-zone:hover {
    border-color: var(--accent);
    background: #eff6ff;
    color: var(--accent);
}

.upload-preview {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.form-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ── MODAIS ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 19, 24, .7);
    z-index: 500;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: white;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 580px;
    max-height: 92vh;
    overflow-y: auto;
    animation: modalIn .22s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.94);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--line2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t);
}

.modal-close:hover {
    background: var(--line);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-upload-zone {
    border: 2px dashed var(--line);
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--t);
}

.modal-upload-zone:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.modal-upload-zone input {
    display: none;
}

.modal-sm {
    max-width: 420px;
}

.color-picker-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.color-opt {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--t);
}

.color-opt.sel {
    border-color: var(--ink);
    transform: scale(1.1);
}

/* ── ESTADOS ── */
.state-box {
    text-align: center;
    padding: 80px 40px;
    color: var(--ink3);
}

.state-box h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink2);
    margin-bottom: 6px;
}

.state-box p {
    font-size: 13px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 16px;
}

/* ── CONFIGURAÇÕES ── */
.config-panel {
    margin: 0 auto;
    max-width: 800px;
    padding: 40px 32px;
}

.config-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.config-section-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.config-section-header h3 {
    font-size: 15px;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
}
.config-section-header h3 i { color: var(--accent); }

.config-list {
    padding: 4px 0;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line2);
    transition: var(--t);
}

.config-item:last-child {
    border-bottom: none;
}

.config-item:hover {
    background: var(--bg);
}

.ci-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .04);
}

/* Item de categoria: nome em cima, keywords como chips embaixo */
.cat-item { align-items: flex-start; padding: 14px 24px; }
.cat-item .ci-dot { margin-top: 3px; }
.ci-corpo { flex: 1; min-width: 0; }

.ci-name {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}
.ci-corpo .ci-name { margin-bottom: 7px; }

.ci-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.ci-chip {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink2);
    background: var(--line2);
    border: 1px solid var(--line);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.ci-vazio {
    font-size: 11px;
    color: var(--ink3);
    font-style: italic;
}

.ci-actions { flex-shrink: 0; display: flex; gap: 4px; }

.ci-keywords {
    font-size: 11px;
    color: var(--ink3);
    font-family: monospace;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ci-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── PAGE CONTENT WRAPPER ── */
.page-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 24px;
}

/* ── RESPONSIVO ── */
@media(max-width:1100px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .sidebar {
        display: none;
    }

    .filters-row,
    .stats-row,
    .table-wrap,
    .form-panel,
    .config-panel {
        margin-left: 16px;
        margin-right: 16px;
        padding-left: 0;
        padding-right: 0;
        margin-top: 24px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-col-2,
    .form-col-3 {
        grid-column: span 1;
    }

    .pedido-card {
        flex-wrap: wrap;
        border-left-width: 6px;
    }

    .card-info-produto {
        text-align: left;
        align-items: flex-start;
        width: 100%;
    }

    .card-produto-nome {
        text-align: left;
    }

    .card-status-row {
        justify-content: flex-start;
    }
}