/* ===== ROOT VARIABLES ===== */
:root {
    --cgo-red: #E74C3C;
    --cgo-red-dark: #C0392B;
    --cgo-black: #111111;
    --cgo-dark: #1b1b1b;
    --cgo-charcoal: #252525;
    --bg-light: #f2f3f5;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --shadow-sm: 0 2px 10px rgba(17, 24, 39, 0.06);
    --shadow-md: 0 12px 30px rgba(17, 24, 39, 0.10);
    --radius: 14px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 82px;
    --navbar-height: 72px;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
}

/* ===== APP CONTAINER ===== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--cgo-black), var(--cgo-dark));
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1001;
    transition: width 0.25s ease, transform 0.3s ease;
    flex: 0 0 auto;
}

/* Centro de Operaciones */
.operations-center{display:grid;gap:1.25rem}.operations-header{margin-bottom:0}.operations-scope{align-items:center;background:#fff;border:1px solid var(--border-color);border-left:4px solid var(--primary-color);border-radius:var(--radius-md);color:var(--gray-600);display:flex;gap:.65rem;padding:.8rem 1rem}.operations-scope i{color:var(--primary-color)}
.operations-kpis{display:grid;gap:1rem;grid-template-columns:repeat(4,minmax(0,1fr))}.operation-kpi{align-items:center;background:#fff;border:1px solid var(--border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);color:var(--gray-900);display:flex;gap:.9rem;min-height:112px;padding:1rem;text-decoration:none;transition:.18s ease}.operation-kpi:hover{box-shadow:var(--shadow-md);color:var(--gray-900);transform:translateY(-2px)}.operation-kpi-icon{align-items:center;background:var(--gray-100);border-radius:12px;display:inline-flex;flex:0 0 44px;font-size:1.25rem;height:44px;justify-content:center}.operation-kpi>span:last-child{display:grid;min-width:0}.operation-kpi small{color:var(--gray-600);font-size:.72rem;font-weight:800;text-transform:uppercase}.operation-kpi strong{font-size:1.75rem;line-height:1.15}.operation-kpi em{color:var(--gray-500);font-size:.75rem;font-style:normal}.operation-kpi.is-critical{border-top:3px solid #b42318}.operation-kpi.is-critical .operation-kpi-icon{background:#fee4e2;color:#b42318}.operation-kpi.is-warning{border-top:3px solid #b54708}.operation-kpi.is-warning .operation-kpi-icon{background:#fef0c7;color:#b54708}.operation-kpi.is-success{border-top:3px solid #067647}.operation-kpi.is-success .operation-kpi-icon{background:#dcfae6;color:#067647}.operation-kpi.is-neutral{border-top:3px solid #475467}.operation-kpi.is-neutral .operation-kpi-icon{color:#344054}
.operations-grid{display:grid;gap:1.25rem;grid-template-columns:repeat(2,minmax(0,1fr))}.operations-panel{background:#fff;border:1px solid var(--border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);min-width:0;overflow:hidden}.operations-panel-header{align-items:flex-start;border-bottom:1px solid var(--border-color);display:flex;gap:1rem;justify-content:space-between;padding:1rem 1.15rem}.operations-panel-header>div{padding-left:1rem;position:relative}.operations-panel-header h2{font-size:1rem;font-weight:850;margin:0}.operations-panel-header p{color:var(--gray-500);font-size:.8rem;margin:.2rem 0 0}.operations-panel-header>a{color:var(--primary-color);flex:none;font-size:.8rem;font-weight:800;text-decoration:none}.status-dot{border-radius:50%;height:8px;left:0;position:absolute;top:.35rem;width:8px}.status-dot.critical{background:#d92d20}.status-dot.warning{background:#f79009}.operations-table{margin:0}.operations-table td,.operations-table th{padding:.8rem 1rem;vertical-align:middle}.operations-table td{font-size:.82rem}.operations-table td small{color:var(--gray-500);display:block}.operations-table a{color:var(--gray-900)}
.status-pill{background:var(--gray-100);border-radius:999px;color:var(--gray-700);display:inline-flex;font-size:.7rem;font-weight:800;padding:.28rem .55rem;white-space:nowrap}.status-pill.critical{background:#fee4e2;color:#b42318}.status-pill.warning{background:#fef0c7;color:#93370d}.status-pill.neutral{background:#f2f4f7;color:#344054}.scope-badge{background:#eaecf0;border-radius:999px;color:#344054;font-size:.65rem;margin-left:.35rem;padding:.2rem .45rem;text-transform:uppercase}.global-panel{border-left:3px solid #475467}.empty-state.compact{min-height:180px;padding:1.5rem}.empty-state.compact i{font-size:1.6rem}.empty-state.compact h3{font-size:.95rem;margin-top:.55rem}
@media(max-width:1199.98px){.operations-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:991.98px){.operations-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.operations-grid{grid-template-columns:1fr}}@media(max-width:575.98px){.operations-kpis{grid-template-columns:1fr}.operation-kpi{min-height:94px}.operations-panel-header{align-items:flex-start;flex-direction:column}}

@media (min-width: 1200px) {
    .app-container.sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed-width);
    }

    .app-container.sidebar-collapsed .sidebar-brand {
        justify-content: center;
        padding-inline: 14px;
    }

    .app-container.sidebar-collapsed .sidebar-brand > div,
    .app-container.sidebar-collapsed .nav-link span,
    .app-container.sidebar-collapsed .sidebar-footer {
        display: none;
    }

    .app-container.sidebar-collapsed .nav-link {
        justify-content: center;
        padding-inline: 10px;
    }

    .app-container.sidebar-collapsed .nav-link i {
        width: auto;
    }
}

@media (max-width: 1199px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
}

/* Brand Section */
.sidebar-brand {
    padding: 24px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.brand-icon {
    width: 46px;
    height: 46px;
    background: transparent;
    color: #f8fafc;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 18px;
    letter-spacing: -1px;
    box-shadow: none;
    flex-shrink: 0;
}

.brand-logo {
    object-fit: contain;
    padding: 0;
}

.sidebar-brand h2 {
    font-size: 17px;
    text-transform: none;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.sidebar-brand p {
    font-size: 12px;
    color: #a3a3a3;
    margin-top: 2px;
    line-height: 1.3;
}

.brand-version {
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Navigation Menu */
.sidebar-nav {
    flex: 1;
    padding: 16px 10px;
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 6px;
}

.nav-link {
    color: #b7b7b7;
    text-decoration: none;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.nav-link:hover {
    background: rgba(231, 76, 60, 0.09);
    color: #fff;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--cgo-red), #d74335);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.24);
}

.nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* Submenu Icon Rotation */
.submenu-icon {
    margin-left: auto;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.nav-link[aria-expanded="true"] .submenu-icon {
    transform: rotate(-180deg);
}

/* Submenu Styles */
.submenu {
    list-style: none;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-top: 6px;
    overflow: hidden;
}

.submenu-link {
    color: #a3a3a3;
    text-decoration: none;
    padding: 10px 12px 10px 44px;
    display: block;
    font-size: 13px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.submenu-link:hover {
    color: #fff;
    background: rgba(231, 76, 60, 0.09);
    border-left-color: var(--cgo-red);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 18px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #a3a3a3;
    font-size: 12px;
    text-align: center;
}

/* ===== SIDEBAR OVERLAY (MOBILE) ===== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    visibility: hidden;
}

.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

@media (max-width: 1199px) {
    .sidebar-overlay {
        display: block;
    }
}

@media (max-width: 1199px) {
    .sidebar-overlay {
        display: block;
    }
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-light);
}

/* ===== NAVBAR TOP ===== */
.navbar-top {
    background: var(--bg-white);
    height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.navbar-left h1 {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0;
    white-space: nowrap;
}

/* Hamburger Button */
.btn-hamburger {
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.btn-hamburger:hover {
    color: var(--cgo-red);
}

@media (max-width: 1199px) {
    .btn-hamburger {
        display: flex;
    }
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Navbar Items */
.navbar-item {
    position: relative;
}

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

.btn-icon:hover {
    color: var(--cgo-red);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--cgo-red);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* User Button */
.btn-user {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.btn-user:hover {
    background: rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cgo-black);
    color: var(--cgo-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-name {
    font-size: 14px;
    color: var(--text-dark);
    display: none;
}

@media (min-width: 768px) {
    .user-name {
        display: block;
    }
}

/* ===== CONTENT AREA ===== */
.content-area {
    flex: 1;
    overflow: auto;
    padding: 20px 20px 88px;
}

.content-footer {
    min-height: 48px;
    padding: 24px 0 env(safe-area-inset-bottom);
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

@media (min-width: 768px) {
    .content-area {
        padding: 24px;
    }
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, #121212 0%, #252525 70%, #3a2d05 100%);
    color: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.18);
}

.hero-header {
    position: relative;
    z-index: 1;
}

.hero-header h2 {
    font-size: 24px;
    margin-bottom: 4px;
    font-weight: 700;
}

.hero-header p {
    color: #d8d8d8;
    font-size: 13px;
    max-width: 760px;
}

/* ===== METRIC CARDS ===== */
.metric-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: all 0.2s ease;
    height: 100%;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--cgo-red);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.icon-yellow {
    background: rgba(231, 76, 60, 0.15);
    color: var(--cgo-red);
}

.icon-blue {
    background: rgba(37, 99, 235, 0.15);
    color: #2563eb;
}

.icon-green {
    background: rgba(22, 163, 74, 0.15);
    color: #16a34a;
}

.icon-red {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
}

.metric-value {
    font-size: 26px;
    font-weight: 900;
    margin: 0;
    letter-spacing: -1px;
}

.metric-note {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 3px;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius);
    border: none;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.alert i {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ===== SCROLLBAR CUSTOM ===== */
.sidebar::-webkit-scrollbar,
.content-area::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 250px;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        /* Debe permanecer sobre el overlay móvil para no bloquear enlaces. */
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .content-area {
        padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
    }
    
    .navbar-top {
        padding: 0 16px;
        gap: 8px;
    }

    .navbar-left {
        flex: 0 0 auto;
    }

    .navbar-left #page-title {
        display: none !important;
    }

    .navbar-right {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }

    .navbar-sucursal {
        flex: 1;
        min-width: 0;
    }

    .navbar-sucursal-form {
        width: 100%;
    }

    .navbar-sucursal-form label {
        display: none;
    }

    .navbar-sucursal-form .form-select {
        min-width: 0;
        width: 100%;
    }

    .navbar-right .btn-user {
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* ===== UTILITY CLASSES ===== */
.d-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-danger {
    color: #dc2626 !important;
}

.opacity-75 {
    opacity: 0.75;
}

/* ===== INVENTORY SCREENS ===== */
.inventory-page {
    max-width: 1500px;
    margin: 0 auto;
}

.inventory-hero {
    background: linear-gradient(135deg, #151515 0%, #2b2b2b 68%, #5a1712 100%);
    border-radius: var(--radius);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 22px;
    box-shadow: var(--shadow-md);
}

.inventory-eyebrow {
    color: #f2b8b1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.inventory-hero h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 4px;
}

.inventory-hero p {
    color: #d6d6d6;
    font-size: 14px;
    margin: 0;
    max-width: 720px;
}

.inventory-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.inventory-toolbar,
.inventory-panel,
.inventory-form-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.inventory-toolbar {
    margin-bottom: 18px;
    padding: 18px;
}

.inventory-toolbar .form-label,
.inventory-form-card .form-label {
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.input-icon {
    position: relative;
}

.input-icon i {
    color: var(--text-muted);
    left: 12px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.input-icon .form-control {
    padding-left: 38px;
}

.inventory-panel,
.inventory-form-card {
    overflow: hidden;
}

.inventory-panel-header,
.inventory-form-header {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
}

.inventory-panel-header h3,
.inventory-form-header h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 2px;
}

.inventory-panel-header p,
.inventory-form-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.inventory-panel-icon {
    align-items: center;
    background: rgba(231, 76, 60, 0.12);
    border-radius: 10px;
    color: var(--cgo-red);
    display: inline-flex;
    flex-shrink: 0;
    font-size: 20px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.inventory-table {
    --bs-table-hover-bg: #fff7f6;
    font-size: 14px;
}

.inventory-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    color: #374151;
    font-size: 11px;
    font-weight: 900;
    padding: 12px 16px;
    text-transform: uppercase;
    white-space: nowrap;
}

.inventory-table tbody td {
    border-bottom: 1px solid #eef0f3;
    padding: 14px 16px;
    vertical-align: middle;
}

.inventory-table-compact tbody td {
    padding-bottom: 11px;
    padding-top: 11px;
}

.code-pill,
.warehouse-pill,
.movement-pill,
.status-pill,
.stock-status {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.code-pill {
    background: #202020;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    padding: 7px 9px;
}

.warehouse-pill {
    background: #f3f4f6;
    border: 1px solid #d9dde3;
    color: #374151;
    font-size: 12px;
    padding: 7px 9px;
}

.movement-pill {
    background: rgba(231, 76, 60, 0.13);
    color: var(--cgo-red-dark);
    font-size: 11px;
    padding: 7px 9px;
}

.status-pill {
    font-size: 12px;
    padding: 7px 10px;
}

.status-pill-ok,
.stock-status-ok {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.status-pill-danger,
.stock-status-danger {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.stock-status-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.stock-status {
    font-size: 12px;
    padding: 8px 10px;
}

.table-main-text {
    color: var(--text-dark);
    font-weight: 700;
}

.table-muted,
.quantity-unit,
.dash-muted {
    color: var(--text-muted);
    font-size: 12px;
}

.table-subline {
    color: var(--text-muted);
    display: block;
    font-size: 11px;
    margin-top: 4px;
}

.quantity-value,
.quantity-warning {
    font-weight: 800;
}

.quantity-warning {
    color: #b45309;
}

.folio-text {
    color: #374151;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
}

.row-muted-danger td {
    background: #fff1f1;
}

.empty-state {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 46px 16px;
    text-align: center;
}

.empty-state i {
    color: #a8b0bd;
    font-size: 34px;
}

.empty-state strong {
    color: var(--text-dark);
    font-size: 16px;
}

.inventory-pagination {
    border-top: 1px solid var(--border-color);
    padding: 14px 18px;
}

.inventory-form-body {
    padding: 22px;
}

.form-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 18px;
    padding: 18px;
}

.form-section-title {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.form-section-title i {
    align-items: center;
    background: #f3f4f6;
    border-radius: 10px;
    color: var(--cgo-red);
    display: inline-flex;
    flex-shrink: 0;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.form-section-title h4 {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
}

.form-section-title p {
    color: var(--text-muted);
    font-size: 12px;
    margin: 2px 0 0;
}

.inventory-note {
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    padding: 12px 14px;
}

.inventory-note i {
    color: var(--cgo-red);
    margin-top: 2px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .inventory-hero,
    .inventory-panel-header,
    .inventory-form-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-hero-actions,
    .form-actions {
        justify-content: stretch;
        width: 100%;
    }

    .inventory-hero-actions .btn,
    .form-actions .btn,
    .form-actions button {
        width: 100%;
    }

    .inventory-hero h2 {
        font-size: 22px;
    }
}

/* Centro de Operaciones · segunda iteración visual */
.operations-center {
    gap: .9rem;
    padding-top: .25rem;
}

.operations-header {
    align-items: flex-start;
    background: linear-gradient(135deg, #191d22 0%, #2b3037 100%);
    border: 0;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .10);
    color: #fff;
    margin: 0;
    min-height: auto;
    padding: 1.05rem 1.25rem;
}

.operations-header .page-eyebrow { color: #f5aaa3; }
.operations-header .page-heading { color: #fff; font-size: clamp(1.35rem, 2.2vw, 1.85rem); margin-top: .1rem; }
.operations-header .page-description { color: #c8cdd4; margin-top: .25rem; }

.operations-scope {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .13);
    border-left: 2px solid #d45a4d;
    border-radius: 7px;
    color: #e5e7eb;
    display: inline-flex;
    font-size: .76rem;
    margin-top: .65rem;
    padding: .35rem .6rem;
}
.operations-scope i { color: #f0a39b; }

.operations-summary {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
    padding: .85rem;
}
.operations-summary.is-priority { border-color: #e7d4d1; }
.operations-summary.is-secondary { background: #f7f8f9; }

.operations-section-heading {
    align-items: end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: .7rem;
}
.operations-section-heading h2 { color: #20242a; font-size: 1rem; font-weight: 850; margin: 0; }
.operations-section-heading p { color: #737b86; font-size: .76rem; margin: 0; }
.operations-section-kicker { color: #9b3128; display: block; font-size: .62rem; font-weight: 850; letter-spacing: .08em; line-height: 1; margin-bottom: .24rem; text-transform: uppercase; }
.operations-detail-heading { border-top: 1px solid #dfe3e7; margin: .2rem 0 -.2rem; padding-top: .8rem; }
.secondary-detail-heading { margin-top: .35rem; }

.operations-kpis { gap: .7rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.operations-kpis-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.operation-kpi {
    border: 1px solid #e1e4e8;
    border-left: 3px solid #667085;
    border-radius: 9px;
    box-shadow: 0 2px 7px rgba(16, 24, 40, .04);
    gap: .7rem;
    min-height: 82px;
    padding: .72rem .8rem;
}
a.operation-kpi:focus-visible { box-shadow: 0 0 0 3px rgba(180, 35, 24, .18); outline: 2px solid #b42318; outline-offset: 2px; }
.operation-kpi-icon { border-radius: 9px; flex-basis: 38px; font-size: 1rem; height: 38px; }
.operation-kpi small { font-size: .66rem; letter-spacing: .02em; }
.operation-kpi strong { font-size: 1.45rem; }
.operation-kpi em { font-size: .68rem; line-height: 1.2; }
.operation-kpi.is-critical { border-left-color: #b42318; border-top: 1px solid #e1e4e8; }
.operation-kpi.is-warning { border-left-color: #b54708; border-top: 1px solid #e1e4e8; }
.operation-kpi.is-success { border-left-color: #067647; border-top: 1px solid #e1e4e8; }
.operation-kpi.is-neutral { border-left-color: #667085; border-top: 1px solid #e1e4e8; }
.operations-kpis-secondary .operation-kpi { background: #fff; box-shadow: none; opacity: .93; }

.operations-grid { gap: .9rem; }
.operations-grid.is-single { grid-template-columns: 1fr; }
.operations-panel { border-radius: 10px; box-shadow: 0 3px 10px rgba(16, 24, 40, .045); }
.operations-panel-header { align-items: center; min-height: 58px; padding: .72rem .9rem; }
.operations-panel-header h2 { font-size: .9rem; }
.operations-panel-header p { font-size: .72rem; }
.operations-panel-header > a { border-bottom: 1px solid transparent; font-size: .73rem; padding: .25rem 0; }
.operations-panel-header > a:hover { border-bottom-color: currentColor; }
.status-dot { height: 7px; top: .3rem; width: 7px; }
.status-dot.neutral { background: #667085; }
.operations-table td, .operations-table th { padding: .58rem .78rem; }
.operations-table th { font-size: .66rem; }
.operations-table td { font-size: .76rem; }
.operations-table tbody tr:last-child td { border-bottom: 0; }
.secondary-panel { border-left: 3px solid #667085; }
.global-panel { border-left-width: 3px; }

.empty-state.compact {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: .65rem;
    justify-content: flex-start;
    min-height: 0;
    padding: .85rem 1rem;
    text-align: left;
}
.empty-state.compact i { color: #667085; font-size: 1rem; margin: 0; }
.empty-state.compact h3 { font-size: .8rem; margin: 0; }
.empty-state.compact p { font-size: .7rem; margin: 0 0 0 auto; }

@media (max-width: 1199.98px) {
    .operations-kpis,
    .operations-kpis-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .operations-center { gap: .75rem; padding-inline: 0; }
    .operations-header { border-radius: 10px; padding: .9rem 1rem; }
    .operations-section-heading { align-items: flex-start; flex-direction: column; gap: .2rem; }
    .operations-summary { padding: .7rem; }
    .operations-kpis,
    .operations-kpis-secondary { grid-template-columns: 1fr; }
    .operation-kpi { min-height: 74px; }
    .operations-grid { grid-template-columns: 1fr; }
    .operations-panel-header { align-items: flex-start; flex-direction: row; }
    .operations-panel-header > a { min-height: 36px; padding: .45rem 0; }
    .empty-state.compact { align-items: flex-start; flex-wrap: wrap; }
    .empty-state.compact p { flex-basis: 100%; margin: -.35rem 0 0 1.65rem; }
    .operations-table { min-width: 620px; }
}

/* ===== MLCONTROL GLOBAL UI STANDARD ===== */
.navbar-top {
    min-height: var(--navbar-height);
    height: auto;
    padding: 0 24px;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
    position: relative;
    z-index: 990;
}

.navbar-title-group {
    min-width: 0;
}

.navbar-product {
    color: var(--text-muted);
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    line-height: 1.1;
    text-transform: uppercase;
}

.navbar-left .navbar-title-group h1 {
    font-size: 19px;
    letter-spacing: -0.01em;
    text-transform: none;
}

.btn-hamburger {
    align-items: center;
    background: #f7f7f8;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.content-area {
    padding: 16px 24px 88px;
}

.page-content,
.app-breadcrumb {
    margin-inline: auto;
    max-width: 1600px;
    width: 100%;
}

.app-breadcrumb {
    margin-bottom: 14px;
}

.app-breadcrumb .breadcrumb {
    align-items: center;
    font-size: 0.76rem;
}

.app-breadcrumb .breadcrumb-item,
.app-breadcrumb .breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.app-breadcrumb .breadcrumb-item a {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.app-breadcrumb .breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: 700;
}

.page-shell {
    margin: 0 auto;
    max-width: 1600px;
    width: 100%;
}

.page-header {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.page-header-copy {
    min-width: 0;
}

.page-eyebrow {
    align-items: center;
    color: var(--cgo-red-dark);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    gap: 7px;
    letter-spacing: 0.08em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.page-heading {
    color: #191b1f;
    font-size: clamp(1.45rem, 2.1vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 0;
}

.page-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 5px 0 0;
    max-width: 760px;
}

.page-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.surface-card,
.filter-card,
.form-card,
.table-card,
.card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.surface-card,
.filter-card,
.form-card,
.table-card {
    margin-bottom: 18px;
}

.filter-card {
    padding: 18px;
}

.filter-card .form-label,
.form-section .form-label {
    color: #4b5563;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.card-header,
.surface-card-header,
.table-card-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: 16px 18px;
}

.surface-card-header,
.table-card-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.surface-card-title,
.table-card-title {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.surface-card-subtitle,
.table-card-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 3px 0 0;
}

.card-body,
.surface-card-body,
.form-card-body {
    padding: 18px;
}

.form-control,
.form-select,
.input-group-text {
    border-color: #d9dde3;
    border-radius: 10px;
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(231, 76, 60, 0.72);
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.12);
}

.form-section {
    background: #fff;
    border-color: var(--border-color);
    padding: 20px;
}

.btn {
    align-items: center;
    border-radius: 10px;
    display: inline-flex;
    font-weight: 700;
    gap: 7px;
    justify-content: center;
    min-height: 40px;
    padding: 0.52rem 0.9rem;
}

.btn-sm {
    border-radius: 8px;
    min-height: 34px;
    padding: 0.36rem 0.68rem;
}

.btn-primary {
    --bs-btn-bg: var(--cgo-red);
    --bs-btn-border-color: var(--cgo-red);
    --bs-btn-hover-bg: var(--cgo-red-dark);
    --bs-btn-hover-border-color: var(--cgo-red-dark);
    --bs-btn-active-bg: #a93226;
    --bs-btn-active-border-color: #a93226;
}

.btn-secondary {
    --bs-btn-bg: #34383e;
    --bs-btn-border-color: #34383e;
    --bs-btn-hover-bg: #22252a;
    --bs-btn-hover-border-color: #22252a;
}

.btn-outline-primary {
    --bs-btn-color: var(--cgo-red-dark);
    --bs-btn-border-color: #e7aaa4;
    --bs-btn-hover-bg: var(--cgo-red);
    --bs-btn-hover-border-color: var(--cgo-red);
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 7px;
}

.dropdown-item {
    align-items: center;
    border-radius: 8px;
    display: flex;
    gap: 9px;
    padding: 0.55rem 0.7rem;
}

.table-responsive {
    border-radius: 0 0 var(--radius) var(--radius);
}

.data-table,
.table {
    --bs-table-hover-bg: #fbf5f4;
    margin-bottom: 0;
}

.data-table thead th,
.table thead th {
    background: #f7f8fa;
    border-bottom: 1px solid var(--border-color);
    color: #4b5563;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    padding: 12px 14px;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table tbody td,
.table tbody td {
    border-color: #eceef1;
    padding: 13px 14px;
    vertical-align: middle;
}

.empty-state {
    min-height: 180px;
    justify-content: center;
}

.empty-state-icon {
    align-items: center;
    background: #f1f2f4;
    border-radius: 50%;
    color: #737b87;
    display: inline-flex;
    font-size: 1.5rem;
    height: 54px;
    justify-content: center;
    margin-bottom: 4px;
    width: 54px;
}

.pagination {
    gap: 4px;
}

.pagination .page-link {
    border: 1px solid var(--border-color);
    border-radius: 8px !important;
    color: #34383e;
    min-width: 36px;
    text-align: center;
}

.pagination .page-item.active .page-link {
    background: #24272c;
    border-color: #24272c;
}

.actions-dropdown .dropdown-toggle::after {
    margin-left: 2px;
}

@media (min-width: 768px) {
    .content-area {
        padding: 18px 28px 88px;
    }
}

@media (max-width: 1199px) {
    body.sidebar-open {
        overflow: hidden;
    }
}

@media (max-width: 767.98px) {
    .navbar-top {
        min-height: 64px;
        padding-inline: 12px;
    }

    .navbar-product {
        display: none;
    }

    .content-area {
        padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
    }

    .app-breadcrumb {
        margin-bottom: 10px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .page-header,
    .surface-card-header,
    .table-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions,
    .page-actions > .btn,
    .page-actions > .dropdown,
    .page-actions > .dropdown > .btn {
        width: 100%;
    }

    .filter-card {
        padding: 14px;
    }

    .form-section,
    .card-body,
    .surface-card-body,
    .form-card-body {
        padding: 15px;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 720px;
    }

    .data-table .btn {
        white-space: nowrap;
    }

    .navbar-sucursal-form .form-select {
        font-size: 0.78rem;
    }
}
