/* Reservus IA · App del móvil: pestañas abajo, aviso de instalación y ventana de la app */

/* Pestañas abajo, solo en el móvil */
.tabbar { display: none; }
@media (max-width: 1020px) {
  body.has-tabbar .p-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.has-tabbar .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--line, #efece4); box-shadow: 0 -8px 24px -18px rgba(35, 31, 20, .35); }
  .tabbar[hidden] { display: none; }
  .tabbar button { position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 2px 4px; border: 0; background: none; border-radius: 12px; color: var(--muted, #6b778c); font: 650 .66rem/1.1 var(--sans, system-ui); cursor: pointer; min-height: 52px; -webkit-tap-highlight-color: transparent; }
  .tabbar button .ic { width: 22px; height: 22px; }
  .tabbar button[aria-current="true"] { color: var(--brand, #8e793e); }
  .tabbar button[aria-current="true"]::before { content: ''; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: currentColor; }
  .tabbar .tb-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red, #d92f45); color: #fff; font: 800 .62rem/17px var(--sans, system-ui); }
  .tabbar .tb-badge[hidden] { display: none; }
}

/* App instalada: respeta la muesca y la barra de estado */
body.is-app .mbar { padding-top: env(safe-area-inset-top); height: calc(58px + env(safe-area-inset-top)); }
body.is-app .side { padding-top: env(safe-area-inset-top); }

/* Aviso "úsala como app" en el navegador del móvil */
.install-bar { display: flex; align-items: center; gap: 10px; margin: 12px 16px 0; padding: 10px 10px 10px 12px; border-radius: 16px; background: var(--surface, #fff); box-shadow: 0 1px 2px rgba(35, 31, 20, .06), 0 10px 26px -18px rgba(35, 31, 20, .4); border: 1px solid var(--line, #efece4); }
.install-bar .ib-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50, #f6f1e2); color: var(--brand, #8e793e); flex: none; }
.install-bar .ib-ic .ic { width: 20px; height: 20px; }
.install-bar .ib-t { flex: 1; min-width: 0; display: grid; }
.install-bar .ib-t b { font-size: .86rem; }
.install-bar .ib-t small { font-size: .74rem; color: var(--muted, #6b778c); }
.install-bar .ib-x { width: 32px; height: 32px; border: 0; background: none; color: var(--muted, #6b778c); border-radius: 10px; display: grid; place-items: center; cursor: pointer; }

/* Acceso en la barra lateral */
.app-entry { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 12px; padding: 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; background: linear-gradient(135deg, rgba(142, 121, 62, .22), rgba(202, 183, 130, .18)); color: #fff; text-align: left; cursor: pointer; font: inherit; }
.app-entry > .ic:first-child { width: 20px; height: 20px; }
.app-entry span { flex: 1; display: grid; }
.app-entry b { font-size: .84rem; }
.app-entry small { font-size: .72rem; opacity: .75; }
.app-entry .ic:last-child { width: 16px; height: 16px; opacity: .7; }

/* Ventana de la app */
.panel-body dialog.app-dlg { width: min(560px, calc(100% - 24px)); }
.app-dlg .dlg-h .icon-btn { margin-left: auto; }
.app-sec { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: var(--fill, #f3efe4); }
.app-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .92rem; }
.app-sec h3 .ic { width: 17px; height: 17px; color: var(--brand, #8e793e); }
.app-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.app-steps li { display: flex; gap: 10px; align-items: center; font-size: .88rem; color: var(--fg-2, #4a4436); }
.app-steps .n { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--brand, #8e793e); color: #fff; font-weight: 800; font-size: .78rem; }
.app-steps .kbd-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; vertical-align: middle; border-radius: 7px; background: #fff; box-shadow: inset 0 0 0 1px var(--line, #efece4); color: var(--brand, #8e793e); }
.app-steps .kbd-ic .ic { width: 15px; height: 15px; }
.app-install { display: grid; gap: 12px; justify-items: start; }
.app-install p { margin: 0; font-size: .88rem; color: var(--fg-2, #4a4436); }
.app-qr { display: grid; grid-template-columns: 148px 1fr; gap: 16px; align-items: center; }
.app-qr .qr-box { background: #fff; padding: 8px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line, #efece4); }
.app-qr .qr-box svg { display: block; width: 100%; height: auto; }
.app-qr p { margin: 0 0 8px; font-size: .88rem; }
.app-ok { display: flex; gap: 10px; align-items: flex-start; }
.app-ok .ic { width: 22px; height: 22px; color: var(--green, #11884a); flex: none; }
.app-ok > div { display: grid; gap: 2px; font-size: .88rem; }
.app-ok span { color: var(--fg-2, #4a4436); }
.app-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.app-acts .btn[hidden] { display: none; }
.muted-s { margin: 0; font-size: .84rem; color: var(--muted, #6b778c); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
@media (max-width: 520px) { .app-qr { grid-template-columns: 1fr; } .app-qr .qr-box { max-width: 180px; } }
