/* ---------- Login ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 1.8rem; }
.login img { width: 120px; margin: 0 auto 1rem; border-radius: 50%; }
.login h1 { text-align: center; font-size: 1.4rem; margin-bottom: .3rem; }
.login p.sub { text-align: center; color: var(--muted); margin: 0 0 1.4rem; font-size: .92rem; }
.pw { position: relative; }
.pw .input { padding-right: 3.4rem; }
.pw button { position: absolute; right: 4px; top: 4px; height: 38px; min-width: 46px; background: none; border: 0; color: var(--muted); cursor: pointer; }

/* ---------- Estructura: lateral en horizontal, barra inferior en vertical ---------- */
.app { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--bg2); border-right: 1px solid var(--line); padding: 1rem .8rem; gap: .3rem; }
.side .who { display: flex; align-items: center; gap: .7rem; padding: .3rem .4rem 1rem; }
.side .who img { width: 44px; height: 44px; border-radius: 50%; }
.side .who b { display: block; font-family: var(--serif); letter-spacing: .08em; font-size: .85rem; }
.side .who small { color: var(--muted); }
.navbtn { display: flex; align-items: center; gap: .7rem; min-height: 48px; padding: .5rem .8rem; border: 0; border-radius: 12px; background: none; color: var(--muted); cursor: pointer; text-align: left; width: 100%; }
.navbtn .ic { font-size: 1.2rem; width: 1.6rem; text-align: center; }
.navbtn:hover { background: var(--card); color: var(--text); }
.navbtn.on { background: var(--card2); color: var(--gold2); box-shadow: inset 3px 0 0 var(--gold); }
.side .spacer { flex: 1; }
.main { padding: 20px 22px 40px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head h2 { font-size: 1.6rem; }

@media (max-width: 899px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; z-index: 40; inset: auto 0 0 0; height: auto; flex-direction: row; justify-content: space-around;
    border-right: 0; border-top: 1px solid var(--line); padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom)); gap: 0;
  }
  .side .who, .side .spacer, .side .navbtn.account { display: none; }
  .navbtn { flex-direction: column; justify-content: center; gap: .1rem; min-height: 54px; padding: .3rem; text-align: center; font-size: .72rem; flex: 1 1 0; min-width: 0; border-radius: 10px; }
  .navbtn.on { box-shadow: inset 0 3px 0 var(--gold); }
  .main { padding: 14px 14px 100px; }
  .mobile-top { display: flex !important; }
}
@media (max-height: 520px) and (max-width: 899px) { .navbtn { min-height: 42px; flex-direction: row; justify-content: center; font-size: .75rem; } .navbtn .ic { font-size: 1rem; } .main { padding-bottom: 70px; } }
.mobile-top { display: none; align-items: center; justify-content: space-between; margin-bottom: .8rem; color: var(--muted); font-size: .9rem; gap: .5rem; }
.mobile-top b { color: var(--text); }

/* ---------- Agenda ---------- */
.datebar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.datebar .btn { min-width: 46px; padding-inline: .9rem; }
.datebar .current { font-family: var(--serif); font-size: 1.2rem; min-width: 11rem; text-align: center; flex: 1; }
.datebar input[type=date] { width: auto; }
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; margin: .9rem 0; }
.wd { text-align: center; padding: .45rem .1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; min-height: 56px; }
.wd small { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; }
.wd b { font-family: var(--serif); font-size: 1.1rem; }
.wd i { display: block; font-style: normal; font-size: .7rem; color: var(--gold2); min-height: 1em; }
.wd.on { border-color: var(--gold); background: var(--card2); }
.wd.today b { color: var(--gold2); }
.tabs { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: .9rem; padding-bottom: .2rem; }
.tab { flex: none; min-height: 40px; padding: .3rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--gold); color: #17130a; border-color: var(--gold); font-weight: 700; }

.cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.col h3 { font-size: 1.1rem; margin-bottom: .6rem; color: var(--gold2); display: flex; justify-content: space-between; align-items: baseline; }
.col h3 small { font-family: var(--font); color: var(--muted); font-size: .8rem; letter-spacing: 0; }
.slot { display: grid; grid-template-columns: 56px 1fr; gap: .7rem; margin-bottom: .5rem; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.slot .t { font-family: var(--serif); font-size: 1.15rem; color: var(--gold2); padding-top: .1rem; }
.slot .t small { display: block; color: var(--muted); font-family: var(--font); font-size: .7rem; }
.slot.free { border-style: dashed; background: transparent; cursor: pointer; align-items: center; }
.slot.free:hover { border-color: var(--gold); }
.slot.free .lbl { color: var(--muted); }
.slot.past { opacity: .4; background: transparent; }
.slot.blocked { background: repeating-linear-gradient(45deg, var(--bg2), var(--bg2) 8px, var(--card) 8px, var(--card) 16px); color: var(--muted); }
.slot.booked { border-left: 4px solid var(--gold); }
.slot.done { border-left: 4px solid var(--ok); }
.slot.noshow { border-left: 4px solid var(--bad); }
.slot .who b { display: block; font-size: 1.05rem; }
.slot .who .sub { color: var(--muted); font-size: .88rem; }
.slot .who a { color: var(--gold2); }
.slot .acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.badge { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .72rem; margin-left: .4rem; vertical-align: middle; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: #25533a; }
.badge.bad { color: var(--bad); border-color: #5a2d2a; }
.empty { color: var(--muted); padding: 1.2rem; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }

/* ---------- Tarjetas y listas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: .8rem; }
.card h3 { font-size: 1.1rem; margin-bottom: .6rem; }
.row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 160px; }
.muted { color: var(--muted); font-size: .9rem; }
.spacer-s { height: .8rem; }

/* Avisos de nuevas citas */
.alerts { position: fixed; z-index: 90; top: 12px; right: 12px; width: min(420px, calc(100vw - 24px)); display: grid; gap: .6rem; }
.alert-card { display: flex; gap: .8rem; align-items: center; justify-content: space-between; background: var(--card2); border: 1px solid var(--gold); border-left: 5px solid var(--gold); border-radius: 14px; padding: .8rem .9rem; box-shadow: 0 10px 40px #000c; animation: pop .25s ease-out; }
.alert-card.cancel { border-color: var(--bad); }
.alert-card .txt { min-width: 0; font-size: .95rem; }
.alert-card .txt b { display: block; font-size: 1.02rem; }
.alert-card .row { flex: none; }
@keyframes pop { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.hint { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; background: #1d1a10; border: 1px solid #4a4020; border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .9rem; }
.steps-list { margin: .3rem 0 0; padding-left: 1.2rem; line-height: 1.7; }
.grid2 { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.days-edit .drow { display: grid; grid-template-columns: 7.5rem 1fr 1fr; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.days-edit .drow:last-child { border: 0; }
.days-edit .drow.off .input { opacity: .35; }
@media (max-width: 520px) { .days-edit .drow { grid-template-columns: 1fr 1fr; } .days-edit .drow .check { grid-column: 1 / -1; } }
.stats { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.stat b { display: block; font-family: var(--serif); font-size: 1.9rem; color: var(--gold2); }
.stat span { color: var(--muted); font-size: .85rem; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: .6rem .4rem; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 500; font-size: .82rem; }
.tbl-wrap { overflow-x: auto; }
.secret-box { font-family: ui-monospace, Consolas, monospace; font-size: 1.8rem; letter-spacing: .25em; text-align: center; padding: 1rem; background: var(--bg); border: 1px dashed var(--gold); border-radius: 12px; color: var(--gold2); margin: 1rem 0; user-select: all; }
