/* =============================================
   Wapitzz — Sistema de Diseño
   Dark Mode optimizado para cocina/tablet
   ============================================= */

/* ─── CSS Variables ─────────────────────────── */
:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1a2744;
    --bg-input: #0f1729;
    --bg-surface: #1e293b;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-white: #ffffff;

    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.3);
    --accent-orange: #f59e0b;
    --accent-orange-glow: rgba(245, 158, 11, 0.3);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.3);
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-purple: #8b5cf6;

    --border-color: #2d3748;
    --border-light: #374151;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.6);
    --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbar personalizado ───────────────── */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ═══════════════════════════════════════════════
   HEADER (compartido)
   ═══════════════════════════════════════════════ */
.kitchen-header, .admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.store-name {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-orange), #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-surface);
    border-radius: 20px;
    font-size: 0.8rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-orange);
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green-glow);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.clock {
    font-size: 1.6rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.nav-link.logout {
    color: var(--accent-red);
}

/* ═══════════════════════════════════════════════
   KITCHEN DASHBOARD
   ═══════════════════════════════════════════════ */
.kitchen-body {
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0d0d0d 70%);
}

.kitchen-main {
    padding: 20px 24px;
}

.orders-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.orders-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.order-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    background: var(--accent-orange);
    color: var(--bg-primary);
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Grid de tarjetas de pedidos */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    animation: fadeIn 0.5s ease;
}

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

/* Tarjeta de pedido */
.order-card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-surface));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: slideIn 0.4s ease;
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-green));
}

.order-card:hover {
    border-color: var(--accent-orange);
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-orange-glow);
    transform: translateY(-2px);
}

.order-card.new {
    animation: newOrder 0.6s ease;
    border-color: var(--accent-green);
    box-shadow: var(--shadow-glow-green);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes newOrder {
    0% { transform: scale(0.9); opacity: 0; box-shadow: 0 0 0 var(--accent-green-glow); }
    50% { transform: scale(1.02); box-shadow: 0 0 40px var(--accent-green-glow); }
    100% { transform: scale(1); opacity: 1; }
}

.order-card.removing {
    animation: removeOrder 0.4s ease forwards;
}

@keyframes removeOrder {
    to { opacity: 0; transform: scale(0.9) translateY(-20px); height: 0; padding: 0; margin: 0; }
}

.order-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.order-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-orange);
}

.order-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.order-items {
    margin-bottom: 14px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.order-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.item-qty {
    font-weight: 700;
    color: var(--accent-green);
    font-size: 1.1rem;
    min-width: 30px;
}

.item-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.item-details {
    font-size: 0.85rem;
    color: var(--accent-orange);
    font-weight: 600;
    background: rgba(245, 158, 11, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    margin-left: 6px;
}

.order-notes-tag {
    font-size: 0.85rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    line-height: 1.4;
}

.order-address {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.order-payment {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.order-driver {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
}

.order-driver label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-purple);
    white-space: nowrap;
}

.driver-select {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition);
}

.driver-select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.order-actions {
    display: flex;
    gap: 10px;
}

.btn-ready {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 60px;
}

.btn-ready:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-green);
}

.btn-ready:active {
    transform: scale(0.97);
}

.btn-cancel {
    width: 60px;
    min-height: 60px;
    background: var(--bg-surface);
    color: var(--accent-red);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.btn-print {
    width: 60px;
    min-height: 60px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-print:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.order-timer {
    text-align: right;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.timer-value {
    font-variant-numeric: tabular-nums;
}

.timer-value.urgent {
    color: var(--accent-red);
    font-weight: 700;
}

/* Estado vacío */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

.empty-state p {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state span {
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════ */
.admin-body {
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0d0d0d 70%);
}

.admin-main {
    padding: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-surface);
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--accent-orange);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Form Card */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.form-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

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

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input, .form-group select {
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--accent-blue-glow);
}

.btn-secondary {
    padding: 12px 28px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

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

.btn-full {
    width: 100%;
}

/* Products List */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.product-row:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.product-row.unavailable {
    opacity: 0.5;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.product-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.product-category {
    font-size: 0.75rem;
    padding: 3px 10px;
    background: var(--bg-surface);
    color: var(--accent-purple);
    border-radius: 12px;
    font-weight: 500;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-green);
    min-width: 80px;
    text-align: right;
}

.product-actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

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

.btn-icon.toggle-on {
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.btn-icon.toggle-off {
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.btn-icon.delete:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.history-number {
    font-weight: 700;
    color: var(--accent-orange);
    font-size: 1rem;
    min-width: 60px;
}

.history-items {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.history-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.history-status.ready { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.history-status.pending { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }
.history-status.delivered { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.history-status.cancelled { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.history-total {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 70px;
    text-align: right;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 100px;
    text-align: right;
}

/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0d0d0d 70%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    font-size: 4rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.4));
}

.login-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-orange), #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form input {
    width: 100%;
}

/* ═══════════════════════════════════════════════
   UTILITIES & MISC
   ═══════════════════════════════════════════════ */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
    z-index: 10000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    box-shadow: var(--shadow-lg);
}

.toast.success { background: var(--accent-green); }
.toast.error { background: var(--accent-red); }
.toast.info { background: var(--accent-blue); }

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

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

/* Badge */
.badge-red {
    background: var(--accent-red);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 50%;
    margin-left: 4px;
    box-shadow: 0 0 8px var(--accent-red-glow);
    animation: pulse 1.5s infinite;
}

/* Chat Layout Container */
.chat-container-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Sidebar */
.chat-sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-sidebar h3 {
    font-size: 1rem;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-list-item {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.chat-list-item:hover {
    background: var(--bg-card);
}

.chat-list-item.active {
    background: var(--bg-input);
    border-left: 4px solid var(--accent-blue);
}

.chat-list-item.needs-human {
    background: rgba(239, 68, 68, 0.05);
}

.chat-list-item.needs-human:hover {
    background: rgba(239, 68, 68, 0.08);
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.chat-item-phone {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.badge-human-needs {
    background: var(--accent-red-glow);
    color: var(--accent-red);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.chat-item-msg {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat Window */
.chat-window {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-card);
}

.chat-window-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.chat-placeholder-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.chat-window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.chat-header-phone {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.ia-active-tag {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-green);
    background: var(--accent-green-glow);
    padding: 4px 12px;
    border-radius: 12px;
}

.btn-resolve {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-resolve:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-green);
}

.chat-window-messages {
    flex: 1;
    min-height: 0; /* IMPRESCINDIBLE PARA QUE EL OVERFLOW FUNCIONE EN FLEXBOX */
    overflow-y: auto;
    padding: 24px 6%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #0b141a;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.83v58.34h-58.34v-.83l.83-.83L54.627 0z' fill='%23ffffff' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 120px 120px;
}

.chat-bubble {
    max-width: 65%;
    width: fit-content;
    padding: 6px 10px 18px 10px;
    border-radius: 8px;
    line-height: 1.4;
    font-size: 0.95rem;
    position: relative;
    word-break: break-word;
    box-shadow: 0 1px 1px rgba(11, 20, 26, 0.2);
}

.bubble-text {
    white-space: pre-wrap;
}

.chat-bubble.client {
    align-self: flex-start;
    background: #202c33;
    color: #e9edef;
    border-top-left-radius: 0;
}

.chat-bubble.me {
    align-self: flex-end;
    background: #005c4b;
    color: #e9edef;
    border-top-right-radius: 0;
}

.chat-bubble.operator {
    align-self: flex-end;
    background: #005c4b;
    color: #e9edef;
    border-top-right-radius: 0;
}

.bubble-meta {
    position: absolute;
    bottom: 4px;
    right: 8px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
}

.bubble-time {
    font-variant-numeric: tabular-nums;
}

.operator-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.chat-window-input {
    padding: 12px 16px;
    background: #202c33;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.chat-window-input form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-window-input input {
    flex: 1;
    padding: 12px 20px;
    background: #2a3942;
    border: none;
    border-radius: 24px;
    color: #e9edef;
    font-size: 0.95rem;
}

.chat-window-input input:focus {
    outline: none;
}

.btn-send {
    background: transparent;
    border: none;
    color: #8696a0;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s;
}

.btn-send:hover {
    color: #00a884;
}

/* Kitchen Tabs */
.kitchen-tabs {
    display: flex;
    gap: 12px;
    background: var(--bg-surface);
    padding: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    width: 100%;
    max-width: 480px;
}

.k-tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.k-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.k-tab-btn.active {
    background: var(--bg-input);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.k-tab-btn span {
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
}

/* Ready status card tweaks */
.order-card.ready-status {
    border-color: rgba(139, 92, 246, 0.3);
}

.order-card.ready-status:hover {
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.1);
}

.btn-deliver {
    background: linear-gradient(135deg, var(--accent-purple), #6d28d9) !important;
}

.btn-deliver:hover {
    box-shadow: var(--shadow-glow-purple) !important;
}

/* Daily Report Dashboard */
.daily-report-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.report-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.report-badge {
    font-size: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 600;
}

.report-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .report-grid {
        grid-template-columns: 1fr;
    }
}

.report-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.report-box.main-box {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(76, 29, 149, 0.05));
    border-color: rgba(139, 92, 246, 0.15);
    align-items: center;
    text-align: center;
}

.report-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-val {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent-purple);
    line-height: 1;
    margin-bottom: 6px;
}

.report-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.report-box-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 6px;
}

.report-stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.report-stat-item strong {
    color: var(--text-primary);
}

.report-empty {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 10px 0;
}

/* ─── Responsive ────────────────────────────── */
@media (max-width: 768px) {
    .kitchen-header, .admin-header {
        padding: 12px 16px;
    }
    
    .store-name {
        font-size: 1.1rem;
    }

    .clock {
        font-size: 1.2rem;
    }

    .orders-grid {
        grid-template-columns: 1fr;
    }

    .kitchen-main, .admin-main {
        padding: 16px;
    }

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

    .product-row {
        flex-wrap: wrap;
    }

    .history-row {
        flex-wrap: wrap;
    }
}
