/* =========================================================
   TiendaRoma - Live Order Hub (Panel Dedicado de Pedidos)
   Design System & Modern App Styles (ui-guidelines.md)
   ========================================================= */

:root,
[data-theme="dark"],
html[data-theme="dark"],
body.dark-mode,
html.dark-mode {
    --pos-bg: #000000;
    --pos-surface: #09090b;
    --pos-surface-card: #121215;
    --pos-surface-hover: #18181c;
    --pos-border: rgba(255, 255, 255, 0.08);
    --pos-border-subtle: rgba(255, 255, 255, 0.04);
    --pos-text: #ffffff;
    --pos-text-secondary: #a1a1aa;
    --pos-text-muted: #71717a;
    
    --pos-primary: #ff4757;
    --pos-primary-rgb: 255, 71, 87;
    --pos-primary-gradient: linear-gradient(135deg, #ff4757, #ff6b81);
    
    --pos-success: #10b981;
    --pos-success-rgb: 16, 185, 129;
    --pos-success-gradient: linear-gradient(135deg, #10b981, #059669);
    
    --pos-warning: #f59e0b;
    --pos-warning-rgb: 245, 158, 11;
    --pos-danger: #ef4444;
    --pos-danger-rgb: 239, 68, 68;
    --pos-info: #3b82f6;
    --pos-info-rgb: 59, 130, 246;
    --pos-purple: #8b5cf6;
    --pos-purple-rgb: 139, 92, 246;
    
    --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-modal: 0 20px 50px rgba(0, 0, 0, 0.75);
}

[data-theme="light"],
html[data-theme="light"],
body.light-mode,
html.light-mode {
    --pos-bg: #f4f4f6;
    --pos-surface: #ffffff;
    --pos-surface-card: #ffffff;
    --pos-surface-hover: #f8fafc;
    --pos-border: rgba(0, 0, 0, 0.08);
    --pos-border-subtle: rgba(0, 0, 0, 0.04);
    --pos-text: #09090b;
    --pos-text-secondary: #52525b;
    --pos-text-muted: #a1a1aa;
    --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-modal: 0 20px 50px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-base);
    font-size: 13px;
    line-height: 1.45;
    background-color: var(--pos-bg);
    color: var(--pos-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* =========================================================
   Top Command Bar (Responsive Desktop & Mobile)
   ========================================================= */
.command-bar {
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color 0.2s ease;
}

.command-bar-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.brand-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--pos-text);
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--pos-primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(var(--pos-primary-rgb), 0.35);
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-badge {
    font-size: 10px;
    font-weight: 700;
    background: rgba(var(--pos-primary-rgb), 0.15);
    color: var(--pos-primary);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--pos-success);
    background: rgba(var(--pos-success-rgb), 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(var(--pos-success-rgb), 0.2);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--pos-success);
    box-shadow: 0 0 0 0 rgba(var(--pos-success-rgb), 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(var(--pos-success-rgb), 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(var(--pos-success-rgb), 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(var(--pos-success-rgb), 0); }
}

/* Actions Right */
.actions-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--pos-border);
    background: var(--pos-surface-card);
    color: var(--pos-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.18s;
}

.icon-btn:hover {
    background: var(--pos-surface-hover);
    color: var(--pos-text);
    border-color: rgba(255, 255, 255, 0.18);
}

.btn-new-order {
    background: var(--pos-primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 4px 14px rgba(var(--pos-primary-rgb), 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn-new-order:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(var(--pos-primary-rgb), 0.45);
}

.desktop-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-hub-link {
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--pos-text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.18s;
    white-space: nowrap;
}

.quick-hub-link:hover {
    color: var(--pos-text);
    background: var(--pos-surface-hover);
    border-color: var(--pos-border);
}

/* Command Bar Controls Row (Search, Filters, View Switcher) */
.command-bar-row-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.search-input-wrap i.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pos-text-muted);
    font-size: 13px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-md);
    padding: 9px 12px 9px 34px;
    font-size: 13px;
    color: var(--pos-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 3px rgba(var(--pos-primary-rgb), 0.15);
}

.filter-select {
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 12.5px;
    color: var(--pos-text);
    font-weight: 500;
    outline: none;
    cursor: pointer;
    white-space: nowrap;
    max-width: 220px;
}

/* View Mode Switcher */
.view-switcher {
    display: flex;
    background: var(--pos-surface-hover);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--pos-border);
    flex-shrink: 0;
}

.view-btn {
    border: none;
    background: transparent;
    color: var(--pos-text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.view-btn.active {
    background: var(--pos-surface-card);
    color: var(--pos-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   KPI Metrics Sub-Bar
   ========================================================= */
.kpi-bar {
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border-subtle);
    padding: 8px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow-x: auto;
    gap: 14px;
    -webkit-overflow-scrolling: touch;
}

.kpi-chips-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.kpi-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-md);
    font-size: 12px;
    white-space: nowrap;
}

.kpi-chip .kpi-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.kpi-chip.kpi-all .kpi-dot { background: var(--pos-primary); }
.kpi-chip.kpi-pending .kpi-dot { background: var(--pos-warning); }
.kpi-chip.kpi-kitchen .kpi-dot { background: var(--pos-info); }
.kpi-chip.kpi-shipped .kpi-dot { background: var(--pos-purple); }
.kpi-chip.kpi-delivered .kpi-dot { background: var(--pos-success); }

.kpi-label {
    color: var(--pos-text-secondary);
    font-weight: 500;
}

.kpi-count {
    font-weight: 700;
    color: var(--pos-text);
}

.kpi-revenue-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--pos-text-secondary);
    white-space: nowrap;
}

.kpi-revenue-val {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--pos-success);
}

/* =========================================================
   Mobile Stage Tabs (Pill Carousel for Native Mobile UX)
   ========================================================= */
.mobile-stage-tabs {
    display: none;
}

/* =========================================================
   Main Viewports
   ========================================================= */
.main-viewport {
    flex: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
}

/* =========================================================
   VIEW 1: KANBAN BOARD
   ========================================================= */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(280px, 1fr));
    gap: 14px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 20px;
}

.kanban-col {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 170px);
    overflow: hidden;
}

.kanban-col-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--pos-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--pos-surface-card);
}

.col-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.col-title-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.col-pending .col-title-icon { background: rgba(var(--pos-warning-rgb), 0.15); color: var(--pos-warning); }
.col-kitchen .col-title-icon { background: rgba(var(--pos-info-rgb), 0.15); color: var(--pos-info); }
.col-shipped .col-title-icon { background: rgba(var(--pos-purple-rgb), 0.15); color: var(--pos-purple); }
.col-delivered .col-title-icon { background: rgba(var(--pos-success-rgb), 0.15); color: var(--pos-success); }
.col-enroute .col-title-icon { background: rgba(var(--pos-purple-rgb), 0.15); color: var(--pos-purple); }

.col-name {
    font-size: 13px;
    font-weight: 700;
}

.col-badge {
    background: var(--pos-surface-hover);
    color: var(--pos-text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--pos-border);
}

.kanban-cards-list {
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
}

/* Kanban Order Card */
.order-card {
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-subtle);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    cursor: pointer;
    position: relative;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
    border-color: rgba(255, 255, 255, 0.18);
}

.order-card.urgent {
    border-left: 4px solid var(--pos-danger);
}

.order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.order-id {
    font-weight: 800;
    font-size: 14px;
    color: var(--pos-primary);
}

.order-time-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--pos-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.order-time-tag.time-alert {
    color: var(--pos-danger);
    font-weight: 700;
}

.order-badges-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.type-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.type-delivery { background: rgba(var(--pos-info-rgb), 0.15); color: #60a5fa; }
.type-pickup { background: rgba(var(--pos-warning-rgb), 0.15); color: #fbbf24; }
.type-salon { background: rgba(var(--pos-purple-rgb), 0.15); color: #c084fc; }

.payment-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.payment-paid { background: rgba(var(--pos-success-rgb), 0.12); color: var(--pos-success); }
.payment-pending { background: rgba(var(--pos-danger-rgb), 0.12); color: #f87171; }

.order-customer-box {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.customer-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.customer-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--pos-text);
}

.customer-address {
    font-size: 11.5px;
    color: var(--pos-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    margin-top: 2px;
}

.btn-whatsapp-direct {
    color: #25d366;
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.25);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.btn-whatsapp-direct:hover {
    transform: scale(1.1);
}

.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid var(--pos-border-subtle);
    gap: 8px;
    flex-wrap: wrap;
}

.order-total-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--pos-success);
}

.card-action-btns {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-card-action {
    background: var(--pos-surface-hover);
    border: 1px solid var(--pos-border);
    color: var(--pos-text-secondary);
    border-radius: var(--radius-sm);
    padding: 6px 9px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.btn-card-action:hover {
    background: var(--pos-text);
    color: var(--pos-bg);
}

.btn-card-next {
    background: var(--pos-primary-gradient);
    color: #fff;
    border: none;
    padding: 6px 12px;
    font-weight: 700;
}

.btn-card-next:hover {
    opacity: 0.92;
    transform: scale(1.02);
}

.col-empty-state {
    text-align: center;
    padding: 30px 15px;
    color: var(--pos-text-muted);
    font-size: 12px;
}

.col-empty-state i {
    font-size: 24px;
    opacity: 0.3;
    margin-bottom: 6px;
    display: block;
}

/* =========================================================
   VIEW 2: HIGH-DENSITY TABLE
   ========================================================= */
.table-viewport-container {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
}

.table-toolbar {
    padding: 10px 14px;
    background: var(--pos-surface-card);
    border-bottom: 1px solid var(--pos-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.table-scroll-wrap {
    overflow-x: auto;
    max-height: calc(100vh - 220px);
    -webkit-overflow-scrolling: touch;
}

.density-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
    white-space: nowrap;
}

.density-table th {
    position: sticky;
    top: 0;
    background: var(--pos-surface-card);
    color: var(--pos-text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--pos-border);
    z-index: 10;
}

.density-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--pos-border-subtle);
    color: var(--pos-text);
    vertical-align: middle;
}

.density-table tbody tr {
    transition: background-color 0.12s;
}

.density-table tbody tr:hover {
    background-color: var(--pos-surface-hover);
}

.table-status-select {
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-sm);
    color: var(--pos-text);
    padding: 5px 7px;
    font-size: 11.5px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.row-actions-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn-sm {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--pos-border);
    background: var(--pos-surface-card);
    color: var(--pos-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

.action-btn-sm:hover {
    background: var(--pos-surface-hover);
    color: var(--pos-text);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-btn-sm.btn-del:hover {
    background: var(--pos-danger);
    color: #fff;
    border-color: var(--pos-danger);
}

/* =========================================================
   Modals & Drawers (ui-guidelines.md)
   ========================================================= */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 840px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-modal);
    transform: scale(0.96);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-backdrop.active .modal-card {
    transform: scale(1);
}

.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--pos-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--pos-surface-card);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title {
    font-size: 16px;
    font-weight: 800;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--pos-border);
    background: var(--pos-surface);
    color: var(--pos-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.modal-close-btn:hover {
    background: var(--pos-danger);
    color: #fff;
    border-color: var(--pos-danger);
}

.modal-body {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--pos-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: var(--pos-surface-card);
}

/* Module Shortcut Cards in Modal */
.module-shortcut-card {
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    gap: 8px;
    transition: transform 0.15s, border-color 0.15s;
}

.module-shortcut-card:hover {
    transform: translateY(-2px);
    border-color: var(--pos-primary);
}

.module-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.module-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--pos-text);
}

.module-card-sub {
    font-size: 11px;
    color: var(--pos-text-muted);
}

/* Form Styles */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
}

.form-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--pos-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-input, .form-textarea, .form-select {
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    font-size: 13px;
    color: var(--pos-text);
    outline: none;
    font-family: inherit;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 3px rgba(var(--pos-primary-rgb), 0.15);
}

/* Customer autocomplete dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    z-index: 50;
    max-height: 180px;
    overflow-y: auto;
    display: none;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--pos-border-subtle);
    display: flex;
    flex-direction: column;
}

.autocomplete-item:hover {
    background: var(--pos-surface-hover);
}

.autocomplete-name {
    font-weight: 700;
    color: var(--pos-text);
}

.autocomplete-sub {
    font-size: 11px;
    color: var(--pos-text-muted);
}

/* Product Picker in Order Builder */
.order-builder-section {
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-lg);
    background: var(--pos-surface-card);
    padding: 12px;
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.order-items-table th {
    font-size: 11px;
    font-weight: 700;
    color: var(--pos-text-muted);
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid var(--pos-border);
}

.order-items-table td {
    padding: 8px;
    border-bottom: 1px solid var(--pos-border-subtle);
}

.item-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.item-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--pos-surface-hover);
    color: var(--pos-text);
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.item-qty-val {
    width: 32px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

/* Totals Box */
.order-totals-summary {
    background: var(--pos-surface-hover);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--pos-border-subtle);
}

.total-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--pos-text-secondary);
}

.total-line.final {
    font-size: 16px;
    font-weight: 800;
    color: var(--pos-text);
    border-top: 1px solid var(--pos-border);
    padding-top: 6px;
    margin-top: 4px;
}

.total-line.final span:last-child {
    color: var(--pos-success);
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 74px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pos-text);
    box-shadow: var(--shadow-elevated);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: slideInUp 0.25s ease-out;
}

.toast.toast-success i { color: var(--pos-success); }
.toast.toast-danger i { color: var(--pos-danger); }
.toast.toast-info i { color: var(--pos-info); }

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================================================
   Print Styles (80mm / 58mm Thermal Receipt)
   ========================================================= */


/* =========================================================
   Mobile Bottom Navigation Bar
   ========================================================= */
.mobile-bottom-nav {
    display: none;
}

/* =========================================================
   RESPONSIVE BREAKPOINTS (Mobile-First Polish)
   ========================================================= */
@media (max-width: 850px) {
    /* Hide desktop extra links */
    .desktop-links {
        display: none;
    }

    /* Command Bar Restructuring */
    .command-bar {
        padding: 8px 12px;
        gap: 8px;
    }

    .brand-name {
        font-size: 14px;
    }

    .command-bar-row-bottom {
        flex-wrap: wrap;
        gap: 8px;
    }

    .search-input-wrap {
        width: 100%;
        min-width: 100%;
    }

    .filter-select {
        flex: 1;
        max-width: none;
    }

    /* Mobile Stage Tabs Carousel */
    .mobile-stage-tabs {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 8px 12px;
        background: var(--pos-surface);
        border-bottom: 1px solid var(--pos-border);
        position: sticky;
        top: 102px;
        z-index: 90;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-stage-tabs::-webkit-scrollbar {
        display: none;
    }

    .mobile-stage-tab {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        border-radius: var(--radius-full);
        background: var(--pos-surface-card);
        border: 1px solid var(--pos-border);
        color: var(--pos-text-secondary);
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s;
    }

    .mobile-stage-tab.active {
        background: var(--pos-primary-gradient);
        color: #ffffff;
        border-color: transparent;
        box-shadow: 0 3px 10px rgba(var(--pos-primary-rgb), 0.35);
    }

    .stage-pill-count {
        background: rgba(0, 0, 0, 0.25);
        padding: 1px 6px;
        border-radius: var(--radius-full);
        font-size: 10.5px;
    }

    .mobile-stage-tab.active .stage-pill-count {
        background: rgba(255, 255, 255, 0.25);
        color: #ffffff;
    }

    /* Kanban Board on Mobile: Single Column Active Stack */
    .main-viewport {
        padding: 10px 12px 80px 12px;
    }

    .kanban-board {
        display: block !important;
        overflow: visible;
        padding-bottom: 0;
    }

    .kanban-col {
        display: none !important;
        max-height: none !important;
        border: none;
        background: transparent;
    }

    .kanban-col.mobile-active-stage {
        display: flex !important;
    }

    .kanban-col-header {
        display: none;
    }

    .kanban-cards-list {
        padding: 0;
        gap: 12px;
    }

    .order-card {
        width: 100%;
        padding: 14px;
        border-radius: var(--radius-lg);
    }

    .order-card-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .card-action-btns {
        width: 100%;
        justify-content: flex-end;
        margin-top: 4px;
    }

    .btn-card-action {
        padding: 8px 12px;
        font-size: 12px;
    }

    .btn-whatsapp-direct {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Mobile Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--pos-surface);
        border-top: 1px solid var(--pos-border);
        z-index: 999;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        justify-content: space-around;
        align-items: center;
        padding: 0 6px;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--pos-text-muted);
        font-size: 10px;
        font-weight: 600;
        text-decoration: none;
        border: none;
        background: transparent;
        cursor: pointer;
        flex: 1;
        height: 100%;
        transition: color 0.15s;
    }

    .mobile-nav-item i {
        font-size: 16px;
    }

    .mobile-nav-item.active {
        color: var(--pos-primary);
    }

    .mobile-nav-item.nav-btn-highlight {
        color: #fff;
    }

    .mobile-nav-item.nav-btn-highlight .nav-icon-circle {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--pos-primary-gradient);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: -18px;
        box-shadow: 0 4px 14px rgba(var(--pos-primary-rgb), 0.5);
        font-size: 18px;
    }

    /* Bottom Sheet Modals on Mobile */
    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal-card {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-height: 88vh;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .form-grid-2, .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .toast-container {
        bottom: 74px;
        left: 14px;
        right: 14px;
    }
}

/* =========================================================
   Product Options & Configuration Modal Styles
   ========================================================= */
.product-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 71, 87, 0.12);
    color: var(--pos-primary);
    border: 1px solid rgba(255, 71, 87, 0.25);
}

.product-type-badge.badge-menu {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.product-type-badge.badge-box {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.3);
}

.product-type-badge.badge-variable {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.product-type-badge.badge-simple {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

/* Variants Grid */
.variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.variant-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 8px;
    background: var(--pos-surface-card);
    border: 1.5px solid var(--pos-border);
    border-radius: var(--radius-md);
    color: var(--pos-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
}

.variant-btn:hover {
    border-color: var(--pos-primary);
    background: var(--pos-surface-hover);
}

.variant-btn.active {
    border-color: var(--pos-primary);
    background: rgba(var(--pos-primary-rgb), 0.1);
    color: var(--pos-primary);
    box-shadow: 0 0 0 1px var(--pos-primary);
}

.variant-name {
    font-size: 12px;
    font-weight: 700;
}

.variant-price {
    font-size: 11px;
    color: var(--pos-text-muted);
}

.variant-btn.active .variant-price {
    color: var(--pos-primary);
    font-weight: 700;
}

/* Menu del Dia / Combo Options */
.menu-free-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 12px;
}

.menu-free-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.menu-free-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}

.menu-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 8px;
}

.menu-option-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 8px;
    background: var(--pos-surface-card);
    border: 1.5px solid var(--pos-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.menu-option-card:hover {
    border-color: var(--pos-primary);
    background: var(--pos-surface-hover);
}

.menu-option-card.active {
    border-color: var(--pos-primary);
    background: rgba(var(--pos-primary-rgb), 0.1);
    box-shadow: 0 0 0 1px var(--pos-primary);
}

.menu-option-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--pos-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: transparent;
    transition: all 0.18s;
}

.menu-option-card.active .menu-option-check {
    background: var(--pos-primary);
    border-color: var(--pos-primary);
    color: #fff;
}

.menu-option-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    margin-bottom: 6px;
    background-color: rgba(255,255,255,0.05);
}

.menu-option-title {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--pos-text);
    line-height: 1.25;
}

.menu-option-desc {
    font-size: 10px;
    color: var(--pos-text-muted);
    margin-top: 2px;
    line-height: 1.2;
}

.menu-option-price {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--pos-primary);
    margin-top: 4px;
}

/* Box Product Tracker & Lists */
.box-tracker-card {
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

/* Extras Groups & Items */
.extras-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.extra-group-card {
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-md);
    padding: 12px;
}

.extra-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.extra-group-title {
    margin: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--pos-text);
}

.extra-group-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--pos-bg);
    color: var(--pos-text-muted);
}

.extra-group-badge.required {
    background: rgba(var(--pos-primary-rgb), 0.15);
    color: var(--pos-primary);
    border: 1px solid rgba(var(--pos-primary-rgb), 0.3);
}

.extra-group-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.extra-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--pos-bg);
    border: 1.5px solid var(--pos-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s ease;
    gap: 8px;
    user-select: none;
}

.extra-item:hover {
    border-color: var(--pos-border-hover);
    background: var(--pos-surface-hover);
}

.extra-item.active {
    border-color: var(--pos-primary);
    background: rgba(var(--pos-primary-rgb), 0.08);
}

.extra-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.extra-item-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--pos-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.18s;
}

.extra-item.active .extra-item-check {
    background: var(--pos-primary);
    border-color: var(--pos-primary);
    color: #fff;
}

.extra-item-thumb {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: var(--pos-surface-card);
}

.extra-item-details {
    flex: 1;
    min-width: 0;
}

.extra-item-name {
    font-weight: 700;
    font-size: 12px;
    color: var(--pos-text);
}

.extra-item-desc {
    font-size: 10.5px;
    color: var(--pos-text-muted);
}

.extra-free-badge {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
}

.extra-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.extra-item-price {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--pos-primary);
}

.extra-qty-counter {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--pos-surface-card);
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-sm);
    padding: 2px 4px;
}

.extra-qty-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: none;
    background: rgba(255,255,255,0.08);
    color: var(--pos-text);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.extra-qty-btn:hover {
    background: var(--pos-primary);
    color: #fff;
}

.extra-qty-val {
    font-size: 12px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.sub-extras-wrap {
    margin-top: 6px;
    padding: 8px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--pos-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* =========================================================
   Thermal Ticket Print (80mm / 58mm POS Centered Layout)
   ========================================================= */
#thermalTicketArea {
    display: none;
}

@media print {
    @page {
        margin: 0;
        size: auto;
    }
    
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: 'Courier New', Courier, monospace, -apple-system, BlinkMacSystemFont, sans-serif !important;
        width: 100% !important;
    }
    
    body * {
        visibility: hidden !important;
    }
    
    #thermalTicketArea, #thermalTicketArea * {
        visibility: visible !important;
    }
    
    #thermalTicketArea {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        margin: 0 auto !important;
        width: 76mm !important;
        max-width: 100% !important;
        padding: 4mm 2mm !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
        color: #000000 !important;
        background: #ffffff !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    .ticket-logo-wrap {
        text-align: center !important;
        margin-bottom: 6px !important;
    }

    .ticket-logo-img {
        display: block !important;
        margin: 0 auto 6px auto !important;
        max-width: 140px !important;
        max-height: 70px !important;
        object-fit: contain !important;
        filter: grayscale(100%) contrast(150%) !important;
    }

    .ticket-center {
        text-align: center !important;
    }

    .ticket-divider {
        border: none !important;
        border-top: 1px dashed #000000 !important;
        margin: 6px 0 !important;
        width: 100% !important;
    }

    .ticket-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 6px 0 !important;
        font-size: 11.5px !important;
        text-align: left !important;
    }

    .ticket-table th {
        border-bottom: 1px dashed #000000 !important;
        padding: 3px 0 !important;
        font-weight: bold !important;
    }

    .ticket-table td {
        padding: 3px 0 !important;
        vertical-align: top !important;
    }

    .ticket-item-sub {
        font-size: 10.5px !important;
        padding-left: 10px !important;
        color: #333333 !important;
    }

    .ticket-row-flex {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin: 2px 0 !important;
    }

    .ticket-total-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 15px !important;
        font-weight: bold !important;
        margin-top: 4px !important;
    }
}

