/* CONTRIX ERP Premium Visual Layer - 2026-10-09
   Scope intentionally limited to ERP-standard containers and the ERP navigation section.
   No business rules, calculations, persistence or Store workflows are changed. */

:root {
    --erp-premium-blue: #2563eb;
    --erp-premium-blue-dark: #1d4ed8;
    --erp-premium-navy: #0f2747;
    --erp-premium-text: #172033;
    --erp-premium-muted: #6b7b94;
    --erp-premium-border: #dfe7f3;
    --erp-premium-surface: #ffffff;
    --erp-premium-bg: #f6f8fc;
    --erp-premium-green: #10b981;
    --erp-premium-amber: #f59e0b;
    --erp-premium-red: #ef4444;
    --erp-premium-purple: #8b5cf6;
}

body.cx-admin-body .erp-page {
    gap: 18px;
    color: var(--erp-premium-text);
}

body.cx-admin-body .erp-page > .erp-hero,
body.cx-admin-body .erp-page > .erp-panel,
body.cx-admin-body .erp-page > .erp-kpi-grid,
body.cx-admin-body .erp-page > .erp-premium-module-layout,
body.cx-admin-body .erp-page > .erp-premium-grid {
    width: 100%;
}

body.cx-admin-body .erp-hero {
    position: relative;
    overflow: hidden;
    min-height: 150px;
    padding: 28px 30px;
    border: 1px solid #dbe7f7;
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 12%, rgba(96, 165, 250, .22), transparent 28%),
        radial-gradient(circle at 82% 92%, rgba(45, 212, 191, .10), transparent 24%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 60%, #eef6ff 100%);
    box-shadow: 0 16px 45px rgba(28, 52, 84, .07);
}

body.cx-admin-body .erp-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -95px;
    bottom: -145px;
    border: 42px solid rgba(37, 99, 235, .05);
    border-radius: 50%;
    pointer-events: none;
}

body.cx-admin-body .erp-hero h2 {
    margin-top: 10px;
    margin-bottom: 8px;
    color: #172033;
    font-size: clamp(1.7rem, 2.3vw, 2.25rem);
    line-height: 1.05;
}

body.cx-admin-body .erp-hero p {
    max-width: 840px;
    color: #70819a;
    font-size: .97rem;
}

body.cx-admin-body .erp-eyebrow {
    border: 1px solid #dbeafe;
    background: #eef5ff;
    color: #2358c4;
}

.erp-premium-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 18px;
    align-items: center;
}

.erp-premium-hero-icon,
.erp-premium-module-icon,
.erp-kpi-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(145deg, #eef6ff, #dcecff);
    color: #1d66dc;
    font-size: 1.6rem;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .06);
}

.erp-premium-hero-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    font-size: 1.85rem;
}

.erp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.erp-kpi-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--erp-premium-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 39, 71, .045);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.erp-kpi-card.green .erp-kpi-icon { background: #eafaf3; color: #0f9b68; }
.erp-kpi-card.purple .erp-kpi-icon { background: #f3edff; color: #7c3aed; }
.erp-kpi-card.amber .erp-kpi-icon { background: #fff6df; color: #d88a00; }
.erp-kpi-card.slate .erp-kpi-icon { background: #edf2f7; color: #52657f; }
.erp-kpi-copy { min-width: 0; }
.erp-kpi-copy small { display: block; color: #74839a; font-size: .74rem; font-weight: 700; }
.erp-kpi-copy strong { display: block; margin-top: 4px; color: #172033; font-size: clamp(1.3rem, 1.8vw, 1.75rem); font-weight: 900; line-height: 1.1; word-break: break-word; }
.erp-kpi-copy span { display: block; margin-top: 5px; color: #91a0b4; font-size: .68rem; }

body.cx-admin-body .erp-panel {
    border: 1px solid var(--erp-premium-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(15, 39, 71, .045);
}

body.cx-admin-body .erp-panel-head {
    padding: 18px 20px;
    border-bottom: 1px solid #edf1f7;
}

body.cx-admin-body .erp-panel-head h3 {
    color: #1a2538;
    font-size: 1.1rem;
}

body.cx-admin-body .erp-panel-body {
    padding: 20px;
}

.erp-premium-module-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
}

.erp-premium-module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.erp-premium-module-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 13px;
    align-items: start;
    min-width: 0;
    padding: 18px;
    border: 1px solid #e2e9f3;
    border-radius: 16px;
    color: inherit;
    background: #fff;
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.erp-premium-module-card:hover {
    transform: translateY(-2px);
    border-color: #b9d2fa;
    box-shadow: 0 12px 25px rgba(37, 99, 235, .08);
    color: inherit;
}

.erp-premium-module-card h4 { margin: 1px 0 5px; color: #1c273a; font-size: .93rem; font-weight: 800; }
.erp-premium-module-card p { margin: 0; color: #73839a; font-size: .78rem; line-height: 1.45; }
.erp-premium-module-arrow { color: #6681a8; font-size: 1.3rem; line-height: 1; }
.erp-premium-module-icon.green { background: #eafaf3; color: #0f9b68; }
.erp-premium-module-icon.purple { background: #f3edff; color: #7c3aed; }
.erp-premium-module-icon.amber { background: #fff4dc; color: #db8b00; }
.erp-premium-module-icon.red { background: #fff0f1; color: #e23c58; }
.erp-premium-module-icon.teal { background: #e9fbf9; color: #0f948e; }

.erp-premium-quick-actions {
    overflow: hidden;
    border: 1px solid #dbe7f7;
    border-radius: 18px;
    background: linear-gradient(180deg, #eff6ff, #f8fbff);
}
.erp-premium-quick-actions h3 { margin: 0; padding: 17px 18px 11px; color: #1d2a3e; font-size: 1rem; font-weight: 900; }
.erp-premium-quick-actions a { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 12px 8px; padding: 12px 13px; border: 1px solid #e1e8f2; border-radius: 12px; background: #fff; color: #32435d; text-decoration: none; font-size: .82rem; font-weight: 650; }
.erp-premium-quick-actions a:hover { border-color: #b8d1f8; color: #1d4ed8; }

.erp-premium-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
    gap: 16px;
}

.erp-filter-bar {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}
.erp-filter-bar > * { min-width: 0; }
.erp-filter-span-2 { grid-column: span 2; }
.erp-filter-span-3 { grid-column: span 3; }
.erp-filter-span-4 { grid-column: span 4; }
.erp-filter-actions { grid-column: span 2; display: flex; gap: 8px; flex-wrap: wrap; }

body.cx-admin-body .erp-page .form-label {
    margin-bottom: 7px;
    color: #334155;
    font-size: .78rem;
    font-weight: 800;
}
body.cx-admin-body .erp-page :is(.form-control, .form-select) {
    min-height: 46px;
    border: 1px solid #d9e3f0;
    border-radius: 12px;
    color: #334155;
    background-color: #fff;
    box-shadow: none;
}
body.cx-admin-body .erp-page :is(.form-control, .form-select):focus {
    border-color: #75a7f4;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .11);
}
body.cx-admin-body .erp-page textarea.form-control { min-height: 110px; }

body.cx-admin-body .erp-page .btn {
    min-height: 42px;
    padding: .55rem .95rem;
    border-radius: 11px;
    font-weight: 750;
}
body.cx-admin-body .erp-page .btn-primary {
    border-color: var(--erp-premium-blue);
    background: linear-gradient(180deg, #2d6df0, #2460dc);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}
body.cx-admin-body .erp-page .btn-primary:hover { border-color: #1d4ed8; background: #1f59d3; }

body.cx-admin-body .erp-page .table-responsive {
    border-radius: 14px;
}
body.cx-admin-body .erp-page .table {
    margin-bottom: 0;
    color: #34445b;
    font-size: .82rem;
}
body.cx-admin-body .erp-page .table > :not(caption) > * > * {
    padding: .82rem .85rem;
    border-bottom-color: #edf1f6;
    vertical-align: middle;
}
body.cx-admin-body .erp-page .table thead th {
    border-top: 0;
    border-bottom: 1px solid #dfe7f2;
    background: #f6f8fb;
    color: #5d6c84;
    font-size: .69rem;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
}
body.cx-admin-body .erp-page .table tbody tr:hover { background: #fbfdff; }
body.cx-admin-body .erp-page .table caption { padding: 12px 2px 0; color: #8796aa; font-size: .74rem; }

.erp-state-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef2f7;
    color: #5d6c82;
    font-size: .7rem;
    font-weight: 800;
}
.erp-state-pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: #94a3b8; }
.erp-state-pill.success { background: #e9f9f1; color: #087a50; }
.erp-state-pill.success::before { background: #18a66c; }
.erp-state-pill.warning { background: #fff6df; color: #9a6400; }
.erp-state-pill.warning::before { background: #f2ad15; }
.erp-state-pill.danger { background: #fff0f1; color: #b42339; }
.erp-state-pill.danger::before { background: #ef4a61; }
.erp-state-pill.info { background: #eaf3ff; color: #235dc5; }
.erp-state-pill.info::before { background: #4383ea; }

.erp-empty-state {
    padding: 48px 20px;
    text-align: center;
    color: #8190a6;
}
.erp-empty-state strong { display: block; margin-bottom: 6px; color: #3b4b62; font-size: .95rem; }

.erp-form-shell { max-width: 1100px; margin-inline: auto; }
.erp-form-card { border: 1px solid var(--erp-premium-border); border-radius: 20px; background: #fff; box-shadow: 0 12px 35px rgba(15, 39, 71, .045); }
.erp-form-card-head { padding: 20px 22px; border-bottom: 1px solid #edf1f6; }
.erp-form-card-head h3 { margin: 0 0 5px; font-size: 1.12rem; font-weight: 900; color: #1d293b; }
.erp-form-card-head p { margin: 0; color: #7b8aa0; font-size: .83rem; }
.erp-form-card-body { padding: 22px; }
.erp-form-actions { display: flex; gap: 9px; flex-wrap: wrap; padding-top: 18px; }

/* ERP navigation only. Tienda keeps its own visual behavior. */
#cx-nav-erp .cx-menu-group > summary {
    min-height: 48px;
    margin-bottom: 3px;
    border: 1px solid transparent;
    border-radius: 12px;
}
#cx-nav-erp .cx-menu-group[open] > summary {
    border-color: rgba(255,255,255,.05);
    background: linear-gradient(90deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
}
#cx-nav-erp .cx-menu-items {
    gap: 3px;
    margin-left: 23px;
    padding-left: 12px;
    border-left-color: rgba(148, 163, 184, .18);
}
#cx-nav-erp .cx-menu-link {
    min-height: 40px;
    padding: 10px 11px;
    border-radius: 10px;
}
#cx-nav-erp .cx-menu-link.active {
    background: linear-gradient(90deg, #2c5da3, #315f9f);
    box-shadow: inset 3px 0 #7eb7ff, 0 7px 15px rgba(0,0,0,.08);
}

@media (max-width: 1200px) {
    .erp-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .erp-premium-module-layout, .erp-premium-grid { grid-template-columns: 1fr; }
    .erp-premium-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .erp-filter-span-2, .erp-filter-span-3, .erp-filter-span-4, .erp-filter-actions { grid-column: span 4; }
}

@media (max-width: 767.98px) {
    body.cx-admin-body .erp-hero { padding: 20px; border-radius: 18px; }
    .erp-premium-hero-inner { align-items: flex-start; }
    .erp-premium-hero-icon { width: 54px; height: 54px; border-radius: 14px; }
    .erp-kpi-grid, .erp-premium-module-grid { grid-template-columns: 1fr; }
    .erp-filter-bar { grid-template-columns: 1fr; }
    .erp-filter-span-2, .erp-filter-span-3, .erp-filter-span-4, .erp-filter-actions { grid-column: auto; }
    .erp-filter-actions > * { flex: 1 1 auto; }
    .erp-kpi-card { padding: 15px; }
    body.cx-admin-body .erp-panel-body { padding: 15px; }
    .erp-premium-module-card { padding: 15px; }
}
