/* Naro Taller — versión web del empleado (misma paleta que la app: índigo, turquesa, negro y blanco) */
:root {
  /* Paleta Naro: índigo (marca), turquesa (acento), negro y blanco */
  --brand: #4F46E5; --on-brand: #FFFFFF;
  --bg: #F6F7FB; --surface: #FFFFFF; --surface-2: #EEF0F6; --surface-3: #E7E9F2;
  --text: #0B0B14; --muted: #5B6075; --line: #E1E3EE;
  --ok: #0F766E; --warn: #B45309; --danger: #B91C1C; --info: #2563EB; --idle: #6B7280;
  --grad: linear-gradient(135deg, #312E81 0%, #4F46E5 45%, #0F766E 100%);
  --radius: 20px;
  --tab-h: 72px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #818CF8; --on-brand: #0B0B1A;
    --bg: #0B0B12; --surface: #13131C; --surface-2: #1A1A25; --surface-3: #22222F;
    --text: #F2F3F8; --muted: #A0A3B8; --line: #2D2D3D;
    --ok: #2DD4BF; --warn: #FBBF24; --danger: #F87171; --info: #93C5FD; --idle: #9CA3AF;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 16px; line-height: 1.35; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

.app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12px) 20px calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); min-height: 100vh; }
.app.no-tabs { padding-bottom: 32px; }

/* Encabezados */
.page-title { font-size: 24px; font-weight: 800; margin: 8px 0 16px; letter-spacing: -0.3px; }
.eyebrow { color: var(--muted); font-weight: 600; font-size: 15px; }
.hello { font-size: 30px; font-weight: 800; letter-spacing: -0.4px; margin: 2px 0 0; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.section-title { font-size: 13px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin: 24px 4px 10px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 18px; }
.card + .card { margin-top: 10px; }

.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none;
  background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); border: 0; cursor: pointer; }
.avatar.solid { background: var(--brand); color: var(--on-brand); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.pill svg { width: 15px; height: 15px; }
.t-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.t-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); }
.t-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.t-info { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.t-idle { color: var(--idle); background: color-mix(in srgb, var(--idle) 14%, transparent); }
.t-brand { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }

/* Estado del día */
.today { border-radius: 24px; padding: 22px; border: 0 !important; background: var(--grad) !important; color: #fff;
  box-shadow: 0 12px 28px -10px rgba(79, 70, 229, .55); }
.today .pill { background: #fff !important; color: #0B0B14 !important; }
.today .big { font-size: 34px; font-weight: 800; margin: 16px 0 4px; letter-spacing: -0.5px; color: #fff; }
.today .detail { color: rgba(255, 255, 255, .9); font-size: 17px; font-weight: 500; }

/* Botones */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 20px;
  border-radius: 16px; border: 1.5px solid transparent; font-weight: 700; font-size: 16px; cursor: pointer; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--brand); }
.btn-text { background: transparent; color: var(--brand); min-height: 44px; width: auto; padding: 0 10px; }
.btn-huge { min-height: 76px; border-radius: 20px; font-size: 20px; font-weight: 800; }
.btn-huge svg { width: 30px; height: 30px; }
.btn + .btn { margin-top: 10px; }

.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.shortcuts .card { margin: 0; }
.shortcut { text-align: left; padding: 16px; cursor: pointer; display: block; width: 100%; }
.shortcut svg { width: 26px; height: 26px; color: var(--brand); }
.shortcut .t { font-size: 17px; font-weight: 700; margin-top: 10px; }
.shortcut .s { color: var(--muted); font-weight: 500; }
.shortcut .s.hl { color: var(--brand); font-weight: 700; }

/* Formularios */
.field { width: 100%; min-height: 56px; padding: 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); outline: none; }
.field:focus { border-color: var(--brand); border-width: 2px; }
textarea.field { min-height: 90px; resize: vertical; }
.code-input { text-align: center; font-size: 32px; font-weight: 800; letter-spacing: 10px; font-variant-numeric: tabular-nums; }
.label { font-size: 17px; font-weight: 700; margin: 20px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 13px; font-weight: 600; cursor: pointer; }
.chip.on { background: color-mix(in srgb, var(--brand) 14%, transparent); border-color: var(--brand); color: var(--brand); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.segmented button { border: 0; background: transparent; min-height: 48px; font-weight: 600; cursor: pointer; }
.segmented button.on { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; width: 100%; text-align: left; }
.switch { width: 52px; height: 32px; border-radius: 16px; background: var(--surface-3); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--danger); }
.switch.on::after { left: 24px; }

/* Horas */
.total { font-size: 40px; font-weight: 800; letter-spacing: -0.5px; margin: 6px 0 2px; }
.day { padding: 14px 16px; }
.day + .day { border-top: 1px solid var(--line); }
.day .name { width: 82px; font-weight: 700; }
.day .name.is-today { color: var(--brand); }
.day .times { color: var(--muted); flex: 1; }
.day .hours { font-weight: 800; font-size: 17px; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-3); margin-top: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.bar.live > i { background: var(--warn); }

/* Pedidos */
.req { padding: 14px 16px; }
.req .title { font-size: 17px; font-weight: 700; }
.req .qty { color: var(--brand); font-weight: 800; }
.req .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 13px; }
.note { background: var(--surface-2); border-radius: 12px; padding: 10px; margin-top: 10px; font-size: 14px; }
.fab { position: fixed; right: max(20px, calc(50% - 260px)); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px); width: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,.18); z-index: 5; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 90px; }
.bubble { max-width: 80%; padding: 10px 14px 8px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .time { font-size: 11px; opacity: .7; text-align: right; margin-top: 3px; }
.bubble.mine { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 4px; }
.broadcast { border-radius: 16px; padding: 12px 14px; margin: 6px 4px; border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.broadcast .head { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.broadcast .head svg { width: 18px; height: 18px; }
.broadcast .body { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.day-chip { align-self: center; background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; margin: 10px 0; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); padding: 8px 12px; z-index: 5; }
.composer .inner { max-width: 560px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; border: 0; background: var(--surface-3); border-radius: 24px; padding: 13px 16px; min-height: 48px; max-height: 140px; resize: none; outline: none; }
.send { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; flex: none; cursor: pointer; }
.send:disabled { opacity: .4; }
.send svg { width: 22px; height: 22px; }

/* Barra de pestañas */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); z-index: 10; }
.tab { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; cursor: pointer; position: relative; }
.tab .ic { width: 64px; height: 32px; border-radius: 16px; display: grid; place-items: center; }
.tab svg { width: 26px; height: 26px; }
.tab.on { color: var(--text); font-weight: 700; }
.tab.on .ic { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

/* Hojas, escáner, confirmación */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; border-radius: 28px 28px 0 0; padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
.sheet .handle { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 16px; }
.sheet h3 { font-size: 22px; margin: 0 0 4px; }
.fullscreen { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow: auto; }
.fullscreen .inner { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 8px) 20px calc(env(safe-area-inset-bottom) + 100px); }
.fullscreen .footer { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 20px calc(env(safe-area-inset-bottom) + 12px); background: var(--bg); }
.fullscreen .footer .btn { max-width: 520px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 8px; min-height: 56px; font-size: 20px; font-weight: 700; }
.icon-btn { width: 48px; height: 48px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: inherit; flex: none; }
.icon-btn svg { width: 24px; height: 24px; }
.scanner { position: fixed; inset: 0; background: #000; z-index: 40; color: #fff; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; transform: translate(-50%, -50%); border: 4px solid #fff; border-radius: 28px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
.scanner .top { position: absolute; top: env(safe-area-inset-top); left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: 8px; font-size: 20px; font-weight: 700; }
.scanner .hint { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 40px); text-align: center; padding: 0 24px; }
.scanner .hint p { font-size: 18px; font-weight: 600; margin: 0 0 14px; }
.scanner .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); max-width: 320px; margin: 0 auto; }
.marked { position: fixed; inset: 0; z-index: 50; background: var(--grad); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.marked svg { width: 120px; height: 120px; }
.marked .t { font-size: 28px; font-weight: 800; margin-top: 16px; }
.marked .h { font-size: 56px; font-weight: 800; }
.marked .s { font-size: 18px; opacity: .8; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px); max-width: 528px; margin: 0 auto; background: #1A1A25; color: #fff;
  border-radius: 14px; padding: 14px 16px; z-index: 60; font-weight: 500; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.error-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; margin: 8px 0; font-weight: 600; }
.error-banner svg { width: 20px; height: 20px; flex: none; }
.empty { text-align: center; padding: 48px 24px; }
.empty .ic { width: 72px; height: 72px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 16px; color: var(--muted); }
.empty .ic svg { width: 34px; height: 34px; }
.empty h4 { font-size: 17px; margin: 0 0 6px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.logo { width: 64px; height: 64px; border-radius: 18px; background: var(--grad); color: var(--on-brand); display: grid; place-items: center; }
.logo svg { width: 34px; height: 34px; }
.menu { position: fixed; right: max(20px, calc(50% - 260px)); top: calc(env(safe-area-inset-top) + 64px); z-index: 25; min-width: 240px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.menu .who { padding: 12px; font-weight: 700; }
.menu button { width: 100%; text-align: left; border: 0; background: transparent; padding: 12px; border-radius: 10px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.menu button svg { width: 22px; height: 22px; }
