/* ============================================
   styles.css - COMPLETO Y ADAPTABLE
   App de Pedidos - Soporte universal y responsivo
   ============================================ */

/* ===== RESET Y VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #ca8a04;
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* ===== CONTENEDOR PRINCIPAL - OCUPA TODO EL ANCHO EN MÓVIL ===== */
.app-container {
    width: 100%;
    max-width: 100%;          /* En móvil ocupa todo el ancho */
    height: 100dvh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@supports not (height: 100dvh) {
    .app-container {
        height: 100vh;
        min-height: 100vh;
    }
}

/* ===== RESPONSIVE: PANTALLAS GRANDES ===== */
/* Tablets y pantallas medianas */
@media (min-width: 640px) {
    .app-container {
        max-width: 600px;
        border-radius: 12px;
        box-shadow: 0 0 20px rgba(0,0,0,0.08);
        margin: 16px auto;
        height: calc(100dvh - 32px);
        min-height: calc(100dvh - 32px);
    }
    body {
        background: #e5e7eb;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100vh;
    }
}

/* Escritorio pequeño */
@media (min-width: 768px) {
    .app-container {
        max-width: 720px;
        border-radius: 16px;
        box-shadow: 0 0 30px rgba(0,0,0,0.1);
        margin: 20px auto;
        height: calc(100dvh - 40px);
        min-height: calc(100dvh - 40px);
    }
}

/* Escritorio mediano */
@media (min-width: 1024px) {
    .app-container {
        max-width: 860px;
        border-radius: 20px;
        box-shadow: 0 0 40px rgba(0,0,0,0.12);
        margin: 30px auto;
        height: calc(100dvh - 60px);
        min-height: calc(100dvh - 60px);
    }
}

/* Escritorio grande */
@media (min-width: 1280px) {
    .app-container {
        max-width: 1000px;
        border-radius: 24px;
        box-shadow: 0 0 50px rgba(0,0,0,0.15);
        margin: 40px auto;
        height: calc(100dvh - 80px);
        min-height: calc(100dvh - 80px);
    }
}

/* Pantallas extra grandes (4K) */
@media (min-width: 1600px) {
    .app-container {
        max-width: 1200px;
        border-radius: 28px;
        margin: 50px auto;
        height: calc(100dvh - 100px);
        min-height: calc(100dvh - 100px);
    }
}

/* ===== SCREENS (pantallas internas) ===== */
.screen {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: 90px;   /* Espacio para el action bar sticky */
    display: none;
    scroll-behavior: smooth;
}

.screen.active {
    display: block;
}

@supports (padding: max(0px)) {
    .screen {
        padding-bottom: max(10px, env(safe-area-inset-bottom, 0px) + 10px);
    }
}

.screen#screen-login {
    padding-bottom: 16px;
}

/* Scrollbar personalizado (escritorio) */
@media (min-width: 768px) {
    .screen::-webkit-scrollbar {
        width: 6px;
    }
    .screen::-webkit-scrollbar-track {
        background: var(--bg);
        border-radius: 3px;
    }
    .screen::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 3px;
    }
    .screen::-webkit-scrollbar-thumb:hover {
        background: var(--primary-dark);
    }
}

/* ===== HEADER ===== */
.header {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-right: 60px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header .user-info {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 4px;
}

@media (min-width: 768px) {
    .header {
        padding: 20px 32px;
        padding-right: 80px;
        padding-top: 20px;
    }
    .header h1 {
        font-size: 1.5rem;
    }
    .header .user-info {
        font-size: 0.875rem;
    }
}

/* ===== BACK BUTTON ===== */
.back-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    .back-btn {
        left: 24px;
        padding: 8px 16px;
        font-size: 1rem;
    }
}

/* ===== MENU BUTTON ===== */
.menu-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 20;
    touch-action: manipulation;
}

.menu-btn:active {
    transform: translateY(-50%) scale(0.9);
}

@media (min-width: 768px) {
    .menu-btn {
        right: 24px;
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
        border-radius: 10px;
    }
}

/* ===== MENÚ DESPLEGABLE ===== */
.dropdown-menu {
    position: fixed;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    min-width: 220px;
    z-index: 99999;
    display: none;
    overflow: hidden;
    border: 1px solid var(--border);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
}

.dropdown-menu.active {
    display: block !important;
}

.dropdown-item {
    padding: 12px 16px;
    font-size: 0.9375rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s ease;
    touch-action: manipulation;
}

.dropdown-item:hover {
    background: var(--bg);
}
.dropdown-item:active {
    background: var(--border);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.dropdown-item.danger {
    color: var(--danger);
}
.dropdown-item.danger:hover {
    background: #fee2e2;
}

.dropdown-item.admin-only {
    display: none;
}
.dropdown-menu.show-admin .admin-only {
    display: flex;
}

@media (max-width: 480px) {
    .dropdown-menu {
        min-width: 200px;
    }
}

/* ===== ACTION BAR ===== */
.action-bar {
    position: sticky;
    bottom: 0;
    background: var(--card);
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    display: flex;
    gap: 12px;
    z-index: 5;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    position: -webkit-sticky;
}

.action-bar .btn {
    flex: 1;
}

@media (min-width: 640px) {
    .action-bar {
        border-radius: 0 0 12px 12px;
    }
}
@media (min-width: 768px) {
    .action-bar {
        border-radius: 0 0 16px 16px;
        padding: 20px 24px;
        gap: 16px;
    }
}
@media (min-width: 1024px) {
    .action-bar {
        border-radius: 0 0 20px 20px;
    }
}
@media (min-width: 1280px) {
    .action-bar {
        border-radius: 0 0 24px 24px;
    }
}

/* ===== LOGIN ===== */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    padding: 24px;
    max-width: 400px;
    margin: 0 auto;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 2rem;
    color: white;
}

@media (min-width: 768px) {
    .login-container {
        max-width: 480px;
        padding: 40px;
    }
    .login-logo {
        width: 100px;
        height: 100px;
        border-radius: 24px;
        font-size: 2.5rem;
    }
}

/* ===== INPUTS ===== */
.input-group {
    width: 100%;
    margin-bottom: 16px;
}
.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
}
.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    -webkit-appearance: none;
    background: white;
}
.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
}
@media (min-width: 768px) {
    .input-group input,
    .input-group select {
        padding: 16px 20px;
        border-radius: 14px;
        font-size: 1.05rem;
    }
}

/* ===== BOTONES ===== */
.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn:active {
    transform: scale(0.98);
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-success {
    background: var(--success);
    color: white;
}
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}
.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    width: auto;
    border-radius: 8px;
}
.btn-sm:active {
    transform: scale(0.95);
}
@media (min-width: 768px) {
    .btn {
        padding: 16px 24px;
        border-radius: 14px;
        font-size: 1.05rem;
    }
    .btn-sm {
        padding: 10px 20px;
        font-size: 0.9375rem;
    }
}

/* ===== CARDS ===== */
.card {
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
@media (min-width: 768px) {
    .card {
        padding: 20px 24px;
        border-radius: 16px;
        margin-bottom: 16px;
    }
}

/* ===== PRODUCTOS ===== */
.product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.product-item:last-child {
    border-bottom: none;
}
.product-row {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 12px;
}
.product-info {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}
.product-info h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-info p {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 2px;
}
.product-controls {
    width: 90px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.product-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}
.product-thumb-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}
@media (min-width: 768px) {
    .product-item {
        padding: 16px 0;
        gap: 20px;
    }
    .product-thumb {
        width: 80px;
        height: 80px;
        border-radius: 12px;
    }
    .product-thumb-placeholder {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    .product-info h3 {
        font-size: 1.1rem;
    }
    .product-controls {
        width: 110px;
    }
}

/* ===== COUNTER ===== */
.counter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.counter-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}
.counter-btn:active {
    transform: scale(0.9);
}
.counter-btn.minus {
    background: var(--danger);
}
.counter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.counter-value {
    min-width: 32px;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
}
@media (min-width: 768px) {
    .counter-btn {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }
    .counter-value {
        min-width: 40px;
        font-size: 1.25rem;
    }
}

/* ===== BADGES ===== */
.qty-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}
.qty-badge.warning {
    background: var(--warning);
}
.qty-badge.danger {
    background: var(--danger);
}
.qty-badge.success {
    background: var(--success);
}
@media (min-width: 768px) {
    .qty-badge {
        padding: 6px 16px;
        font-size: 0.9375rem;
    }
}

/* ===== PRECIO ===== */
.precio-tag {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}
.precio-total-bar {
    background: var(--card);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
}
.precio-total-bar .label {
    color: var(--text-light);
    font-size: 0.875rem;
}
.precio-total-bar .monto {
    color: var(--primary);
    font-size: 1.125rem;
}
@media (min-width: 768px) {
    .precio-total-bar {
        padding: 16px 24px;
        font-size: 1.125rem;
        border-radius: 16px;
    }
    .precio-total-bar .monto {
        font-size: 1.25rem;
    }
}

/* ===== STOCK ===== */
.stock-indicator {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
    margin-top: 2px;
}
.stock-indicator.low {
    color: var(--warning);
}
.stock-indicator.critical {
    color: var(--danger);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
}

/* ===== MODALES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: var(--card);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
}
.modal h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}
.modal p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 20px;
}
.modal-actions {
    display: flex;
    gap: 12px;
}
@media (min-width: 768px) {
    .modal {
        max-width: 420px;
        padding: 32px;
        border-radius: 20px;
    }
    .modal h3 {
        font-size: 1.25rem;
    }
}

/* ===== SLIDER ===== */
.slider-container {
    position: relative;
    width: 100%;
    height: 60px;
    background: #e5e7eb;
    border-radius: 30px;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;
    margin-top: 8px;
}
.slider-track-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--success), #22c55e);
    border-radius: 30px;
    transition: width 0.1s linear;
}
.slider-thumb {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 52px;
    height: 52px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    cursor: grab;
    z-index: 3;
    transition: left 0.1s linear;
    touch-action: none;
}
.slider-thumb::after {
    content: "→";
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
}
.slider-text {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    line-height: 60px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #6b7280;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.2s;
}
.slider-container.confirmed .slider-thumb {
    cursor: default;
}
.slider-container.confirmed .slider-thumb::after {
    content: "✓";
    color: var(--success);
}
.slider-container.confirmed .slider-text {
    opacity: 0;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 200;
    transition: transform 0.3s ease;
    white-space: nowrap;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast.error {
    background: var(--danger);
}
.toast.success {
    background: var(--success);
}
.toast.info {
    background: var(--primary);
}
@media (min-width: 768px) {
    .toast {
        top: 24px;
        padding: 16px 32px;
        font-size: 1rem;
        border-radius: 12px;
        max-width: 90%;
        white-space: normal;
    }
}

/* ===== FAB ===== */
.fab {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    border: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
.fab.visible {
    display: flex;
}
@media (min-width: 768px) {
    .fab {
        bottom: 100px;
        right: 24px;
        width: 64px;
        height: 64px;
        font-size: 1.75rem;
    }
}

/* ===== DEBUG ===== */
.debug-box {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ===== RETIRANDO ===== */
.retirando-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 4px;
}

/* ============================================
   COLA DE ESPERA
   ============================================ */
.cola-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}
.cola-badge.cola-listo {
    background: #dcfce7;
    color: #16a34a;
    animation: pulse-verde 1.5s ease-in-out infinite;
}
.cola-badge.cola-naranja {
    background: #fff3e0;
    color: #e65100;
}
.cola-badge.cola-amarilla {
    background: #fff8e1;
    color: #f57f17;
}
.cola-badge.cola-verde {
    background: #e8f5e9;
    color: #2e7d32;
}

.cola-position-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.cola-position-badge.cola-listo {
    background: #dcfce7;
    color: #16a34a;
    animation: pulse-verde 1.5s ease-in-out infinite, shake-listo 2s ease-in-out infinite;
}
.cola-position-badge.cola-naranja {
    background: #fff3e0;
    color: #e65100;
}
.cola-position-badge.cola-amarilla {
    background: #fff8e1;
    color: #f57f17;
}
.cola-position-badge.cola-verde {
    background: #e8f5e9;
    color: #2e7d32;
}

.cola-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}
.cola-card.cola-listo {
    border-left-color: #16a34a;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    animation: resaltar-verde 2s ease-in-out infinite;
}
.cola-card.cola-naranja {
    border-left-color: #e65100;
    background: linear-gradient(135deg, #ffffff 0%, #fff3e0 100%);
}
.cola-card.cola-amarilla {
    border-left-color: #f57f17;
    background: linear-gradient(135deg, #ffffff 0%, #fff8e1 100%);
}
.cola-card.cola-verde {
    border-left-color: #2e7d32;
}
.cola-info {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   ADMIN AVISOS RETIRO
   ============================================ */
.aviso-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    padding: 16px;
    background: var(--card);
}
.aviso-card.cola-listo {
    border-left-color: #16a34a;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}
.aviso-card.cola-naranja {
    border-left-color: #e65100;
    background: linear-gradient(135deg, #ffffff 0%, #fff3e0 100%);
}
.aviso-card.cola-amarilla {
    border-left-color: #f57f17;
    background: linear-gradient(135deg, #ffffff 0%, #fff8e1 100%);
}
.aviso-card.cola-verde {
    border-left-color: #2e7d32;
}
.aviso-card input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 4px;
    border: 2px solid var(--border);
    transition: all 0.2s ease;
}
.aviso-card input[type="checkbox"]:checked {
    accent-color: var(--success);
}
.aviso-card input[type="checkbox"][data-cambio="true"] {
    animation: pulse-checkbox 1s ease-in-out infinite;
}

/* ============================================
   ADMIN USUARIOS
   ============================================ */
.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.user-card:last-child {
    border-bottom: none;
}
.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    flex-shrink: 0;
}
.user-info-flex {
    flex: 1;
    min-width: 0;
}
.user-info-flex input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
}
.user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
.icon-btn.active {
    background: var(--warning);
    color: white;
}
.icon-btn.danger {
    background: #fee2e2;
    color: var(--danger);
}
@media (min-width: 768px) {
    .user-card {
        padding: 16px 0;
        gap: 20px;
    }
    .user-avatar {
        width: 52px;
        height: 52px;
        font-size: 1.25rem;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes pulse-verde {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(22,163,74,0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px 8px rgba(22,163,74,0.15); }
}
@keyframes resaltar-verde {
    0%, 100% { background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%); }
    50% { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); }
}
@keyframes shake-listo {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
@keyframes pulse-checkbox {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   FILTROS Y UTILIDADES
   ============================================ */
.filter-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#estado-ultima-actualizacion {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    transition: color 0.3s ease;
    min-width: 70px;
    text-align: right;
}
#estado-ultima-actualizacion.actualizando {
    color: rgba(255,255,200,0.8);
    animation: pulse 1s ease-in-out infinite;
}
#admin-avisos-conteo,
#admin-avisos-seleccionados {
    font-weight: 600;
    color: var(--primary);
}

/* ============================================
   RESPONSIVE: GRIDS
   ============================================ */
@media (min-width: 768px) {
    .productos-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .productos-grid .card {
        margin-bottom: 0;
    }
}
@media (min-width: 1024px) {
    .productos-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ============================================
   TABLAS RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        font-size: 0.9375rem;
    }
    table th,
    table td {
        padding: 12px 16px !important;
    }
}

/* ============================================
   BOTÓN REFRESH ESTADO
   ============================================ */
.btn-refresh-estado {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.3s ease;
    touch-action: manipulation;
}
.btn-refresh-estado:active {
    transform: rotate(180deg);
}
.btn-refresh-estado .spinning {
    animation: spin 0.6s linear infinite;
}

/* ============================================
   LOADING INDICATOR
   ============================================ */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-light);
}
.loading-indicator .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}
.progress-bar-container .reservado {
    background: var(--primary);
    height: 100%;
    transition: width 0.3s ease;
}
.progress-bar-container .entregado {
    background: var(--success);
    height: 100%;
    transition: width 0.3s ease;
}

/* ============================================
   RESPONSIVE: PANTALLAS MUY PEQUEÑAS
   ============================================ */
@media (max-width: 380px) {
    .header {
        padding-right: 50px;
    }
    #estado-ultima-actualizacion {
        font-size: 0.5rem;
        min-width: 50px;
    }
    .header h1 {
        font-size: 1rem;
    }
    .back-btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    .menu-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    .card {
        padding: 12px;
    }
    .btn {
        padding: 10px;
        font-size: 0.875rem;
    }
    .product-thumb {
        width: 48px;
        height: 48px;
    }
    .product-thumb-placeholder {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
    .product-info h3 {
        font-size: 0.8125rem;
    }
    .counter-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    .counter-value {
        min-width: 24px;
        font-size: 0.9375rem;
    }
    .qty-badge {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
}
