/* GRUPO IMPOR — Sistema Central */

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --success: #0d9488;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #0f1117;
    --bg-card: #1a1d28;
    --bg-sidebar: #141620;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --border: #2d3348;
    --radius: 12px;
}

[data-theme="light"] {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --success: #0d9488;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --text: #1a1d28;
    --text-muted: #6b7280;
    --border: #e5e7eb;
}

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

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

/* ── Login ── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1117 0%, #1a1d28 100%);
}

.login-container { width: 100%; max-width: 420px; padding: 20px; }

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
}

.login-header p {
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── Buttons ── */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-full { width: 100%; padding: 14px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.error-msg {
    color: var(--danger);
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.empresa-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
}

.sidebar-menu {
    list-style: none;
    padding: 8px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px 9px 24px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu li a .menu-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: var(--text);
    background: rgba(26, 115, 232, 0.1);
    border-left-color: var(--primary);
}

.menu-group-label {
    padding: 14px 20px 4px 24px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.5;
}

.menu-group-label:first-child {
    padding-top: 6px;
}

.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 20px;
    opacity: 0.5;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.user-info {
    margin-bottom: 8px;
    font-size: 13px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary);
    border-radius: 12px;
    font-size: 11px;
    margin-left: 4px;
}

/* ── Main Content ── */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-sidebar);
}

.top-bar h1 {
    font-size: 20px;
    font-weight: 600;
    flex: 1;
}

.empresa-badge {
    padding: 6px 16px;
    background: rgba(26, 115, 232, 0.15);
    border: 1px solid var(--primary);
    border-radius: 20px;
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    margin-right: 16px;
}

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 32px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.btn-filter {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter:hover {
    border-color: var(--primary);
    color: var(--text);
}

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

/* ── Dashboard Grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 32px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: transform 0.2s, border-color 0.2s;
    min-width: 0;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.kpi-wide {
    grid-column: span 2;
}

.kpi-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.kpi-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.kpi-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.kpi-sub {
    margin-top: 8px;
    font-size: 13px;
    color: var(--warning);
}

.kpi-details {
    margin-top: 12px;
    display: flex;
    gap: 20px;
    font-size: 13px;
}

.kpi-positive { color: var(--success); }
.kpi-negative { color: var(--danger); }

/* ── Tables ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover {
    background: rgba(26, 115, 232, 0.05);
}

/* ── Status Badges ── */
.status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-pendiente { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-pagado { background: rgba(139, 92, 246, 0.18); color: #a78bfa; }
.status-recibido { background: rgba(26, 115, 232, 0.15); color: var(--primary); }
.status-completado { background: rgba(34, 197, 94, 0.18); color: #22c55e; }

.badge-success { background: rgba(34, 197, 94, 0.18); color: #22c55e; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.form-control {
    padding: 10px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
}
.form-control:focus { outline: none; border-color: var(--primary); }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.kpi-danger { border-color: var(--danger); }

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

/* ── Content Sections ── */
.content-section {
    padding: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

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

/* ── Top Bar Actions ── */
.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Botones de acción dentro de filas de tabla — compactos */
.tbl-action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    transition: all 0.15s;
}
.tbl-action-btn:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-1px);
}
.tbl-action-btn:disabled {
    opacity: 0.85;
}

.icon-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    position: relative;
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--primary);
}

.icon-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(26, 115, 232, 0.1);
}

.notif-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 300;
    display: none;
}

.notif-dropdown.open {
    display: block;
}

.notif-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.notif-item:hover {
    background: rgba(26, 115, 232, 0.05);
}

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

.notif-icon {
    margin-right: 8px;
}

.notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .dashboard-grid {
        padding: 16px;
    }
    .kpi-wide {
        grid-column: span 1;
    }
}


/* Ventas — KPIs Cartera/Dropi: grid horizontal (fix pantalla larga) */
.ventas-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.ventas-kpis .kpi-card {
    padding: 14px 16px;
}
.ventas-kpis .kpi-value {
    font-size: 22px;
}
.ventas-kpis .kpi-label {
    font-size: 12px;
}

/* ── Sidebar Overlay (mobile) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}
.sidebar-overlay.active {
    display: block;
}
@media (min-width: 769px) {
    .sidebar-overlay { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════════
   WMS COMPONENTS (Recepcion, Picking, Devoluciones, Bodegas, Compras nuevo)
   Agregado 2026-05-06 — usa las variables del ERP existente
   ═══════════════════════════════════════════════════════════════ */

/* ── Page header ── */
.wms-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.wms-page-header h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 4px 0;
    letter-spacing: -0.5px;
}
.wms-page-header .desc {
    font-size: 13px;
    color: var(--text-muted, var(--text-dim));
    margin: 0;
}

/* ── Stats grid ── */
.wms-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.wms-stat {
    background: var(--bg-card, var(--bg-2));
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
}
.wms-stat .label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted, var(--text-dim));
    font-weight: 700;
    margin-bottom: 4px;
}
.wms-stat .value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}
.wms-stat .value.green  { color: #10b981; }
.wms-stat .value.red    { color: #ef4444; }
.wms-stat .value.amber  { color: #f59e0b; }
.wms-stat .value.blue   { color: #3b82f6; }

/* ── Card ── */
.wms-card {
    background: var(--bg-card, var(--bg-2));
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
}
.wms-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.wms-card-header h2 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.wms-card-header .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Form fields (compatible con .field y .input ya existentes) ── */
.wms-form-grid {
    display: grid;
    gap: 10px;
}
.wms-form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.wms-form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) {
    .wms-form-grid.cols-2,
    .wms-form-grid.cols-3 { grid-template-columns: 1fr; }
}
.wms-field { display: flex; flex-direction: column; gap: 4px; }
.wms-field > label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted, var(--text-dim));
}

/* ── Inputs unificados (no chocan con .input del ERP) ── */
.wms-input, .wms-select, .wms-textarea {
    background: var(--bg, var(--bg-1));
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    width: 100%;
    transition: border-color 0.15s, background 0.15s;
}
.wms-input:focus, .wms-select:focus, .wms-textarea:focus {
    outline: none;
    border-color: var(--primary, #6366f1);
}
.wms-input.scanner {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
}

/* ── Table ── */
.wms-table-wrap {
    overflow-x: auto;
    border-radius: 6px;
}
.wms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.wms-table th, .wms-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.wms-table th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted, var(--text-dim));
    font-weight: 700;
    background: var(--bg-2, rgba(255,255,255,0.02));
}
.wms-table td.num, .wms-table th.num { text-align: right; }
.wms-table tr:hover td { background: rgba(99,102,241,0.04); }

/* ── Badges ── */
.wms-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wms-b-pendiente  { background: rgba(239,68,68,.15); color: #ef4444; }
.wms-b-abono      { background: rgba(245,158,11,.15); color: #f59e0b; }
.wms-b-pagado     { background: rgba(59,130,246,.15); color: #3b82f6; }
.wms-b-recibido   { background: rgba(16,185,129,.15); color: #10b981; }
.wms-b-completado { background: rgba(99,102,241,.15); color: #6366f1; }
.wms-b-confirmar  { background: rgba(168,85,247,.15); color: #a855f7; }

.wms-tipo-PRINCIPAL    { background: rgba(99,102,241,.15); color: #6366f1; }
.wms-tipo-SUCURSAL     { background: rgba(59,130,246,.15); color: #3b82f6; }
.wms-tipo-DROPSHIP     { background: rgba(245,158,11,.15); color: #f59e0b; }
.wms-tipo-TRANSITO     { background: rgba(168,85,247,.15); color: #a855f7; }
.wms-tipo-DEVOLUCIONES { background: rgba(239,68,68,.15); color: #ef4444; }

/* ── Modal ── */
.wms-modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 20px;
    overflow-y: auto;
}
.wms-modal-bg.open { display: flex; }
.wms-modal {
    background: var(--bg-card, var(--bg-2));
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.wms-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.wms-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.wms-modal-close {
    background: transparent;
    border: 0;
    color: var(--text-muted, var(--text-dim));
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
}
.wms-modal-body { padding: 16px 20px; }
.wms-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

/* ── Mode tabs (para Recepcion: Libre / Desde compra) ── */
.wms-mode-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 14px;
}
.wms-mode-btn {
    padding: 10px 18px;
    background: transparent;
    border: 0;
    color: var(--text-muted, var(--text-dim));
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    margin-bottom: -2px;
}
.wms-mode-btn.active {
    color: var(--primary, #6366f1);
    border-bottom-color: var(--primary, #6366f1);
}
.wms-mode-pane { display: none; }
.wms-mode-pane.active { display: block; }

/* ── Tabs internos (modal detalle compras) ── */
.wms-tabs-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}
.wms-tab-btn {
    padding: 8px 14px;
    background: transparent;
    border: 0;
    color: var(--text-muted, var(--text-dim));
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.wms-tab-btn.active {
    color: var(--primary, #6366f1);
    border-bottom-color: var(--primary, #6366f1);
}
.wms-tab-content { display: none; }
.wms-tab-content.active { display: block; }

/* ── Toast ── */
.wms-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}
.wms-toast {
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--bg-card, var(--bg-2));
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    font-size: 13px;
    animation: wms-toast-in 0.2s ease;
}
.wms-toast.success { border-left: 4px solid #10b981; }
.wms-toast.error   { border-left: 4px solid #ef4444; }
.wms-toast.info    { border-left: 4px solid #3b82f6; }
@keyframes wms-toast-in {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ── Helpers ── */
.wms-flex { display: flex; }
.wms-gap-1 { gap: 4px; }
.wms-gap-2 { gap: 8px; }
.wms-gap-3 { gap: 12px; }
.wms-mt-1 { margin-top: 6px; }
.wms-mt-2 { margin-top: 10px; }
.wms-mt-3 { margin-top: 14px; }
.wms-mb-2 { margin-bottom: 10px; }
.wms-mb-3 { margin-bottom: 14px; }
.wms-text-center { text-align: center; }
.wms-text-right { text-align: right; }
.wms-text-mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }
.wms-text-dim { color: var(--text-muted, var(--text-dim)); }
.wms-hidden { display: none !important; }

/* ── Compra-pendiente card (para recepcion-desde-compra) ── */
.wms-compra-pendiente {
    padding: 10px 14px;
    background: var(--bg, var(--bg-1));
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all .15s;
}
.wms-compra-pendiente:hover {
    border-color: var(--primary, #6366f1);
    background: var(--bg-2, rgba(99,102,241,0.04));
}
.wms-compra-pendiente.selected {
    border-color: var(--primary, #6366f1);
    background: rgba(99,102,241,0.1);
}

/* ── Item-row (modal nueva compra) ── */
.wms-item-row {
    display: grid;
    grid-template-columns: 1fr 80px 110px 90px 36px;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.wms-item-row:last-child { border: 0; }

/* ── IMPORSHOP_ONLY: ocultar selector de empresa ── */
body.imporshop-only #empresaSelector {
    display: none !important;
}
body.imporshop-only .sidebar-header {
    padding-bottom: 12px;
}


/* ── WMS tiles para dashboard minimalista IMPORSHOP ── */
.wms-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.wms-tile {
    background: var(--bg-card, var(--bg-2));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all 0.15s;
    color: var(--text);
    text-decoration: none;
}
.wms-tile:hover {
    border-color: var(--primary, #6366f1);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.wms-tile .wms-tile-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
}
.wms-tile .wms-tile-info { flex: 1; min-width: 0; }
.wms-tile .wms-tile-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.wms-tile .wms-tile-desc {
    font-size: 12px;
    color: var(--text-muted, var(--text-dim));
    line-height: 1.4;
}

/* ── Sidebar section labels (IMPORSHOP) ── */
.menu-section-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted, #6B7A8C);
    padding: 14px 22px 6px;
    text-transform: uppercase;
}

/* ── IMPORSHOP overrides: limpieza visual modulos heredados del ERP ── */
body.imporshop-strict .top-bar,
body.imporshop-strict .main-content > .top-bar,
body.imporshop-strict main.main-content > header.top-bar { display: none !important; }
body.imporshop-strict #wmsImporshopHidden { display: none !important; }

/* ── IMPORSHOP page title (header consistente en todos los modulos) ── */
.imp-page-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg, transparent);
}
.imp-page-title h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
}
.imp-page-title .desc {
    font-size: 13px;
    color: var(--text-muted, var(--text-dim));
    margin-top: 2px;
}
.imp-page-title .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
@media (max-width: 768px) {
    .imp-page-title { padding: 14px 14px 10px; }
    .imp-page-title h1 { font-size: 18px; }
    .imp-page-title .desc { font-size: 12px; }
}

/* ── IMPORSHOP overrides v2 (safe): solo lo pedido especificamente ── */

/* COMPRAS: ocultar funcionalidades que no aplican a operativo IMPORSHOP */
body.imporshop-strict #btnNuevaImport,
body.imporshop-strict #btnNuevaImportTab,
body.imporshop-strict #tabBtnImport,
body.imporshop-strict #pageTabBtnImportaciones,
body.imporshop-strict #pageTabBtnPapelera,
body.imporshop-strict #pageTabBtnAuditoria { display: none !important; }
