/* Turnos Ni Paper — usa los tokens de style.css (blanco, Nunito Sans, menta). */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pastillas de estado (públicas y panel) */
.tn-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: var(--radius-pill); white-space: nowrap; background: var(--c-bg-soft); color: var(--c-text); }
.tn-pill--proceso { background: var(--c-accent); color: #fff; }
.tn-pill--listo { background: #e4f6f1; color: #206b53; }
.tn-pill--entregado, .tn-pill--cancelado { background: var(--c-bg-soft); color: var(--c-muted); }

/* ───────── Página pública ───────── */
.tn-public { max-width: 860px; margin-inline: auto; }

.tn-now { position: relative; overflow: hidden; text-align: center; background: linear-gradient(160deg, #eaf7f3 0%, #ffffff 62%); border: 1px solid #cfeae2; border-radius: 22px; padding: clamp(30px, 5vw, 56px) 20px clamp(34px, 5vw, 60px); box-shadow: var(--shadow); }
.tn-now::before { content: ""; position: absolute; width: 340px; height: 340px; right: -110px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(121,196,180,.28), rgba(121,196,180,0) 70%); pointer-events: none; }
.tn-now > * { position: relative; }
.tn-now__live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-accent-dk); background: #fff; border: 1px solid #cfeae2; border-radius: var(--radius-pill); padding: 6px 14px 6px 12px; margin: 0 0 16px; }
.tn-now__live i { width: 9px; height: 9px; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 0 0 rgba(121,196,180,.6); animation: tn-pulse 2s ease-out infinite; }
@keyframes tn-pulse { 70% { box-shadow: 0 0 0 9px rgba(121,196,180,0); } 100% { box-shadow: 0 0 0 0 rgba(121,196,180,0); } }
@media (prefers-reduced-motion: reduce) { .tn-now__live i { animation: none; } }
.tn-now__lbl { font-size: clamp(18px, 3.2vw, 24px); font-weight: 700; line-height: 1.3; color: var(--c-ink); margin: 0 0 18px; }
.tn-now__num { display: inline-block; font-size: clamp(56px, 13vw, 108px); font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--c-ink); background: #fff; border: 2px dashed var(--c-accent); border-radius: 20px; padding: .14em .42em .18em; margin: 0; box-shadow: 0 12px 32px rgba(93,169,151,.16); }

.tn-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.tn-stat { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--c-line); border-radius: 16px; padding: 16px 20px; }
.tn-stat__ico { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #eaf7f3; color: var(--c-accent-dk); }
.tn-stat__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tn-stat strong { font-size: 26px; font-weight: 800; line-height: 1.15; color: var(--c-ink); overflow-wrap: anywhere; }
.tn-stat span { font-size: 13.5px; color: var(--c-text); }
.tn-stat--ok { border-color: #bfe6da; background: #f2fbf8; }
.tn-stat--ok .tn-stat__ico { background: #d9f1e9; color: #206b53; }
.tn-stat--ok strong { color: #206b53; }

.tn-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 40px 0 16px; }
.tn-toolbar h2 { margin: 0; font-size: 24px; }
.tn-search input { font: inherit; font-size: 15px; padding: 11px 16px; border: 1px solid var(--c-line); border-radius: var(--radius-pill); min-width: min(100%, 260px); background: #fff; color: var(--c-ink); }
.tn-search input:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.tn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tn-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 14px 18px; }
.tn-row__num { font-size: 26px; font-weight: 800; color: var(--c-ink); min-width: 3.2ch; }
.tn-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tn-row__main strong { color: var(--c-ink); }
.tn-row__main span { font-size: 14.5px; overflow-wrap: anywhere; }
.tn-row__main small { font-size: 12.5px; color: var(--c-muted); }
.tn-row--proceso { border-color: var(--c-accent); box-shadow: var(--shadow); }
.tn-row--proceso .tn-row__num { color: var(--c-accent-dk); }
.tn-row--entregado { opacity: .55; }
.tn-row.is-hit { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.tn-empty { text-align: center; padding: 28px 12px; color: var(--c-text); }
.tn-foot { margin-top: 28px; font-size: 13.5px; color: var(--c-muted); text-align: center; }
.tn-foot a { color: var(--c-accent-dk); font-weight: 700; }

@media (max-width: 520px) {
  .tn-row { grid-template-columns: auto 1fr; }
  .tn-row .tn-pill { grid-column: 2; justify-self: start; }
}

/* ───────── Panel de Laura (celular primero) ───────── */
.tn-admin { background: var(--c-bg-soft); min-height: 100vh; }
.tn-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; background: #fff; border-bottom: 1px solid var(--c-line); padding: 8px var(--gutter); }
.tn-bar strong { font-size: 18px; color: var(--c-ink); margin-right: auto; }
.tn-bar__link { font-size: 14px; font-weight: 700; color: var(--c-accent-dk); background: none; border: 0; cursor: pointer; font-family: inherit; padding: 8px 4px; }
.tn-inline { display: inline; margin: 0; }
.tn-wrap { max-width: 640px; margin-inline: auto; padding: 20px var(--gutter) 80px; }

.tn-login { margin-top: 8vh; }
.tn-login h1 { font-size: 26px; margin: 0 0 6px; }
.tn-login input { font-size: 22px; letter-spacing: .3em; text-align: center; }

.tn-form { background: #fff; box-shadow: var(--shadow); }
.tn-form h2 { margin: 0 0 18px; font-size: 20px; }
.tn-form input { font-size: 17px; padding: 14px; }
.tn-form small, .tn-edit small { font-weight: 400; color: var(--c-muted); }
.tn-big { padding: 18px; font-size: 18px; }

.tn-nuevo { text-align: center; background: var(--c-accent); color: #fff; border-radius: var(--radius-lg); padding: 24px 20px; margin-bottom: 20px; }
.tn-nuevo__lbl { margin: 0; font-weight: 700; }
.tn-nuevo__num { font-size: 84px; font-weight: 800; line-height: 1; margin: 6px 0 14px; }
.tn-nuevo__aviso { margin: 0 0 12px; font-size: 14px; opacity: .95; }

.tn-h { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--c-text); margin: 32px 0 12px; display: flex; align-items: center; gap: 8px; }
.tn-count { background: var(--c-ink); color: #fff; font-size: 12px; border-radius: var(--radius-pill); padding: 2px 9px; }
.tn-vacio { text-align: center; color: var(--c-text); padding: 32px 0; }
.tn-pie { text-align: center; margin-top: 28px; }
.tn-pie a { color: var(--c-accent-dk); font-weight: 700; }

.tn-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; scroll-margin-top: 70px; }
.tn-card--proceso { border-color: var(--c-accent); }
.tn-card--entregado, .tn-card--cancelado { opacity: .7; }
.tn-card__top { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; }
.tn-card__num { font-size: 30px; font-weight: 800; color: var(--c-ink); line-height: 1.1; }
.tn-card__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tn-card__main strong { color: var(--c-ink); font-size: 17px; }
.tn-card__main span { overflow-wrap: anywhere; }
.tn-card__main small { color: var(--c-muted); font-size: 12.5px; }
.tn-card__aviso { color: var(--c-accent-dk) !important; }
.tn-card__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.tn-card__acts .btn { min-height: 44px; }

.tn-more { flex-basis: 100%; margin-top: 4px; }
.tn-more summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--c-text); padding: 8px 0; }
.tn-edit { margin-top: 8px; }
.tn-edit .field { margin-bottom: 12px; }
.tn-edit input { font-size: 16px; padding: 12px; width: 100%; }
.tn-cancel { background: none; border: 0; color: #9e2e22; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; padding: 10px 0; }
.tn-linkbtn { text-decoration: none; }

/* ───────── Fila anónima y consulta privada ───────── */
.tn-list--anon { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tn-list--anon .tn-row { grid-template-columns: auto 1fr; padding: 12px 16px; }
.tn-list--anon .tn-row .tn-pill { justify-self: end; }

.tn-lookup { margin-top: 24px; background: #fff; border: 1px solid var(--c-line); }
.tn-lookup h2 { margin: 0 0 6px; font-size: 22px; }
.tn-lookup > p { margin: 0 0 18px; font-size: 14.5px; }
.tn-lookup__row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 14px; }
.tn-lookup small { font-weight: 400; color: var(--c-muted); }
.tn-lookup input { font-size: 17px; padding: 14px; width: 100%; }
@media (max-width: 560px) { .tn-lookup__row { grid-template-columns: 1fr; gap: 0; } }

.tn-result { margin-top: 18px; padding: 18px; border-radius: var(--radius); background: var(--c-bg-soft); text-align: center; }
.tn-result p { margin: 8px 0 0; }
.tn-result__num { font-size: 34px; font-weight: 800; color: var(--c-ink); margin: 0 0 8px !important; }
.tn-result--proceso { background: #eef8f5; border: 1px solid var(--c-accent); }
.tn-result--listo { background: #e4f6f1; border: 1px solid #bfe6da; }
.tn-result--err { background: #fde8e8; color: #9e2e22; text-align: left; }

/* ───────── Popup de consulta ───────── */
html.tn-lock { overflow: hidden; }
.tn-modal { border: 0; padding: 0; background: transparent; width: min(92vw, 420px); max-width: 420px; max-height: 92vh; margin: auto; color: var(--c-text); overflow: visible; }
.tn-modal::backdrop { background: rgba(30, 40, 38, .45); backdrop-filter: blur(4px); animation: tn-fade .2s ease-out; }
.tn-modal[open] .tn-modal__box { animation: tn-pop .32s var(--ease); }
@keyframes tn-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tn-pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

.tn-modal__box { position: relative; background: linear-gradient(170deg, #eaf7f3 0%, #fff 48%); border: 1px solid #cfeae2; border-radius: 24px; padding: 34px 26px 26px; text-align: center; box-shadow: 0 30px 70px rgba(0,0,0,.22); }
.tn-modal__x { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; font-size: 28px; line-height: 1; color: var(--c-muted); cursor: pointer; }
.tn-modal__x:hover { background: var(--c-bg-soft); color: var(--c-ink); }
.tn-modal__x:focus-visible { outline: 2px solid var(--c-accent); }
.tn-modal__eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-accent-dk); }

.tn-modal__ticket { position: relative; display: block; width: min(250px, 100%); margin: 0 auto 22px; filter: drop-shadow(0 14px 22px rgba(93,169,151,.24)); }
.tn-tk { background: #fff; border-radius: 18px; padding: 20px 24px 18px; text-align: center;
  -webkit-mask: radial-gradient(circle 12px at 0 calc(100% - 62px), #0000 98%, #000) 0 0 / 51% 100% no-repeat, radial-gradient(circle 12px at 100% calc(100% - 62px), #0000 98%, #000) 100% 0 / 51% 100% no-repeat;
          mask: radial-gradient(circle 12px at 0 calc(100% - 62px), #0000 98%, #000) 0 0 / 51% 100% no-repeat, radial-gradient(circle 12px at 100% calc(100% - 62px), #0000 98%, #000) 100% 0 / 51% 100% no-repeat; }
.tn-tk__lbl { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: var(--c-accent-dk); }
.tn-modal__num { margin: 2px 0 16px; font-size: clamp(60px, 18vw, 88px); font-weight: 800; line-height: 1; letter-spacing: -.03em; color: var(--c-ink); }
.tn-tk__foot { border-top: 2px dashed #cfeae2; padding-top: 14px; display: flex; justify-content: center; }
.tn-modal .tn-pill { display: inline-flex; align-items: center; height: 30px; padding: 0 16px; font-size: 13px; }
.tn-modal__ticket--proceso .tn-modal__num { color: var(--c-accent-dk); }
.tn-modal__ticket--listo .tn-modal__num { color: #206b53; }

.tn-steps { list-style: none; margin: 24px 0 0; padding: 0; display: flex; justify-content: space-between; position: relative; }
.tn-steps::before { content: ""; position: absolute; left: 12%; right: 12%; top: 8px; height: 2px; background: var(--c-line); }
.tn-steps li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--c-muted); }
.tn-steps__dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--c-line); z-index: 1; }
.tn-steps .is-done { color: var(--c-accent-dk); }
.tn-steps .is-done .tn-steps__dot { background: var(--c-accent); border-color: var(--c-accent); }
.tn-steps .is-now { color: var(--c-ink); font-weight: 700; }
.tn-steps .is-now .tn-steps__dot { background: #fff; border-color: var(--c-accent); box-shadow: 0 0 0 4px rgba(121,196,180,.3); }

.tn-modal__msg { margin: 22px 0 2px; font-size: 17px; font-weight: 700; color: var(--c-ink); line-height: 1.35; }
.tn-modal__fecha { margin: 0 0 22px; font-size: 13px; color: var(--c-muted); }

/* Destellos cuando el pedido está listo */
.tn-spark { position: absolute; width: 14px; height: 14px; background: var(--c-accent); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); opacity: 0; animation: tn-twinkle 2.4s ease-in-out infinite; }
.tn-spark--1 { top: -12px; left: -14px; animation-delay: 0s; }
.tn-spark--2 { top: -18px; right: 16px; width: 10px; height: 10px; animation-delay: .5s; }
.tn-spark--3 { top: 34%; right: -20px; animation-delay: 1s; }
.tn-spark--4 { bottom: -14px; right: -4px; width: 11px; height: 11px; animation-delay: 1.5s; }
.tn-spark--5 { bottom: -16px; left: 18px; animation-delay: .8s; }
.tn-spark--6 { top: 40%; left: -22px; width: 10px; height: 10px; animation-delay: 1.9s; }
@keyframes tn-twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }

@media (prefers-reduced-motion: reduce) {
  .tn-modal[open] .tn-modal__box, .tn-modal::backdrop { animation: none; }
  .tn-spark { animation: none; opacity: .9; }
}

/* ───────── "App": fondo de libreta, encabezado y pie compactos ───────── */
html { background: #fff; }
body.tn-page { background: transparent; }
body.tn-page::before { content: ""; position: fixed; inset: 0; z-index: -2; background: #fff url(../img/turnos-bg.svg) left top / cover no-repeat; }
body.tn-page::after { content: ""; position: fixed; right: -70px; bottom: -70px; width: 420px; height: 420px; z-index: -1; background: url(../img/logo-mark.png) center / contain no-repeat; opacity: .06; pointer-events: none; }
.tn-admin.tn-page { background: transparent; }

.tn-appbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(93,169,151,.22); }
.tn-appbar__in { max-width: 1040px; margin-inline: auto; display: flex; align-items: center; gap: 22px; padding: 8px var(--gutter); }
.tn-appbar__logo { display: block; flex: none; line-height: 0; }
.tn-appbar__logo img { height: 40px; width: auto; }
.tn-appbar__nav { margin-left: auto; display: flex; gap: 6px; }
.tn-appbar__nav a { font-size: 14px; font-weight: 600; color: var(--c-ink); padding: 8px 12px; border-radius: var(--radius-pill); }
.tn-appbar__nav a:hover { background: #eaf7f3; color: var(--c-accent-dk); }
.tn-appbar .btn { flex: none; }
@media (max-width: 760px) { .tn-appbar__nav { display: none; } .tn-appbar .btn { margin-left: auto; } }

.tn-public { max-width: 700px; margin-inline: auto; padding: 26px var(--gutter) 40px; }
.tn-intro { text-align: center; margin-bottom: 20px; }
.tn-intro__eyebrow { margin: 0 0 4px; font-size: 12.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--c-accent-dk); }
.tn-intro h1 { margin: 0; font-size: clamp(26px, 5vw, 34px); line-height: 1.15; }
.tn-intro p:last-child { margin: 6px 0 0; font-size: 15px; }

.tn-now { padding: clamp(22px, 4vw, 34px) 18px clamp(26px, 4vw, 38px); border-radius: 20px; }
.tn-now__live { margin-bottom: 12px; }
.tn-now__lbl { font-size: clamp(16px, 2.6vw, 20px); margin-bottom: 14px; }
.tn-now__num { font-size: clamp(46px, 10vw, 76px); border-radius: 16px; }
.tn-stat { padding: 12px 16px; }
.tn-stat__ico { width: 40px; height: 40px; }
.tn-stat strong { font-size: 22px; }
.tn-lookup { margin-top: 18px; box-shadow: var(--shadow); }
.tn-lookup h2 { font-size: 19px; }
.tn-lookup > p { font-size: 14px; }

.tn-foot { margin-top: 22px; }
.tn-appfoot { text-align: center; padding: 8px var(--gutter) 90px; font-size: 13px; color: var(--c-muted); }
.tn-appfoot p { margin: 0; }
.tn-appfoot__social { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.tn-appfoot__social a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--c-text); background: rgba(255,255,255,.7); border: 1px solid var(--c-line); }
.tn-appfoot__social a:hover { color: var(--c-accent-dk); border-color: var(--c-accent); }
@media (max-width: 700px) {
  body.tn-page::before { background-size: 1000px auto; background-position: left top; }
  body.tn-page::after { width: 300px; height: 300px; right: -60px; bottom: -60px; }
}

/* Popup de error (turno no encontrado, límite, red) */
.tn-modal.is-error .tn-modal__box { background: linear-gradient(170deg, #fdecea 0%, #fff 52%); border-color: #f4cfca; }
.tn-err-ico { width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #c4574a; box-shadow: 0 10px 24px rgba(196,87,74,.16); }
.tn-modal__title { margin: 0 0 8px; font-size: 21px; font-weight: 800; line-height: 1.25; color: var(--c-ink); }
.tn-modal__text { margin: 0 0 18px; font-size: 15px; line-height: 1.55; }
.tn-modal__wa { margin-bottom: 12px; width: 100%; }

/* Ver/ocultar PIN */
.tn-pw { position: relative; }
.tn-pw input { padding-right: 52px; }
.tn-pw__btn { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--c-muted); cursor: pointer; }
.tn-pw__btn:hover { background: #eaf7f3; color: var(--c-accent-dk); }
.tn-pw__btn:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 1px; }
.tn-pw__btn [hidden] { display: none; }
