/* ==========================================================
   Expedição v6.0 PRO — WMS-Grade Dark Dashboard
   Inspired by: ShipStation · ShipBob · Shopify Fulfillment
   Clean · Structured · Professional · Fully Responsive
   ========================================================== */

/* ── 1. Design Tokens ────────────────────────────────── */
:root {
    --bg-0: #09090b;
    --bg-1: #0f0f12;
    --bg-2: #18181b;
    --bg-3: #1e1e23;
    --bg-4: #27272a;
    --bg-5: #303036;

    --surface: #131316;
    --surface-raised: #1a1a1f;

    --border: rgba(255,255,255,.06);
    --border-hover: rgba(255,255,255,.10);
    --border-focus: rgba(99,102,241,.45);

    --text: #fafafa;
    --text-2: #d4d4d8;
    --text-3: #a1a1aa;
    --text-4: #71717a;
    --text-5: #52525b;

    --accent: #818cf8;
    --accent-dim: #6366f1;
    --accent-bg: rgba(99,102,241,.08);
    --accent-border: rgba(99,102,241,.18);

    --green: #34d399;
    --green-dim: #10b981;
    --green-bg: rgba(16,185,129,.08);
    --green-border: rgba(16,185,129,.18);

    --amber: #fbbf24;
    --amber-dim: #f59e0b;
    --amber-bg: rgba(245,158,11,.08);
    --amber-border: rgba(245,158,11,.18);

    --red: #f87171;
    --red-dim: #ef4444;
    --red-bg: rgba(239,68,68,.08);
    --red-border: rgba(239,68,68,.18);

    --blue: #60a5fa;
    --blue-dim: #3b82f6;
    --blue-bg: rgba(59,130,246,.08);
    --blue-border: rgba(59,130,246,.18);

    --cyan: #22d3ee;
    --cyan-bg: rgba(6,182,212,.08);

    /* Aliases de compatibilidade — telas/seções legadas referenciam estes nomes,
       que não existiam no :root e caíam para o valor inicial (cores quebradas). */
    --emerald: var(--green-dim);
    --danger: var(--red);
    --text-1: var(--text);
    --border-1: var(--border);

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 2px 8px rgba(0,0,0,.25);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.35);

    --ease: cubic-bezier(.4,0,.2,1);
    --fast: 120ms var(--ease);
    --normal: 200ms var(--ease);
    --slow: 350ms var(--ease);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

/* ── 2. Reset & Base ─────────────────────────────────── */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-0);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
}

::selection { background: rgba(99,102,241,.25); color: #fff; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }
button, a, input, select, textarea { font-family: inherit; }

/* ── 2b. Lucide Icons ────────────────────────────────── */
.lucide {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
    vertical-align: middle;
    flex-shrink: 0;
}
.btn .lucide,
.card-header .lucide,
h1 .lucide,
h2 .lucide,
h3 .lucide {
    width: 15px;
    height: 15px;
}
.header h1 .lucide {
    width: 20px;
    height: 20px;
    color: var(--accent);
}
.scanner-icon .lucide {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}
.conf-icon .lucide {
    width: 18px;
    height: 18px;
}
.operator-icon .lucide {
    width: 14px;
    height: 14px;
}
.search-icon .lucide {
    width: 13px;
    height: 13px;
}
.btn-xs .lucide {
    width: 13px;
    height: 13px;
}
.btn-sm .lucide {
    width: 14px;
    height: 14px;
}

/* ── 3. Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.14); }

/* ── 4. Header ───────────────────────────────────────── */
.header {
    background: linear-gradient(180deg, rgba(15,15,18,.95) 0%, rgba(15,15,18,.88) 100%);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -.3px;
    color: var(--text);
}

.header h1 .icon { font-size: 20px; }

.header h1 .version {
    font-size: 9px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    letter-spacing: .5px;
    text-transform: uppercase;
}

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

.empresa-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}

.empresa-selector label {
    font-size: 10px;
    color: var(--text-4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.empresa-selector select {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 6px 28px 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border var(--fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 6px center;
    background-repeat: no-repeat;
    background-size: 14px;
}
.empresa-selector select:focus { border-color: var(--accent-dim); }

.conn-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green-dim);
    animation: pulse-dot 2.5s ease-in-out infinite;
    flex-shrink: 0;
}
.conn-dot.offline {
    background: var(--red);
    box-shadow: 0 0 6px var(--red-dim);
    animation: none;
}
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:.4; } }

/* ── 5. Buttons ──────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--fast);
    white-space: nowrap;
    user-select: none;
    line-height: 1.3;
    letter-spacing: -.1px;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity:.3; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--accent-dim); color: #fff; }
.btn-primary:hover { background: var(--accent); }

.btn-success { background: var(--green-dim); color: #fff; }
.btn-success:hover { background: var(--green); }

.btn-warning { background: var(--amber-dim); color: #000; font-weight: 700; }
.btn-warning:hover { background: var(--amber); }

.btn-danger { background: var(--red-dim); color: #fff; }
.btn-danger:hover { background: var(--red); }

.btn-accent { background: var(--accent-dim); color: #fff; }
.btn-accent:hover { background: var(--accent); }

.btn-ghost {
    background: var(--bg-3);
    color: var(--text-3);
    border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-4); border-color: var(--border-hover); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-3);
}
.btn-outline:hover { border-color: var(--accent-dim); color: var(--accent); background: var(--accent-bg); }

.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 10px; border-radius: var(--radius-xs); }

/* ── 6. Layout ───────────────────────────────────────── */
.container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 16px 24px 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

/* Legacy compat */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.main-grid {
    display: grid;
    grid-template-columns: 440px 1fr;
    gap: 14px;
}

/* ── 7. Stat Cards ───────────────────────────────────── */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border-color var(--fast), box-shadow var(--fast), transform var(--fast);
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    transform: translateY(-1px);
}

.stat-card .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card .stat-icon i,
.stat-card .stat-icon svg { width: 15px; height: 15px; }

.stat-pendente .stat-icon { background: var(--amber-bg); color: var(--amber); }
.stat-ativo .stat-icon { background: var(--blue-bg); color: var(--blue); }
.stat-finalizado .stat-icon { background: var(--accent-bg); color: var(--accent); }
.stat-conferencia .stat-icon { background: var(--amber-bg); color: var(--amber); }
.stat-faturado .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-analytics .stat-icon { background: var(--cyan-bg); color: var(--cyan); }

.stat-card .stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-card .stat-label {
    font-size: 9px;
    color: var(--text-4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    line-height: 1.3;
    white-space: nowrap;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    line-height: 1;
}

.stat-pendente { border-left: 3px solid var(--amber-dim); }
.stat-pendente .stat-value { color: var(--amber); }

.stat-ativo { border-left: 3px solid var(--blue-dim); }
.stat-ativo .stat-value { color: var(--blue); }

.stat-finalizado { border-left: 3px solid var(--accent-dim); }
.stat-finalizado .stat-value { color: var(--accent); }

.stat-conferencia { border-left: 3px solid var(--amber-dim); }
.stat-conferencia .stat-value { color: var(--amber); }

.stat-faturado { border-left: 3px solid var(--green-dim); }
.stat-faturado .stat-value { color: var(--green); }

.stat-analytics { border-left: 3px solid var(--cyan); }

/* ── 8. Cards ────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--normal);
}
.card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.card + .card { margin-top: 12px; }

.card-header {
    padding: 10px 14px;
    background: rgba(255,255,255,.015);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 11.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-3);
    letter-spacing: -.1px;
}
.card-header h2 i,
.card-header h2 svg {
    width: 13px;
    height: 13px;
    color: var(--text-4);
}

.card-body { padding: 14px; }

/* Specific card accents */
.card-pedido-ativo .card-header { border-left: 3px solid var(--accent-dim); }
.card-history .card-header { border-left: 3px solid var(--cyan); }
.card-pedidos .card-header { border-left: 3px solid var(--green-dim); }

/* Live indicator for history */
.history-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green-dim);
    animation: pulse-dot 2s ease-in-out infinite;
}

/* ── 9. Scanner ──────────────────────────────────────── */
.scanner-area { margin-bottom: 12px; }
.scanner-area .card-header {
    border-left: 3px solid var(--accent-dim);
    background: linear-gradient(135deg, rgba(99,102,241,.03) 0%, transparent 100%);
    padding: 8px 14px;
}
.scanner-area .card-body { padding: 10px 14px; }

.scanner-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative;
}

.scanner-input {
    flex: 1;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px 10px 38px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
    outline: none;
    transition: border var(--fast), box-shadow var(--fast);
    letter-spacing: 1.5px;
    font-family: var(--mono);
}
.scanner-input:focus {
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-bg);
}
.scanner-input::placeholder {
    color: var(--text-5);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: normal;
    font-family: var(--font);
}

.scanner-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-5);
    pointer-events: none;
    z-index: 1;
}

/* Scan confirm bar */
.scan-confirm-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-top: 8px;
    border-radius: var(--radius-sm);
    background: var(--amber-bg);
    border: 1px solid var(--amber-border);
    color: var(--amber);
    font-size: 12px;
    font-weight: 500;
    animation: confirmPulse 1.8s ease-in-out infinite;
}
.scan-confirm-bar .confirm-icon { font-size: 16px; }
.scan-confirm-bar strong {
    font-family: var(--mono);
    color: #fff;
    background: rgba(245,158,11,.12);
    padding: 1px 6px;
    border-radius: 3px;
}
@keyframes confirmPulse { 0%,100% { opacity:1; } 50% { opacity:.65; } }

/* Conferência bar */
.conferencia-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-top: 8px;
    background: var(--amber-bg);
    border: 1px solid var(--amber-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    animation: confPulse 2s infinite;
}
@keyframes confPulse {
    0%,100% { border-color: var(--amber-border); }
    50% { border-color: var(--amber-dim); }
}
.conf-icon { font-size: 16px; }
.conf-text { flex: 1; }

/* Camera */
.camera-preview {
    margin-top: 10px;
    text-align: center;
    animation: fadeIn .25s ease;
}

/* Shortcuts */
.shortcuts-bar {
    display: flex;
    gap: 14px;
    padding: 8px 0 0;
    flex-wrap: wrap;
}
.shortcut-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-5);
}
.shortcut-item kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    font-family: var(--mono);
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--text-4);
}

/* Toggle Switch — Impressão Direta */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    vertical-align: middle;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 18px;
    transition: 0.2s;
}
.toggle-slider:before {
    content: "";
    position: absolute;
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background: var(--text-5);
    border-radius: 50%;
    transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--emerald);
    border-color: var(--emerald);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(14px);
    background: #fff;
}

/* ── 10. Main Navigation Tabs ────────────────────────── */
.main-tabs {
    display: flex;
    gap: 2px;
    margin: 14px 0 0;
    padding: 3px;
    background: var(--bg-2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.main-tabs::-webkit-scrollbar { display: none; }

.main-tab {
    padding: 7px 14px;
    background: transparent;
    border: none;
    color: var(--text-4);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.main-tab i, .main-tab svg { width: 13px; height: 13px; stroke-width: 2; }
.main-tab:hover { color: var(--text-2); background: var(--bg-3); }
.main-tab.active {
    color: #fff;
    background: var(--accent-dim);
}

/* ── 11. Sub-Tabs & Search ───────────────────────────── */
.tabs-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.tabs-left { display: flex; align-items: center; gap: 8px; }
.tabs-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.tabs {
    display: flex;
    gap: 1px;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
    padding: 2px;
    border: 1px solid var(--border);
}

.tab {
    padding: 5px 12px;
    border: none;
    background: none;
    color: var(--text-4);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--fast);
}
.tab.active { background: var(--accent-dim); color: #fff; }
.tab:hover:not(.active) { color: var(--text-2); background: var(--bg-3); }

.tab .tab-count {
    font-size: 9px;
    font-weight: 700;
    background: rgba(255,255,255,.12);
    padding: 1px 5px;
    border-radius: var(--radius-full);
    margin-left: 4px;
    font-family: var(--mono);
}
.tab:not(.active) .tab-count { background: var(--bg-4); color: var(--text-5); }

/* Search */
.search-wrap { position: relative; }
.search-wrap .search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text-5);
    pointer-events: none;
}
.search-input {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px 6px 26px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    outline: none;
    width: 160px;
    transition: all var(--fast);
}
.search-input:focus { border-color: var(--accent-dim); width: 220px; }
.search-input::placeholder { color: var(--text-5); }

/* Filter days */
.btn-filter-dias {
    padding: 5px 10px;
    font-size: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--blue-bg);
    color: var(--blue);
    cursor: pointer;
    transition: all var(--fast);
    font-weight: 600;
    white-space: nowrap;
}
.btn-filter-dias:hover { background: rgba(59,130,246,.14); }
.btn-filter-dias.btn-filter-all { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }

/* Export */
.btn-export {
    background: var(--bg-2);
    color: var(--text-4);
    border: 1px solid var(--border);
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--fast);
}
.btn-export:hover { border-color: var(--accent-dim); color: var(--accent); }

/* ── 12. Table ───────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

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

th {
    text-align: left;
    padding: 9px 12px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 700;
    color: var(--text-5);
    background: var(--bg-2);
    border-bottom: 2px solid var(--border-hover);
    position: sticky;
    top: 0;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text-3); }
th.sort-active { color: var(--accent); }
th .sort-icon { display: inline-block; width: 12px; margin-left: 2px; font-size: 8px; vertical-align: middle; opacity:.4; }
th.sortable:hover .sort-icon, th.sort-active .sort-icon { opacity:1; }

td {
    padding: 9px 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tr { transition: background var(--fast); cursor: pointer; }
tr:hover td { background: rgba(99,102,241,.02); }
tr.row-selected td { background: rgba(99,102,241,.04); }

td .pedido-num {
    font-weight: 700;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
}
td .pedido-valor {
    font-size: 10px;
    color: var(--text-5);
    font-family: var(--mono);
}

/* Detail row */
tr.row-detail td {
    padding: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--accent-border);
    cursor: default;
}
.row-detail-content {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    font-size: 12px;
    animation: slideDown .2s ease-out;
}
@keyframes slideDown { from { opacity:0; transform: translateY(-4px); } to { opacity:1; transform: translateY(0); } }

.detail-section h4 {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-5);
    margin-bottom: 6px;
    font-weight: 600;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    color: var(--text-3);
}
.detail-item .sku-tag {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--accent);
    font-size: 11px;
}

/* ── 13. Pedido Ativo ────────────────────────────────── */
.pedido-ativo {
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.pedido-ativo .pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.pedido-ativo .pedido-number {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -.2px;
}
.pedido-ativo .pedido-cliente { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.pedido-ativo .pedido-meta {
    text-align: right;
    font-size: 11px;
    color: var(--text-5);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.progress-total {
    padding: 6px 14px;
    background: var(--bg-2);
    display: flex;
    align-items: center;
    gap: 10px;
}
.progress-total .progress-info { font-size: 11px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.progress-total .progress-pct { font-weight: 700; color: var(--accent); font-family: var(--mono); font-size: 12px; }

.timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--mono);
    color: var(--cyan);
    background: var(--cyan-bg);
    border: 1px solid rgba(6,182,212,.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Item list */
.item-list { list-style: none; }
.item-list li { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.item-list li.item-row {
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--fast);
}
.item-list li.item-row:hover { background: rgba(255,255,255,.02); }
.item-list li.item-row:last-child { border-bottom: none; }
.item-list li.item-progress-row { padding: 0 14px 4px; }

.item-list .item-sku {
    font-weight: 600;
    font-family: var(--mono);
    color: var(--accent);
    min-width: 100px;
    font-size: 11px;
}
.item-list .item-desc {
    flex: 1;
    margin: 0 12px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
}
.item-list .item-qty { display: flex; align-items: center; gap: 5px; }

.qty-badge {
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 10px;
    font-weight: 700;
    font-family: var(--mono);
}
.qty-complete { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.qty-partial { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.qty-pending { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

/* ── 14. Progress Bars ───────────────────────────────── */
.progress {
    width: 100%; height: 3px;
    background: var(--bg-4);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress.progress-lg { height: 5px; }
.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width .4s var(--ease);
}
.progress-bar.green { background: var(--green-dim); }
.progress-bar.yellow { background: var(--amber-dim); }
.progress-bar.red { background: var(--red-dim); }
.progress-bar.blue { background: var(--accent-dim); }

/* ── 15. Badges ──────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge-site { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-marketplace { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
.badge-amazon { background: rgba(255,153,0,.10); color: #f59e0b; border: 1px solid rgba(255,153,0,.25); }
.badge-magalu { background: rgba(0,113,206,.10); color: #3b82f6; border: 1px solid rgba(0,113,206,.25); }
.badge-shopee { background: rgba(238,77,45,.10); color: #ef4444; border: 1px solid rgba(238,77,45,.25); }
.badge-ml { background: rgba(255,232,33,.12); color: #ca8a04; border: 1px solid rgba(255,232,33,.30); }
.badge-shein { background: rgba(0,0,0,.06); color: #525252; border: 1px solid rgba(0,0,0,.15); }
.badge-tiktok { background: rgba(0,0,0,.06); color: #525252; border: 1px solid rgba(0,0,0,.15); }
.badge-dafiti { background: rgba(0,113,206,.10); color: #3b82f6; border: 1px solid rgba(0,113,206,.25); }
.badge-nf-auto { background: rgba(16,185,129,.08); color: var(--green); border: 1px solid rgba(16,185,129,.20); font-size: 8px; margin-left: 2px; }
.badge-empresa { background: rgba(139,92,246,.08); color: #a78bfa; border: 1px solid rgba(139,92,246,.18); font-size: 9px; }
.badge-pendente { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-ativo { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
.badge-finalizado { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-faturado { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }

/* ── 16. Pagination ──────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 2px 2px;
    font-size: 11px;
    color: var(--text-5);
}
.page-btns { display: flex; gap: 4px; }
.page-btn {
    padding: 5px 12px;
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text-3);
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--fast);
}
.page-btn:hover { border-color: var(--accent-dim); color: var(--text); }
.page-btn:disabled { opacity:.2; cursor: not-allowed; }

/* ── 17. History Panel – Timeline Rica ────────────────── */
.history-panel {
    max-height: 400px;
    overflow-y: auto;
    padding: 2px 0;
}

/* Grupo por data */
.history-group { margin-bottom: 4px; }
.history-group:last-child { margin-bottom: 0; }

.history-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-5);
    position: sticky;
    top: 0;
    background: var(--bg-1);
    z-index: 2;
    border-bottom: 1px solid var(--border);
}
.history-group-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent-dim);
    flex-shrink: 0;
}
.history-group-count {
    margin-left: auto;
    background: var(--bg-3);
    color: var(--text-4);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: 600;
}

/* Item da timeline */
.history-item-v2 {
    display: flex;
    gap: 8px;
    padding: 6px 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--fast);
    position: relative;
}
.history-item-v2:last-child { border-bottom: none; }
.history-item-v2:hover {
    background: rgba(255,255,255,.015);
}

/* Dot da timeline (com ícone) */
.h-timeline-dot {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.h-timeline-dot i,
.h-timeline-dot svg {
    width: 13px; height: 13px;
}

/* Cores dos dots por ação */
.h-timeline-dot.h-action-bipado { background: var(--blue-bg); color: var(--blue); }
.h-timeline-dot.h-action-finalizado { background: var(--green-bg); color: var(--green); }
.h-timeline-dot.h-action-nf_gerada { background: var(--accent-bg); color: var(--accent); }
.h-timeline-dot.h-action-nf_vinculada { background: var(--cyan-bg); color: var(--cyan); }
.h-timeline-dot.h-action-etiqueta { background: rgba(168,85,247,.08); color: #a855f7; }
.h-timeline-dot.h-action-cancelado { background: var(--red-bg); color: var(--red); }
.h-timeline-dot.h-action-desfeito { background: var(--amber-bg); color: var(--amber); }
.h-timeline-dot.h-action-revertido { background: var(--amber-bg); color: var(--amber); }
.h-timeline-dot.h-action-conferencia_inicio { background: rgba(168,85,247,.08); color: #a855f7; }
.h-timeline-dot.h-action-conferencia_ok { background: var(--green-bg); color: var(--green); }
.h-timeline-dot.h-action-conferencia_erro { background: var(--red-bg); color: var(--red); }
.h-timeline-dot.h-action-devolucao { background: var(--amber-bg); color: var(--amber); }

/* Conteúdo */
.h-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Linha principal: ação + SKU + hora */
.h-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.h-action-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 1px 7px;
    border-radius: var(--radius-full);
}
.h-action-label.h-action-bipado { background: var(--blue-bg); color: var(--blue); }
.h-action-label.h-action-finalizado { background: var(--green-bg); color: var(--green); }
.h-action-label.h-action-nf_gerada { background: var(--accent-bg); color: var(--accent); }
.h-action-label.h-action-nf_vinculada { background: var(--cyan-bg); color: var(--cyan); }
.h-action-label.h-action-etiqueta { background: rgba(168,85,247,.08); color: #a855f7; }
.h-action-label.h-action-cancelado { background: var(--red-bg); color: var(--red); }
.h-action-label.h-action-desfeito { background: var(--amber-bg); color: var(--amber); }
.h-action-label.h-action-revertido { background: var(--amber-bg); color: var(--amber); }
.h-action-label.h-action-conferencia_inicio { background: rgba(168,85,247,.08); color: #a855f7; }
.h-action-label.h-action-conferencia_ok { background: var(--green-bg); color: var(--green); }
.h-action-label.h-action-conferencia_erro { background: var(--red-bg); color: var(--red); }
.h-action-label.h-action-devolucao { background: var(--amber-bg); color: var(--amber); }

.h-sku-v2 {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--text-2);
    font-size: 11px;
    background: var(--bg-3);
    padding: 1px 6px;
    border-radius: var(--radius-xs);
}

.h-nf-badge {
    font-size: 9px;
    font-weight: 600;
    color: var(--cyan);
    background: var(--cyan-bg);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    letter-spacing: .2px;
}

.h-time-v2 {
    font-family: var(--mono);
    color: var(--text-5);
    font-size: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Linha de pedido + cliente */
.h-pedido-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    margin-top: 1px;
}
.h-pedido-num {
    font-family: var(--mono);
    font-weight: 700;
    color: var(--accent);
    font-size: 11px;
}
.h-cliente {
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

/* Canal badges */
.h-canal-badge {
    font-size: 8px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.h-canal-site { background: var(--green-bg); color: var(--green); }
.h-canal-mkt { background: var(--amber-bg); color: var(--amber); }

/* Detalhes */
.h-detail-v2 {
    color: var(--text-5);
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* Operador */
.h-operador {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--text-5);
    margin-top: 1px;
}
.h-operador svg { width: 10px; height: 10px; }

/* Legacy compat — manter para não quebrar */
.h-action-bipado { background: var(--blue-bg); color: var(--blue); }
.h-action-finalizado { background: var(--green-bg); color: var(--green); }
.h-action-nf_gerada { background: var(--accent-bg); color: var(--accent); }
.h-action-nf_vinculada { background: var(--cyan-bg); color: var(--cyan); }
.h-action-cancelado { background: var(--red-bg); color: var(--red); }
.h-action-desfeito { background: var(--amber-bg); color: var(--amber); }
.h-action-revertido { background: var(--amber-bg); color: var(--amber); }

/* ── 18. Toast Notifications ─────────────────────────── */
.toast-container {
    position: fixed;
    top: 68px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}
.toast {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    animation: toastIn .3s ease-out;
    max-width: 340px;
    pointer-events: auto;
    border-left: 3px solid transparent;
    box-shadow: var(--shadow-lg);
}
.toast-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); border-left-color: var(--green-dim); }
.toast-error { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); border-left-color: var(--red-dim); }
.toast-info { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); border-left-color: var(--blue-dim); }
@keyframes toastIn { from { transform: translateX(100%); opacity:0; } to { transform: translateX(0); opacity:1; } }

/* ── 19. Modal ───────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg-1);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 460px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn .2s ease-out;
}
@keyframes modalIn { from { transform: scale(.95) translateY(8px); opacity:0; } to { transform: scale(1) translateY(0); opacity:1; } }

.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.modal-header h3 { font-size: 14px; font-weight: 600; letter-spacing: -.2px; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.modal-footer #modal-btn-reverter { margin-right: auto; }

.modal-confirm-dialog { max-width: 380px; }
.modal-confirm-dialog .modal-body p { font-size: 13px; line-height: 1.5; color: var(--text-2); }

/* ── 20. Forms ───────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 5px;
    font-weight: 600;
}
.form-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    transition: border var(--fast);
}
.form-input:focus {
    border-color: var(--accent-dim);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-bg);
}
.form-input::placeholder { color: var(--text-5); }
textarea.form-input { resize: vertical; min-height: 60px; line-height: 1.4; }

/* ── 21. Loading Bar ─────────────────────────────────── */
.loading-bar {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 200;
    display: none;
    overflow: hidden;
}
.loading-bar.show { display: block; }
.loading-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 30%;
    background: var(--accent-dim);
    animation: loadSlide .8s infinite;
    border-radius: 1px;
}
@keyframes loadSlide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

/* ── 22. Empty State ─────────────────────────────────── */
.empty-state { text-align: center; padding: 32px 20px; color: var(--text-5); }
.empty-state .icon { font-size: 36px; margin-bottom: 8px; opacity: .5; }
.empty-state p { font-size: 12px; color: var(--text-4); }
.empty-state .hint { font-size: 11px; margin-top: 4px; color: var(--text-5); }

/* ── 23. Print Buttons ───────────────────────────────── */
.btn-group-print { display: flex; gap: 3px; flex-wrap: nowrap; }

.btn-reprint {
    background: var(--green-dim); color: #fff;
    border: none; padding: 4px 8px; font-size: 10px;
    border-radius: var(--radius-xs); cursor: pointer;
    white-space: nowrap; transition: all var(--fast); font-weight: 600;
}
.btn-reprint:hover { background: var(--green); }

.btn-print-nf {
    background: var(--accent-dim); color: #fff;
    border: none; padding: 4px 8px; font-size: 10px;
    border-radius: var(--radius-xs); cursor: pointer;
    white-space: nowrap; transition: all var(--fast); font-weight: 600;
}
.btn-print-nf:hover { background: var(--accent); }

.btn-print-etq, .btn-print-full {
    background: var(--bg-3); color: var(--text-4);
    border: 1px solid var(--border); padding: 4px 8px; font-size: 10px;
    border-radius: var(--radius-xs); cursor: pointer;
    white-space: nowrap; transition: all var(--fast); font-weight: 600;
}
.btn-print-etq:hover, .btn-print-full:hover { border-color: var(--border-hover); color: var(--text-2); }

.btn-faturar-row { padding: 4px 10px; font-size: 10px; white-space: nowrap; }

/* ── 24. Batch Actions ───────────────────────────────── */
.batch-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    margin-bottom: 10px;
}
.batch-info { font-size: 12px; color: var(--accent); font-weight: 600; }

.batch-progress-bar-wrap {
    width: 100%; height: 6px;
    background: var(--bg-3);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.batch-progress-bar {
    height: 100%;
    background: var(--accent-dim);
    border-radius: var(--radius-full);
    transition: width .4s ease;
}

/* ── 25. Checkbox Column ─────────────────────────────── */
.col-check { width: 36px; text-align: center; }
.col-check input[type="checkbox"], .pedido-checkbox {
    width: 14px; height: 14px;
    cursor: pointer;
    accent-color: var(--accent-dim);
}
.row-selected { background: var(--accent-bg) !important; }
.row-selected td { background: transparent !important; }

/* ── 26. Tags ────────────────────────────────────────── */
.tag-badge {
    display: inline-block;
    padding: 1px 7px;
    font-size: 9px;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid var(--blue-border);
    margin: 1px 2px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.tags-row { margin-top: 3px; line-height: 1.8; }

.tag-suggestions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag-suggestion {
    padding: 3px 10px;
    font-size: 10px;
    border-radius: var(--radius-full);
    background: var(--bg-2);
    color: var(--text-3);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all var(--fast);
}
.tag-suggestion:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-border); }

/* ── 27. Tracking ────────────────────────────────────── */
.tracking-icon { font-size: 11px; margin-left: 4px; color: var(--green); }
.tempo-sep { font-size: 10px; color: var(--text-5); font-family: var(--mono); }

/* ── 28. Advanced Filters ────────────────────────────── */
.advanced-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 5px; }
.filter-group label { font-size: 11px; color: var(--text-3); white-space: nowrap; font-weight: 500; }
.filter-input-sm {
    width: 80px; padding: 5px 8px; font-size: 11px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xs); color: var(--text);
    transition: border var(--fast);
}
.filter-input-sm:focus { border-color: var(--accent-dim); outline: none; }

/* ── 29. Alert Badge & Notification Dropdown ─────────── */
.header-alert-btn {
    position: relative; font-size: 14px;
    transition: color var(--fast);
}
.header-alert-btn:hover { color: var(--amber); }
.header-alert-btn.has-alerts { color: var(--amber); }

.alert-badge {
    position: absolute; top: -5px; right: -7px;
    background: var(--red); color: #fff;
    font-size: 9px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: var(--radius-full);
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px var(--surface);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes bell-ring {
    0% { transform: rotate(0); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-14deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(6deg); }
    60% { transform: rotate(-4deg); }
    70% { transform: rotate(2deg); }
    80% { transform: rotate(0); }
    100% { transform: rotate(0); }
}
.header-alert-btn.ring svg { animation: bell-ring .8s ease; }

/* Overlay */
.alertas-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.25);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* Dropdown flutuante */
.alertas-dropdown {
    position: fixed;
    top: 56px; right: 20px;
    width: 400px; max-width: calc(100vw - 32px);
    max-height: calc(100vh - 80px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 48px rgba(0,0,0,.25), 0 4px 12px rgba(0,0,0,.15);
    z-index: 1000;
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: dropdown-in .2s ease-out;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-8px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.alertas-dropdown-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
}
.alertas-dropdown-header h3 {
    font-size: 14px; font-weight: 600; color: var(--text);
    margin: 0;
}
.alertas-header-actions {
    display: flex; align-items: center; gap: 10px;
}
.alertas-count-label {
    font-size: 11px; color: var(--text-4);
    background: var(--bg-3);
    padding: 2px 8px; border-radius: var(--radius-full);
}

/* Tabs de filtro */
.alertas-tabs {
    display: flex; gap: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
}
.alertas-tab {
    padding: 8px 12px;
    font-size: 11px; font-weight: 500;
    color: var(--text-4);
    background: none; border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--fast);
    white-space: nowrap;
}
.alertas-tab:hover { color: var(--text); }
.alertas-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* Lista de alertas */
.alertas-list {
    flex: 1;
    overflow-y: auto;
    max-height: 420px;
    padding: 4px 0;
}
.alertas-empty {
    text-align: center; padding: 40px 20px;
    color: var(--text-4);
}
.alertas-empty span { font-size: 32px; display: block; margin-bottom: 8px; }
.alertas-empty p { font-size: 12px; margin: 0; }

/* Item de alerta individual */
.alerta-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light, rgba(255,255,255,.04));
    cursor: pointer;
    transition: background var(--fast);
}
.alerta-item:last-child { border-bottom: none; }
.alerta-item:hover { background: var(--bg-3); }

.alerta-icon-wrap {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.alerta-icon-atraso { background: rgba(239,68,68,.12); color: var(--red); }
.alerta-icon-sem_faturar { background: rgba(245,158,11,.12); color: var(--amber); }

.alerta-body { flex: 1; min-width: 0; }
.alerta-title {
    font-size: 12px; font-weight: 500; color: var(--text);
    line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.alerta-meta-row {
    display: flex; align-items: center; gap: 8px;
    margin-top: 4px; flex-wrap: wrap;
}
.alerta-tag {
    font-size: 10px; padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.alerta-tag-empresa { background: var(--bg-4); color: var(--text-3); }
.alerta-tag-tempo { color: var(--text-5); font-size: 10px; }
.alerta-tag-alta { background: rgba(239,68,68,.12); color: var(--red); }
.alerta-tag-media { background: rgba(245,158,11,.12); color: var(--amber); }

.alerta-arrow {
    color: var(--text-5); font-size: 14px;
    align-self: center; flex-shrink: 0;
    opacity: 0; transition: opacity var(--fast);
}
.alerta-item:hover .alerta-arrow { opacity: 1; }

/* Footer */
.alertas-dropdown-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.alertas-dropdown-footer .btn { font-size: 11px; }

/* ── 30. Auto-Sync Indicator ─────────────────────────── */
.auto-sync-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    transition: all var(--fast);
    border: 1px solid var(--border);
}
.auto-sync-indicator:hover { background: var(--bg-2); }

.sync-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sync-dot.active { background: var(--green); box-shadow: 0 0 4px var(--green-dim); animation: syncPulse 2s infinite; }
.sync-dot.inactive { background: var(--text-5); }
.sync-label { font-size: 10px; color: var(--text-4); font-weight: 500; }
@keyframes syncPulse { 0%,100% { opacity:1; } 50% { opacity:.3; } }

/* ── 31. Pick List Modal ─────────────────────────────── */
.modal-wide { max-width: 960px; width: 95vw; max-height: 92vh; }

.pick-toolbar {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
    flex-shrink: 0;
}
.pick-filters-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.pick-filter-group { display: flex; flex-direction: column; gap: 3px; }
.pick-filter-group label { font-size: 9px; text-transform: uppercase; color: var(--text-5); font-weight: 600; letter-spacing: .4px; }
.pick-filter-group select {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    padding: 5px 8px; font-size: 11px; cursor: pointer;
}
.pick-filter-group select:focus { border-color: var(--accent-dim); outline: none; }
.pick-filter-check { justify-content: flex-end; }
.pick-filter-check label {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--text-2); cursor: pointer;
    text-transform: none; font-weight: 400;
}

.pick-search-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pick-search-input {
    flex: 1; background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    padding: 6px 10px; font-size: 11px; transition: border var(--fast);
}
.pick-search-input:focus { border-color: var(--accent-dim); outline: none; }
.pick-search-input::placeholder { color: var(--text-5); }
.pick-search-count { font-size: 10px; color: var(--text-5); white-space: nowrap; }

/* Pick Summary */
.pick-summary { padding: 8px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.pick-summary-inner { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pick-chip {
    display: inline-flex; align-items: center; gap: 3px;
    background: var(--bg-3); color: var(--text-4);
    padding: 3px 10px; border-radius: var(--radius-full);
    font-size: 10px; font-weight: 500; border: 1px solid var(--border);
}
.pick-chip-sku { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.pick-chip-qty { background: var(--green-bg); color: var(--green); border-color: var(--green-border); font-weight: 700; }
.pick-chip-accent { background: rgba(139,92,246,.08); color: #a78bfa; border-color: rgba(139,92,246,.18); }
.pick-chip-warn { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }

/* Pick Table */
.pick-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pick-table thead th {
    padding: 8px 10px; text-align: left;
    font-size: 9px; text-transform: uppercase;
    letter-spacing: .4px; color: var(--text-5);
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1;
}
.pick-row { border-bottom: 1px solid var(--border); transition: background var(--fast); }
.pick-row:hover { background: rgba(255,255,255,.02); }
.pick-row td { padding: 6px 10px; vertical-align: middle; }
.pick-col-idx { width: 36px; text-align: center; color: var(--text-5); font-size: 10px; }
.pick-col-sku code {
    font-family: var(--mono); font-size: 10px;
    background: var(--bg-3); padding: 1px 6px;
    border-radius: 3px; border: 1px solid var(--border);
}
.pick-col-gtin { font-size: 10px; color: var(--text-5); }
.pick-col-desc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-col-qty { text-align: center; width: 60px; }
.pick-qty-single { font-weight: 600; font-size: 13px; }
.pick-qty-multi {
    font-weight: 700; font-size: 14px; color: var(--amber);
    background: var(--amber-bg); padding: 2px 8px;
    border-radius: var(--radius-xs); border: 1px solid var(--amber-border);
}
.pick-col-orders { font-size: 10px; }
.pick-order-tag {
    display: inline-block; background: var(--bg-3);
    padding: 1px 6px; border-radius: 3px;
    margin: 1px 2px; font-size: 9px;
    color: var(--text-4); border: 1px solid var(--border);
}
.pick-order-tag small { font-weight: 700; color: var(--text-2); }
.dim { color: var(--text-5); }

/* Urgência — linhas e tags */
.pick-row-critico { background: rgba(239, 68, 68, .08) !important; }
.pick-row-alerta  { background: rgba(245, 158, 11, .06) !important; }
.pick-tag-critico { border-color: var(--red) !important; color: var(--red) !important; }
.pick-tag-alerta  { border-color: var(--amber) !important; color: var(--amber) !important; }
.pick-col-urg { width: 28px; text-align: center; font-size: 12px; }

/* Chips urgência */
.pick-chip-critico { background: rgba(239, 68, 68, .15) !important; color: #ef4444 !important; border-color: rgba(239, 68, 68, .3) !important; }
.pick-chip-alerta  { background: rgba(245, 158, 11, .15) !important; color: #f59e0b !important; border-color: rgba(245, 158, 11, .3) !important; }
.pick-chip-canal   { background: rgba(99, 102, 241, .12) !important; color: #818cf8 !important; border-color: rgba(99, 102, 241, .3) !important; }

/* Agrupamento por empresa */
.pick-empresa-group { margin-bottom: 2px; }
.pick-empresa-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: var(--bg-3);
    border-bottom: 2px solid var(--accent);
    position: sticky; top: 0; z-index: 2;
}
.pick-empresa-name { font-weight: 700; font-size: 13px; color: var(--accent); }
.pick-empresa-stats { font-size: 11px; color: var(--text-4); }

/* Date input no pick toolbar */
.pick-date-input {
    padding: 4px 6px; background: var(--bg-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 11px; width: 130px;
}
.pick-date-input::-webkit-calendar-picker-indicator { filter: invert(0.7); }

/* Segunda linha de filtros */
.pick-filters-row-2 {
    display: flex; align-items: center; gap: 14px;
    margin-top: 6px; padding-top: 6px;
    border-top: 1px solid var(--border);
}

/* ── 32. Analytics ───────────────────────────────────── */
.analytics-view { margin-top: 20px; }

.analytics-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.analytics-controls label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.analytics-controls select {
    padding: 6px 10px; background: var(--bg-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 12px;
}

.chart-container { min-height: 200px; overflow-x: auto; }

.top-list { display: flex; flex-direction: column; gap: 6px; }
.top-item {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0; border-bottom: 1px solid var(--border);
}
.top-item:last-child { border-bottom: none; }
.top-rank {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--bg-4); display: flex;
    align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: var(--text-4);
    flex-shrink: 0;
}
.top-item:nth-child(1) .top-rank { background: var(--amber-dim); color: #000; }
.top-item:nth-child(2) .top-rank { background: var(--text-3); color: #000; }
.top-item:nth-child(3) .top-rank { background: #92400e; color: #fff; }

.top-name { font-family: var(--mono); font-size: 11px; color: var(--text-2); min-width: 80px; }
.top-bar-wrap { flex: 1; height: 4px; background: var(--bg-4); border-radius: var(--radius-full); overflow: hidden; }
.top-bar { height: 100%; background: var(--accent-dim); border-radius: var(--radius-full); transition: width .3s ease; }
.top-count { font-size: 11px; font-weight: 700; color: var(--text-4); min-width: 30px; text-align: right; font-family: var(--mono); }

.empresa-stat-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border);
}
.empresa-stat-item:last-child { border-bottom: none; }
.empresa-stat-nome { font-weight: 600; font-size: 12px; color: var(--text); }
.empresa-stat-counts { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.empresa-stat-counts .badge { font-size: 9px; padding: 2px 6px; }

/* ── 33. Operator Badge ──────────────────────────────── */
.operator-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px; background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm); font-size: 11px;
    transition: all var(--fast); cursor: pointer;
}
.operator-badge:hover { background: var(--accent-dim); color: #fff; }
.operator-icon { font-size: 13px; }
.operator-name { font-weight: 600; }
.operator-role { color: var(--text-5); font-size: 10px; }

/* ── 34. Romaneio Profissional ──────────────────────── */

/* Filtros */
.romaneio-filters { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.romaneio-filters-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.romaneio-filters-row + .romaneio-filters-row { margin-top: 10px; }
.romaneio-filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 120px; flex: 1; }
.romaneio-filter-group label { font-size: 10px; text-transform: uppercase; color: var(--text-4); letter-spacing: .5px; font-weight: 600; }
.romaneio-filter-group select,
.romaneio-filter-group input { background: var(--bg-3); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font-size: 12px; color: var(--text-1); }
.romaneio-filter-group select:focus,
.romaneio-filter-group input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(99,102,241,.15); }

/* Resumo */
.romaneio-resumo { margin-bottom: 16px; display: none; }
.rom-resumo-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rom-resumo-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; min-width: 100px; }
.rom-resumo-value { font-size: 18px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.rom-resumo-label { font-size: 10px; color: var(--text-4); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.rom-resumo-info { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rom-chip { background: var(--bg-3); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; font-size: 10px; color: var(--text-3); }
.rom-chip-status { background: rgba(99,102,241,.12); color: var(--accent); border-color: rgba(99,102,241,.3); }
.rom-chip-canal { background: rgba(16,185,129,.10); color: #10b981; border-color: rgba(16,185,129,.25); }

/* Empty state */
.romaneio-empty { text-align: center; padding: 50px 20px; color: var(--text-4); }
.romaneio-empty span { font-size: 40px; display: block; margin-bottom: 10px; }
.romaneio-empty p { font-size: 13px; }

/* Grupo */
.rom-grupo { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; transition: all .2s; }
.rom-grupo:hover { border-color: var(--accent-dim, var(--border)); }
.rom-grupo-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; user-select: none; background: var(--bg-2); transition: background .15s; }
.rom-grupo-header:hover { background: var(--bg-3); }
.rom-grupo-title { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rom-grupo-toggle { transition: transform .2s; font-size: 14px; color: var(--text-4); }
.rom-grupo.collapsed .rom-grupo-toggle { transform: rotate(-90deg); }
.rom-grupo.collapsed .rom-grupo-body { display: none; }
.rom-grupo-badge { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.rom-grupo-stats { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); align-items: center; }
.rom-grupo-pct { font-size: 10px; color: var(--text-4); background: var(--bg-3); padding: 2px 6px; border-radius: 4px; }
.rom-grupo-body { border-top: 1px solid var(--border); }

/* Tabela */
.rom-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.rom-table thead th { background: var(--bg-3); color: var(--text-4); font-size: 9px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); font-weight: 700; position: sticky; top: 0; }
.rom-table tbody td { padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,.04); color: var(--text-2); }
.rom-table tbody tr:hover { background: rgba(99,102,241,.04); }
.rom-table tbody tr:nth-child(even) { background: rgba(255,255,255,.015); }
.rom-table tbody tr:nth-child(even):hover { background: rgba(99,102,241,.06); }
.rom-table code { background: var(--bg-3); padding: 1px 5px; border-radius: 3px; font-size: 10px; }
.rom-totals-row td { border-top: 2px solid var(--border); background: var(--bg-3) !important; }

/* Colunas */
.rom-col-idx { width: 36px; text-align: center; color: var(--text-5); }
.rom-col-pedido { width: 90px; }
.rom-col-cliente { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rom-col-empresa { width: 100px; font-size: 10px; }
.rom-col-canal { width: 90px; }
.rom-col-nf { width: 80px; }
.rom-col-rastreio { width: 110px; font-size: 10px; }
.rom-col-itens { width: 50px; text-align: center; }
.rom-col-valor { width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.rom-col-data { width: 80px; font-size: 10px; }

/* Tags */
.rom-canal-tag { background: rgba(16,185,129,.10); color: #10b981; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.rom-rastreio { font-family: 'JetBrains Mono', monospace; font-size: 9px !important; }
.dim { color: var(--text-5); }

/* Toggle Bipar Etiquetas */
.rom-toggle-label { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 11px; color: var(--text-3); white-space: nowrap; padding: 7px 0; user-select: none; }
.rom-toggle-label input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* Scanner de Etiquetas */
.rom-scanner-area { background: var(--bg-2); border: 2px dashed var(--accent); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; animation: romScannerFadeIn .3s ease; }
@keyframes romScannerFadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.rom-scanner-header { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.rom-scanner-header i { width: 16px; height: 16px; color: var(--accent); }
.rom-scanner-count { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-left: auto; }
.rom-scanner-input-wrap { margin-bottom: 10px; }
.rom-scanner-input { width: 100%; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 14px; color: var(--text-1); font-family: 'JetBrains Mono', monospace; transition: border-color .15s; }
.rom-scanner-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.rom-scanner-input::placeholder { color: var(--text-5); }
.rom-scanner-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.rom-scanner-hint { font-size: 11px; color: var(--text-5); font-style: italic; }

/* Câmera no Romaneio */
.rom-camera-preview { margin: 10px 0; border-radius: 10px; overflow: hidden; position: relative; background: #000; }
.rom-camera-preview #rom-camera-reader { width: 100%; max-width: 400px; margin: 0 auto; }
.rom-camera-preview #rom-camera-reader video { border-radius: 8px; }
.rom-camera-close { position: absolute; top: 6px; right: 6px; z-index: 10; background: rgba(0,0,0,.6) !important; color: #fff !important; border-radius: 6px; font-size: 11px; gap: 4px; }
#btn-rom-camera { color: var(--accent); }
#btn-rom-camera.active { background: var(--accent); color: #fff; border-radius: 6px; }
.rom-scanned-tag { display: inline-flex; align-items: center; gap: 4px; background: rgba(99,102,241,.12); color: var(--accent); border: 1px solid rgba(99,102,241,.25); border-radius: 6px; padding: 3px 8px; font-size: 11px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.rom-scanned-tag button { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; opacity: .6; transition: opacity .15s; }
.rom-scanned-tag button:hover { opacity: 1; color: var(--danger); }

/* ── 35a. Stat Cards — Pronto & Expedido ─────────────── */
.stat-pronto { border-left: 3px solid rgba(16,185,129,.5); }
.stat-pronto .stat-value { color: #10b981; }
.stat-pronto .stat-icon { background: rgba(16,185,129,.12); color: #10b981; }
.stat-expedido { border-left: 3px solid rgba(59,130,246,.5); }
.stat-expedido .stat-value { color: #3b82f6; }
.stat-expedido .stat-icon { background: rgba(59,130,246,.12); color: #3b82f6; }

/* ── 35b. Expedição — Scanner & Workflow ─────────────── */
/* ── Expedição — Card body ───────────────────────────── */
.exp-card-body { padding: 16px; }
.exp-header-actions { display: flex; gap: 6px; align-items: center; }

/* ── Expedição — Scanner Section ─────────────────────── */
.exp-scanner-section { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.exp-scanner-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.exp-scanner-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.exp-scanner-title i, .exp-scanner-title svg { width: 20px; height: 20px; color: var(--accent); }
.exp-scanner-actions { display: flex; gap: 8px; align-items: center; }
.exp-scanner-count { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 12px; }
.exp-btn-label { /* Hidden on small screens via media query */ }

/* Scanner input */
.exp-scanner-input-wrap { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; position: relative; }
.exp-scanner-input-wrap .scanner-icon { display: flex; align-items: center; color: var(--text-5); flex-shrink: 0; }
.exp-scanner-input-wrap .scanner-icon i, .exp-scanner-input-wrap .scanner-icon svg { width: 20px; height: 20px; }
.exp-scanner-input { flex: 1; background: var(--bg-3); border: 2px solid var(--border); border-radius: 10px; padding: 12px 16px; font-size: 15px; color: var(--text-1); font-family: 'JetBrains Mono', monospace; transition: border-color .15s, box-shadow .15s; }
.exp-scanner-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px rgba(99,102,241,.18); }
.exp-scanner-input::placeholder { color: var(--text-5); font-size: 13px; }

/* Camera preview */
.exp-camera-preview { background: var(--bg-3); border: 2px solid var(--accent); border-radius: 12px; padding: 0; margin-bottom: 14px; overflow: hidden; position: relative; }
.exp-camera-reader { width: 100%; min-height: 200px; }
.exp-camera-reader video { width: 100% !important; border-radius: 10px 10px 0 0; }
.exp-camera-controls { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: rgba(0,0,0,.3); }
.exp-camera-hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,.8); }
.exp-camera-hint i, .exp-camera-hint svg { width: 16px; height: 16px; color: var(--accent); }

/* Scanned list */
.exp-scanned-list { min-height: 60px; max-height: 400px; overflow-y: auto; }
.exp-empty-hint { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 16px; text-align: center; }
.exp-empty-hint p { font-size: 13px; color: var(--text-5); margin: 0; line-height: 1.5; }
.exp-scanned-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.05); transition: background .12s; border-radius: 8px; margin-bottom: 2px; }
.exp-scanned-item:hover { background: rgba(99,102,241,.06); }
.exp-scanned-item:last-child { border-bottom: none; }
.exp-scanned-idx { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; border-radius: 50%; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.exp-scanned-info { flex: 1; min-width: 0; }
.exp-scanned-top-row { display: flex; align-items: center; gap: 6px; }
.exp-scanned-info strong { font-size: 13px; color: var(--text-1); }
.exp-scanned-canal { font-size: 9px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: rgba(99,102,241,.12); color: var(--accent); text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.exp-scanned-cliente { display: block; font-size: 11px; color: var(--text-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.exp-scanned-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.exp-scanned-empresa { font-size: 10px; color: var(--text-4); background: var(--bg-3); padding: 2px 6px; border-radius: 4px; }
.exp-scanned-rastreio { background: var(--bg-3); padding: 2px 8px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--accent); letter-spacing: .3px; }
.exp-scanned-valor { font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-scanned-remove { font-size: 20px; color: var(--text-5); cursor: pointer; transition: color .15s; padding: 2px 6px; border-radius: 6px; }
.exp-scanned-remove:hover { color: var(--danger); background: rgba(239,68,68,.08); }

/* Action bar */
.exp-action-bar { display: flex; align-items: center; justify-content: space-between; background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.25); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; gap: 12px; }
.exp-action-info { font-size: 14px; color: var(--text-2); }
.exp-action-info strong { color: #10b981; font-size: 18px; }

/* Result */
.exp-result-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.exp-result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.exp-result-header h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-1); }
.exp-result-header h3 i, .exp-result-header h3 svg { width: 18px; height: 18px; color: #10b981; }
.exp-result-stats { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.exp-result-stat { background: var(--bg-3); border-radius: 8px; padding: 10px 16px; text-align: center; min-width: 80px; flex: 1; }
.exp-result-stat-value { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
.exp-result-stat-label { font-size: 10px; text-transform: uppercase; color: var(--text-4); letter-spacing: .4px; }
.exp-stat-ok .exp-result-stat-value { color: #10b981; }
.exp-stat-total .exp-result-stat-value { color: var(--accent); }
.exp-stat-err .exp-result-stat-value { color: var(--danger); }
.exp-result-list { margin-top: 10px; }
.exp-result-list h4 { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.exp-result-items { display: flex; flex-direction: column; gap: 4px; }
.exp-result-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; font-size: 12px; flex-wrap: wrap; }
.exp-result-ok { background: rgba(16,185,129,.06); }
.exp-result-err { background: rgba(239,68,68,.06); }
.exp-result-item strong { color: var(--text-1); }
.exp-result-item code { background: var(--bg-3); padding: 1px 5px; border-radius: 3px; font-size: 10px; color: var(--text-3); }
.exp-tag-bling { background: rgba(59,130,246,.12); color: #3b82f6; font-size: 9px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.exp-tag-shopify { background: rgba(16,185,129,.12); color: #10b981; font-size: 9px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }

/* Romaneio toggle */
.exp-romaneio-toggle { margin-top: 18px; }
.exp-romaneio-toggle summary { list-style: none; }
.exp-romaneio-toggle summary::-webkit-details-marker { display: none; }

/* Camera button active state */
#btn-exp-camera.active { background: var(--accent); color: #fff; border-radius: 6px; }

/* ── 35. Button Group Meta ───────────────────────────── */
.btn-group-meta { display: inline-flex; gap: 3px; margin-top: 3px; }

/* ── 36. Responsive — Tablet ─────────────────────────── */
@media (max-width: 1200px) {
    .main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
    .grid-4, .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-card .stat-icon { width: 30px; height: 30px; }
    .stat-card .stat-value { font-size: 20px; }
}

/* ── 37. Responsive — Mobile ─────────────────────────── */
@media (max-width: 768px) {
    /* --- Header --- */
    .header {
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px;
    }
    .header h1 { font-size: 14px; flex-shrink: 0; }
    .header h1 .version { display: none; }
    .header-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 5px;
        flex: 1;
        min-width: 0;
    }
    .empresa-selector { order: 10; width: 100%; }
    .empresa-selector label { display: none; }
    .empresa-selector select { flex: 1; font-size: 12px; padding: 6px 24px 6px 8px; }
    .auto-sync-indicator .sync-label { display: none; }
    .auto-sync-indicator { padding: 3px 6px; }
    .operator-badge .operator-role { display: none; }
    .operator-badge { padding: 3px 8px; font-size: 10px; }
    .header-actions > .btn { font-size: 10px; padding: 4px 8px; gap: 4px; }
    .header-actions > .btn .lucide { width: 13px; height: 13px; }

    /* --- Container --- */
    .container { padding: 10px 8px 24px; }

    /* --- Stat Cards: 5 cards → last spans full width --- */
    .grid-4,
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-bottom: 12px;
    }
    .grid-4 > .stat-card:last-child:nth-child(odd),
    .stats-grid > .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .stat-card { padding: 8px 10px; gap: 8px; }
    .stat-card .stat-icon { width: 28px; height: 28px; }
    .stat-card .stat-icon i, .stat-card .stat-icon svg { width: 13px; height: 13px; }
    .stat-card .stat-value { font-size: 18px; }
    .stat-card .stat-label { font-size: 8px; }

    /* --- Main Tabs (horizontal scroll, larger targets) --- */
    .main-tabs {
        gap: 1px;
        padding: 2px;
        margin: 12px 0 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .main-tabs::-webkit-scrollbar { display: none; }
    .main-tab { font-size: 11px; padding: 9px 12px; white-space: nowrap; flex-shrink: 0; }

    /* --- Sub-Tabs & Search --- */
    .tabs-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .tabs-left {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tabs-left::-webkit-scrollbar { display: none; }
    .tabs .tab { flex-shrink: 0; white-space: nowrap; }
    .tabs-right {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
    }
    .search-wrap { flex: 1 1 100%; order: 10; }
    .search-input { width: 100%; }
    .search-input:focus { width: 100%; }
    .tabs-right .btn-filter-dias { font-size: 10px; padding: 5px 8px; flex: 1; text-align: center; justify-content: center; }
    .tabs-right .btn-export { font-size: 10px; padding: 5px 8px; }
    .tabs-right .btn { font-size: 10px; }

    /* --- Scanner --- */
    .scanner-area .card-body { padding: 10px; }
    .scanner-input-wrap {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 6px;
    }
    .scanner-input {
        grid-column: 1 / -1;
        width: 100%;
        font-size: 15px;
        padding: 11px 12px 11px 36px;
        min-width: 0;
    }
    .scanner-icon { left: 10px; font-size: 14px; }
    .scanner-input-wrap > .btn {
        min-width: 0;
        justify-content: center;
        font-size: 11px;
    }
    #btn-faturar { grid-column: 1 / -1; }
    .shortcuts-bar { display: none; }
    .scan-confirm-bar {
        font-size: 11px;
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: wrap;
    }
    .scan-confirm-bar .btn { flex: 1; min-width: 0; justify-content: center; }
    .conferencia-bar {
        flex-direction: column;
        align-items: stretch;
        font-size: 11px;
        padding: 8px 10px;
        gap: 6px;
    }
    .conferencia-bar .conf-text { font-size: 11px; line-height: 1.4; }
    .conferencia-bar .btn { width: 100%; justify-content: center; }

    /* --- Table: hide canal, data, status, loja columns on mobile --- */
    .col-canal,
    .col-loja,
    .col-status,
    .col-data { display: none; }

    table { font-size: 11px; }
    th, td { padding: 6px 6px; }
    th { font-size: 9px; }
    .col-check { width: 28px; }

    .pedido-num { font-size: 11px !important; }
    .pedido-valor { font-size: 10px !important; }
    .tag-badge { font-size: 8px; padding: 0px 5px; }

    /* --- Actions column: stack buttons --- */
    .btn-group-print {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
    }
    .btn-group-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
        margin-top: 2px;
    }
    .btn-faturar-row { padding: 3px 8px; font-size: 9px; }

    /* --- Batch bar --- */
    .batch-bar {
        flex-direction: column;
        gap: 6px;
        padding: 8px 10px;
    }
    .batch-bar .btn { width: 100%; justify-content: center; }

    /* --- Advanced Filters --- */
    .advanced-filters { 
        flex-direction: column; 
        gap: 8px;
        padding: 10px;
    }
    .filter-group { width: 100%; }
    .filter-input-sm { flex: 1; width: 100%; }

    /* --- Modals: near full-screen (bottom sheet style) --- */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        animation: modalSlideUp .25s ease-out;
    }
    @keyframes modalSlideUp {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    .modal-header { padding: 12px 14px; }
    .modal-header h3 { font-size: 13px; }
    .modal-body { padding: 12px; max-height: calc(92vh - 110px); overflow-y: auto; }
    .modal-footer {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .modal-footer .btn { flex: 1; min-width: 0; justify-content: center; }
    .modal-wide { width: 100vw !important; max-width: 100vw !important; }

    /* --- Pedido Ativo card --- */
    .pedido-ativo .pedido-header {
        flex-direction: column;
        gap: 6px;
        padding: 10px 12px;
    }
    .pedido-ativo .pedido-meta {
        text-align: left;
        align-items: flex-start;
        flex-direction: row;
        gap: 8px;
        flex-wrap: wrap;
    }
    .pedido-ativo .pedido-number { font-size: 14px; }
    .progress-total { padding: 6px 12px; gap: 8px; }
    .item-list li.item-row { padding: 6px 12px; }
    .item-list .item-desc {
        white-space: normal;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 0 8px;
        font-size: 10px;
    }
    .item-list .item-sku { min-width: 70px; font-size: 10px; }
    .item-list .item-qty { font-size: 10px; }
    .row-detail-content { grid-template-columns: 1fr; padding: 10px 12px; gap: 10px; }
    .detail-item { flex-wrap: wrap; font-size: 11px; }
    .camera-preview video { max-width: 100% !important; }

    /* --- Main Grid: keep scanner → pedido ativo flow --- */
    .card-body { padding: 12px; }
    .card-header { padding: 10px 12px; }
    .card-header h2 { font-size: 11px; }
    .card + .card { margin-top: 12px; }

    /* --- Toast --- */
    .toast-container {
        right: 8px;
        left: 8px;
        top: 68px;
        bottom: auto;
    }
    .toast { max-width: 100%; font-size: 11px; padding: 8px 12px; }

    /* --- Romaneio --- */
    .romaneio-filters-row { flex-direction: column; gap: 8px; }
    .romaneio-filter-group { min-width: 100%; }
    .rom-resumo-grid { gap: 6px; }
    .rom-resumo-card { min-width: 80px; padding: 8px 10px; }
    .rom-resumo-value { font-size: 14px; }
    .rom-grupo-header { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; }
    .rom-grupo-stats { font-size: 10px; gap: 8px; }
    .rom-table { font-size: 10px; }
    .rom-table thead th { padding: 6px 6px; font-size: 8px; }
    .rom-table tbody td { padding: 5px 6px; }
    .rom-col-empresa, .rom-col-rastreio, .rom-col-nf { display: none; }
    .rom-scanner-header { flex-wrap: wrap; gap: 6px; font-size: 11px; }
    .rom-scanner-input { font-size: 14px; padding: 10px 12px; }

    /* --- Analytics --- */
    .analytics-controls { flex-direction: column; align-items: stretch; gap: 8px; }
    .analytics-controls select { width: 100%; }

    /* --- Pagination --- */
    .pagination {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        justify-content: center;
    }
    .page-info { width: 100%; text-align: center; }
    .page-btns { display: flex; gap: 6px; flex: 1; }
    .page-btn { flex: 1; text-align: center; }

    /* --- Alertas dropdown (bottom sheet) --- */
    .alertas-overlay { background: rgba(0,0,0,.4); }
    .alertas-dropdown {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: 80vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        animation: modalSlideUp .25s ease-out;
    }

    /* --- History panel --- */
    .history-panel { max-height: 280px; }
    .history-item-v2 { padding: 6px 10px; gap: 8px; }
    .h-timeline-dot { width: 24px; height: 24px; }
    .h-timeline-dot i, .h-timeline-dot svg { width: 11px; height: 11px; }
    .h-action-label { font-size: 9px; padding: 1px 5px; }
    .h-sku-v2 { font-size: 10px; }
    .h-time-v2 { font-size: 9px; }
    .h-pedido-line { font-size: 10px; }
    .h-detail-v2 { font-size: 9px; }
    .h-cliente { max-width: 100px; }
    .history-group-header { padding: 5px 10px; font-size: 9px; }

    /* --- Performance & Devoluções tables --- */
    .performance-view table { font-size: 10px; }
    .devolucoes-view table { font-size: 10px; }
    .devolucoes-view th, .devolucoes-view td { padding: 5px 6px; }
    .usuarios-view table { font-size: 10px; }
    .usuarios-view th, .usuarios-view td { padding: 5px 6px; }

    /* --- Table wrapper: scroll indicator --- */
    .table-wrap {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        position: relative;
    }
    .table-wrap::-webkit-scrollbar { display: none; }

    /* --- Badges on mobile --- */
    .badge { font-size: 8px; padding: 1px 6px; }
    .badge-empresa { display: none; }
    .badge-conferencia { font-size: 9px; }

    /* --- Expedição — Mobile Layout ─────────────────────── */
    .exp-card-body { padding: 10px; }
    .exp-header-actions { gap: 4px; }
    .exp-btn-label { display: none; }

    .exp-scanner-section { padding: 12px; border-radius: 10px; }
    .exp-scanner-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }
    .exp-scanner-title { font-size: 13px; }
    .exp-scanner-actions { width: 100%; justify-content: space-between; }
    .exp-scanner-count { font-size: 12px; padding: 4px 14px; }

    /* Scanner input — full width, big target for mobile */
    .exp-scanner-input-wrap {
        flex-direction: column;
        gap: 8px;
    }
    .exp-scanner-input-wrap .scanner-icon { display: none; }
    .exp-scanner-input {
        width: 100%;
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 10px;
        border-width: 2px;
    }
    #btn-exp-scan-manual {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        justify-content: center;
        border-radius: 10px;
    }

    /* Camera — full width on mobile */
    .exp-camera-preview {
        border-radius: 10px;
        margin: 0 -12px 14px;
        border-left: none;
        border-right: none;
        border-radius: 0;
        width: calc(100% + 24px);
    }
    .exp-camera-reader { min-height: 220px; }
    .exp-camera-controls { padding: 10px 12px; }
    .exp-camera-hint { font-size: 11px; }

    /* Camera button prominent on mobile */
    #btn-exp-camera {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 8px;
    }

    /* Scanned list — card style on mobile */
    .exp-scanned-list { max-height: 50vh; }
    .exp-scanned-item {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px;
        background: var(--bg-3);
        border-radius: 10px;
        margin-bottom: 6px;
        border-bottom: none;
    }
    .exp-scanned-idx { width: 26px; height: 26px; font-size: 11px; }
    .exp-scanned-info {
        flex: 1;
        min-width: calc(100% - 80px);
    }
    .exp-scanned-info strong { font-size: 13px; }
    .exp-scanned-cliente {
        max-width: 100%;
        white-space: normal;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 11px;
    }
    .exp-scanned-meta {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
        order: 3;
    }
    .exp-scanned-rastreio {
        font-size: 11px;
        padding: 3px 8px;
        word-break: break-all;
    }
    .exp-scanned-empresa { font-size: 10px; }
    .exp-scanned-valor {
        font-size: 12px;
        margin-left: auto;
    }
    .exp-scanned-remove {
        font-size: 22px;
        padding: 4px 8px;
    }

    /* Action bar — sticky at bottom on mobile */
    .exp-action-bar {
        position: sticky;
        bottom: 0;
        z-index: 50;
        flex-direction: column;
        gap: 8px;
        padding: 12px;
        border-radius: 12px 12px 0 0;
        margin: 0 -10px -10px;
        width: calc(100% + 20px);
        box-shadow: 0 -4px 20px rgba(0,0,0,.3);
    }
    .exp-action-info { text-align: center; font-size: 13px; }
    #btn-gerar-expedicao {
        width: 100%;
        padding: 14px;
        font-size: 15px;
        border-radius: 10px;
        justify-content: center;
    }

    /* Result stats on mobile */
    .exp-result-card { padding: 12px; }
    .exp-result-stats { gap: 6px; }
    .exp-result-stat { padding: 8px 10px; min-width: 60px; }
    .exp-result-stat-value { font-size: 16px; }
    .exp-result-item { flex-wrap: wrap; gap: 4px; padding: 6px 8px; font-size: 11px; }

    /* Empty hint on mobile */
    .exp-empty-hint { padding: 24px 12px; }
    .exp-empty-hint p { font-size: 12px; }
}

/* ── 38. Responsive — Small Phone ────────────────────── */
@media (max-width: 480px) {
    .header h1 { font-size: 13px; gap: 5px; }
    .header h1 .icon { font-size: 16px; }

    /* Stats: single column, horizontal layout */
    .grid-4, .stats-grid { grid-template-columns: 1fr; gap: 4px; }
    .stat-card {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 8px 12px;
        gap: 10px;
    }
    .stat-card .stat-icon { width: 30px; height: 30px; }
    .stat-card .stat-icon i, .stat-card .stat-icon svg { width: 14px; height: 14px; }
    .stat-card .stat-info { flex-direction: row; align-items: center; gap: 8px; }
    .stat-card .stat-label { font-size: 9px; }
    .stat-card .stat-value { font-size: 18px; }

    .main-tab { font-size: 10px; padding: 8px 10px; }

    .scanner-input { font-size: 14px; letter-spacing: 1px; }
    .scanner-input-wrap { grid-template-columns: 1fr; }
    .scanner-input-wrap > .btn { width: 100%; }

    th, td { padding: 4px 4px; font-size: 10px; }
    .pedido-num { font-size: 10px !important; }
    .pedido-valor { display: none !important; }

    /* Also hide Itens column on small phones */
    .col-itens { display: none; }

    .btn { font-size: 10px; padding: 5px 8px; }
    .btn-sm { font-size: 10px; padding: 4px 7px; }
    .btn-xs { font-size: 9px; padding: 3px 6px; }

    /* Detail row adjustments */
    .detail-item { font-size: 10px; }
    .sku-tag { font-size: 9px; }

    /* Header: more compact */
    .header { padding: 6px 8px; gap: 4px; }
    .header-actions > .btn { padding: 3px 6px; }
    .operator-badge { padding: 2px 6px; }
    .operator-badge .operator-name { font-size: 9px; }

    /* Stat cards: horizontal compact */
    .stat-card .stat-label { font-size: 8px; letter-spacing: .3px; }

    /* Card padding tighter */
    .card-body { padding: 8px; }
    .card-header { padding: 8px 10px; }

    /* Batch bar compact */
    .batch-bar { padding: 6px 8px; gap: 4px; }
    .batch-info { font-size: 11px; }

    /* Pedido ativo items: single line */
    .item-list .item-desc { margin: 0 4px; }
    .item-list .item-sku { min-width: 55px; font-size: 9px; }
}

/* ── 39. Pick List Responsive ────────────────────────── */
@media (max-width: 700px) {
    .pick-filters-row { gap: 6px; flex-wrap: wrap; }
    .pick-filters-row-2 { flex-wrap: wrap; gap: 8px; }
    .pick-filter-group { min-width: 100%; }
    .pick-filter-group select { font-size: 10px; padding: 4px 6px; }
    .pick-date-input { width: 110px; font-size: 10px; }
    .pick-col-gtin { display: none; }
    .pick-col-desc { max-width: 120px; }
    .pick-col-urg { display: none; }
    .modal-wide { width: 100vw; max-width: 100vw; }
}

/* ── 40. Animations ──────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes highlight-flash {
    0% { background: rgba(245,158,11,.3); }
    100% { background: transparent; }
}
.highlight-flash { animation: highlight-flash 2s ease-out; }

/* ── 41. Alertas Dropdown Responsive ─────────────────── */
@media (max-width: 480px) {
    .alertas-dropdown {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: 80vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .alertas-tabs { overflow-x: auto; }
}

/* ── 41. Print ───────────────────────────────────────── */
@media print {
    .header, .scanner-area, .main-tabs, .shortcuts-bar,
    .pagination, .btn, .batch-bar, .toast-container,
    .loading-bar, .modal-overlay {
        display: none !important;
    }
    body { background: #fff; color: #000; }
    .card { border: 1px solid #ddd; box-shadow: none; }
}

/* ── 42. Focus Visible ───────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 2px; }

/* ── 43. Select Arrow ────────────────────────────────── */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 6px center;
    background-repeat: no-repeat;
    background-size: 14px;
    padding-right: 24px;
}

/* ── 44. Performance table ───────────────────────────── */
.performance-view table td:first-child { width: 40px; }

/* ── 45. Touch Optimization (mobile) ─────────────────── */
@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 36px; padding: 8px 14px; }
    .btn-sm { min-height: 32px; }
    .btn-xs { min-height: 28px; padding: 4px 10px; }
    .tab { padding: 8px 14px; }
    .main-tab { padding: 10px 14px; min-height: 40px; }
    td { padding: 10px 8px; }
    .search-input { padding: 10px 10px 10px 28px; font-size: 16px; }
    .form-input { padding: 10px 12px; font-size: 16px; }
    .scanner-input { padding: 14px 14px 14px 40px; font-size: 16px; }
    .pedido-checkbox { width: 18px !important; height: 18px !important; }
    select { font-size: 16px; padding: 8px 28px 8px 10px; }
    input[type="text"], input[type="number"], input[type="date"], input[type="password"] { font-size: 16px; }
}

/* ── 46. Wide Screen (>1600px) ───────────────────────── */
@media (min-width: 1600px) {
    .container { max-width: 1580px; }
    .grid-4 { gap: 14px; }
    .main-grid { gap: 18px; grid-template-columns: 480px 1fr; }
    .stat-card { padding: 16px 18px; }
    .stat-card .stat-value { font-size: 28px; }
}

/* ── 47. Scan Mode Indicator ─────────────────────────── */
.scan-mode-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    animation: fadeIn .3s ease;
}
.scan-mode-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}
.scan-mode-indicator.mode-faturar {
    background: var(--amber-bg);
    color: var(--amber);
    border: 1px solid var(--amber-border);
}
.scan-mode-indicator.mode-faturar .scan-mode-dot {
    background: var(--amber);
    box-shadow: 0 0 6px var(--amber-dim);
}
.scan-mode-indicator.mode-nf-pronta {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
}
.scan-mode-indicator.mode-nf-pronta .scan-mode-dot {
    background: var(--green);
    box-shadow: 0 0 6px var(--green-dim);
}
.scan-mode-indicator.mode-separando {
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid var(--blue-border);
}
.scan-mode-indicator.mode-separando .scan-mode-dot {
    background: var(--blue);
    box-shadow: 0 0 6px var(--blue-dim);
}

/* ── 48. NF Pronta Badge & Pedido Ativo States ───────── */
.badge-nf-pronta {
    background: linear-gradient(135deg, rgba(16,185,129,.12) 0%, rgba(52,211,153,.08) 100%);
    color: var(--green);
    border: 1px solid var(--green-border);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: .3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-nf-pronta::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.pedido-ativo.nf-pronta-mode {
    border-color: var(--green-border);
    box-shadow: 0 0 20px rgba(16,185,129,.08);
}
.pedido-ativo.nf-pronta-mode .pedido-header {
    background: linear-gradient(135deg, rgba(16,185,129,.04) 0%, transparent 100%);
}

/* ── 49. Scanner Glow on Complete ────────────────────── */
.scanner-area.scan-complete-glow {
    border-color: var(--green-border);
    box-shadow: 0 0 20px rgba(16,185,129,.15), 0 0 40px rgba(16,185,129,.05);
    transition: border-color .4s ease, box-shadow .4s ease;
}
.scanner-area.scan-faturar-glow {
    border-color: var(--amber-border);
    box-shadow: 0 0 20px rgba(245,158,11,.12), 0 0 40px rgba(245,158,11,.04);
    transition: border-color .4s ease, box-shadow .4s ease;
}

/* ── 50. NF Pronta Success Banner ────────────────────── */
.nf-pronta-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(16,185,129,.1) 0%, rgba(52,211,153,.04) 100%);
    border: 1px solid var(--green-border);
    border-left: 4px solid var(--green);
    border-radius: var(--radius);
    animation: bannerSlideIn .4s ease-out;
    position: relative;
    z-index: 2;
}
.nf-pronta-banner .banner-icon {
    font-size: 32px;
    flex-shrink: 0;
    margin-top: 2px;
}
.nf-pronta-banner .banner-text {
    flex: 1;
    min-width: 0;
}
.nf-pronta-banner .banner-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 4px;
}
.nf-pronta-banner .banner-detail {
    font-size: 11px;
    color: var(--text-3);
}
@keyframes bannerSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toast warning variant */
.toast-warning { 
    background: var(--amber-bg); 
    color: var(--amber); 
    border: 1px solid var(--amber-border); 
    border-left-color: var(--amber-dim); 
}

/* ── 51. Pedido Info Cards in Modal ──────────────────── */
.modal-pedido-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.modal-pedido-card .info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.modal-pedido-card .info-row .label {
    color: var(--text-4);
    font-weight: 500;
    min-width: 70px;
}
.modal-pedido-card .info-row .value {
    font-weight: 600;
    color: var(--text);
}
.modal-pedido-card .status-badge-lg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    margin-top: 8px;
}
.modal-pedido-card .status-badge-lg.ready {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
}

/* =============================================
   Etiqueta Config Dropdown
   ============================================= */
.etiqueta-config-dropdown {
    position: fixed;
    z-index: 1000;
    min-width: 280px;
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: 0;
}
.etiqueta-config-header {
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--border-1);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.etiqueta-canais-list {
    padding: 6px 0;
    max-height: 320px;
    overflow-y: auto;
}
.etiqueta-canal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    cursor: pointer;
    transition: background .15s;
    font-size: 13px;
}
.etiqueta-canal-item:hover {
    background: var(--bg-2);
}
.etiqueta-canal-name {
    font-weight: 500;
}
.toggle-switch-sm {
    transform: scale(.8);
    margin: 0;
}

/* =============================================
   Consulta View
   ============================================= */
.consulta-view .consulta-scanner-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.consulta-view .consulta-scanner-wrap .scanner-input {
    flex: 1;
}

/* =============================================
   Expedição em Massa — table rows
   ============================================= */
#exp-massa-content table tbody tr {
    transition: background .15s;
}
#exp-massa-content table tbody tr:hover {
    background: var(--bg-2);
}
