/* CONTRIX · Producción y logística
   Capa visual únicamente. No modifica reglas de negocio ni comportamiento de los formularios. */

#cx-group-operations {
    margin-top: 6px;
    border: 1px solid rgba(96, 165, 250, .10);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(37, 99, 235, .055), rgba(15, 23, 42, 0));
}

#cx-group-operations > summary {
    min-height: 54px;
    border-radius: 13px;
}

#cx-group-operations[open] > summary {
    background: rgba(255, 255, 255, .045);
}

#cx-group-operations .cx-menu-items {
    padding: 2px 8px 10px 24px;
    border-left-color: rgba(96, 165, 250, .22);
}

#cx-group-operations .cx-menu-link {
    min-height: 43px;
    margin: 3px 0;
    padding: 10px 12px;
    border-radius: 11px;
    transition: background .18s ease, transform .18s ease, color .18s ease;
}

#cx-group-operations .cx-menu-link:hover {
    transform: translateX(2px);
    background: rgba(96, 165, 250, .09);
}

#cx-group-operations .cx-menu-link.active {
    box-shadow: inset 3px 0 0 #93c5fd, 0 8px 22px rgba(37, 99, 235, .14);
}

.cx-operations-page {
    --ops-blue: #2563eb;
    --ops-blue-2: #3b82f6;
    --ops-ink: #172033;
    --ops-muted: #64748b;
    --ops-line: #e5eaf1;
    --ops-soft: #f7f9fc;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cx-ops-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 25px 27px;
    border: 1px solid #dce5f1;
    border-radius: 22px;
    background:
        radial-gradient(circle at 87% 10%, rgba(16, 185, 129, .11), transparent 24%),
        radial-gradient(circle at 70% 100%, rgba(37, 99, 235, .12), transparent 27%),
        linear-gradient(135deg, #ffffff 0%, #f9fbff 64%, #eef5ff 100%);
    box-shadow: 0 16px 42px rgba(15, 23, 42, .055);
}

.cx-ops-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -100px;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(37, 99, 235, .10);
    border-radius: 50%;
    pointer-events: none;
}

.cx-ops-hero-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.cx-ops-icon {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: #1d4ed8;
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    border: 1px solid #d8e8ff;
    font-size: 1.55rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.cx-ops-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
    color: #2563eb;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.cx-ops-hero h2 {
    margin: 0 0 6px;
    color: var(--ops-ink);
    font-size: clamp(1.55rem, 2.3vw, 2.15rem);
    font-weight: 900;
    letter-spacing: -.025em;
}

.cx-ops-hero p {
    max-width: 820px;
    margin: 0;
    color: var(--ops-muted);
    line-height: 1.6;
}

.cx-ops-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cx-ops-actions .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 800;
    padding-inline: 16px;
}

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

.cx-ops-kpi {
    min-height: 118px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 16px 17px;
    border: 1px solid var(--ops-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15,23,42,.045);
}

.cx-ops-kpi-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.25rem;
}

.cx-ops-kpi.green .cx-ops-kpi-icon { background: #ecfdf5; color: #059669; }
.cx-ops-kpi.amber .cx-ops-kpi-icon { background: #fff7ed; color: #d97706; }
.cx-ops-kpi.violet .cx-ops-kpi-icon { background: #f5f3ff; color: #7c3aed; }
.cx-ops-kpi.slate .cx-ops-kpi-icon { background: #f1f5f9; color: #475569; }

.cx-ops-kpi small {
    display: block;
    margin-bottom: 4px;
    color: #7c8aa0;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.25;
}

.cx-ops-kpi strong {
    display: block;
    color: var(--ops-ink);
    font-size: clamp(1.32rem, 2vw, 1.75rem);
    font-weight: 900;
    line-height: 1.05;
    word-break: break-word;
}

.cx-ops-kpi span {
    display: block;
    margin-top: 5px;
    color: #94a3b8;
    font-size: .72rem;
}

.cx-ops-panel {
    overflow: hidden;
    border: 1px solid var(--ops-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15,23,42,.045);
}

.cx-ops-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #eef2f7;
}

.cx-ops-panel-head h3 {
    margin: 0;
    color: var(--ops-ink);
    font-size: 1.08rem;
    font-weight: 900;
}

.cx-ops-panel-head p {
    margin: 5px 0 0;
    color: var(--ops-muted);
    font-size: .9rem;
    line-height: 1.5;
}

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

.cx-ops-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(125px, .7fr)) auto;
    gap: 12px;
    align-items: end;
}

.cx-ops-filter-grid.simple {
    grid-template-columns: minmax(220px, 1fr) auto;
}

.cx-ops-filter-grid .form-label,
.cx-ops-form-grid .form-label {
    margin-bottom: 6px;
    color: #475569;
    font-size: .76rem;
    font-weight: 800;
}

.cx-operations-page .form-control,
.cx-operations-page .form-select {
    min-height: 43px;
    border-color: #dce3ed;
    border-radius: 11px;
    background-color: #fff;
    color: #1e293b;
    box-shadow: none;
}

.cx-operations-page .form-control:focus,
.cx-operations-page .form-select:focus {
    border-color: #93b8ff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}

.cx-ops-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0,1fr));
    gap: 14px;
}

.cx-ops-table-wrap {
    overflow-x: auto;
}

.cx-operations-page .cx-ops-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.cx-operations-page .cx-ops-table thead th {
    padding: 12px 14px;
    border-bottom: 1px solid #dde5ef;
    background: #f8fafc;
    color: #64748b;
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cx-operations-page .cx-ops-table tbody td,
.cx-operations-page .cx-ops-table tbody th {
    padding: 13px 14px;
    border-bottom: 1px solid #eef2f6;
    color: #334155;
    vertical-align: middle;
}

.cx-operations-page .cx-ops-table tbody tr:hover {
    background: #fbfdff;
}

.cx-operations-page .cx-ops-table tbody tr:last-child td,
.cx-operations-page .cx-ops-table tbody tr:last-child th {
    border-bottom: 0;
}

.cx-ops-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    color: #475569;
    background: #f1f5f9;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

.cx-ops-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
}

.cx-ops-status.success { color: #047857; background: #ecfdf5; }
.cx-ops-status.success::before { background: #10b981; }
.cx-ops-status.info { color: #1d4ed8; background: #eff6ff; }
.cx-ops-status.info::before { background: #3b82f6; }
.cx-ops-status.warning { color: #a16207; background: #fffbeb; }
.cx-ops-status.warning::before { background: #f59e0b; }
.cx-ops-status.danger { color: #b91c1c; background: #fef2f2; }
.cx-ops-status.danger::before { background: #ef4444; }

.cx-ops-progress {
    width: 120px;
    max-width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf2f7;
}

.cx-ops-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.cx-ops-empty {
    padding: 42px 20px !important;
    color: #94a3b8 !important;
    text-align: center;
}

.cx-ops-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f8fbff;
    color: #475569;
}

.cx-ops-callout strong { color: #1e3a8a; }

.cx-ops-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
}

.cx-ops-detail {
    padding: 15px;
    border: 1px solid #e7ecf3;
    border-radius: 14px;
    background: #fbfcfe;
}

.cx-ops-detail small {
    display: block;
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: .68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cx-ops-detail strong {
    color: #1e293b;
    font-size: .95rem;
}

.cx-ops-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.cx-ops-note {
    color: #7c8aa0;
    font-size: .78rem;
    line-height: 1.55;
}

@media (max-width: 1180px) {
    .cx-ops-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .cx-ops-filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .cx-ops-detail-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 720px) {
    .cx-operations-page { gap: 13px; }
    .cx-ops-hero { padding: 19px; align-items: flex-start; flex-direction: column; border-radius: 17px; }
    .cx-ops-hero-main { align-items: flex-start; }
    .cx-ops-icon { width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; }
    .cx-ops-actions { width: 100%; justify-content: stretch; }
    .cx-ops-actions .btn { flex: 1 1 auto; }
    .cx-ops-kpis { grid-template-columns: 1fr; }
    .cx-ops-kpi { min-height: 98px; }
    .cx-ops-panel-head { padding: 16px; }
    .cx-ops-panel-body { padding: 16px; }
    .cx-ops-filter-grid,
    .cx-ops-filter-grid.simple { grid-template-columns: 1fr; }
    .cx-ops-detail-grid { grid-template-columns: 1fr; }
    #cx-group-operations .cx-menu-items { padding-left: 18px; }
}

.cx-operations-page > .erp-hero {
    position: relative;
    overflow: hidden;
    padding: 24px 26px;
    border-color: #dce5f1;
    border-radius: 22px;
    background:
        radial-gradient(circle at 88% 16%, rgba(16,185,129,.10), transparent 25%),
        radial-gradient(circle at 72% 100%, rgba(37,99,235,.10), transparent 28%),
        linear-gradient(135deg, #fff 0%, #f9fbff 64%, #eef5ff 100%);
    box-shadow: 0 16px 42px rgba(15,23,42,.055);
}

.cx-operations-page > .erp-hero h2 {
    color: #172033;
    font-size: clamp(1.55rem, 2.3vw, 2.1rem);
    letter-spacing: -.02em;
}

.cx-operations-page > .erp-panel {
    border-color: #e5eaf1;
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(15,23,42,.045);
}

@media (max-width: 720px) {
    .cx-ops-form-grid {
        grid-template-columns: 1fr;
    }

    .cx-ops-form-grid > * {
        grid-column: 1 !important;
    }
}

/* === CONTRIX · Refresh visual producción/logística/compras sugeridas === */
.cx-ops-hero {
    padding: 30px 32px;
    border-radius: 24px;
}

.cx-ops-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,.36), rgba(255,255,255,0));
    pointer-events: none;
}

.cx-ops-hero-main > div:last-child {
    min-width: 0;
}

.cx-ops-actions {
    align-items: center;
}

.cx-ops-actions .btn-primary {
    box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

.cx-ops-hero-pills,
.cx-ops-panel-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cx-ops-pill,
.cx-ops-metric-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 31px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #dce5f1;
    background: rgba(255,255,255,.82);
    color: #475569;
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.cx-ops-pill b,
.cx-ops-metric-tag b {
    color: #0f172a;
    font-weight: 900;
}

.cx-ops-kpi {
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.cx-ops-kpi::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(37,99,235,.82), rgba(59,130,246,.24));
}

.cx-ops-kpi.green::after { background: linear-gradient(90deg, rgba(5,150,105,.82), rgba(16,185,129,.24)); }
.cx-ops-kpi.amber::after { background: linear-gradient(90deg, rgba(217,119,6,.82), rgba(245,158,11,.24)); }
.cx-ops-kpi.violet::after { background: linear-gradient(90deg, rgba(124,58,237,.82), rgba(139,92,246,.24)); }
.cx-ops-kpi.slate::after { background: linear-gradient(90deg, rgba(71,85,105,.82), rgba(148,163,184,.24)); }

.cx-ops-kpi:hover {
    transform: translateY(-2px);
    border-color: #d4deea;
    box-shadow: 0 16px 36px rgba(15,23,42,.07);
}

.cx-ops-panel {
    border-radius: 22px;
}

.cx-ops-panel-head {
    background: linear-gradient(180deg, rgba(248,250,252,.9), rgba(255,255,255,1));
}

.cx-ops-panel-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.cx-ops-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid #dbe7ff;
    font-size: .76rem;
    font-weight: 900;
}

.cx-ops-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
}

.cx-ops-toolbar .text-muted {
    font-size: .82rem;
}

.cx-ops-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cx-ops-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.cx-ops-inline-card {
    padding: 16px 17px;
    border: 1px solid #e7edf6;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.cx-ops-inline-card h4 {
    margin: 0 0 4px;
    color: #172033;
    font-size: .96rem;
    font-weight: 900;
}

.cx-ops-inline-card p {
    margin: 0;
    color: #64748b;
    font-size: .83rem;
    line-height: 1.55;
}

.cx-ops-form-section-title {
    margin: 0 0 12px;
    color: #1e293b;
    font-size: .9rem;
    font-weight: 900;
}

.cx-ops-form-grid.two-up {
    grid-template-columns: repeat(2, minmax(0,1fr));
}

.cx-ops-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 4px;
}

.cx-ops-checkbox-stack {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cx-ops-checkbox-stack .form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 0;
}

.cx-ops-checkbox-stack .form-check-label {
    color: #334155;
    font-weight: 700;
}

.cx-ops-table-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 16px;
}

.cx-ops-table-caption {
    color: #64748b;
    font-size: .82rem;
}

.cx-ops-table tbody td strong,
.cx-ops-table tbody th strong {
    color: #0f172a;
}

.cx-ops-table tbody td .small,
.cx-ops-table tbody td .text-muted.small {
    line-height: 1.45;
}

.cx-ops-row-highlight {
    padding: 3px 10px;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: .72rem;
    font-weight: 800;
}

.cx-ops-empty-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 210px;
    padding: 28px 20px;
    text-align: center;
    color: #94a3b8;
}

.cx-ops-empty-state .icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 1.4rem;
}

.cx-ops-empty-state strong {
    color: #1e293b;
    font-size: 1rem;
}

.cx-ops-highlight-box {
    padding: 16px 18px;
    border: 1px dashed #d9e5f5;
    border-radius: 16px;
    background: linear-gradient(180deg, #f9fbff, #ffffff);
}

.cx-ops-highlight-box strong {
    color: #0f172a;
}

.cx-ops-table-wrap + .cx-ops-actions-row {
    padding: 16px 20px 20px;
}

@media (max-width: 1180px) {
    .cx-ops-grid-2,
    .cx-ops-form-grid.two-up {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .cx-ops-hero {
        padding: 22px 20px;
    }

    .cx-ops-toolbar,
    .cx-ops-table-tools {
        padding-left: 16px;
        padding-right: 16px;
    }

    .cx-ops-panel-head-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
