/* Sano Doctor — Sistema visual */
:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --sb-w: 252px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --surface-3: #e1e7f1;
  --border: #e0e6ef;
  --border-strong: #cdd6e4;
  --text: #0b1220;
  --muted: #5a6577;
  --faint: #929eb2;
  --brand: #0d9488;
  --brand-2: #14b8a6;
  --brand-ink: #ffffff;
  --brand-soft: #e0f5f1;
  --brand-text: #0f766e;
  --success: #15803d;
  --success-soft: #e7f6ec;
  --warning: #b45309;
  --warning-soft: #fdf3e2;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --info: #4f46e5;
  --info-soft: #ecebfe;
  --violet: #7c3aed;
  --violet-soft: #f1ebfe;
  --text-bs: #7c3aed;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px -8px rgba(15, 23, 42, .16);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .38);
  --ring: 0 0 0 3px rgba(13, 148, 136, .22);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #050d12;
  --surface: #0d1322;
  --surface-2: #121a2c;
  --surface-3: #1a2439;
  --border: #1b2539;
  --border-strong: #27344f;
  --text: #eef3fb;
  --muted: #9aa7bd;
  --faint: #66738b;
  --brand: #2dd4bf;
  --brand-2: #5eead4;
  --brand-ink: #03201c;
  --brand-soft: rgba(45, 212, 191, .12);
  --brand-text: #5eead4;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, .12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .13);
  --info: #a5b4fc;
  --info-soft: rgba(165, 180, 252, .13);
  --violet: #c4b5fd;
  --violet-soft: rgba(167, 139, 250, .14);
  --text-bs: #c4b5fd;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 70px -20px rgba(0, 0, 0, .8);
  --ring: 0 0 0 3px rgba(45, 212, 191, .28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 14.5px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-text); }
svg { width: 18px; height: 18px; flex: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft); }

/* ---------- Utilidades ---------- */
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .xs { font-size: 11px; }
.num { font-variant-numeric: tabular-nums; } .mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; }
.text-bs { color: var(--text-bs); } .text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); } .text-brand { color: var(--brand-text); }
.center { text-align: center; } .r { text-align: right; } .c { text-align: center; } .nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; } .row-wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; } .stack-sm { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; } .mt { margin-top: 8px; } .mt-lg { margin-top: 18px; } .mb { margin-bottom: 10px; }
.bold { font-weight: 700; }
.divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 650; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s, opacity .15s; user-select: none; text-decoration: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #14b8a6, #0d9488 55%, #4f46e5); color: #fff; box-shadow: 0 8px 18px -8px rgba(13, 148, 136, .85); }
:root[data-theme="dark"] .btn-primary { color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-success { background: #16a34a; color: #fff; box-shadow: 0 6px 16px -8px rgba(22, 163, 74, .8); }
.btn-soft { background: var(--brand-soft); color: var(--brand-text); }
.btn-whatsapp { background: #16a34a; color: #fff; }
.btn-whatsapp:hover { background: #15803d; }
.btn-demo { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-demo svg { color: var(--brand); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; }
.btn-xl { height: 56px; padding: 0 22px; font-size: 16.5px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; } .btn-icon.btn-sm { width: 32px; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.textarea { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
.input-lg { height: 52px; font-size: 20px; font-weight: 700; }
.input-sm { height: 34px; font-size: 13.5px; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a0b4' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .prefix { position: absolute; left: 12px; color: var(--faint); font-weight: 650; pointer-events: none; }
.input-group .prefix + .input { padding-left: 30px; }
.suffix-btn { position: absolute; right: 4px; }
.hint { font-size: 12px; color: var(--faint); }
.error-msg { color: var(--danger); font-size: 13px; font-weight: 600; min-height: 0; }
.error-msg:empty { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }
.section-title { font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 8px 0 2px; }
fieldset { border: 0; padding: 0; margin: 0; }

/* Segmentado */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 12px; border-radius: 9px; font-weight: 650; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button.on svg { color: var(--brand); }
.seg-block { display: flex; } .seg-block button { flex: 1; justify-content: center; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-weight: 650; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { font-size: 11px; opacity: .7; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge-neutral { background: var(--surface-2); color: var(--muted); }
.badge-brand { background: var(--brand-soft); color: var(--brand-text); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.dotc { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.card-flush { padding: 0; overflow: hidden; }
.card-title { font-weight: 750; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-title svg { color: var(--brand); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.kpi-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tone-brand { background: var(--brand-soft); color: var(--brand-text); }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warning { background: var(--warning-soft); color: var(--warning); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }

/* ---------- Tablas y listas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; } .table .c { text-align: center; }
.t-name { font-weight: 650; } .t-sub { font-size: 12px; color: var(--faint); }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 750; font-size: 13px; flex: none; }
.emoji-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); flex: none; overflow: hidden; }
.emoji-box img { width: 100%; height: 100%; object-fit: cover; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 36px 16px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 4px; stroke-width: 1.6; }
.empty b { color: var(--text); font-size: 15px; }
.empty span { font-size: 13.5px; max-width: 360px; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--surface-3); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Arranque ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; transition: opacity .3s; }
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.boot-inner img { width: 84px; height: 84px; border-radius: 24px; box-shadow: var(--shadow-lg); animation: pop .5s var(--ease); }

/* ---------- Login ---------- */
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1100px 620px at -10% -20%, rgba(45, 212, 191, .55) 0%, transparent 55%), radial-gradient(900px 600px at 110% 120%, rgba(37, 99, 235, .55) 0%, transparent 55%), linear-gradient(150deg, #03141a 0%, #062a2e 50%, #0a1d40 100%);
}
.auth-hero::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); pointer-events: none; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; position: relative; z-index: 1; letter-spacing: -.01em; }
.auth-brand img { width: 44px; height: 44px; border-radius: 13px; }
.auth-brand small { display: block; font-weight: 600; font-size: 12px; opacity: .7; letter-spacing: .08em; text-transform: uppercase; }
.auth-hero h1 { font-size: 44px; line-height: 1.08; letter-spacing: -.03em; margin: 0 0 16px; max-width: 560px; font-weight: 800; }
.auth-hero h1 em { font-style: normal; background: linear-gradient(90deg, #67e8f9, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { font-size: 16.5px; color: rgba(255, 255, 255, .78); max-width: 520px; margin: 0; }
.auth-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; max-width: 600px; }
.auth-feature { display: flex; gap: 10px; align-items: center; font-size: 14px; color: rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); padding: 11px 12px; border-radius: 13px; backdrop-filter: blur(4px); }
.auth-feature span { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(45, 212, 191, .16); color: #67e8f9; flex: none; }
.auth-food { position: absolute; right: -30px; top: 50%; transform: translateY(-50%); font-size: 140px; opacity: .08; z-index: 0; line-height: 1; user-select: none; }
.auth-panel { display: grid; place-items: center; padding: 32px 22px; background: var(--bg); }
.auth-card { width: 100%; max-width: 410px; animation: fadeUp .5s var(--ease); }
.auth-card h2 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.02em; }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; margin-bottom: 22px; }
.auth-mobile-brand img { width: 40px; height: 40px; border-radius: 12px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--faint); font-size: 12.5px; font-weight: 600; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-foot { font-size: 12.5px; color: var(--faint); text-align: center; margin-top: 18px; }

/* ---------- Estructura de la app ---------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sb-w); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40; transition: transform .25s var(--ease);
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 12px; }
.sb-brand img { width: 38px; height: 38px; border-radius: 11px; }
.sb-brand b { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.sb-brand small { display: block; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.sb-tenant { margin: 4px 14px 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.sb-tenant b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-tenant .xs { color: var(--faint); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.sb-section { font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 14px 10px 6px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 11px; border: 0; background: transparent; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; text-align: left; position: relative; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-text); }
.nav-item.active svg { color: var(--brand); }
.nav-item .nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.nav-item .nav-badge.warn { background: var(--warning); }
.nav-item .nav-badge.info { background: var(--brand); }
.sb-foot { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.rate-pill { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1px solid var(--border); background: var(--surface-2); border-radius: 11px; padding: 9px 12px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rate-pill b { color: var(--text-bs); font-size: 14px; }
.rate-pill:hover { border-color: var(--brand); }
.sb-status { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); }
.sb-btn { border: 1px solid var(--border); background: transparent; border-radius: 9px; padding: 6px 10px; font-size: 12.5px; font-weight: 650; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sb-btn:hover { color: var(--text); border-color: var(--border-strong); }
.sb-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.sb-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-backdrop { display: none; }

.main { margin-left: var(--sb-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: none; position: sticky; top: 0; z-index: 30; height: 58px; align-items: center; gap: 10px; padding: 0 10px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar img { width: 30px; height: 30px; border-radius: 9px; }
.tb-title { font-weight: 750; font-size: 15px; }
.tb-sub { font-size: 11.5px; color: var(--faint); }
.rate-mini { border: 1px solid var(--border); background: var(--surface-2); border-radius: 9px; padding: 6px 9px; font-size: 12.5px; font-weight: 750; color: var(--text-bs); }
.content { padding: 26px 30px 40px; width: 100%; max-width: 1480px; margin: 0 auto; flex: 1; }
.content.full { max-width: none; padding: 0; }
.view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-title { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -.025em; }
.view-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.view-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px; border-bottom: 1px solid var(--border); }
.search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); flex: 1; min-width: 200px; }
.search:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.search svg { color: var(--faint); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%; }

.bottom-nav { display: none; }

/* Banners */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 18px; font-size: 13.5px; font-weight: 600; flex-wrap: wrap; }
.banner button { border: 0; background: rgba(255, 255, 255, .22); color: inherit; border-radius: 8px; padding: 5px 10px; font-weight: 700; font-size: 12.5px; }
.demo-banner { background: linear-gradient(90deg, #0d9488, #4f46e5 60%, #7c3aed); color: #fff; }
.demo-banner svg { width: 16px; height: 16px; vertical-align: -3px; }
.demo-clock { display: inline-flex; align-items: center; gap: 8px; }
.demo-ending { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .75; } }
.admin-banner { background: #0b1220; color: #fff; }
:root[data-theme="dark"] .admin-banner { background: #1a2439; }
.offline-banner { background: var(--warning-soft); color: var(--warning); padding: 8px 18px; font-size: 13px; font-weight: 600; }
.announce-banner { background: var(--info-soft); color: var(--info); }
.announce-banner button { background: transparent; }

/* ---------- Modales ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(3, 7, 18, .6); backdrop-filter: blur(3px); z-index: 80; display: grid; place-items: center; padding: 18px; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 36px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .22s var(--ease); border: 1px solid var(--border); }
.modal-sm { max-width: 420px; } .modal-lg { max-width: 760px; } .modal-xl { max-width: 1020px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.modal-title { font-size: 18px; font-weight: 800; letter-spacing: -.015em; }
.modal-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.x-btn { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); flex: none; }
.x-btn:hover { color: var(--text); background: var(--surface-3); }
.modal-body { padding: 6px 20px 18px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.summary-box { background: var(--surface-2); border-radius: var(--radius); padding: 6px 14px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border-strong); font-size: 14px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row.total { font-size: 18px; font-weight: 800; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 120; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: none; display: flex; align-items: center; gap: 10px; background: #0b1220; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: fadeUp .25s var(--ease); max-width: 420px; }
:root[data-theme="dark"] .toast { background: #eef3fb; color: #0b1220; }
.toast i { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; flex: none; }
.toast.danger i { background: #ef4444; } .toast.warning i { background: #f59e0b; } .toast.info i { background: #22d3ee; }

/* ======================================================================
   PUNTO DE VENTA
   ====================================================================== */
.main.main-fixed { height: 100vh; height: 100dvh; overflow: hidden; }
.content.full { flex: 1; min-height: 0; display: flex; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; flex: 1; min-height: 0; width: 100%; }
.pos > .pos-main { grid-column: 1; grid-row: 1; }
.pos > .cart { grid-column: 2; grid-row: 1; }
.cart-backdrop { display: none; }
.pos-main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.pos-head { padding: 18px 22px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--border); background: var(--bg); }
.pos-grid-wrap { flex: 1; overflow-y: auto; padding: 16px 22px 100px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.pcard {
  position: relative; display: flex; flex-direction: column; text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 12px; gap: 8px; transition: transform .12s var(--ease), box-shadow .15s, border-color .15s; min-height: 152px; overflow: hidden;
}
.pcard:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.pcard:active:not(:disabled) { transform: scale(.97); }
.pcard:disabled { opacity: .5; cursor: not-allowed; }
.pcard-media { height: 68px; border-radius: 12px; display: grid; place-items: center; font-size: 40px; background: var(--pc, var(--surface-2)); overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; }
.pcard-name { font-weight: 700; font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-price { margin-top: auto; display: flex; flex-direction: column; gap: 1px; }
.pcard-price b { font-size: 15.5px; font-weight: 800; }
.pcard-price b small { font-size: 11px; font-weight: 650; color: var(--muted); margin-right: 3px; }
.pcard-price span { font-size: 11.5px; color: var(--text-bs); font-weight: 650; }
.pcard-flag { position: absolute; top: 8px; right: 8px; }
.pcard-qty { position: absolute; top: 8px; left: 8px; background: var(--brand); color: #fff; min-width: 24px; height: 24px; border-radius: 99px; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; box-shadow: var(--shadow); }

.cart { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; height: 100%; }
.cart-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.cart-ctx { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cart-ctx .btn { flex: 1; min-width: 0; justify-content: flex-start; }
.cart-list { flex: 1; overflow-y: auto; padding: 6px 12px; }
.cline { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 6px; border-bottom: 1px dashed var(--border); animation: fadeUp .2s var(--ease); }
.cline:last-child { border-bottom: 0; }
.cline-name { font-weight: 700; font-size: 14px; display: flex; gap: 6px; align-items: baseline; }
.cline-meta { font-size: 12px; color: var(--muted); grid-column: 1; }
.cline-meta .note { color: var(--warning); font-weight: 600; }
.cline-total { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.cline-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.cline.sent { opacity: .78; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; height: 32px; }
.stepper button { width: 32px; height: 100%; border: 0; background: var(--surface-2); display: grid; place-items: center; }
.stepper button:hover { background: var(--surface-3); }
.stepper button svg { width: 15px; height: 15px; }
.stepper span { min-width: 34px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-foot { border-top: 1px solid var(--border); padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.cart-totals { display: flex; flex-direction: column; gap: 4px; }
.cart-totals .between { font-size: 13.5px; color: var(--muted); }
.cart-grand { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 4px; }
.cart-grand .lbl { font-weight: 700; color: var(--muted); font-size: 13px; }
.cart-grand .val { text-align: right; }
.cart-grand .val b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; display: block; line-height: 1.05; }
.cart-grand .val span { color: var(--text-bs); font-weight: 700; font-size: 14px; }
.cart-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.cart-fab { display: none; }

/* Opciones del producto */
.opt-group { display: flex; flex-direction: column; gap: 8px; }
.opt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); font-weight: 650; font-size: 14px; text-align: left; }
.opt small { color: var(--muted); font-weight: 650; }
.opt.on { border-color: var(--brand); background: var(--brand-soft); }
.opt.on small { color: var(--brand-text); }
.opt:disabled { opacity: .45; }
.qty-big { display: flex; align-items: center; justify-content: center; gap: 16px; }
.qty-big button { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); display: grid; place-items: center; }
.qty-big span { font-size: 28px; font-weight: 800; min-width: 50px; text-align: center; }

/* Cobro */
.pay-total { text-align: center; padding: 14px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand-soft), transparent); border: 1px solid var(--border); }
.pay-total b { font-size: 36px; font-weight: 800; letter-spacing: -.03em; display: block; }
.pay-total span { color: var(--text-bs); font-weight: 750; font-size: 16px; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.pay-method { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 650; font-size: 13.5px; text-align: left; }
.pay-method i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pay-method.on { border-color: var(--brand); background: var(--brand-soft); }
.pay-lines { display: flex; flex-direction: column; gap: 8px; }
.pay-line { display: grid; grid-template-columns: 1fr 150px auto auto; gap: 8px; align-items: center; }
.pay-line .lbl { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.pay-line .lbl i { width: 10px; height: 10px; border-radius: 50%; }
.pay-status { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; font-weight: 750; }
.pay-status.due { background: var(--danger-soft); color: var(--danger); }
.pay-status.ok { background: var(--success-soft); color: var(--success); }

/* ======================================================================
   MESAS
   ====================================================================== */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tcard { position: relative; border-radius: 18px; padding: 16px; border: 1.5px solid var(--border); background: var(--surface); text-align: left; min-height: 132px; display: flex; flex-direction: column; gap: 6px; transition: transform .12s var(--ease), box-shadow .15s; }
.tcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tcard-name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.tcard-state { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.tcard-total { margin-top: auto; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tcard-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; }
.tcard-meta span { display: inline-flex; align-items: center; gap: 4px; }
.tcard-meta svg { width: 13px; height: 13px; }
.tcard.free .tcard-state { color: var(--success); }
.tcard.free { border-style: dashed; border-color: var(--border-strong); }
.tcard.busy { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); background: linear-gradient(160deg, var(--brand-soft), var(--surface) 70%); }
.tcard.busy .tcard-state { color: var(--brand-text); }
.tcard.ready { border-color: color-mix(in srgb, var(--success) 60%, var(--border)); }
.tcard.ready .tcard-state { color: var(--success); }
.tcard-edit { position: absolute; top: 10px; right: 10px; }
.tcard-add { border-style: dashed; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; background: transparent; }
.tcard-add svg { width: 26px; height: 26px; }

/* ======================================================================
   COCINA
   ====================================================================== */
.kboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.kcol { background: var(--surface-2); border-radius: var(--radius-lg); padding: 12px; min-height: 300px; border: 1px solid var(--border); }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; font-weight: 800; }
.kcol-head .badge { font-size: 12px; }
.kcol-list { display: flex; flex-direction: column; gap: 10px; }
.kticket { background: var(--surface); border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; animation: pop .25s var(--ease); }
.kticket-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px dashed var(--border); gap: 8px; }
.kticket-no { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.kticket-label { font-weight: 700; font-size: 13.5px; }
.kticket-time { font-size: 12px; font-weight: 750; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.kticket-time.late { background: var(--danger-soft); color: var(--danger); }
.kticket-time.warn { background: var(--warning-soft); color: var(--warning); }
.kticket-items { padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.kitem { display: flex; gap: 10px; font-size: 14.5px; }
.kitem b { min-width: 28px; height: 26px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; font-size: 13px; flex: none; }
.kitem small { display: block; color: var(--muted); font-size: 12.5px; }
.kitem .note { color: var(--warning); font-weight: 700; }
.kticket-foot { padding: 10px 12px; display: flex; gap: 8px; border-top: 1px solid var(--border); background: var(--surface-2); }
.kticket-foot .btn { flex: 1; }

/* ======================================================================
   MENÚ / RECETAS
   ====================================================================== */
.recipe { display: flex; flex-direction: column; gap: 8px; }
.recipe-row { display: grid; grid-template-columns: 1fr 110px 64px 74px 36px; gap: 8px; align-items: center; }
.recipe-row .unit { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.recipe-row .cost { font-size: 12.5px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.recipe-head { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.box-white { background: var(--surface); }
.variant-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.margin-bar { display: flex; gap: 16px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.margin-bar b { font-size: 16px; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 20px; }
.emoji-pick button.on { border-color: var(--brand); background: var(--brand-soft); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--brand-text); border-color: var(--brand); }

/* Barra de stock */
.stockbar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 70px; }
.stockbar i { display: block; height: 100%; border-radius: 99px; background: var(--success); }
.stockbar.low i { background: var(--warning); } .stockbar.out i { background: var(--danger); }

/* Gráfico de barras */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar i { width: 100%; max-width: 44px; border-radius: 4px 4px 0 0; background: var(--brand); min-height: 2px; transition: height .4s var(--ease); }
.bars .bar.today i { background: var(--brand-2); }
.bars .bar span { font-size: 11px; color: var(--faint); white-space: nowrap; }
.hbar { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.hbar .track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* Panel de administración */
.admin-wrap { min-height: 100vh; }
.admin-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.admin-top img { width: 36px; height: 36px; border-radius: 11px; }

/* Acciones rápidas */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.quick button { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); font-weight: 750; text-align: left; transition: transform .12s, box-shadow .15s; }
.quick button:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quick button small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.quick .kpi-icon { width: 42px; height: 42px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .pos { grid-template-columns: 1fr 350px; }
  .quick { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-mobile-brand { display: flex; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 35; }
  .main { margin-left: 0; padding-bottom: 66px; }
  .topbar { display: flex; }
  .content { padding: 18px 14px 30px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 650; color: var(--muted); position: relative; }
  .bottom-nav button.active { color: var(--brand-text); }
  .bottom-nav button svg { width: 21px; height: 21px; }
  .bottom-nav .bn-badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
  .grid-main, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .pos { grid-template-columns: minmax(0, 1fr); }
  .pos > .cart { grid-column: auto; grid-row: auto; }
  .pos-head { padding: 12px 14px 10px; }
  .pos-grid-wrap { padding: 12px 14px 110px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .cart { position: fixed; inset: auto 0 0 0; height: 88vh; border-left: 0; border-radius: 22px 22px 0 0; z-index: 60; transform: translateY(105%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  .cart.open { transform: none; }
  .cart-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 55; }
  .cart-fab { display: flex; position: fixed; left: 14px; right: 14px; bottom: 76px; z-index: 50; height: 56px; border-radius: 16px; border: 0; background: linear-gradient(135deg, #14b8a6, #0d9488 60%, #4f46e5); color: #fff; align-items: center; justify-content: space-between; padding: 0 18px; font-weight: 800; font-size: 15px; box-shadow: 0 12px 30px -10px rgba(13, 148, 136, .9); }
  .cart-fab .cnt { background: rgba(255, 255, 255, .25); border-radius: 99px; padding: 2px 10px; margin-right: 8px; }
  .kboard { grid-template-columns: 1fr; }
  .toasts { top: calc(10px + env(safe-area-inset-top)); }
}
@media (max-width: 640px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .view-title { font-size: 22px; }
  .hide-sm { display: none !important; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px; } .kpi-value { font-size: 21px; } .kpi-icon { width: 30px; height: 30px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 22px 22px 0 0; max-width: none !important; }
  .pay-line { grid-template-columns: 1fr 120px auto; }
  .pay-line .hide-xs { display: none; }
  .recipe-row { grid-template-columns: 1fr 80px 44px 32px; }
  .recipe-row .cost { display: none; }
  .tgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .quick { grid-template-columns: 1fr 1fr; }
  .table th, .table td { padding: 10px; }
  .auth-features { grid-template-columns: 1fr; }
}
@media print { body * { visibility: hidden; } }

/* Tarjeta para instalar la app (PWA) */
.install-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: linear-gradient(135deg, var(--brand-soft), var(--surface) 70%); }
.install-card img { width: 42px; height: 42px; border-radius: 12px; flex: none; }
.install-card b { display: block; font-size: 14px; }
.install-card span { display: block; font-size: 12.5px; color: var(--muted); }


/* ---------- Recorrido guiado ---------- */
.tour { position: fixed; inset: 0; z-index: 150; }
.tour-block { position: absolute; inset: 0; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(3, 7, 18, .7), 0 0 0 3px var(--brand-2), 0 0 26px 6px rgba(45, 212, 191, .5); transition: all .32s var(--ease); pointer-events: none; animation: tourPulse 2s ease-in-out infinite; }
@keyframes tourPulse { 50% { box-shadow: 0 0 0 9999px rgba(3, 7, 18, .7), 0 0 0 3px var(--brand-2), 0 0 34px 10px rgba(45, 212, 191, .32); } }
.tour-tip { position: fixed; width: min(360px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 18px; padding: 16px 16px 12px; box-shadow: var(--shadow-lg); transition: left .3s var(--ease), top .3s var(--ease), opacity .15s; animation: pop .25s var(--ease); }
.tour-tip.busy { opacity: .4; }
.tour-tip.center { width: min(420px, calc(100vw - 24px)); }
.tour-step { font-size: 11.5px; font-weight: 750; color: var(--brand-text); text-transform: uppercase; letter-spacing: .06em; }
.tour-title { font-size: 17px; font-weight: 800; margin: 4px 0 6px; letter-spacing: -.01em; }
.tour-text { font-size: 14px; color: var(--muted); line-height: 1.5; }
.tour-dots { display: flex; gap: 5px; margin: 12px 0 10px; flex-wrap: wrap; }
.tour-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--surface-3); transition: .2s; }
.tour-dots i.on { width: 18px; background: var(--brand); }
.tour-actions { display: flex; align-items: center; gap: 6px; }

/* ---------- Ayuda ---------- */
.help-video { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: var(--radius); border: 0; text-align: left; color: #fff; background: radial-gradient(500px 200px at 0% 0%, rgba(45, 212, 191, .7), transparent 60%), linear-gradient(135deg, #0b1433, #120c35); }
.help-video b { display: block; font-size: 16px; } .help-video small { display: block; opacity: .75; font-size: 13px; }
.help-play { width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex: none; }
.help-play svg { width: 22px; height: 22px; }
.help-list { display: flex; flex-direction: column; gap: 8px; }
.help-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-align: left; }
.help-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.help-item b { display: block; font-size: 14px; } .help-item small { display: block; color: var(--muted); font-size: 12.5px; }
.help-item > svg { color: var(--faint); }
.tutorial-video { width: 100%; border-radius: 12px; background: #000; display: block; max-height: 70vh; }

/* ======================================================================
   SANO-TÉCNICO — componentes del taller
   ====================================================================== */
.tone-neutral { background: var(--surface-2); color: var(--muted); }
.linkish { border: 0; background: none; padding: 0; color: var(--brand-text); font-weight: 650; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.linkish svg { width: 13px; height: 13px; }
.pcard-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.pcard-ic svg { width: 24px; height: 24px; }
kbd { font-family: inherit; font-size: 10.5px; font-weight: 750; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--faint); }

/* Búsqueda en la barra lateral */
.sb-search { margin: 2px 14px 6px; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 11px; color: var(--faint); font-size: 13px; font-weight: 600; text-align: left; transition: border-color .15s, box-shadow .15s; }
.sb-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-search:hover { border-color: var(--brand); box-shadow: var(--ring); color: var(--muted); }

/* Etiquetas */
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-text); font-size: 12.5px; font-weight: 650; }
.tag-warn { background: var(--warning-soft); color: var(--warning); }
.tag-x { border: 0; background: none; padding: 0; display: grid; place-items: center; color: inherit; opacity: .6; }
.tag-x:hover { opacity: 1; } .tag-x svg { width: 13px; height: 13px; }
.chips-wrap { flex-wrap: wrap; overflow: visible; }
.chips-wrap .chip { height: 34px; font-size: 13px; }
.chips-wrap .chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* Pares clave–valor */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; }
.kv > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv span { font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.kv b { font-size: 14px; overflow-wrap: anywhere; }
.secret { padding: 4px 10px; border-radius: 8px; background: var(--surface-2); letter-spacing: .14em; font-weight: 700; }

/* ---------- Recepción de equipos ---------- */
.intake { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.in-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.in-sec { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 80px; }
.in-sec-head { display: flex; gap: 12px; align-items: center; }
.in-n { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: linear-gradient(135deg, #14b8a6, #0d9488 55%, #4f46e5); box-shadow: 0 6px 16px -6px rgba(13, 148, 136, .6); }
.in-side { position: sticky; top: 18px; }
.in-summary { display: flex; flex-direction: column; gap: 10px; }
.sum-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.sum-line span { color: var(--muted); flex: none; } .sum-line b { text-align: right; min-width: 0; }
.sum-total { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); }
.sum-total span { font-size: 12px; font-weight: 700; color: var(--brand-text); }
.sum-total b { font-size: 26px; letter-spacing: -.02em; }
.in-fab { display: none; }
.cust-pick { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--brand); background: var(--brand-soft); border-radius: 13px; }
.type-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.type-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 650; font-size: 12.5px; transition: all .15s; }
.type-btn svg { width: 24px; height: 24px; }
.type-btn:hover { border-color: var(--border-strong); color: var(--text); }
.type-btn.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); box-shadow: var(--ring); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.chk { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); text-align: left; transition: all .15s; }
.chk span { font-weight: 700; font-size: 13px; }
.chk small { font-size: 11px; color: var(--faint); font-weight: 650; }
.chk.ok { border-color: color-mix(in srgb, var(--success) 45%, transparent); background: var(--success-soft); }
.chk.ok small { color: var(--success); }
.chk.bad { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }
.chk.bad small { color: var(--danger); }
.chk.na small { color: var(--muted); }
.chk-mini { display: flex; flex-wrap: wrap; gap: 5px; }
.cm { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.cm.ok { background: var(--success-soft); color: var(--success); }
.cm.bad { background: var(--danger-soft); color: var(--danger); }
.mini-items { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.done-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }

/* Patrón de desbloqueo */
.pattern-pad { position: relative; width: 210px; height: 210px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); border-radius: 20px; background: linear-gradient(160deg, #062a2a, #111c3a); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), var(--shadow); touch-action: none; user-select: none; }
.pp-dot { border: 0; background: none; display: grid; place-items: center; position: relative; z-index: 2; padding: 0; }
.pp-dot i { width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .28); transition: all .15s; }
.pp-dot b { position: absolute; font-size: 10px; color: #04121c; font-weight: 800; }
.pp-dot.on i { width: 26px; height: 26px; background: #22d3ee; box-shadow: 0 0 0 6px rgba(45, 212, 191, .18); }
.pp-dot.first i { width: 32px; height: 32px; background: #fbbf24; box-shadow: 0 0 0 7px rgba(251, 191, 36, .2); }
.pp-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.pp-lines polyline { stroke: rgba(45, 212, 191, .75); }
.pattern-mini { padding: 6px; border-radius: 12px; background: var(--surface-2); line-height: 0; }
.pattern-mini svg { width: 92px; height: 92px; }

/* Fotos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 13px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.photo .btn { position: absolute; top: 6px; right: 6px; }
.photo.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border: 2px dashed var(--border-strong); color: var(--muted); font-size: 12.5px; font-weight: 650; background: transparent; }
.photo.add:hover { border-color: var(--brand); color: var(--brand-text); }
.photo.add svg { width: 26px; height: 26px; }

/* ---------- Tablero del taller ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; scroll-snap-type: x proximity; }
.bcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; scroll-snap-align: start; border-top: 3px solid var(--bc, var(--border-strong)); }
.bcol-brand { --bc: var(--brand); } .bcol-info { --bc: var(--info); } .bcol-warning { --bc: var(--warning); } .bcol-violet { --bc: var(--violet); }
.bcol-success { --bc: var(--success); } .bcol-danger { --bc: var(--danger); } .bcol-neutral { --bc: var(--faint); }
.bcol-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 750; font-size: 13.5px; padding: 2px 4px; }
.bcol-head > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.bcol-head svg { color: var(--bc); }
.bcol-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 290px); overflow-y: auto; }
.bcol-empty { text-align: center; color: var(--faint); font-size: 12.5px; padding: 22px 6px; border: 1px dashed var(--border-strong); border-radius: 12px; }
.rcard { display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; padding: 11px 12px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.rcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.rcard.urgent { border-left: 3px solid var(--danger); }
.rcard-num { font-weight: 800; font-size: 12.5px; color: var(--brand-text); }
.rcard-time { font-size: 11.5px; color: var(--faint); font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }
.rcard-time.late { color: var(--danger); } .rcard-time svg { width: 13px; height: 13px; }
.rcard-dev { display: flex; align-items: center; gap: 7px; font-size: 14px; min-width: 0; }
.rcard-dev svg { color: var(--muted); }
.rcard-fault { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard-foot { font-size: 12.5px; color: var(--muted); gap: 8px; }
.rcard-foot span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.rcard-foot svg { width: 14px; height: 14px; }
.rcard .badge svg { width: 12px; height: 12px; }
.table.rt tr.click { cursor: pointer; } .table.rt tr.click:hover td { background: var(--surface-2); }
td.click { cursor: pointer; }

/* Etapas en el inicio */
.pipeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.pipe { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); text-align: left; transition: transform .15s var(--ease), border-color .15s; --pc: var(--faint); }
.pipe:hover { transform: translateY(-2px); border-color: var(--pc); }
.pipe-n { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.pipe-l { font-size: 12px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.pipe-l svg { width: 14px; height: 14px; color: var(--pc); }
.pipe i { position: absolute; left: 0; bottom: 0; height: 4px; border-radius: 0 4px 4px 0; background: var(--pc); }
.pipe-brand { --pc: var(--brand); } .pipe-info { --pc: var(--info); } .pipe-warning { --pc: var(--warning); } .pipe-violet { --pc: var(--violet); }
.pipe-success { --pc: var(--success); } .pipe-danger { --pc: var(--danger); } .pipe-neutral { --pc: var(--faint); }

/* ---------- Ficha de la orden ---------- */
.repair-modal .modal-body { padding: 0; }
.rp-head { position: sticky; top: 0; z-index: 5; background: var(--surface); padding: 18px 20px 0; border-bottom: 1px solid var(--border); }
.rp-dev { display: flex; gap: 14px; align-items: flex-start; }
.rp-icon { width: 52px; height: 52px; border-radius: 16px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #14b8a6, #0d9488 55%, #4f46e5); box-shadow: 0 10px 22px -10px rgba(13, 148, 136, .7); }
.rp-icon svg { width: 26px; height: 26px; }
.rp-num { font-weight: 800; color: var(--brand-text); font-size: 13.5px; }
.rp-title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; }
.rp-dev .small svg { width: 13px; height: 13px; vertical-align: -2px; }
.rp-money { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.rp-money > div { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.rp-money span { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.rp-money b { font-size: 16px; }
.rp-money small { font-size: 11.5px; font-weight: 650; }
.rp-steps { display: flex; gap: 6px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rp-steps::-webkit-scrollbar { display: none; }
.rp-step { flex: 1 0 auto; display: flex; align-items: center; gap: 7px; padding: 7px 11px 7px 7px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 12.5px; white-space: nowrap; transition: all .15s; }
.rp-step i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.rp-step i svg { width: 14px; height: 14px; }
.rp-step:hover { border-color: var(--brand); color: var(--text); }
.rp-step.done { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.rp-step.done i { background: var(--success-soft); }
.rp-step.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 16px -8px var(--brand); }
.rp-step.on i { background: rgba(255, 255, 255, .22); }
.rp-step.bad.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.rp-tabs { margin: 12px 0 0; border-bottom: 0; }
.rp-body { padding: 18px 20px; background: var(--bg); min-height: 300px; }
.rp-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: start; }
.rp-foot { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--border); }
.track-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; border: 1px dashed color-mix(in srgb, var(--brand) 55%, transparent); background: var(--brand-soft); text-align: left; }
.track-box > svg { width: 26px; height: 26px; color: var(--brand); }
.budget td input { max-width: 110px; }
.budget-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding: 14px 4px 4px; }
.budget-total { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; padding: 4px; }
.suggest button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 9px; text-align: left; font-size: 13.5px; }
.suggest button:hover, .suggest button.on { background: var(--surface-2); }
.timeline { position: relative; display: flex; flex-direction: column; gap: 14px; padding-left: 4px; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 12px; bottom: 12px; width: 2px; background: var(--border); }
.tl-item { position: relative; display: flex; gap: 12px; align-items: flex-start; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 3px solid var(--bg); z-index: 1; }
.tl-dot svg { width: 15px; height: 15px; }

/* ---------- Búsqueda global ---------- */
.search-big { height: 52px; border-radius: 14px; font-size: 16px; }
.search-big input { font-size: 16px; }
.sres { margin-top: 12px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sitem { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 12px; text-align: left; }
.sitem:hover, .sitem.on { background: var(--surface-2); }
.sitem small { display: block; color: var(--muted); font-size: 12.5px; }
.sitem > svg:last-child { color: var(--faint); }

/* ---------- Técnicos ---------- */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tech-card { display: flex; flex-direction: column; gap: 14px; }
.tech-card.inactive { opacity: .6; }
.tech-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tech-stats > div { display: flex; flex-direction: column; gap: 1px; padding: 9px 10px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.tech-stats b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
.tech-stats span { font-size: 11px; color: var(--faint); font-weight: 700; }

/* ---------- Login: teléfono animado ---------- */
.auth-hero { position: relative; overflow: hidden; }
.auth-device { position: absolute; right: 6%; bottom: 9%; width: 170px; height: 300px; z-index: 0; opacity: .9; pointer-events: none; }
.ad-phone { position: absolute; inset: 0; border-radius: 30px; border: 3px solid rgba(94, 234, 212, .55); background: linear-gradient(170deg, rgba(15, 118, 110, .25), rgba(67, 56, 202, .18)); box-shadow: 0 30px 80px -20px rgba(45, 212, 191, .45), inset 0 0 30px rgba(45, 212, 191, .12); transform: rotate(-8deg); animation: adFloat 6s ease-in-out infinite; }
.ad-screen { position: absolute; inset: 16px 12px; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 18px 14px; background: rgba(4, 18, 28, .35); }
.ad-screen span { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .14); }
.ad-screen span:nth-child(1) { width: 70%; } .ad-screen span:nth-child(2) { width: 90%; } .ad-screen span:nth-child(3) { width: 55%; }
.ad-screen::after { content: ""; position: absolute; left: 0; right: 0; height: 40%; top: -40%; background: linear-gradient(180deg, transparent, rgba(45, 212, 191, .35), transparent); animation: adScan 3.2s linear infinite; }
.ad-ring { position: absolute; left: -40px; top: 30px; width: 90px; height: 90px; border-radius: 50%; border: 2px dashed rgba(251, 191, 36, .55); animation: adSpin 14s linear infinite; }
@keyframes adFloat { 0%, 100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(-6deg) translateY(-12px); } }
@keyframes adScan { to { top: 100%; } }
@keyframes adSpin { to { transform: rotate(360deg); } }

/* ---------- Consulta pública del equipo ---------- */
.track-page { min-height: 100vh; background: radial-gradient(1200px 500px at 10% -10%, rgba(45, 212, 191, .22), transparent 60%), radial-gradient(900px 500px at 110% 10%, rgba(124, 58, 237, .2), transparent 60%), var(--bg); padding: 28px 16px 40px; }
.track-wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.track-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; align-self: center; }
.track-brand img { width: 40px; height: 40px; border-radius: 12px; }
.track-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 22px; animation: fadeUp .4s var(--ease); }
.track-card h1, .track-card h2 { margin: 0 0 4px; letter-spacing: -.02em; }
.track-foot { text-align: center; color: var(--faint); font-size: 12px; margin: 0; }
.tr-top { display: flex; gap: 12px; align-items: center; }
.tr-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.tr-icon svg { width: 26px; height: 26px; }
.tr-dev { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.tr-hero { margin-top: 16px; padding: 16px 18px; border-radius: 16px; display: flex; flex-direction: column; gap: 3px; }
.tr-hero b { font-size: 22px; letter-spacing: -.02em; }
.tr-hero span { font-size: 14px; opacity: .9; }
.tr-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 18px; position: relative; }
.tr-step { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 11px; font-weight: 700; color: var(--faint); position: relative; }
.tr-step::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.tr-step:first-child::before { display: none; }
.tr-step.done::before, .tr-step.on::before { background: var(--success); }
.tr-step i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--border); z-index: 1; }
.tr-step i svg { width: 15px; height: 15px; }
.tr-step.done { color: var(--success); } .tr-step.done i { background: var(--success); border-color: var(--success); color: #fff; }
.tr-step.on { color: var(--brand-text); } .tr-step.on i { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 5px var(--brand-soft); }
.tr-step small { font-weight: 600; font-size: 10px; color: var(--faint); }
.tr-note { margin-top: 16px; display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; background: var(--info-soft); color: var(--info); font-size: 13.5px; font-weight: 600; }
.tr-items { display: flex; flex-direction: column; gap: 7px; padding: 12px 14px; border-radius: 13px; background: var(--surface-2); font-size: 13.5px; }
.tr-total { padding-top: 8px; border-top: 1px dashed var(--border-strong); font-size: 15px; }
.tr-biz { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }

/* ---------- Responsive del taller ---------- */
@media (max-width: 1180px) {
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .intake { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 980px) {
  .intake { grid-template-columns: 1fr; }
  .in-side { display: none; }
  .in-fab { display: block; position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 20; padding: 8px 0; }
  .in-fab .btn { box-shadow: 0 12px 30px -10px rgba(13, 148, 136, .7); }
  .rp-grid { grid-template-columns: 1fr; }
  .rp-money { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-device { display: none; }
}
@media (max-width: 640px) {
  .type-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipe { padding: 10px; } .pipe-n { font-size: 22px; }
  .board { grid-auto-columns: 84%; }
  .rp-head { padding: 14px 14px 0; }
  .rp-body { padding: 14px; }
  .rp-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .rp-foot > .row { width: 100%; }
  .rp-foot > .row .btn { flex: 1; }
  .rp-title { font-size: 18px; }
  .rp-icon { width: 44px; height: 44px; }
  .rp-money { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-money > div:last-child { grid-column: span 2; }
  .tech-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .done-actions { grid-template-columns: 1fr; }
  .tr-steps { gap: 0; } .tr-step span { font-size: 10px; }
  .track-card { padding: 18px; }
  .pattern-pad { width: 230px; height: 230px; }
}
.tr-step span { line-height: 1.15; }
@media (max-width: 640px) { .tr-step { font-size: 9.5px; } .tr-step span { font-size: 9.5px; } .tr-step small { font-size: 9px; } }
.budget td:first-child { width: 55%; min-width: 240px; }
.budget [data-name] { flex: 1; min-width: 150px; max-width: none; }
.budget td input[data-name] { max-width: none; }
.budget td .badge { flex: none; }
.rlist { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Sin scroll lateral en ningún dispositivo ----------
   Las columnas de grid/flex toman el ancho mínimo de su contenido (textos largos sin salto),
   lo que en teléfonos ensanchaba toda la página. Se fuerza que encojan y que los textos se ajusten. */
html { overflow-x: hidden; }
body, .app, .main, .content, .auth-screen { max-width: 100%; overflow-x: clip; }
.grid-main > *, .grid-2 > *, .grid-3 > *, .kpis > *, .quick > *, .form-grid > *, .form-grid-3 > *,
.tech-grid > *, .pipeline > *, .type-grid > *, .stack > *, .view-header > *, .toolbar > *, .card { min-width: 0; }
.quick button > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.tech-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; }
.btn { max-width: 100%; }
.chips-wrap .chip { max-width: 100%; }
.view-actions > .row, .toolbar > .row { flex-wrap: wrap; min-width: 0; }
input[type="date"].input { min-width: 0; }
@media (max-width: 980px) {
  .auth-screen, .grid-main, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .auth-panel { padding: 28px 16px; min-width: 0; }
  .view-header > div:first-child { flex: 1 1 100%; }
  .view-actions { width: 100%; }
  .view-actions > .row, .toolbar > .row { flex: 1 1 100%; }
  .view-actions > .row input[type="date"], .toolbar > .row input[type="date"] { flex: 1 1 0; width: auto; }
  .toolbar .select { min-width: 0 !important; flex: 1 1 140px; }
  .chips-wrap .chip { white-space: normal; height: auto; min-height: 34px; padding: 6px 13px; text-align: left; line-height: 1.25; }
  .row-wrap > .btn { white-space: normal; height: auto; min-height: 32px; padding-top: 6px; padding-bottom: 6px; line-height: 1.2; text-align: left; }
  .type-btn { min-width: 0; font-size: 11.5px; padding: 10px 2px; }
  .type-btn span { max-width: 100%; overflow-wrap: anywhere; text-align: center; line-height: 1.15; }
}
@media (max-width: 400px) {
  .type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { gap: 8px; }
  .kpi { padding: 11px; } .kpi-value { font-size: 19px; }
  .content { padding: 16px 12px 28px; }
}
/* Ventanas emergentes: nunca más anchas que la pantalla */
.modal-backdrop { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.modal, .modal-body, .modal-body > * { min-width: 0; }
.modal-body { overflow-x: hidden; }
/* Tablas que en teléfono se muestran como tarjetas (panel de sedes) */
@media (max-width: 640px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody { display: block; width: 100%; }
  .table-cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 14px; border-bottom: 1px solid var(--border); }
  .table-cards td { display: block; padding: 0 !important; border: 0 !important; text-align: left; min-width: 0; }
  .table-cards td:first-child, .table-cards td:last-child { grid-column: 1 / -1; }
  .table-cards td:last-child { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; white-space: normal; }
  .table-cards td.r { text-align: right; }
  .table-cards td.c { text-align: left; justify-self: start; }
}

/* =====================================================================
   SANO DOCTOR — Módulos médicos
   ===================================================================== */
/* Login: trazo de electrocardiograma */
.auth-ecg { position: absolute; left: 0; right: 0; bottom: 16%; height: 120px; z-index: 0; pointer-events: none; opacity: .55; }
.auth-ecg svg { width: 100%; height: 100%; }
.auth-ecg polyline { fill: none; stroke: #5eead4; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: ecgDraw 4.5s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(94, 234, 212, .8)); }
@keyframes ecgDraw { 0% { stroke-dashoffset: 1400; opacity: 0; } 10% { opacity: 1; } 60% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .auth-ecg polyline { animation: none; stroke-dashoffset: 0; } }

/* Utilidades */
.mt-xs { margin-top: 6px; }
.mb { margin-bottom: 14px; }
.select-sm { height: 34px; font-size: 13.5px; padding-left: 10px; }
.select-xs { height: 28px; font-size: 12px; padding: 0 26px 0 8px; border-radius: 8px; background-position: right 8px center; width: auto; }
.chip-xs { height: 28px; padding: 0 10px; font-size: 12px; }
.chip-xs svg { width: 13px; height: 13px; }
label.chip { cursor: pointer; user-select: none; }
.seg-n { font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; display: inline-grid; place-items: center; font-weight: 800; }
.seg-n:empty { display: none; }
.input-group .suffix { position: absolute; right: 10px; color: var(--faint); font-size: 11.5px; font-weight: 650; pointer-events: none; }
.input-group .input:has(+ .suffix) { padding-right: 44px; }
.kpis-sm .kpi-value { font-size: 20px; }
.avatar-lg { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; }
.kv-1 { grid-template-columns: 1fr; gap: 10px; }
.type-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--faint)); margin-right: 5px; vertical-align: 1px; flex: none; }

/* Alertas clínicas */
.allergy-strip { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 13.5px; font-weight: 650; border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.allergy-strip svg { width: 18px; height: 18px; flex: none; }
.ctx-strip { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ctx-strip span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.ctx-strip svg { width: 14px; height: 14px; color: var(--brand); flex: none; }
.vital-alert { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 11px; font-size: 13px; font-weight: 650; background: var(--info-soft); color: var(--info); }
.vital-alert svg { width: 16px; height: 16px; flex: none; }
.vital-alert.warning { background: var(--warning-soft); color: var(--warning); }
.vital-alert.danger { background: var(--danger-soft); color: var(--danger); }
.vital-alert.success { background: var(--success-soft); color: var(--success); }

/* Agenda */
.ag-toolbar { flex-wrap: wrap; gap: 10px; }
.day-grid { display: flex; flex-direction: column; }
.slot { display: grid; grid-template-columns: 64px minmax(0, 1fr); border-bottom: 1px solid var(--border); min-height: 56px; }
.slot:last-child { border-bottom: 0; }
.slot.now { background: linear-gradient(90deg, var(--brand-soft), transparent 60%); }
.slot.now .slot-t { color: var(--brand-text); }
.slot-t { padding: 12px 0 0 14px; font-weight: 800; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.slot-c { display: flex; flex-direction: column; gap: 6px; padding: 7px 12px 7px 0; min-width: 0; }
.slot-free { align-self: stretch; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 11px; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--faint); font-weight: 650; font-size: 13px; transition: all .15s; }
.slot-free:hover { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); }
.slot-free svg { width: 15px; height: 15px; }
.slot-break { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 11px; background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 8px, transparent 8px, transparent 16px); color: var(--faint); font-size: 12.5px; font-weight: 650; }
.appt { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c, var(--brand)); box-shadow: var(--shadow-sm); min-width: 0; }
.appt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.appt-act { display: flex; align-items: center; gap: 6px; flex: none; }
.appt-time { font-variant-numeric: tabular-nums; color: var(--brand-text); font-size: 13.5px; }
.appt-cancelada, .appt-no_asistio { opacity: .6; }
.appt-cancelada .appt-main b { text-decoration: line-through; }
.appt-atendida { background: var(--surface-2); }
.appt-espera { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); background: color-mix(in srgb, var(--warning-soft) 60%, var(--surface)); }
.appt-consulta { border-color: color-mix(in srgb, var(--violet) 50%, var(--border)); background: color-mix(in srgb, var(--violet-soft) 60%, var(--surface)); }
.appt.appt-espera, .appt.appt-consulta, .appt.appt-atendida, .appt.appt-cancelada, .appt.appt-no_asistio { border-left: 4px solid var(--c, var(--brand)); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.wcol { background: var(--surface); min-height: 260px; display: flex; flex-direction: column; min-width: 0; }
.wcol.today { background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); }
.wcol-h { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 4px 8px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 700; }
.wcol-h b { font-size: 20px; color: var(--text); letter-spacing: -.02em; }
.wcol-h small { font-size: 11px; color: var(--brand-text); min-height: 14px; }
.wcol.today .wcol-h b { color: var(--brand-text); }
.wcol-l { display: flex; flex-direction: column; gap: 4px; padding: 6px; }
.wappt { border: 0; text-align: left; display: flex; flex-direction: column; gap: 0; padding: 5px 7px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--c, var(--brand)); font-size: 11.5px; min-width: 0; }
.wappt b { font-size: 11px; color: var(--brand-text); }
.wappt span { font-weight: 600; }
.wappt.appt-no_asistio, .wappt.appt-cancelada { opacity: .55; }
.wappt.appt-atendida { opacity: .75; }

/* Sala de espera */
.wait-card { margin-bottom: 16px; border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); }
.wait-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.wait-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.wait-item.in { background: var(--violet-soft); border-color: color-mix(in srgb, var(--violet) 30%, transparent); }
.wait-n { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; background: var(--warning); color: #fff; }

/* Formulario de cita */
.type-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.type-grid .type-btn { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; gap: 2px 6px; padding: 10px 12px; text-align: left; }
.type-grid .type-btn small { width: 100%; font-size: 11px; color: var(--faint); padding-left: 15px; }
.type-grid .type-btn.on { border-color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 12%, var(--surface)); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--brand)) 18%, transparent); }
.pt-pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--brand); background: var(--brand-soft); border-radius: 13px; min-width: 0; }
.pick-list { max-height: 380px; overflow: auto; }

/* Consulta */
.consult-modal .rp-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.tab-n { margin-left: 5px; font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-text); display: inline-grid; place-items: center; font-weight: 800; }
.save-state { font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.save-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.save-state.ok { color: var(--success); } .save-state.ok::before { background: var(--success); }
.save-state.bad { color: var(--danger); } .save-state.bad::before { background: var(--danger); }
.vitals-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.vf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vf > span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.vitals-calc { display: flex; flex-direction: column; gap: 6px; }
.dx-results { max-height: 300px; overflow: auto; }
.dx-opt, .med-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 11px; background: transparent; text-align: left; color: var(--text); }
.dx-opt:hover, .med-opt:hover { background: var(--brand-soft); }
.dx-opt svg, .med-opt > svg { flex: none; color: var(--brand); width: 17px; height: 17px; }
.med-opt small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.med-opt.conflict { background: var(--danger-soft); }
.med-opt.conflict > svg { color: var(--danger); }
.med-results { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow: auto; }
.med-results:empty { display: none; }
.dx-code { display: inline-grid; place-items: center; min-width: 46px; height: 24px; padding: 0 6px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-text); font-weight: 800; font-size: 11.5px; font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; flex: none; }
.dx-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); }
.dx-item:first-child { border-color: var(--brand); box-shadow: var(--ring); }
.rx-line { border-left: 4px solid var(--brand); }
.rx-line.conflict { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface)); }
.rx-n { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--brand); color: var(--brand-ink); }
.rx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
.rx-grid .field.full { grid-column: 1 / -1; }
.rx-grid .lbl { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.doc-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.doc-card .kpi-icon { flex: none; }
.charge-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.charge-line:last-child { border-bottom: 0; }
.addendum { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--info); margin-top: 8px; }

/* Signos vitales en la ficha */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.vcell { display: flex; flex-direction: column; gap: 1px; padding: 9px 11px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.vcell span { font-size: 11px; font-weight: 700; opacity: .8; text-transform: uppercase; letter-spacing: .04em; }
.vcell b { font-size: 16px; letter-spacing: -.01em; }
.vcell small { font-size: 11px; opacity: .8; }
.spark { width: 100%; height: 90px; display: block; }
.spark-line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-ref { stroke: var(--danger); stroke-dasharray: 4 4; stroke-width: 1; opacity: .6; vector-effect: non-scaling-stroke; }
.files-grid .file-card { display: flex; flex-direction: column; }
.file-pdf { flex: 1; width: 100%; border: 0; background: var(--danger-soft); color: var(--danger); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 800; }
.file-pdf svg { width: 30px; height: 30px; }
.file-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 8px; font-size: 11px; font-weight: 650; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Cobrar: consultas pendientes */
.pend-strip { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--violet-soft); border: 1px solid color-mix(in srgb, var(--violet) 25%, transparent); margin-bottom: 10px; }
.pend-strip b svg { width: 15px; height: 15px; vertical-align: -2px; }
.pend-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.pend-item { flex: none; display: flex; align-items: center; gap: 10px; width: 230px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-align: left; color: var(--text); }
.pend-item:hover { border-color: var(--violet); }
.pend-item small { display: block; font-size: 11.5px; color: var(--muted); }

/* Configuración: firma */
.sig-box { display: grid; place-items: center; min-height: 92px; padding: 10px; border-radius: 12px; border: 1px dashed var(--border-strong); background: #fff; margin-bottom: 8px; }
.sig-box img { max-height: 90px; max-width: 100%; }
.sig-box .faint { color: #6b7d85; text-align: center; }
.sig-canvas { width: 100%; aspect-ratio: 3 / 1; border-radius: 12px; border: 1px solid var(--border-strong); background: #fff; touch-action: none; cursor: crosshair; display: block; }

/* Verificación pública */
.vf-hero { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; }
.vf-hero.ok { background: var(--success-soft); color: var(--success); }
.vf-hero.bad { background: var(--danger-soft); color: var(--danger); }
.vf-hero b { display: block; font-size: 21px; letter-spacing: -.02em; }
.vf-hero span { display: block; font-size: 13.5px; color: var(--text); }
.vf-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; background: currentColor; }
.vf-ic svg { width: 28px; height: 28px; color: #fff; }
.vf-doc { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }

@media (max-width: 980px) {
  .week-grid { grid-template-columns: repeat(7, minmax(110px, 1fr)); overflow-x: auto; }
  .rx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .appt { flex-wrap: wrap; }
  .appt-act { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .slot { grid-template-columns: 52px minmax(0, 1fr); }
  .slot-t { padding-left: 10px; font-size: 12px; }
  .wait-list { grid-template-columns: 1fr; }
  .vitals-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pend-item { width: 200px; }
  .auth-ecg { display: none; }
}

.slot-gone { min-height: 30px; opacity: .55; }
.slot-gone .slot-t { padding-top: 6px; }

/* Consulta en teléfonos: nada se sale de la pantalla */
.rp-grid > * { min-width: 0; }
@media (max-width: 560px) {
  .consult-modal .rp-dev { flex-wrap: wrap; }
  .consult-modal .rp-dev > .row { width: 100%; justify-content: flex-end; }
  .consult-modal .rp-dev > .row .select { flex: 1; min-width: 0; }
  .charge-line { flex-wrap: wrap; row-gap: 6px; }
  .charge-line > .grow { flex-basis: 100%; }
  .consult-modal [data-add-svc], .consult-modal [data-add-prod] { min-width: 0 !important; flex-basis: 100% !important; }
}
