/* =========================================================
   Creativa · tema CRM
========================================================= */
:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e6e9f0;
    --text: #0f172a;
    --text-2: #475569;
    --muted: #94a3b8;

    --brand: #2563eb;
    --brand-600: #1d4ed8;
    --brand-50: #eff4ff;
    --side: #0f1e36;
    --side-2: #17294a;
    --side-text: #c7d2e5;

    --green: #16a34a;  --green-50: #e9f9ef;
    --red: #dc2626;    --red-50: #fdecec;
    --amber: #d97706;  --amber-50: #fff6e5;
    --violet: #7c3aed; --violet-50: #f3edff;
    --cyan: #0891b2;   --cyan-50: #e6f7fb;

    --r: 12px;
    --r-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .05);
    --shadow-lg: 0 18px 50px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.ti { font-size: 18px; vertical-align: -3px; }

.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Layout ---------------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
    background: var(--side); color: var(--side-text); position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; padding: 16px 12px 0; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; color: #fff; flex: none; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #7c3aed); display: grid; place-items: center; font-weight: 800; }
.brand b { font-size: 16px; display: block; }
.brand small { color: #8094b4; font-size: 11px; }
/* El menú tiene su propio scroll: así nunca se sale del fondo oscuro aunque haya muchos módulos */
.nav {
    display: flex; flex-direction: column; gap: 1px; flex: 1; min-height: 0;
    overflow-y: auto; margin: 0 -6px; padding: 0 6px 12px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 6px; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6b7fa3; padding: 12px 12px 4px; flex: none; }
.nav-sec:first-child { padding-top: 0; }
.nav a {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px;
    color: var(--side-text); font-weight: 500; flex: none;
}
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }
.side-foot { flex: none; padding: 12px 24px; margin: 0 -12px; background: var(--side); border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; color: #8094b4; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
    height: 62px; background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px; padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.top h1 { font-size: 18px; font-weight: 700; }
.top .spacer { flex: 1; }
.top .menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 30px; cursor: pointer; }
.user-chip:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-chip small { display: block; color: var(--muted); font-size: 11px; line-height: 1.1; }
.content { padding: 22px; flex: 1; min-width: 0; }
.content.flush { padding: 0; }

/* ---------------- Componentes ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 15px; font-weight: 650; }
.card-b { padding: 18px; }
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: 2fr 1fr; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.right { text-align: right; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

.kpi { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.kpi-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi-ic .ti { font-size: 22px; }
.kpi small { color: var(--text-2); font-weight: 500; }
.kpi b { display: block; font-size: 22px; font-weight: 750; margin: 2px 0; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12px; color: var(--muted); }
.up { color: var(--green); font-weight: 600; } .dn { color: var(--red); font-weight: 600; }
.bg-blue { background: var(--brand-50); color: var(--brand); }
.bg-green { background: var(--green-50); color: var(--green); }
.bg-amber { background: var(--amber-50); color: var(--amber); }
.bg-violet { background: var(--violet-50); color: var(--violet); }
.bg-red { background: var(--red-50); color: var(--red); }
.bg-cyan { background: var(--cyan-50); color: var(--cyan); }
.progress { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 6px; }

/* Botones */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px;
    border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600;
    white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-p { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-p:hover { background: var(--brand-600); }
.btn-g { background: var(--green); border-color: var(--green); color: #fff; }
.btn-g:hover { filter: brightness(.95); background: var(--green); }
.btn-d { color: var(--red); border-color: #f5c2c2; }
.btn-d:hover { background: var(--red-50); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-ic { width: 34px; height: 34px; padding: 0; border-radius: 8px; }
.btn-lg { height: 50px; font-size: 16px; border-radius: 11px; }
.btn-block { width: 100%; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.input, .select, textarea.input {
    height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
    outline: none; width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.input-ic { position: relative; }
.input-ic .ti { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-ic .input { padding-left: 36px; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-weight: 500; }
.switch input { display: none; }
.switch i { width: 38px; height: 22px; border-radius: 22px; background: #cbd5e1; position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(16px); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.b-green { background: var(--green-50); color: var(--green); }
.b-red { background: var(--red-50); color: var(--red); }
.b-amber { background: var(--amber-50); color: var(--amber); }
.b-gray { background: #eef1f5; color: var(--text-2); }
.b-blue { background: var(--brand-50); color: var(--brand); }
.b-violet { background: var(--violet-50); color: var(--violet); }

/* Tablas */
.table-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
    text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2);
    background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: #fafbfd; }
.tbl .right { text-align: right; }
.tbl-empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.tbl-empty .ti { font-size: 36px; display: block; margin-bottom: 8px; opacity: .5; }
.code { font-weight: 650; color: var(--text); }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--text-2); font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .field { min-width: 130px; }

/* Menú contextual */
.menu { position: fixed; z-index: 90; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--surface-2); }
.menu .danger { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 18px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 36px); display: flex; flex-direction: column; animation: pop .18s; }
.modal.lg { max-width: 820px; } .modal.sm { max-width: 400px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-h h3 { font-size: 16px; flex: 1; }
.modal-b { padding: 20px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

/* Toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 11px 15px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 9px; align-items: center; max-width: 380px; animation: pop .2s; }
.toast.ok .ti { color: #4ade80; } .toast.err { background: #7f1d1d; } .toast.warn .ti { color: #fbbf24; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(1200px 600px at 0% 0%, #1e3a8a 0%, var(--side) 60%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h2 { font-size: 36px; line-height: 1.15; max-width: 440px; }
.login-art p { color: #aebbd6; max-width: 420px; }
.login-box { display: grid; place-items: center; padding: 30px; }
.login-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-form h3 { font-size: 24px; }

/* Lista de detalle (vista previa) */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.kv small { display: block; color: var(--muted); font-size: 11.5px; }
.kv b { font-weight: 600; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.sum-row.total { border: 0; font-size: 18px; font-weight: 750; padding-top: 10px; }

/* =========================================================
   POS
========================================================= */
.pos { display: grid; grid-template-columns: 1fr 420px; grid-template-rows: minmax(0, 1fr); height: calc(100vh - 62px); }
.pos-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--border); }
.pos-search { padding: 14px 18px 10px; display: flex; gap: 10px; background: var(--surface); }
.pos-search .input { height: 44px; font-size: 15px; }
.chips { display: flex; gap: 6px; padding: 0 18px 12px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.chip { flex: none; padding: 6px 13px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 500; }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.prods { flex: 1; overflow: auto; padding: 16px 18px; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.p-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; position: relative;
    display: flex; flex-direction: column; gap: 3px; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.p-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(37, 99, 235, .12); }
.p-card:active { transform: scale(.98); }
.p-card.off { opacity: .45; pointer-events: none; }
.p-card .ini { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; margin-bottom: 6px; }
.p-card .nm { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.p-card .cd { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-card .pr { font-weight: 750; font-size: 15px; margin-top: 4px; }
.p-card .st { font-size: 11.5px; }
.p-list .p-card { flex-direction: row; align-items: center; gap: 12px; margin-bottom: 8px; }
.p-list .p-card .ini { margin: 0; }
.p-list .p-card .nm { min-height: 0; -webkit-line-clamp: 1; }

.pos-right { display: flex; flex-direction: column; background: var(--surface); min-height: 0; }
.cart-h { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.pick:hover { border-color: var(--brand); background: var(--brand-50); }
.pick .ti { color: var(--brand); }
.pick small { display: block; color: var(--muted); font-size: 11px; }
.pick b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart { flex: 1; overflow: auto; padding: 6px 16px; }
.line { padding: 10px 0; border-bottom: 1px solid var(--border); }
.line-top { display: flex; gap: 8px; align-items: flex-start; }
.line-top .nm { flex: 1; font-weight: 600; line-height: 1.3; }
.line-top .nm small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.line-bot { display: flex; gap: 8px; align-items: center; margin-top: 7px; }
.qty { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty button { width: 28px; height: 30px; border: 0; background: var(--surface-2); cursor: pointer; font-weight: 700; }
.qty input { width: 46px; height: 30px; border: 0; text-align: center; outline: none; }
.line .mini { height: 30px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; width: 100%; outline: none; text-align: right; }
.line .mini:focus { border-color: var(--brand); }
.line .tot { min-width: 92px; text-align: right; font-weight: 700; }
.line .del { color: var(--muted); cursor: pointer; border: 0; background: none; padding: 2px; }
.line .del:hover { color: var(--red); }
.cart-empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); }
.cart-empty .ti { font-size: 46px; opacity: .35; }

.pay { border-top: 1px solid var(--border); padding: 12px 16px 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.totals .sum-row { padding: 3px 0; border: 0; color: var(--text-2); }
.totals .sum-row.total { color: var(--text); font-size: 24px; padding-top: 4px; }
.methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.method { border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 7px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.method .ti { font-size: 20px; }
.method.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button { flex: 1; min-width: 70px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.cambio { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.cambio b { font-size: 18px; }
.mixto-row { display: flex; gap: 6px; margin-bottom: 6px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; font-weight: 500; }
.banner.warn { background: var(--amber-50); color: #92400e; }
.banner.info { background: var(--brand-50); color: var(--brand-600); }
kbd { font: 600 11px Inter, sans-serif; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }

.list-pick { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; margin-top: 12px; }
.list-pick button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.list-pick button:hover { border-color: var(--brand); background: var(--brand-50); }
.list-pick small { display: block; color: var(--muted); font-size: 12px; }

.dropzone { display: block; border: 2px dashed var(--border); border-radius: 12px; padding: 26px; text-align: center; cursor: pointer; color: var(--text-2); }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); }
.dropzone .ti { font-size: 34px; color: var(--brand); display: block; margin-bottom: 6px; }

[hidden] { display: none !important; }

/* Autocompletar de productos (inventario) */
.ac { position: relative; }
.ac-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 300px; overflow: auto; padding: 4px; }
.ac-list button { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.ac-list button:hover { background: var(--brand-50); }
.ac-list small { display: block; color: var(--muted); font-size: 11.5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
    .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos { grid-template-columns: 1fr 380px; }
}
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; left: 0; top: 0; z-index: 60; width: 250px; transform: translateX(-100%); transition: transform .2s; }
    .shell.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
    .top .menu-btn { display: inline-flex; }
    .g-3, .g-2, .g-21 { grid-template-columns: 1fr; }
    .pos { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
    .cart { max-height: 50vh; }
    .pos-left { border-right: 0; max-height: 60vh; }
    .login { grid-template-columns: 1fr; }
    .login-art { display: none; }
    .kv { grid-template-columns: 1fr; }
    .content { padding: 16px; }
    .top { padding: 0 16px; }
    .user-chip .who { display: none; }
}
@media (max-width: 560px) { .g-4 { grid-template-columns: 1fr; } }

/* =========================================================
   Restaurante: mesas, comanda, cocina, domicilios
========================================================= */
.nav-badge { margin-left: auto; background: var(--amber); color: #fff; border-radius: 20px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.modal.xl { max-width: 1200px; height: calc(100vh - 36px); }
.modal.xl .modal-b { flex: 1; min-height: 0; overflow: hidden; }

.mesas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.mesa {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 120px;
    padding: 12px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); cursor: pointer;
    box-shadow: var(--shadow); transition: transform .1s, border-color .15s;
}
.mesa:hover { transform: translateY(-1px); }
.mesa small { color: var(--text-2); font-size: 12px; }
.mesa.libre { border-color: #bfe8cd; background: var(--green-50); }
.mesa.libre .mesa-libre { color: var(--green); margin-top: auto; font-weight: 600; }
.mesa.ocupada { border-color: var(--brand); background: var(--brand-50); }
.mesa.lista { border-color: var(--amber); background: var(--amber-50); animation: pulso 1.6s infinite; }
.mesa-total { font-size: 20px; font-weight: 800; margin-top: 4px; }
@keyframes pulso { 50% { box-shadow: 0 0 0 6px rgba(217, 119, 6, .18); } }

.cmd { display: grid; grid-template-columns: 1fr 440px; height: 100%; min-height: 0; }
.cmd-prods { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.cmd-prods .chips { padding: 0 14px 10px; }
.cmd-prods .prods { padding: 12px 14px; }
.cmd-prods .p-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.cmd-ticket { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.cmd-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.cmd-cli { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.cmd-items { flex: 1; overflow: auto; padding: 4px 16px; }
.cmd-it { padding: 10px 0; border-bottom: 1px solid var(--border); }
.cmd-it.pagado { opacity: .6; }
.cmd-q { min-width: 34px; font-size: 15px; }
.cmd-nota { color: var(--amber); font-size: 12.5px; font-weight: 600; }
.cmd-foot { border-top: 1px solid var(--border); padding: 12px 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }

.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.kds-card { background: var(--surface); border: 2px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.kds-card.medio { border-color: var(--amber); } .kds-card.tarde { border-color: var(--red); } .kds-card.ok { border-color: var(--green); opacity: .75; }
.kds-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.kds-h b { font-size: 16px; display: block; } .kds-h small { color: var(--text-2); font-size: 12px; }
.kds-min { font-size: 20px; font-weight: 800; }
.kds-card.tarde .kds-min { color: var(--red); } .kds-card.medio .kds-min { color: var(--amber); }
.kds-b { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.kds-it { display: flex; gap: 8px; align-items: flex-start; text-align: left; width: 100%; padding: 9px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 15px; }
.kds-it em { display: block; color: var(--amber); font-style: normal; font-weight: 700; font-size: 13px; }
.kds-it.preparando { background: var(--violet-50); border-color: #d9c8fb; }
.kds-it.listo { background: var(--green-50); border-color: #bfe8cd; text-decoration: line-through; color: var(--text-2); }
.kds-it .ti { font-size: 20px; color: var(--muted); } .kds-it.preparando .ti { color: var(--violet); } .kds-it.listo .ti { color: var(--green); }
.kds-f { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--border); }
.content:fullscreen { background: var(--bg); overflow: auto; padding: 22px; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; }
.kanban-col { background: #eaeef5; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.kanban-h { display: flex; align-items: center; gap: 6px; font-weight: 700; padding: 4px 6px; }
.kanban-h .badge { margin-left: auto; }
.dom-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; box-shadow: var(--shadow); font-size: 13px; }
.dom-card:hover { border-color: var(--brand); }
.placa { font-family: "Courier New", monospace; font-weight: 800; letter-spacing: .05em; }
label.chip { user-select: none; }
label.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, minmax(240px, 1fr)); } }
@media (max-width: 900px) {
    .cmd { grid-template-columns: 1fr; grid-template-rows: 45% 55%; }
    .cmd-prods { border-right: 0; border-bottom: 1px solid var(--border); }
    .modal.xl { height: calc(100vh - 20px); }
    .kanban { grid-template-columns: 1fr; }
}
