<input type="hidden" id="condicion" value="0"/>
<input type="hidden" id="tipo_atencion" value="5"/>
<input type="hidden" id="tipo_atencion_opcional" value="1"/>

<style>
.production-board {
    --prod-surface: #ffffff;
    --prod-surface-soft: #f7fafd;
    --prod-border: #d9e4f0;
    --prod-ink: #15324d;
    --prod-muted: #6e8094;
    --prod-primary: #244b74;
    --prod-primary-strong: #16324f;
    --prod-accent: #1f8ed6;
    --prod-success: #177d58;
    --prod-success-soft: #e8f6ef;
    --prod-warning: #c67f17;
    --prod-warning-soft: #fff3dc;
    --prod-danger: #c13f3f;
    --prod-danger-soft: #fdeaea;
    --prod-shadow: 0 18px 40px rgba(19, 42, 71, 0.08);
    color: var(--prod-ink);
}

.production-board .card-modern {
    background: var(--prod-surface);
    border-radius: 18px;
    border: 1px solid var(--prod-border);
    box-shadow: var(--prod-shadow);
}

.production-board__hero {
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.production-board__hero .card-body {
    padding: 1.5rem;
    background:
        radial-gradient(circle at top right, rgba(31, 142, 214, 0.18), transparent 34%),
        linear-gradient(135deg, #f8fbff 0%, #f2f6fb 100%);
}

.production-hero__header,
.production-hero__footer,
.production-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.production-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(36, 75, 116, 0.1);
    color: var(--prod-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.production-hero__title {
    margin: 0.7rem 0 0.35rem;
    color: var(--prod-primary-strong);
    font-size: 2rem;
    font-weight: 700;
}

.production-hero__subtitle,
.production-section-head p,
.production-list-shell__header p,
.production-refresh-note {
    margin: 0;
    color: var(--prod-muted);
}

.production-live-pill,
.production-mode-btn,
.production-channel-chip,
.production-chip,
.production-status-badge,
.production-priority-badge,
.production-channel-badge,
.production-flow-badge,
.production-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.production-live-pill,
.production-mode-btn,
.production-channel-chip,
.production-chip,
.production-status-badge,
.production-priority-badge,
.production-channel-badge,
.production-flow-badge {
    border-radius: 999px;
    font-weight: 700;
}

.production-live-pill {
    padding: 0.65rem 1rem;
    background: #eef8f2;
    color: var(--prod-success);
}

.production-live-pill__dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--prod-success);
    box-shadow: 0 0 0 6px rgba(23, 125, 88, 0.12);
}

.production-live-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-left: auto;
}

.production-live-inline .production-live-pill {
    padding: 0.48rem 0.78rem;
}

.production-live-inline .production-refresh-note {
    white-space: nowrap;
    font-size: 0.9rem;
}

.production-mode-switch,
.production-channel-strip,
.production-section-head__legend,
.production-card__eyebrow,
.production-card__stats,
.production-line__meta,
.production-line__support,
.production-status-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.production-mode-btn {
    min-height: 48px;
    padding: 0.85rem 1.15rem;
    border: 1px solid var(--prod-border);
    background: var(--prod-surface);
    color: var(--prod-primary-strong);
    transition: all 0.2s ease;
}

.production-mode-btn:hover,
.production-mode-btn:focus {
    border-color: #a9c5e3;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(21, 50, 77, 0.08);
}

.production-mode-btn.active {
    border-color: transparent;
    background: linear-gradient(135deg, #244b74 0%, #1f8ed6 100%);
    color: #ffffff;
    box-shadow: 0 16px 32px rgba(31, 90, 145, 0.22);
}

.production-mode-btn__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.8rem;
    height: 1.8rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: rgba(36, 75, 116, 0.1);
    color: inherit;
    font-size: 0.8rem;
    font-weight: 700;
}

.production-mode-btn.active .production-mode-btn__count {
    background: rgba(255, 255, 255, 0.18);
}

.production-channel-chip {
    padding: 0.7rem 0.95rem;
    background: #f3f7fb;
    color: var(--prod-primary);
    border: 1px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.production-channel-chip strong,
.production-context strong,
.production-operator strong,
.production-timebox strong,
.production-card__stat strong,
.production-card__title,
.production-line__title,
.production-product-cell__title {
    color: var(--prod-primary-strong);
}

.production-channel-chip--mesa {
    background: linear-gradient(135deg, #eaf3ff 0%, #f6fbff 100%);
    border-color: #d5e6fb;
}

.production-channel-chip--mostrador {
    background: linear-gradient(135deg, #ebf8ef 0%, #f6fcf8 100%);
    border-color: #d5eedc;
}

.production-channel-chip--delivery {
    background: linear-gradient(135deg, #fff2e3 0%, #fff9f1 100%);
    border-color: #f4ddbd;
}

.production-channel-chip i {
    font-size: 0.95rem;
}

.production-summary-row {
    margin-bottom: 1.2rem;
}

.production-summary-card,
.production-card,
.production-list-shell {
    border-radius: 18px;
    border: 1px solid var(--prod-border);
    background: var(--prod-surface);
    box-shadow: 0 12px 28px rgba(19, 42, 71, 0.06);
}

.production-summary-card {
    height: 100%;
    padding: 1.15rem 1.2rem;
}

.production-summary-card__label,
.production-card__stat small {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--prod-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.production-summary-card__value {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.production-summary-card__help {
    margin-top: 0.45rem;
    color: var(--prod-muted);
    font-size: 0.88rem;
}

.production-summary-card--primary {
    background: linear-gradient(135deg, #244b74 0%, #1b6ca6 100%);
    border-color: transparent;
}

.production-summary-card--primary .production-summary-card__label,
.production-summary-card--primary .production-summary-card__value,
.production-summary-card--primary .production-summary-card__help {
    color: #ffffff;
}

.production-stack {
    display: grid;
    gap: 1.15rem;
}

.production-card {
    overflow: hidden;
}

.production-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.02rem 1.12rem;
    background: linear-gradient(135deg, #f7fbff 0%, #eef4fb 100%);
    border-bottom: 1px solid var(--prod-border);
    flex-wrap: wrap;
}

.production-card__header-left {
    min-width: 240px;
}

.production-card__subtitle,
.production-context span,
.production-operator span,
.production-timebox span {
    color: var(--prod-muted);
    font-size: 0.85rem;
}

.production-card__support-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

.production-card__stat {
    min-width: 130px;
    padding: 0.75rem 0.95rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(36, 75, 116, 0.08);
}

.production-card__body {
    padding: 0.92rem 1.08rem 1.08rem;
}

.production-card__body-grid {
    display: grid;
    gap: 0.85rem;
}

.production-line {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(180px, 0.8fr) minmax(170px, 0.75fr) auto;
    gap: 0.9rem;
    align-items: center;
    padding: 1rem;
    border-radius: 16px;
    background: var(--prod-surface-soft);
    border: 1px solid #e4edf7;
}

.production-line__title,
.production-product-cell__title {
    color: #102844;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.production-line__title {
    margin: 0;
    font-size: 1.16rem;
    line-height: 1.22;
}

.production-product-cell__title {
    margin: 0;
    font-size: 1.16rem;
    line-height: 1.22;
}

.production-comment {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.65rem;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    background: #fff4d8;
    color: #915b00;
    font-size: 0.88rem;
    font-weight: 600;
}

.production-chip,
.production-status-badge,
.production-priority-badge,
.production-channel-badge,
.production-flow-badge {
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.production-chip {
    background: #edf4fb;
    color: var(--prod-primary);
}

.production-chip--neutral {
    background: #f1f4f7;
    color: var(--prod-muted);
}

.production-chip--product-name {
    background: #e9f0f8;
    color: #3b5e86;
    font-weight: 700;
}

.production-status-badge--waiting {
    background: var(--prod-success-soft);
    color: var(--prod-success);
}

.production-status-badge--preparing {
    background: var(--prod-warning-soft);
    color: var(--prod-warning);
}

.production-priority-badge--normal {
    background: #edf5ff;
    color: var(--prod-accent);
}

.production-priority-badge--attention {
    background: var(--prod-warning-soft);
    color: var(--prod-warning);
}

.production-priority-badge--urgent {
    background: var(--prod-danger-soft);
    color: var(--prod-danger);
}

.production-channel-badge--mesa {
    background: #e9f2ff;
    color: #205589;
}

.production-channel-badge--mostrador {
    background: #eaf8ef;
    color: #237349;
}

.production-channel-badge--delivery {
    background: #fff2e5;
    color: #b86d00;
}

.production-channel-badge i,
.production-flow-badge i {
    font-size: 0.82rem;
}

.production-flow-badge {
    background: #f5f7fa;
    color: var(--prod-primary-strong);
}

.production-flow-badge--service {
    background: #edf4ff;
    color: #205589;
}

.production-flow-badge--pack {
    background: #eaf8ef;
    color: #237349;
}

.production-flow-badge--dispatch {
    background: #fff2e5;
    color: #b86d00;
}

.production-action-btn {
    min-width: 126px;
    min-height: 42px;
    padding: 0.7rem 0.95rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    line-height: 1.1;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.production-action-btn--primary {
    background: linear-gradient(135deg, #23517d 0%, #1f8ed6 100%);
    color: #ffffff;
}

.production-action-btn--success {
    background: linear-gradient(135deg, #1d8c63 0%, #29b07e 100%);
    color: #ffffff;
}

.production-action-btn--ghost {
    background: #eef4fb;
    color: var(--prod-primary);
}

.production-action-btn:hover,
.production-action-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(28, 67, 105, 0.16);
    filter: saturate(1.04);
}

.production-action-btn__icon {
    font-size: 0.92rem;
}

.production-order-action {
    min-width: 214px;
    min-height: 56px;
    padding: 1rem 1.2rem;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(24, 58, 92, 0.14);
}

.production-order-action--mesa {
    background: linear-gradient(135deg, #23517d 0%, #2e8ed6 100%);
    color: #ffffff;
}

.production-order-action--mostrador {
    background: linear-gradient(135deg, #218450 0%, #35a96b 100%);
    color: #ffffff;
}

.production-order-action--delivery {
    background: linear-gradient(135deg, #d77c19 0%, #eea649 100%);
    color: #ffffff;
}

.production-order-action .production-action-btn__icon {
    font-size: 1rem;
}

.production-card--attention .production-card__header {
    background: linear-gradient(135deg, #fffaf0 0%, #fff4dc 100%);
}

.production-card--urgent .production-card__header {
    background: linear-gradient(135deg, #fff6f6 0%, #ffeaea 100%);
}

.production-list-shell .customtab {
    padding: 0 1.15rem;
    border-bottom: 1px solid var(--prod-border);
}

.production-list-shell .customtab .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-right: 0.35rem;
    padding: 0.95rem 0.25rem;
    color: var(--prod-muted);
    font-weight: 700;
}

.production-list-shell .customtab .nav-link i {
    font-size: 0.92rem;
}

.production-list-shell .customtab .nav-link.active {
    color: var(--prod-primary-strong);
    border-bottom-width: 3px;
}

.production-list-shell .tab-content {
    padding: 0 1.15rem 1.15rem;
}

.production-channel-board {
    display: grid;
    gap: 1.15rem;
}

.production-ticket-card {
    border: 1px solid var(--prod-border);
    border-radius: 18px;
    background: #fbfdff;
    box-shadow: 0 10px 24px rgba(19, 42, 71, 0.04);
    overflow: hidden;
}

.production-ticket-card--channel-mesa,
.production-card--channel-mesa {
    border-color: #c9ddf5;
    background: linear-gradient(180deg, #f2f8ff 0%, #f8fbff 100%);
    box-shadow: inset 7px 0 0 #4f8fd8, 0 10px 24px rgba(19, 42, 71, 0.04);
}

.production-ticket-card--channel-mostrador,
.production-card--channel-mostrador {
    border-color: #cce8d8;
    background: linear-gradient(180deg, #f1fbf4 0%, #f8fcf9 100%);
    box-shadow: inset 7px 0 0 #2f9b59, 0 10px 24px rgba(19, 42, 71, 0.04);
}

.production-ticket-card--channel-delivery,
.production-card--channel-delivery {
    border-color: #eed8ba;
    background: linear-gradient(180deg, #fff7ec 0%, #fffbf5 100%);
    box-shadow: inset 7px 0 0 #e1902d, 0 10px 24px rgba(19, 42, 71, 0.04);
}

.production-card--order-group {
    position: relative;
    border-width: 2px;
    box-shadow: 0 14px 30px rgba(19, 42, 71, 0.08);
}

.production-card--order-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 16px 16px 0 0;
    opacity: 0.95;
    z-index: 1;
}

.production-card--order-group .production-card__header {
    border-bottom-width: 2px;
    padding: 0.68rem 0.95rem;
    gap: 0.5rem;
}

.production-card--order-group .production-card__header-left {
    min-width: 190px;
}

.production-card--order-group .production-card__title {
    margin: 0;
    font-size: 1.48rem;
    line-height: 1.12;
}

.production-card--order-group .production-card__subtitle {
    margin: 0.06rem 0 0;
    font-size: 0.76rem;
    line-height: 1.2;
}

.production-card--order-group .production-card__support-row {
    margin-top: 0.1rem;
}

.production-card--order-group .production-card__body {
    padding: 0.72rem 0.9rem 0.9rem;
}

.production-card--order-group .production-card__body-grid {
    gap: 0.6rem;
}

.production-card--order-group .production-card__stat {
    min-width: 110px;
    padding: 0.52rem 0.65rem;
    border-radius: 12px;
}

.production-card--order-group .production-card__stat small {
    margin-bottom: 0.16rem;
    font-size: 0.72rem;
}

.production-card--order-group .production-card__stat strong {
    font-size: 1.04rem;
    line-height: 1.15;
}

.production-card--order-group .production-ticket-card__support {
    font-size: 0.82rem;
    line-height: 1.18;
}

.production-card--order-group .production-order-action {
    min-height: 44px;
    padding: 0.62rem 0.95rem;
    border-radius: 14px;
    font-size: 0.92rem;
}

.production-card--order-group .production-line {
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
}

.production-card--order-group.production-card--channel-mesa::before {
    background: linear-gradient(90deg, #4f8fd8 0%, #6fa9ea 100%);
}

.production-card--order-group.production-card--channel-mostrador::before {
    background: linear-gradient(90deg, #2f9b59 0%, #49b273 100%);
}

.production-card--order-group.production-card--channel-delivery::before {
    background: linear-gradient(90deg, #e1902d 0%, #f0ac58 100%);
}

.production-card--order-group.production-card--channel-mesa:not(.production-card--attention):not(.production-card--urgent) .production-card__header {
    background: linear-gradient(135deg, #eaf4ff 0%, #e1efff 100%);
}

.production-card--order-group.production-card--channel-mostrador:not(.production-card--attention):not(.production-card--urgent) .production-card__header {
    background: linear-gradient(135deg, #ecf9f0 0%, #e2f4e8 100%);
}

.production-card--order-group.production-card--channel-delivery:not(.production-card--attention):not(.production-card--urgent) .production-card__header {
    background: linear-gradient(135deg, #fff6ea 0%, #fdeed9 100%);
}

.production-card--order-group.production-card--channel-mesa .production-card__body,
.production-ticket-card--channel-mesa .production-ticket-card__body {
    background: linear-gradient(180deg, rgba(79, 143, 216, 0.09) 0%, rgba(79, 143, 216, 0.03) 100%);
}

.production-card--order-group.production-card--channel-mostrador .production-card__body,
.production-ticket-card--channel-mostrador .production-ticket-card__body {
    background: linear-gradient(180deg, rgba(47, 155, 89, 0.09) 0%, rgba(47, 155, 89, 0.03) 100%);
}

.production-card--order-group.production-card--channel-delivery .production-card__body,
.production-ticket-card--channel-delivery .production-ticket-card__body {
    background: linear-gradient(180deg, rgba(225, 144, 45, 0.09) 0%, rgba(225, 144, 45, 0.03) 100%);
}

.production-ticket-card--attention {
    border-color: #f3d08f;
}

.production-ticket-card--urgent {
    border-color: #f0b8b8;
}

.production-ticket-card__body {
    display: grid;
    gap: 1rem;
    padding: 1rem 1.1rem;
}

.production-ticket-card__top,
.production-ticket-card__footer,
.production-ticket-card__meta,
.production-ticket-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.production-ticket-card__eyebrow {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.production-ticket-card__title {
    margin: 0;
    color: #102844;
    font-size: 1.16rem;
    font-weight: 800;
    line-height: 1.22;
}

.production-line__title .production-qty,
.production-ticket-card__title .production-qty,
.production-product-cell__title .production-qty {
    display: inline-flex;
    align-items: center;
    margin-right: 0.35rem;
    padding: 0.14rem 0.5rem;
    border-radius: 999px;
    background: #fff0e0;
    border: 1px solid #ffd5b0;
    color: #b24a00;
    font-weight: 900;
    line-height: 1.05;
}

.production-ticket-card__time {
    color: var(--prod-primary-strong);
    font-size: 1rem;
    font-weight: 700;
}

.production-ticket-card__context {
    display: grid;
    gap: 0.2rem;
}

.production-ticket-card__context strong {
    color: var(--prod-primary-strong);
}

.production-ticket-card__context span,
.production-ticket-card__support {
    color: var(--prod-muted);
    font-size: 0.88rem;
}

.production-ticket-card__support {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.production-ticket-card__actions {
    justify-content: flex-end;
    margin-left: auto;
}

.production-ticket-card__status {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.production-line__operator-note {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.28rem;
    color: var(--prod-muted);
    font-size: 0.82rem;
}

.production-ticket-card__support i,
.production-line__operator-note i {
    font-size: 0.78rem;
}

.production-line--channel-mesa {
    border-left: 4px solid rgba(79, 143, 216, 0.38);
}

.production-line--channel-mostrador {
    border-left: 4px solid rgba(47, 155, 89, 0.38);
}

.production-line--channel-delivery {
    border-left: 4px solid rgba(225, 144, 45, 0.38);
}

.production-card__subtitle strong,
.production-line__context strong {
    display: block;
}

.production-empty,
.production-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 220px;
    padding: 2rem;
    border: 1px dashed var(--prod-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--prod-muted);
    text-align: center;
}

.production-loading .spinner-border {
    width: 2.3rem;
    height: 2.3rem;
    color: var(--prod-primary);
}

.production-mode-hidden {
    display: none !important;
}

@media (min-width: 992px) {
    .production-board--compact .production-board__hero {
        margin-bottom: 0.85rem;
    }

    .production-board--compact .production-board__hero .card-body {
        padding: 0.95rem 1.1rem;
    }

    .production-board--compact .production-hero__header {
        display: none;
    }

    .production-board--compact .production-hero__footer {
        margin-top: 0 !important;
    }

    .production-board--compact .production-mode-switch,
    .production-board--compact .production-channel-strip {
        gap: 0.55rem;
    }

    .production-board--compact .production-mode-btn,
    .production-board--compact .production-channel-chip {
        min-height: 42px;
        padding: 0.62rem 0.9rem;
    }

    .production-board--compact .production-live-inline {
        gap: 0.38rem;
    }

    .production-board--compact .production-live-inline .production-live-pill {
        padding: 0.38rem 0.62rem;
    }

    .production-board--compact .production-live-inline .production-live-pill__dot {
        width: 0.5rem;
        height: 0.5rem;
        box-shadow: none;
    }

    .production-board--compact .production-live-inline .production-refresh-note {
        font-size: 0.82rem;
    }

    .production-board--compact .production-summary-row {
        margin-bottom: 0.75rem;
    }

    .production-board--compact .production-summary-card {
        padding: 0.82rem 0.95rem;
    }

    .production-board--compact .production-summary-card__label {
        margin-bottom: 0.28rem;
        font-size: 0.74rem;
    }

    .production-board--compact .production-summary-card__value {
        font-size: 1.55rem;
    }

    .production-board--compact .production-summary-card__help {
        display: none;
    }

    .production-board--compact .production-section-head {
        margin-bottom: 0.45rem;
    }

    .production-board--compact .production-section-head p {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .production-board__hero .card-body,
    .production-card__header,
    .production-card__body,
    .production-ticket-card__body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .production-line {
        grid-template-columns: 1fr;
    }

    .production-action-btn {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .production-board__hero {
        position: sticky;
        top: 58px;
        z-index: 18;
        margin-bottom: 0.85rem;
    }

    .production-board__hero {
        margin-bottom: 1rem;
    }

    .production-board__hero .card-body {
        padding: 1rem;
    }

    .production-mode-switch,
    .production-channel-strip {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.2rem;
    }

    .production-mode-switch::-webkit-scrollbar,
    .production-channel-strip::-webkit-scrollbar,
    .production-summary-row::-webkit-scrollbar,
    .production-card__stats::-webkit-scrollbar {
        display: none;
    }

    .production-mode-btn,
    .production-channel-chip {
        width: auto;
        min-height: 42px;
        padding: 0.7rem 0.95rem;
        justify-content: center;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .production-summary-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-left: -6px;
        margin-right: -6px;
        padding-bottom: 0.3rem;
        margin-bottom: 0.75rem;
    }

    .production-summary-row > [class*="col-"] {
        flex: 0 0 152px;
        max-width: 152px;
        padding-left: 6px;
        padding-right: 6px;
        margin-bottom: 0;
    }

    .production-summary-card {
        padding: 0.75rem 0.82rem;
    }

    .production-summary-card__label {
        margin-bottom: 0.25rem;
        font-size: 0.68rem;
    }

    .production-summary-card__value {
        font-size: 1.35rem;
    }

    .production-summary-card__help {
        display: none;
    }

    .production-section-head {
        align-items: flex-start;
        gap: 0.4rem;
        margin-bottom: 0.7rem;
    }

    .production-card__header {
        align-items: flex-start;
        gap: 0.75rem;
        padding-top: 0.95rem;
        padding-bottom: 0.95rem;
    }

    .production-card__header-left {
        min-width: 0;
        width: 100%;
    }

    .production-card__stats {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.55rem;
        padding-bottom: 0.2rem;
    }

    .production-card__stat {
        min-width: 112px;
        padding: 0.6rem 0.72rem;
        flex: 0 0 auto;
    }

    .production-card__body {
        padding: 0.8rem 0.95rem 0.95rem;
    }

    .production-card__body-grid {
        gap: 0.65rem;
    }

    .production-line {
        padding: 0.85rem;
        gap: 0.55rem;
    }

    .production-line__title {
        margin-bottom: 0;
        font-size: 0.95rem;
    }

    .production-chip,
    .production-status-badge,
    .production-priority-badge,
    .production-channel-badge,
    .production-flow-badge {
        padding: 0.35rem 0.55rem;
        font-size: 0.72rem;
    }

    .production-ticket-card__actions {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .production-order-action {
        width: auto;
        min-width: 0;
        align-self: flex-start;
    }

    .production-ticket-card__status {
        width: 100%;
    }

    .production-refresh-note {
        display: none;
    }

    .production-live-pill {
        display: inline-flex;
        justify-content: center;
    }

    .production-ticket-card__support {
        font-size: 0.8rem;
    }
}

@media (max-width: 575.98px) {
    .production-board__hero .card-body {
        padding: 0.75rem;
    }

    .production-hero__header {
        display: none;
    }

    .production-board__hero .production-hero__footer {
        margin-top: 0 !important;
    }

    .production-board__hero {
        top: 58px;
        border-radius: 16px;
    }

    .production-hero__eyebrow {
        font-size: 0.68rem;
        padding: 0.28rem 0.65rem;
    }

    .production-hero__title {
        margin-top: 0.4rem;
        font-size: 1.28rem;
    }

    .production-hero__subtitle,
    .production-section-head p,
    .production-section-head__legend {
        display: none;
    }

    .production-hero__header,
    .production-hero__footer {
        gap: 0.55rem;
    }

    .production-mode-btn,
    .production-channel-chip {
        min-height: 38px;
        padding: 0.55rem 0.8rem;
        font-size: 0.84rem;
    }

    .production-card,
    .production-ticket-card {
        border-radius: 16px;
    }

    .production-card__header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }

    .production-card__header > div:last-child {
        grid-column: 2;
        justify-self: end;
        align-self: start;
    }

    .production-card__eyebrow {
        gap: 0.4rem;
    }

    .production-card__title {
        font-size: 1.08rem;
    }

    .production-card__subtitle {
        margin: 0;
        font-size: 0.76rem;
    }

    .production-card__support-row {
        margin-top: 0.22rem;
    }

    .production-card__stats {
        grid-column: 1 / -1;
        gap: 0.45rem;
    }

    .production-card__stat {
        min-width: 88px;
        padding: 0.45rem 0.55rem;
        border-radius: 11px;
    }

    .production-card__stat small {
        margin-bottom: 0.28rem;
        font-size: 0.68rem;
    }

    .production-card__body {
        padding: 0.72rem 0.8rem 0.8rem;
    }

    .production-line {
        padding: 0.72rem;
        border-radius: 14px;
    }

    .production-line__operator-note {
        margin-top: 0.2rem;
        font-size: 0.75rem;
    }

    .production-card--order-group .production-card__header {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
    }

    .production-card--order-group .production-card__eyebrow {
        gap: 0.32rem;
    }

    .production-card--order-group .production-card__eyebrow .production-priority-badge--normal {
        display: none;
    }

    .production-card--order-group.production-card--channel-delivery .production-card__subtitle,
    .production-card--order-group.production-card--channel-mostrador .production-card__subtitle {
        display: none;
    }

    .production-card--order-group .production-card__header > div:last-child {
        grid-column: auto;
        justify-self: auto;
        align-self: auto;
        width: 100%;
    }

    .production-card--order-group .production-card__stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 0.4rem;
        overflow: visible;
        padding-bottom: 0;
    }

    .production-card--order-group .production-card__stat {
        min-width: 0;
        padding: 0.42rem 0.5rem;
    }

    .production-card--order-group .production-card__stat small {
        margin-bottom: 0.18rem;
        font-size: 0.58rem;
        letter-spacing: 0.05em;
    }

    .production-card--order-group .production-card__stat strong {
        font-size: 0.82rem;
        line-height: 1.2;
        word-break: break-word;
    }

    .production-card--order-group .production-line__context {
        display: none;
    }

    .production-card--order-group .production-timebox {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.45rem;
        flex-wrap: wrap;
    }

    .production-card--order-group .production-order-action {
        width: 100%;
        min-height: 36px;
        padding: 0.52rem 0.75rem;
    }

    .production-card--order-group .production-status-stack {
        margin-top: 0;
    }

    .production-card--order-group .production-line__operator-note {
        display: none;
    }

    .production-card--order-group .text-right,
    .production-card--order-group .production-action-btn {
        width: 100%;
    }

    .production-comment {
        margin-top: 0.5rem;
        padding: 0.45rem 0.6rem;
        font-size: 0.78rem;
    }

    .production-ticket-card__top,
    .production-ticket-card__footer {
        align-items: flex-start;
    }

    .production-ticket-card__time {
        font-size: 0.95rem;
    }
}
</style>

<div class="production-board production-board--compact">
    <div class="card card-modern production-board__hero">
        <div class="card-body">
            <div class="production-hero__header">
                <div>
                    <span class="production-hero__eyebrow"><i class="ti-dashboard"></i> Operacion en cocina</span>
                    <h2 class="production-hero__title">Cola de produccion en tiempo real</h2>
                    <p class="production-hero__subtitle">Consulta lo pendiente y avanza cada preparacion con toques simples, tanto en pantalla fija como en tablet o celular.</p>
                </div>
            </div>

            <div class="production-hero__footer m-t-20">
                <div class="production-mode-switch">
                    <button type="button" class="btn production-mode-btn" data-mode="lista" onclick="listarPedidos();"><span>Orden de llegada</span><span class="production-mode-btn__count" id="mode_count_lista"></span></button>
                    <button type="button" class="btn production-mode-btn" data-mode="platos" onclick="agruparPlatos();"><span>Por producto</span><span class="production-mode-btn__count" id="mode_count_platos"></span></button>
                    <button type="button" class="btn production-mode-btn" data-mode="pedidos" onclick="agruparPedidos();"><span>Por pedido</span><span class="production-mode-btn__count" id="mode_count_pedidos"></span></button>
                </div>

                <div class="production-channel-strip">
                    <div class="production-channel-chip production-channel-chip--mesa"><i class="fa fa-utensils"></i><span>Mesa</span><strong id="metric_channel_mesa">0</strong></div>
                    <div class="production-channel-chip production-channel-chip--mostrador"><i class="fa fa-shopping-bag"></i><span>Para llevar</span><strong id="metric_channel_most">0</strong></div>
                    <div class="production-channel-chip production-channel-chip--delivery"><i class="fa fa-motorcycle"></i><span>Delivery</span><strong id="metric_channel_del">0</strong></div>
                    <div class="production-live-inline">
                        <span class="production-live-pill"><span class="production-live-pill__dot"></span> En vivo</span>
                        <span class="production-refresh-note">Ultima actualizacion <strong id="production_last_refresh">instantes</strong></span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row production-summary-row">
        <div class="col-lg-3 col-sm-6 m-b-15"><div class="production-summary-card production-summary-card--primary"><span class="production-summary-card__label">Items pendientes</span><p class="production-summary-card__value" id="metric_total_items">0</p><div class="production-summary-card__help">Total visible en esta area</div></div></div>
        <div class="col-lg-3 col-sm-6 m-b-15"><div class="production-summary-card"><span class="production-summary-card__label">Pedidos activos</span><p class="production-summary-card__value" id="metric_total_orders">0</p><div class="production-summary-card__help">Agrupados por ticket</div></div></div>
        <div class="col-lg-3 col-sm-6 m-b-15"><div class="production-summary-card"><span class="production-summary-card__label">En espera</span><p class="production-summary-card__value" id="metric_waiting">0</p><div class="production-summary-card__help">Listos para iniciar o despachar</div></div></div>
        <div class="col-lg-3 col-sm-6 m-b-15"><div class="production-summary-card"><span class="production-summary-card__label">Urgentes</span><p class="production-summary-card__value" id="metric_urgent">0</p><div class="production-summary-card__help" id="metric_oldest_wait">Sin demoras criticas</div></div></div>
    </div>

    <div class="production-section-head">
        <div>
            <h4 id="production_view_title">Por pedido</h4>
            <p id="production_view_subtitle">Vista principal para completar ordenes y despachar cada ticket con un solo vistazo.</p>
        </div>
        <div class="production-section-head__legend">
            <span class="production-priority-badge production-priority-badge--normal" title="Normal: de 0 a 7 minutos de espera">Normal</span>
            <span class="production-priority-badge production-priority-badge--attention" title="Atencion: de 8 a 14 minutos de espera">Atencion</span>
            <span class="production-priority-badge production-priority-badge--urgent" title="Urgente: 15 minutos o mas de espera">Urgente</span>
        </div>
    </div>

    <div class="display-agrupacion-platos production-mode-hidden"><div id="agrupacion_platos_list" class="production-stack"></div></div>
    <div class="display-agrupacion-pedidos"><div id="agrupacion_pedidos_list" class="production-stack"></div></div>

    <div class="display-lista production-mode-hidden">
        <div class="card card-modern production-list-shell">
            <ul class="nav nav-tabs customtab" role="tablist">
                <li class="nav-item" id="tab1"><a class="nav-link active production-list-tab" data-toggle="tab" data-tab="1" href="#tab-1" role="tab"><i class="fa fa-utensils"></i><span class="font-medium">Mesa</span><span class="production-mode-btn__count" id="cant_pedidos_mesa"></span></a></li>
                <li class="nav-item" id="tab2"><a class="nav-link production-list-tab" data-toggle="tab" data-tab="2" href="#tab-2" role="tab"><i class="fa fa-shopping-bag"></i><span class="font-medium">Para llevar</span><span class="production-mode-btn__count" id="cant_pedidos_most"></span></a></li>
                <li class="nav-item" id="tab3"><a class="nav-link production-list-tab" data-toggle="tab" data-tab="3" href="#tab-3" role="tab"><i class="fa fa-motorcycle"></i><span class="font-medium">Delivery</span><span class="production-mode-btn__count" id="cant_pedidos_del"></span></a></li>
            </ul>

            <div class="tab-content">
                <div class="tab-pane active" id="tab-1" role="tabpanel">
                    <div id="list_pedidos_mesa" class="production-channel-board"></div>
                </div>
                <div class="tab-pane" id="tab-2" role="tabpanel">
                    <div id="list_pedidos_most" class="production-channel-board"></div>
                </div>
                <div class="tab-pane" id="tab-3" role="tabpanel">
                    <div id="list_pedidos_del" class="production-channel-board"></div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="https://js.pusher.com/7.0/pusher.min.js"></script>
