:root {
    --primary: #032a56;
    --primary-light: #0a468d;
    --primary-dark: #001a33;
    --accent: #00d2ff;
    --accent-hover: #00b4db;
    --bg: #f4f7fa;
    --card: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --text-muted: #8c98a4;
    --danger: #ff7675;
    --danger-dark: #d63031;
    --success: #00b894;
    --success-light: #55efc4;
    --warning: #fdcb6e;
    --warning-dark: #e17055;
    --info: #0984e3;
    --border: #e2e8f0;
    --border-focus: #032a56;
    --shadow-sm: 0 2px 8px rgba(3, 42, 86, 0.04);
    --shadow: 0 10px 30px rgba(3, 42, 86, 0.08);
    --shadow-lg: 0 20px 50px rgba(3, 42, 86, 0.15);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ─── App Container & Layout ────────────────────────────────── */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Header ────────────────────────────────────────────────── */
.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 26, 51, 0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: #ffffff;
}

.header-logo {
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.header-titles h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-titles .badge-sub {
    font-size: 0.65rem;
    background: rgba(0, 210, 255, 0.18);
    color: var(--accent);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-titles p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.server-status-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-light);
    box-shadow: 0 0 8px var(--success-light);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-cart-pill {
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 210, 255, 0.3);
}

.btn-cart-pill:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 210, 255, 0.4);
}

.cart-count-badge {
    background: var(--primary);
    color: #ffffff;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

/* ─── Navigation Tabs Bar ───────────────────────────────────── */
.nav-tabs-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    position: sticky;
    top: 59px;
    z-index: 90;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.9rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--accent);
}

.tab-counter {
    background: #edf2f7;
    color: var(--text);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.tab-btn.active .tab-counter {
    background: var(--primary);
    color: #ffffff;
}

.tab-counter.pulse-red {
    background: var(--danger);
    color: #ffffff;
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ─── Main Content Container ────────────────────────────────── */
.main-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem 1rem;
    flex: 1;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ─── Search & Filter Section ───────────────────────────────── */
.search-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* ─── POS Split View Order Builder (Compact High-Density 50/50 Layout) ─── */
.pos-order-builder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 960px) {
    .pos-order-builder {
        grid-template-columns: 1fr;
    }
}

.pos-search-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.search-results-box {
    margin-top: 1rem;
    max-height: 550px;
    min-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.25rem;
}

.search-result-row {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: var(--transition);
}

.search-result-row:hover {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 3px 10px rgba(3, 42, 86, 0.08);
    transform: translateY(-1px);
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.result-price-side {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: right;
    flex-shrink: 0;
}

.result-price-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}

.pos-cart-panel {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.pos-cart-items-container {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.pos-cart-table {
    width: 100%;
    border-collapse: collapse;
}

.pos-cart-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0.45rem 0.6rem;
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid var(--border);
}

.pos-cart-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.82rem;
    vertical-align: middle;
}

.pos-cart-table tr:last-child td {
    border-bottom: none;
}

.btn-del-item {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-del-item:hover {
    background: #fee2e2;
}

.pos-totals-strip {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.95rem;
    margin-bottom: 0.85rem;
    border: 1px solid var(--border);
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.15rem;
}

.pos-total-row.grand-total {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--border);
    margin-bottom: 0;
}

.pos-cart-panel .form-group {
    margin-bottom: 0.55rem;
}

.pos-cart-panel .form-group label {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}

.pos-cart-panel .form-control {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.pos-cart-panel .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    background: #fdfdfd;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(3, 42, 86, 0.08);
    background: #ffffff;
}

.category-chips {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.chip {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text-light);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.chip:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(3, 42, 86, 0.2);
}

/* ─── Product Catalog Grid ──────────────────────────────────── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.25rem;
}

.product-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(0, 210, 255, 0.4);
}

.product-category-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f1f5f9;
    color: var(--primary-light);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.product-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(3, 42, 86, 0.08) 0%, rgba(0, 210, 255, 0.12) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.9rem;
    color: var(--primary);
}

.product-info h3 {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.product-meta span {
    background: #f8fafc;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.product-price small {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    display: block;
}

.btn-add-cart {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.55rem 0.95rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition);
}

.btn-add-cart:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(3, 42, 86, 0.25);
    transform: scale(1.03);
}

.btn-add-cart:active {
    transform: scale(0.98);
}

/* ─── Orders Queue & Live Dashboard ─────────────────────────── */
.orders-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.orders-stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card.stat-pending .stat-icon { background: rgba(255, 118, 117, 0.15); color: var(--danger); }
.stat-card.stat-picking .stat-icon { background: rgba(253, 203, 110, 0.2); color: var(--warning-dark); }
.stat-card.stat-way .stat-icon { background: rgba(9, 132, 227, 0.15); color: var(--info); }
.stat-card.stat-done .stat-icon { background: rgba(0, 184, 148, 0.15); color: var(--success); }

.stat-content h4 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.stat-content p {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    margin-top: 0.15rem;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.25rem;
}

.order-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
}

.order-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.order-card.status-PENDIENTE { border-left: 5px solid var(--danger); }
.order-card.status-EN_PICKING { border-left: 5px solid var(--warning); }
.order-card.status-EN_CAMINO { border-left: 5px solid var(--info); }
.order-card.status-ENTREGADO { border-left: 5px solid var(--success); }
.order-card.status-CANCELADO { border-left: 5px solid var(--text-muted); opacity: 0.75; }

.order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.order-id-badge {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--primary);
}

.order-time-elapsed {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.badge-PENDIENTE { background: #ffeaea; color: var(--danger-dark); }
.status-badge.badge-EN_PICKING { background: #fff8e6; color: #b7791f; }
.status-badge.badge-EN_CAMINO { background: #e6f4ff; color: var(--info); }
.status-badge.badge-ENTREGADO { background: #e6fffa; color: var(--success); }
.status-badge.badge-CANCELADO { background: #f1f5f9; color: var(--text-light); }

.order-customer-info {
    margin-bottom: 0.85rem;
}

.customer-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.customer-address {
    font-size: 0.82rem;
    color: var(--text-light);
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    line-height: 1.35;
    margin-bottom: 0.25rem;
}

.customer-phone-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary-light);
    font-weight: 600;
}

.wa-btn {
    color: #25d366;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.wa-btn:hover {
    text-decoration: underline;
}

.order-notes-box {
    background: #fffbeb;
    border: 1px dashed #fcd34d;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    color: #92400e;
    margin-top: 0.4rem;
}

.order-items-summary {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 0.65rem;
    margin-bottom: 0.85rem;
    font-size: 0.8rem;
}

.order-item-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.order-item-line:last-child {
    margin-bottom: 0;
}

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

.order-total-block {
    display: flex;
    flex-direction: column;
}

.order-total-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.order-total-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
}

.order-card-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-action-sm {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition);
}

.btn-take-order {
    background: var(--primary);
    color: #ffffff;
}

.btn-take-order:hover {
    background: var(--primary-light);
}

.btn-status-transit {
    background: var(--info);
    color: #ffffff;
}

.btn-status-deliver {
    background: var(--success);
    color: #ffffff;
}

.btn-print-sm {
    background: #edf2f7;
    color: var(--text);
}

.btn-print-sm:hover {
    background: #e2e8f0;
}

/* ─── Cart Drawer & Modal ───────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 42, 86, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    background: var(--primary);
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-close-modal {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.btn-close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(3, 42, 86, 0.08);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.cart-items-list {
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cart-item-row {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.cart-item-row:last-child {
    border-bottom: none;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-qty {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #ffffff;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-qty:hover {
    background: #f1f5f9;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.btn-submit-order {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #ffffff;
    border: none;
    padding: 0.85rem 1.8rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(3, 42, 86, 0.3);
    transition: var(--transition);
}

.btn-submit-order:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(3, 42, 86, 0.4);
}

/* ─── Thermal Ticket Print Preview ──────────────────────────── */
.ticket-container {
    font-family: 'Courier New', Courier, monospace;
    background: #ffffff;
    padding: 1.5rem;
    width: 320px;
    margin: 0 auto;
    border: 1px dashed #94a3b8;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #000000;
}

.ticket-header {
    text-align: center;
    margin-bottom: 1rem;
}

.ticket-divider {
    border-top: 1px dashed #000000;
    margin: 0.5rem 0;
}

/* ─── API Integration Tab ───────────────────────────────────── */
.integration-doc-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.code-block {
    background: #0f172a;
    color: #38bdf8;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: 'Consolas', 'Fira Code', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    margin: 0.75rem 0 1.25rem 0;
}

.badge-method {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.badge-method.get { background: #0284c7; color: #ffffff; }
.badge-method.post { background: #16a34a; color: #ffffff; }

/* ─── Toast Notifications ───────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--primary-dark);
    color: #ffffff;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--accent);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── Responsive Adjustments ────────────────────────────────── */
@media (max-width: 768px) {
    .main-header { padding: 0.75rem 1rem; }
    .header-titles p { display: none; }
    .main-container { padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .orders-grid { grid-template-columns: 1fr; }
}

/* ─── Staff Management (Gestión de Personal Espaciosa) ───────── */
.staff-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.clickable-card {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(3, 42, 86, 0.12);
    border-color: var(--primary-light);
}

.clickable-card:active {
    transform: translateY(0);
}

.clickable-card.active-stat-card {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(3, 42, 86, 0.15);
    background: #ffffff;
}


@media (max-width: 900px) {
    .staff-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.staff-table-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
}

.staff-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.staff-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.staff-table th {
    background: #f8fafc;
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.staff-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text);
}

.staff-table tbody tr:hover td {
    background: #f8fafc;
}

.staff-table tbody tr:last-child td {
    border-bottom: none;
}

.cedula-badge {
    font-family: 'Consolas', 'Fira Code', monospace;
    font-weight: 700;
    font-size: 0.88rem;
    background: #f1f5f9;
    color: var(--primary);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
    display: inline-block;
}

.user-avatar-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(3, 42, 86, 0.2);
}

.user-name-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.25;
}

.user-contact-block {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.82rem;
}

.user-email-line {
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.user-phone-line {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
}

.role-badge.role-admin {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.role-badge.role-operador {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.role-badge.role-picker {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.role-badge.role-domiciliario {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge-listo_entrega {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}

.stat-card.stat-packed {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
}

.stat-card.stat-packed .stat-icon {
    background: #fef3c7;
    color: #b45309;
}

.placa-badge {
    background: #fef08a;
    color: #854d0e;
    font-family: 'Consolas', monospace;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid #fde047;
    margin-left: 0.25rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
}

.status-pill.status-active {
    background: #dcfce7;
    color: #15803d;
}

.status-pill.status-inactive {
    background: #fee2e2;
    color: #b91c1c;
}


