:root { color-scheme: dark; --bg:#111318; --surface:#1b1e25; --surface-2:#252a33; --line:#343b48; --text:#f2f4f7; --muted:#a7afbd; --blue:#397cff; --yellow:#d6a929; --orange:#d97720; --green:#23945d; --red:#c94242; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font-family:system-ui,-apple-system,Segoe UI,sans-serif; }
body.busy { cursor:progress; }
body.busy::after { content:'Procesando…'; position:fixed; left:50%; bottom:18px; transform:translateX(-50%); z-index:10; padding:9px 14px; border-radius:999px; background:var(--blue); color:white; font-size:.8rem; font-weight:700; box-shadow:0 4px 18px #0008; }
.request-error { display:flex; align-items:center; gap:10px; }
.request-error { margin:10px 16px 0; padding:10px 12px; border-radius:10px; background:#5d2020; color:#ffdada; }
button,input { font:inherit; }
button { border:0; color:inherit; cursor:pointer; }
.shell { min-height:100vh; display:flex; flex-direction:column; }
.header { padding:14px 16px; background:var(--surface); border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; gap:10px; position:sticky; top:0; z-index:3; }
.title { font-weight:750; }
.subtle { color:var(--muted); font-size:.82rem; }
.connection { padding:6px 9px; border-radius:999px; font-size:.75rem; font-weight:700; background:var(--green); }
.connection.offline { background:var(--red); }
.connection.reconnecting { background:var(--yellow); color:#171717; }
.content { padding:16px; flex:1; max-width:900px; width:100%; margin:auto; }
.tabs { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:16px; }
.tab,.button { min-height:48px; border-radius:10px; background:var(--surface-2); font-weight:700; padding:12px 14px; }
.tab.active,.button.primary { background:var(--blue); }
.button.success { background:var(--green); }
.button.danger { background:var(--red); }
.button:disabled { opacity:.45; cursor:not-allowed; }
body.busy button:not(:disabled) { cursor:progress; }
.grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:14px; }
.table-card { min-height:120px; display:flex; flex-direction:column; justify-content:space-between; text-align:left; }
.table-name { font-size:1.25rem; font-weight:800; }
.status { display:inline-flex; width:max-content; padding:5px 8px; border-radius:6px; font-size:.72rem; font-weight:800; }
.libre { background:#4a5360; } .ocupada { background:#235d9f; } .pendiente { background:var(--yellow); color:#171717; } .preparando { background:var(--orange); } .lista { background:var(--green); } .incidencia { background:var(--red); }
.section-title { margin:20px 0 9px; color:var(--muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; }
.row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.stack { display:flex; flex-direction:column; gap:10px; }
.product-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.product { text-align:left; min-height:66px; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:11px; }
.product strong { display:block; } .product small { color:var(--muted); }
.order-line { padding:12px 0; border-bottom:1px solid var(--line); }
.bottom { position:sticky; bottom:0; background:var(--surface); border-top:1px solid var(--line); padding:12px 16px; display:flex; flex-wrap:wrap; gap:8px; }
.bottom>* { flex:1 1 auto; min-width:110px; }
.line-row { display:flex; flex-direction:column; gap:8px; }
.line-row + .line-row { margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
.line-actions { flex-wrap:wrap; justify-content:flex-start; }
.back { background:transparent; padding:0; color:var(--muted); }
.empty { padding:40px 10px; text-align:center; color:var(--muted); }
.notice { padding:12px; border-radius:10px; background:#352d17; color:#f7d66d; }
input,select { width:100%; padding:14px; border-radius:9px; border:1px solid var(--line); background:var(--surface-2); color:var(--text); }
@media (min-width:700px) { .grid { grid-template-columns:repeat(4,minmax(0,1fr)); } .product-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
