/* =====================================================================
   Sistema de diseño — Comandas Restaurante
   Tokens + componentes reutilizables sobre Tailwind (CDN, sin build step)
   ===================================================================== */

:root {
    --ink-900: #14161a;
    --ink-800: #1e2127;
    --ink-700: #2a2e36;
    --ink-600: #3a3f4a;
    --ink-500: #5b6270;
    --ink-400: #848b99;
    --ink-300: #b7bcc6;
    --ink-200: #e2e5ea;
    --ink-100: #f1f2f5;
    --ink-50:  #f8f9fb;

    --brand-600: #ea580c;
    --brand-500: #f97316;
    --brand-400: #fb923c;
    --brand-100: #ffedd5;
    --brand-50:  #fff7ed;

    --success-600: #15803d;
    --success-500: #16a34a;
    --success-100: #dcfce7;

    --warning-600: #b45309;
    --warning-500: #d97706;
    --warning-100: #fef3c7;

    --danger-600: #b91c1c;
    --danger-500: #dc2626;
    --danger-100: #fee2e2;

    --info-600: #1d4ed8;
    --info-500: #2563eb;
    --info-100: #dbeafe;

    --radius-lg: 1.25rem;
    --radius-md: 0.875rem;
    --radius-sm: 0.5rem;

    --shadow-soft: 0 1px 2px rgba(20, 22, 26, 0.04), 0 8px 24px -12px rgba(20, 22, 26, 0.12);
    --shadow-lift: 0 4px 10px rgba(20, 22, 26, 0.06), 0 16px 40px -16px rgba(20, 22, 26, 0.22);
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
    height: 100%;
    background: var(--ink-50);
    color: var(--ink-800);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------------------------------------------------------------------
   Botones
   --------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius-md);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, color 0.12s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--brand-500); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }

.btn-dark { background: var(--ink-900); color: #fff; }
.btn-dark:hover:not(:disabled) { background: var(--ink-800); }

.btn-ghost { background: transparent; color: var(--ink-600); }
.btn-ghost:hover:not(:disabled) { background: var(--ink-100); }

.btn-outline { background: #fff; color: var(--ink-700); border: 1.5px solid var(--ink-200); }
.btn-outline:hover:not(:disabled) { border-color: var(--brand-400); color: var(--brand-600); }

.btn-danger { background: var(--danger-500); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-600); }

.btn-success { background: var(--success-500); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--success-600); }

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.95rem 1.6rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-icon { padding: 0.55rem; border-radius: 999px; }

/* ---------------------------------------------------------------------
   Tarjetas
   --------------------------------------------------------------------- */

.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--ink-100);
}

.card-hover {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
    border-color: var(--brand-200, var(--ink-200));
}

/* ---------------------------------------------------------------------
   Badges / estados
   --------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    line-height: 1;
}
.badge-dot { width: 0.4rem; height: 0.4rem; border-radius: 999px; background: currentColor; }

.badge-success { background: var(--success-100); color: var(--success-600); }
.badge-warning { background: var(--warning-100); color: var(--warning-600); }
.badge-danger  { background: var(--danger-100);  color: var(--danger-600); }
.badge-info    { background: var(--info-100);    color: var(--info-600); }
.badge-neutral { background: var(--ink-100);     color: var(--ink-600); }
.badge-brand   { background: var(--brand-100);   color: var(--brand-600); }

/* ---------------------------------------------------------------------
   Barra superior / navegación
   --------------------------------------------------------------------- */

.topbar {
    background: var(--ink-900);
    color: #fff;
}

.topbar .brand-mark {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}

.nav-pill {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    transition: all 0.15s ease;
}
.nav-pill:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-pill.active { color: #fff; background: rgba(255,255,255,0.14); }

/* ---------------------------------------------------------------------
   Mesas (grid del mesero)
   --------------------------------------------------------------------- */

.mesa-tile {
    aspect-ratio: 1 / 0.85;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 700;
    border: 1.5px solid transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    cursor: pointer;
    position: relative;
}
.mesa-tile:active { transform: scale(0.96); }

.mesa-tile.libre {
    background: var(--success-100);
    color: var(--success-600);
}
.mesa-tile.ocupada {
    background: var(--ink-900);
    color: #fff;
    box-shadow: var(--shadow-lift);
}
.mesa-tile.reservada {
    background: var(--info-100);
    color: var(--info-600);
}
.mesa-tile.porlimpiar {
    background: var(--warning-100);
    color: var(--warning-600);
}

.mesa-num { font-size: 1.6rem; line-height: 1; }
.mesa-label { font-size: 0.7rem; font-weight: 600; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---------------------------------------------------------------------
   Comanda / carrito
   --------------------------------------------------------------------- */

.producto-tile {
    background: #fff;
    border: 1.5px solid var(--ink-100);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    cursor: pointer;
    transition: all 0.12s ease;
    text-align: left;
}
.producto-tile:hover { border-color: var(--brand-400); box-shadow: var(--shadow-soft); }
.producto-tile:active { transform: scale(0.98); }

.cart-line {
    animation: line-in 0.2s ease;
}
@keyframes line-in {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

.pulse-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--brand-500);
    animation: pulse-dot 1.6s infinite;
}
@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(249, 115, 22, 0); }
    100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

/* ---------------------------------------------------------------------
   Tablero de cocina (KDS)
   --------------------------------------------------------------------- */

.kds-column {
    background: var(--ink-100);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.kds-ticket {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--ink-200);
    box-shadow: var(--shadow-soft);
}
.kds-ticket.urgente {
    border-color: var(--danger-500);
    box-shadow: 0 0 0 3px var(--danger-100);
}

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */

.modal-backdrop {
    background: rgba(20, 22, 26, 0.55);
    backdrop-filter: blur(2px);
}
.modal-panel {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lift);
}

/* ---------------------------------------------------------------------
   Utilidades varias
   --------------------------------------------------------------------- */

.scroll-thin { scrollbar-width: thin; }
.text-money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.skeleton {
    background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 37%, var(--ink-100) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}
@keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

[x-cloak] { display: none !important; }
