/* ===== Estilo del NICHO (Mi Kit de Viaje) =====
   Fondo lavanda, tarjetas blancas muy redondeadas, índigo + acento lima y barra inferior flotante tipo «píldora». */
:root { --bg: #f3f2fb; --line: #e6e4f4; --radius: 22px; --lime: #c8f169; --lime-ink: #1b2a05;
  --shadow: 0 1px 2px rgba(40,30,120,.04), 0 8px 24px rgba(40,30,120,.07); }
:root { --deep: var(--brand); }   /* fondo de las tarjetas con texto blanco */
:root[data-theme="dark"] { --deep: var(--brand-2); --bg: #11111c; --surface: #1b1b2a; --line: #2c2b40; --lime: #b5e255; --lime-ink: #142003; }

.card { border: 0; }
.row-item { border: 0; box-shadow: var(--shadow); border-radius: 18px; }
.list { display: grid; gap: 8px; }
.stack { display: grid; gap: 12px; }
.stack > .card { margin-bottom: 0; }
.h2 { font-size: 1.1rem; }
.tabs { border: 0; box-shadow: var(--shadow); border-radius: 16px; margin-bottom: 14px; }
.topbar { border-bottom: 0; }
.btn { border-radius: 14px; }
.btn.lime { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.iconbtn.fill { background: var(--brand); color: var(--on-brand); border-radius: 50%; }
.iconbtn.fill:active { filter: brightness(.92); }
.initials { font-weight: 800; letter-spacing: .02em; }
.avatar.lg.initials { font-size: 1.6rem; } .avatar.xl.initials { font-size: 2rem; } .avatar.sm.initials { font-size: .8rem; }

/* Cabecera grande de las pestañas principales */
.apphead { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 720px; margin: 0 auto;
  padding: calc(18px + var(--safe-t)) 16px 4px; }
.apphead h1 { margin: 0; font-size: 1.7rem; line-height: 1.15; }
.apphead small { display: block; font-size: .9rem; }
.apphead .iconbtn { background: var(--surface); box-shadow: var(--shadow); border-radius: 50%; width: 44px; height: 44px; }
.apphead .iconbtn.fill { background: var(--brand); }

/* Tarjeta destacada (próximo viaje, aviso de maleta encontrada) */
.hcard { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 24px; margin-bottom: 14px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.hcard > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.hcard b { font-size: 1.25rem; line-height: 1.2; overflow-wrap: anywhere; }
.hcard.hero { background: linear-gradient(135deg, var(--deep), color-mix(in srgb, var(--deep) 55%, #7c3aed)); color: #fff; }
.hcard.hero span { color: rgba(255,255,255,.88); }
.hcard.hero .pill { background: rgba(255,255,255,.2); color: #fff; }
.hcard.danger { background: var(--danger-soft); color: var(--danger); }
.hcard.danger b { font-size: 1.05rem; } .hcard.danger span { color: var(--ink); font-size: .9rem; }
.hcard .bigic { width: 56px; height: 56px; opacity: .9; flex: none; }
.hcard.static { cursor: default; }
.pill { display: inline-flex; align-items: center; gap: 4px; width: max-content; max-width: 100%; padding: 4px 11px; border-radius: 99px; font-size: .78rem; font-weight: 700;
  background: var(--brand-soft); color: var(--brand); }
.pill .ic { width: 14px; height: 14px; }
.warnline, .okline { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; }
.warnline .ic, .okline .ic { width: 16px; height: 16px; }
.hcard.hero .warnline { color: #fff; background: rgba(0,0,0,.18); border-radius: 10px; padding: 4px 8px; width: max-content; max-width: 100%; }
.hcard.hero .okline { color: var(--lime); }
p.warnline { color: var(--warn); display: block; }

.secthead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.secthead .h2 { margin: 0; }

/* Viajeros */
.people { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.people::-webkit-scrollbar { display: none; }
.person { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; flex: none; color: var(--ink); text-align: center; }
.person > span:not(.avatar) { font-weight: 650; font-size: .9rem; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person small { color: var(--mute); font-size: .75rem; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .avatar.lg { width: 72px; height: 72px; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.person.add .avatar { background: var(--surface); border: 2px dashed var(--brand); box-shadow: none; }

/* Accesos rápidos */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; color: var(--ink); font-size: 1rem; }
.qa { display: grid; gap: 2px; align-content: start; text-align: left; padding: 14px; border: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); cursor: pointer; min-height: 104px; }
.qa .ic { width: 34px; height: 34px; padding: 7px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; }
.qa small { color: var(--mute); font-size: .8rem; }
.quick .qa:first-child .ic { background: var(--lime); color: var(--lime-ink); }

/* Estados de caducidad */
.stchip { display: inline-block; width: max-content; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: var(--line); color: var(--mute); }
.stchip.ok { background: #e3f6e9; color: #15803d; }
.stchip.soon { background: var(--warn-soft); color: var(--warn); }
.stchip.expired { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .stchip.ok { background: #15301f; color: #4ade80; }

/* Documentos */
.doccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.doccard { display: grid; gap: 6px; padding: 16px; border-radius: 20px; color: #fff; min-height: 116px; align-content: space-between;
  background: linear-gradient(135deg, var(--deep), color-mix(in srgb, var(--deep) 60%, #0ea5e9)); box-shadow: var(--shadow); }
.doccard .dtype { display: flex; align-items: center; gap: 6px; font-size: .85rem; opacity: .92; }
.doccard .dtype .ic { width: 18px; height: 18px; }
.doccard b { font-size: 1.15rem; letter-spacing: .06em; overflow-wrap: anywhere; }
.doccard .stchip { background: rgba(0,0,0,.28); color: #fff; }
.doccard.expired { background: linear-gradient(135deg, #b4321f, #e8590c); }
.doccard.soon { background: linear-gradient(135deg, #b45309, #d97706); }
.doccard.big { min-height: 150px; margin-bottom: 14px; }
.doccard.big b { font-size: 1.35rem; letter-spacing: 0; }
.copyrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.copyrow:first-child { border-top: 0; padding-top: 0; }
.copyrow > span { flex: 1; min-width: 0; display: grid; }
.copyrow small { color: var(--mute); font-size: .78rem; }
.copyrow b { overflow-wrap: anywhere; font-weight: 650; }
.copyrow .iconbtn { color: var(--brand); background: var(--brand-soft); border-radius: 12px; }
.lockcard { display: flex; align-items: center; gap: 12px; }
.lockcard > .ic { width: 34px; height: 34px; padding: 7px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.lockcard > div { flex: 1; min-width: 0; }
.docphotos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.docphoto { aspect-ratio: 1.58; border-radius: 14px; overflow: hidden; border: 0; padding: 0; background: var(--bg); display: grid; place-items: center; color: var(--mute); cursor: pointer; text-align: center; }
.docphotos.edit .docphoto { border: 2px dashed var(--line); }
.docphoto img { width: 100%; height: 100%; object-fit: cover; }

/* Asistente de nuevo viaje */
.stephead { display: grid; gap: 4px; padding: 18px; border-radius: 24px; margin-bottom: 14px; background: var(--deep); color: #fff; }
.stephead .pill { background: var(--lime); color: var(--lime-ink); }
.stephead b { font-size: 1.35rem; } .stephead span { opacity: .9; }

/* Maletas */
.bags { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.bagcard { display: grid; background: var(--surface); border-radius: 22px; overflow: hidden; color: var(--ink); box-shadow: var(--shadow); }
.bagcard > img, .bagcard > .bagph { width: 100%; aspect-ratio: 1.2; object-fit: cover; }
.bagcard > div { display: grid; gap: 4px; padding: 10px 12px 12px; }
.bagcard small { color: var(--mute); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1em; }
.bagcard.lost { outline: 3px solid var(--danger); }
.bagph { display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.bagph .ic { width: 44px; height: 44px; }
.baghero { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 12px; }
.baghero > img, .baghero > .bagph { width: 96px; height: 96px; border-radius: 18px; object-fit: cover; flex: none; }
.baghero > div { display: grid; gap: 4px; min-width: 0; }
.baghero b { font-size: 1.2rem; overflow-wrap: anywhere; } .baghero span:not(.pill) { color: var(--mute); }
.baghero.lost { outline: 3px solid var(--danger); }
.lostrow { padding-top: 10px; border-top: 1px solid var(--line); }
.foundcard.new { outline: 2px solid var(--brand); }
.foundcard p { overflow-wrap: anywhere; }

/* Menú «Más» */
.menu { display: grid; gap: 8px; }
.menuitem { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.menuitem > .ic:first-child { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.menuitem > span { flex: 1; min-width: 0; display: grid; }
.menuitem small { color: var(--mute); font-size: .82rem; }
.menuitem .chev { color: var(--mute); }

/* Reloj mundial */
.clockhere { display: grid; gap: 2px; text-align: center; background: var(--deep); color: #fff; }
.clockhere small { color: rgba(255,255,255,.85); }
.clockhere b { font-size: 2.6rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clockrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.clockrow:first-child { border-top: 0; padding-top: 0; }
.clockrow > span { flex: 1; min-width: 0; display: grid; }
.clockrow small { color: var(--mute); font-size: .8rem; }
.clocktime { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.clockrow .iconbtn { color: var(--mute); }
#addz { align-items: flex-end; gap: 8px; }
#addz .btn { min-height: 46px; }

/* Barra inferior flotante tipo «píldora» */
.tabbar { left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); height: var(--tabbar); border-radius: 26px; border: 0;
  background: var(--surface); box-shadow: 0 10px 30px rgba(40,30,120,.16); padding: 0 6px; align-items: center; }
:root[data-theme="dark"] .tabbar { box-shadow: 0 10px 30px rgba(0,0,0,.5); border: 1px solid var(--line); }
.tabbar a { height: 100%; }
.tabbar a.active { color: var(--brand); }
.tabbar a.active svg { background: var(--brand-soft); border-radius: 12px; padding: 3px; width: 32px; height: 30px; }
.tabbar .fab { width: 54px; height: 54px; margin-top: -26px; background: var(--lime); color: var(--lime-ink); border: 4px solid var(--bg); box-shadow: 0 8px 20px rgba(40,30,120,.25); }
body { padding-bottom: calc(var(--tabbar) + 24px + var(--safe-b)); }
.sticky-actions { bottom: calc(var(--tabbar) + 18px + var(--safe-b)); }

@media (min-width: 720px) {
  .tabbar { max-width: 560px; margin: 0 auto; }
}
.dlgerr { color: var(--danger); font-weight: 600; font-size: .9rem; margin: 8px 0 0; min-height: 1.2em; }
.dlgerr:empty { display: none; }
.row-item > .avatar, .row-item > .stchip, .row-item > .ic { flex: none; }
.hcard > div, .bagcard > div, .baghero > div { grid-template-columns: minmax(0, 1fr); }
.legrow { align-items: flex-end; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.legrow .field:first-child { min-width: 120px; }
.legitem { align-items: flex-start; }
.leglinks { margin-top: 8px; gap: 6px; }
/* 1.1: equipaje, emergencia, día de salida, gastos, frases */
.packlist { padding: 6px 12px; }
.packrow { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding: 4px 0; }
.packrow:first-child { border-top: 0; }
.packrow .check { margin: 0; padding: 8px 0; flex: 1; }
.packrow.done span { text-decoration: line-through; color: var(--mute); }
.packrow .iconbtn { color: var(--mute); }
.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--lime); border-radius: 99px; transition: width .2s; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sosrow > .ic:first-child { color: var(--danger); }
.sosc { background: var(--surface); border: 3px solid var(--danger); border-radius: 24px; padding: 18px; margin-bottom: 12px; }
.soshead { display: flex; align-items: center; gap: 8px; color: var(--danger); letter-spacing: .04em; }
.sosc h2 { font-size: 1.6rem; margin: 8px 0 12px; overflow-wrap: anywhere; }
.sosline { margin: 0 0 12px; display: grid; gap: 2px; }
.sosline small { color: var(--mute); font-size: .8rem; }
.sosline b { font-size: 1.3rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.sosline.hot b { color: var(--danger); }
.daycard { border: 2px solid var(--lime); }
.daycard .pill .ic { width: 14px; height: 14px; }
.legline { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.legline .ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--brand); }
.exptotal { display: block; font-size: 2rem; margin: 4px 0; }
.row-item > b { white-space: nowrap; }
.quick.tools { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.phseg { display: flex; flex-wrap: wrap; margin-bottom: 10px; }
.phrase { width: 100%; text-align: left; border: 0; cursor: pointer; font: inherit; }
.phrase small { font-size: .8rem; }
.phrase b { font-size: 1.1rem; }
.phbig .phbigtxt { font-size: 2rem; font-weight: 800; line-height: 1.2; margin: 6px 0 12px; overflow-wrap: anywhere; }
.wrap > .row.wrapr { margin-top: 18px; }
.list > .addins { justify-self: start; width: max-content; }
.row-item > .pill { flex: none; }
/* Foto del destino de fondo: nítida, con un velo de color translúcido para que el texto se lea */
.hcard.hero.hasphoto { position: relative; overflow: hidden; background-color: var(--deep);
  background-image: linear-gradient(120deg, color-mix(in srgb, var(--deep) 88%, transparent) 0%, color-mix(in srgb, var(--deep) 62%, transparent) 55%, color-mix(in srgb, #7c3aed 35%, transparent) 100%), var(--photo);
  background-size: cover; background-position: center; }
.hcard.hero.hasphoto b, .hcard.hero.hasphoto span { text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.phcredit { position: absolute; right: 12px; bottom: 6px; font-size: .6rem; color: rgba(255,255,255,.8) !important; text-shadow: 0 1px 3px rgba(0,0,0,.6); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photocredit { font-size: .72rem; color: var(--mute); margin: -8px 0 12px; text-align: right; }
.photocredit a { color: var(--mute); }
/* Trayectos */
.legrow.card { padding: 12px; margin-bottom: 10px; }
.modeseg { display: inline-flex; }
.modeseg button { padding: 6px 10px; }
.modeseg .ic { width: 20px; height: 20px; }
.legrow[data-mode="plane"] .nop { display: none; }
.card .qrbox + .row.wrapr { margin-top: 18px; }
.card .row.wrapr + p, .card .row.wrapr + .banner { margin-top: 14px; }
