/* ============================================================
   Recepción de Pedidos + Módulo Kiosko
   Diseño profesional, comercial y 100% responsive.
   Reutiliza la paleta del panel (admin.css).
   ============================================================ */

:root {
    --ord-kiosk: #7c3aed;
    --ord-online: #0ea5e9;
    --ord-whatsapp: #22c55e;
    --ord-pending: #f59e0b;
    --ord-preparing: #3b82f6;
    --ord-ready: #10b981;
    --ord-completed: #94a3b8;
    --ord-cancelled: #ef4444;
}

/* ---------- Toolbar / filtros por canal ---------- */
.orders-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(15, 23, 42, 0.08));
}

.orders-channel-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 14px;
}

.orders-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all .2s ease;
    white-space: nowrap;
}

.orders-tab:hover { color: #334155; }

.orders-tab.active {
    background: #fff;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .1);
}

.orders-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.orders-tab.active .orders-tab-count {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.orders-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.orders-history-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    user-select: none;
}
.orders-history-toggle input { width: 16px; height: 16px; accent-color: #667eea; }

/* ---------- Lista de pedidos ---------- */
.orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 18px;
    align-items: start;
}

.orders-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.orders-empty i { margin-bottom: 14px; color: #cbd5e1; }
.orders-empty p { font-size: 15px; }

/* ---------- Tarjeta de pedido ---------- */
.order-card {
    position: relative;
    background: #fff;
    border-radius: 18px;
    border: 1px solid #eef2f7;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.order-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .12);
}
/* Acento de estado (barra superior con gradiente) */
.order-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
}
.order-card.status-pending::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.order-card.status-preparing::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.order-card.status-ready::before { background: linear-gradient(90deg, #10b981, #34d399); }
.order-card.status-completed::before { background: #cbd5e1; }
.order-card.status-cancelled::before { background: #fca5a5; }
.order-card.status-completed { opacity: .82; }
.order-card.status-cancelled { opacity: .72; }

/* Urgencia: pedidos activos con demasiada espera */
.order-card.order-urgent { animation: orderPulse 1.8s ease-in-out infinite; }
@keyframes orderPulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(15, 23, 42, .06); }
    50% { box-shadow: 0 6px 26px rgba(239, 68, 68, .35); }
}

.order-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
}
.order-card-headline {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.order-channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 9px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: #fff;
}
.channel-kiosk { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.channel-online { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.channel-whatsapp { background: linear-gradient(135deg, #16a34a, #22c55e); }
.channel-pos { background: linear-gradient(135deg, #d97706, #f59e0b); }
.channel-other { background: linear-gradient(135deg, #475569, #64748b); }

.order-number {
    font-weight: 800;
    color: #0f172a;
    font-size: 15px;
    font-family: 'Courier New', ui-monospace, monospace;
    letter-spacing: .5px;
}

.order-status-pill {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.order-status-pill.status-pending { background: #fef3c7; color: #b45309; }
.order-status-pill.status-preparing { background: #dbeafe; color: #1d4ed8; }
.order-status-pill.status-ready { background: #d1fae5; color: #047857; }
.order-status-pill.status-completed { background: #e2e8f0; color: #475569; }
.order-status-pill.status-cancelled { background: #fee2e2; color: #b91c1c; }

.order-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    font-size: 12.5px;
    color: #475569;
}
.order-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    padding: 3px 9px;
    border-radius: 8px;
}
.order-card-meta i { color: #94a3b8; }
.order-time { font-weight: 600; }
.order-time.order-time-late { background: #fef2f2 !important; border-color: #fecaca !important; color: #dc2626 !important; }
.order-time.order-time-late i { color: #dc2626; }

.order-items {
    border-top: 1px dashed #e2e8f0;
    border-bottom: 1px dashed #e2e8f0;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 240px;
    overflow-y: auto;
}

.order-item-line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: baseline;
    font-size: 14px;
}
.order-item-qty {
    font-weight: 800;
    color: #4f46e5;
    background: #eef2ff;
    border-radius: 6px;
    padding: 1px 7px;
    font-size: 13px;
}
.order-item-name { color: #1e293b; font-weight: 500; }
.order-item-name small {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 400;
}
.order-item-note { color: #b45309 !important; }
.order-item-price { font-weight: 700; color: #334155; }

.order-card-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.order-total {
    font-weight: 800;
    font-size: 18px;
    color: #0f172a;
}

.order-pay-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: transform .15s ease, filter .15s ease;
}
.order-pay-btn:hover { transform: translateY(-1px); filter: brightness(.98); }
.order-pay-btn.unpaid { background: #fff7ed; color: #c2410c; border: 1.5px solid #fdba74; }
.order-pay-btn.paid { background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; }

.order-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}
.order-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    border-radius: 10px;
    font-weight: 700;
}

.order-done-label {
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.order-done-label.cancelled { color: #b91c1c; }

.btn-danger-soft {
    background: #fef2f2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
}
.btn-danger-soft:hover { background: #fee2e2; }

/* ---------- Aviso de módulo desactivado ---------- */
.module-notice {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
}
.module-notice.off {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #9a3412;
    border: 1px solid #fed7aa;
}
.module-notice i { font-size: 16px; }

/* ============================================================
   Módulo Kiosko (equipos + link/QR)
   ============================================================ */
.kiosk-add-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
}
.kiosk-add-form .form-control { flex: 1; min-width: 180px; }
.kiosk-add-form .btn { white-space: nowrap; }

.kiosk-devices-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kiosk-device-card {
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 18px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
    transition: box-shadow .2s ease;
}
.kiosk-device-card:hover { box-shadow: 0 10px 26px rgba(15, 23, 42, .1); }
.kiosk-device-card.inactive { opacity: .6; }

.kiosk-device-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.kiosk-device-head h4 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kiosk-device-head h4 i { color: #7c3aed; }
.kiosk-device-loc, .kiosk-device-code {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 12px;
    font-size: 12.5px;
    color: #64748b;
}
.kiosk-device-code {
    font-family: 'Courier New', monospace;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}
.kiosk-device-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.kiosk-link-block {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}
.kiosk-qr {
    width: 140px;
    height: 140px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 8px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
}
.kiosk-link-info { flex: 1; min-width: 240px; }
.kiosk-link-info label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}
.kiosk-link-info .input-group {
    display: flex;
    gap: 6px;
}
.kiosk-link-info .input-group .form-control {
    flex: 1;
    font-size: 13px;
    background: #f8fafc;
}
.kiosk-link-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.kiosk-link-actions .btn { border-radius: 9px; }

.btn-outline {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
}
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }

/* ---------- Badge de pedidos activos en el Dashboard ---------- */
.orders-kpi-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
    animation: orderPulse 1.8s ease-in-out infinite;
}

/* ---------- Filas de toggle en Configuración → Módulos ---------- */
.settings-card-body .form-group.toggle-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    margin-bottom: 10px;
    background: #fbfcfe;
}
.settings-card-body .form-group.toggle-row > div { flex: 1; }
.settings-card-body .form-group.toggle-row strong {
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 7px;
}
.settings-card-body .form-group.toggle-row strong i { color: #7c3aed; }

/* Toggle visible sobre fondo claro (el estilo base es blanco translúcido,
   pensado para fondos oscuros; aquí lo hacemos gris para que se vea el OFF). */
.settings-card-body .form-group.toggle-row .toggle-slider {
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}
.settings-card-body .form-group.toggle-row .toggle-switch input:checked + .toggle-slider {
    background: #22c55e;
    box-shadow: none;
}
.settings-card-body .form-group.toggle-row .toggle-slider:before {
    box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
}

/* ============================================================
   Responsive
   ============================================================ */
/* ---------- Barra de resumen (KPIs) ---------- */
.orders-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.orders-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.orders-stat-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
}

.orders-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
}

.orders-stat[data-stat="pending"] { border-top: 3px solid var(--ord-pending); }
.orders-stat[data-stat="preparing"] { border-top: 3px solid var(--ord-preparing); }
.orders-stat[data-stat="ready"] { border-top: 3px solid var(--ord-ready); }
.orders-stat[data-stat="today"] { border-top: 3px solid var(--ord-online); }
.orders-stat.orders-stat-sales { border-top: 3px solid #16a34a; }
.orders-stat.orders-stat-sales .orders-stat-value { color: #16a34a; }

/* ---------- Buscador ---------- */
.orders-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.orders-search i {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}

.orders-search input {
    padding: 9px 14px 9px 32px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 13.5px;
    min-width: 220px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.orders-search input:focus {
    outline: none;
    border-color: var(--ord-online);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

#ordersCamBtn {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}
#ordersCamBtn:hover { filter: brightness(1.05); }

.order-print-btn { padding: 8px 12px; }

/* ---------- Filtro de fechas (historial) ---------- */
.orders-history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
}

.orders-date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.orders-date-field input {
    padding: 8px 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 13px;
    background: #fff;
}

.orders-date-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ---------- Cancelación ---------- */
.order-cancel-reason {
    margin: 0 16px 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
}

.order-cancel-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

#orderCancelModal .modal-dialog { max-width: 480px; }

/* ---------- Cobro / método de pago ---------- */
.order-pay-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.order-pay-method {
    font-size: 12px;
    font-weight: 700;
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
    padding: 4px 10px;
    border-radius: 999px;
}

.order-pay-prompt {
    font-weight: 600;
    margin: 0 0 12px;
    color: #334155;
}

.order-pay-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.order-pay-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    color: #334155;
    transition: all .2s ease;
}

.order-pay-option i { font-size: 22px; color: #667eea; }
.order-pay-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.06);
    transform: translateY(-1px);
}

#orderPayModal .modal-dialog { max-width: 420px; }

/* ---------- Escaneo de pedido (QR) ---------- */
#orderScanModal .modal-dialog,
#orderFoundModal .modal-dialog { max-width: 480px; }
.order-scan-cam {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #0f172a;
    border-radius: 14px;
    overflow: hidden;
    margin-top: 14px;
}
.order-scan-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-scan-frame {
    position: absolute;
    inset: 18%;
    border: 3px solid rgba(255, 255, 255, .9);
    border-radius: 16px;
    box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .35);
}
.order-scan-hint { font-size: 14px; color: #475569; margin-bottom: 14px; line-height: 1.5; }
.order-scan-input { position: relative; display: flex; align-items: center; }
.order-scan-input i { position: absolute; left: 14px; color: #94a3b8; }
.order-scan-input input {
    width: 100%;
    padding: 14px 14px 14px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: .5px;
}
.order-scan-input input:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,.15); }
.order-scan-footer { flex-wrap: wrap; gap: 8px; }
.order-found-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.order-found-folio {
    font-family: 'Courier New', monospace;
    font-size: 1.35rem;
    letter-spacing: .5px;
}
.order-found-total { font-size: 1.25rem; margin: 8px 0; color: #0f172a; }
.order-found-total strong { color: #16a34a; font-size: 1.45rem; }
.order-found-meta { color: #64748b; font-size: 14px; margin: 0 0 8px; }
.order-found-items { font-size: 13.5px; color: #334155; background: #f8fafc; border-radius: 10px; padding: 10px 12px; margin: 0; }
.order-found-actions { flex-wrap: wrap; gap: 8px; }

/* Resaltado del pedido encontrado por escaneo */
/* Solicitudes de mesa (servicio al cajero) */
.table-requests-panel {
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 14px;
    padding: 14px 16px;
    margin: 0 0 16px;
}
.tr-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.tr-panel-head h3 {
    margin: 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9a3412;
}
.tr-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ea580c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.tr-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tr-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 12px 14px;
}
.tr-card.tr-pending {
    border-left: 4px solid #ea580c;
    animation: trPulse 1.8s ease-in-out infinite;
}
.tr-card.tr-ack {
    border-left: 4px solid #f59e0b;
    opacity: 0.95;
}
@keyframes trPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.18); }
    50% { box-shadow: 0 0 0 6px rgba(234, 88, 12, 0); }
}
.tr-table {
    font-weight: 800;
    font-size: 1.05rem;
    color: #9a3412;
    margin-bottom: 2px;
}
.tr-type {
    font-weight: 700;
    color: #334155;
    margin-bottom: 2px;
}
.tr-msg {
    font-size: 13.5px;
    color: #475569;
    margin: 4px 0;
}
.tr-time {
    font-size: 12px;
    color: #94a3b8;
}
.tr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .tr-card { flex-direction: column; align-items: stretch; }
    .tr-actions { justify-content: stretch; }
    .tr-actions .btn { flex: 1; }
}

.order-card.order-scan-hit {
    animation: orderScanHit 2.4s ease;
    outline: 3px solid #22c55e;
    outline-offset: 2px;
}
@keyframes orderScanHit {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
    30% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 6px 20px rgba(15, 23, 42, .06); }
}

@media (max-width: 900px) {
    .orders-toolbar { position: static; }
    .orders-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .orders-list { grid-template-columns: 1fr; }
    .orders-stats { grid-template-columns: repeat(2, 1fr); }
    .orders-stat-value { font-size: 22px; }
    .orders-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .orders-channel-tabs { justify-content: space-between; }
    .orders-tab { flex: 1; justify-content: center; padding: 10px 8px; }
    .orders-toolbar-actions { justify-content: space-between; flex-wrap: wrap; }
    .orders-search { width: 100%; }
    .orders-search input { min-width: 0; width: 100%; }
    .orders-history-filters { flex-direction: column; align-items: stretch; }
    .orders-date-presets { justify-content: flex-start; }
    .kiosk-link-block { justify-content: center; text-align: center; }
    .kiosk-link-info { min-width: 100%; }
    .kiosk-qr { width: 160px; height: 160px; }
    .kiosk-device-head { flex-direction: column; }
    .order-actions .btn { min-width: 100%; }
    .order-print-btn { min-width: auto !important; }
    .order-pay-options { grid-template-columns: 1fr 1fr; }
}
