:root{
  --gold: #B98D3E;
  --gold-light: #E8D9AE;
  --cream: #F6EFDD;
  --paper: #FBF8F1;
  --grey: #8B9096;
  --grey-dark: #4A4E52;
  --sky: #3E9BC9;
  --sky-deep: #2C7396;
  --rose: #D65B7B;
  --ink: #2B2823;
  --line: #E4D9BE;
}
*{box-sizing:border-box; margin:0; padding:0;}
html,body{height:100%;}
body{
  background:#EDE6D3;
  font-family:'Work Sans', sans-serif;
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
}
#root{height:100%;}

.boot-loader{
  height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
}
.boot-logo{
  width:64px; height:64px; border-radius:50%; background:var(--cream); border:2px solid var(--gold-light);
  display:flex; align-items:center; justify-content:center; font-size:26px; color:var(--gold); font-family:'Fraunces',serif;
}
.boot-text{ font-family:'Fraunces',serif; color:var(--grey-dark); font-size:15px; }

/* ---------- Shell de la app ---------- */
.app-shell{
  max-width:480px; margin:0 auto; min-height:100vh; background:var(--paper);
  display:flex; flex-direction:column; position:relative; box-shadow:0 0 40px rgba(0,0,0,0.08);
}
.header{
  background:linear-gradient(135deg, var(--gold) 0%, #A87B32 100%);
  padding:18px 18px 22px; flex-shrink:0; position:relative;
}
.header.admin-header{ background:var(--grey-dark); }
.header-row{ display:flex; align-items:center; gap:10px; }
.logo-mini{
  width:34px; height:34px; border-radius:50%; background:var(--cream); border:2px solid var(--gold-light);
  display:flex; align-items:center; justify-content:center; font-size:16px; overflow:hidden; padding:2px; flex-shrink:0;
}
.brand-mark{ width:30px; height:30px; border-radius:50%; object-fit:cover; display:block; }
.header h2{ font-family:'Fraunces', serif; color:#fff; font-size:19px; font-weight:600; }
.header p{ color:rgba(255,255,255,0.85); font-size:11px; margin-top:2px; }
.back-btn{
  width:30px; height:30px; border-radius:50%; background:rgba(255,255,255,0.25); border:none;
  display:flex; align-items:center; justify-content:center; color:#fff; flex-shrink:0; cursor:pointer;
}

.content{ flex:1; overflow-y:auto; padding:14px 16px 90px; background:var(--paper); }

.card{
  background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px; margin-bottom:12px;
  display:flex; gap:10px;
}
.card .thumb{ width:56px; height:56px; border-radius:10px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:22px; }
.thumb.a{ background:var(--gold-light); color:#8A6521; }
.thumb.b{ background:#DCEEF6; color:var(--sky-deep); }
.thumb.c{ background:#F7DDE4; color:var(--rose); }
.card-body{ flex:1; min-width:0; }
.card-body h3{ font-size:13.5px; font-weight:600; margin-bottom:3px; color:var(--ink); }
.card-body p{ font-size:11px; color:var(--grey); line-height:1.4; }
.row-between{ display:flex; align-items:center; justify-content:space-between; margin-top:6px; }
.price{ font-family:'Fraunces', serif; font-weight:600; font-size:13px; color:var(--sky-deep); }
.tag{ font-size:9.5px; padding:2px 7px; border-radius:20px; font-weight:600; letter-spacing:0.02em; }
.tag.free{ background:#E4F3E7; color:#3F8A55; }
.tag.pay{ background:var(--gold-light); color:#8A6521; }

.btn{ font-size:11px; font-weight:600; padding:8px 14px; border-radius:20px; border:none; background:var(--sky); color:#fff; cursor:pointer; }
.btn.gold{ background:var(--gold); }
.btn.outline{ background:none; border:1.5px solid var(--sky); color:var(--sky-deep); }
.btn.block{ width:100%; padding:12px; font-size:13px; }
.btn:disabled{ opacity:0.5; cursor:not-allowed; }

.section-label{
  font-family:'Fraunces', serif; font-size:13px; font-weight:600; color:var(--grey-dark);
  margin:4px 0 10px; display:flex; align-items:center; gap:6px;
}
.section-label::before{ content:''; width:3px; height:14px; background:var(--gold); border-radius:2px; display:inline-block; }

/* Calendario */
.cal-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:5px; margin-bottom:14px; }
.cal-day-name{ font-size:9px; text-align:center; color:var(--grey); font-weight:600; }
.cal-day{
  aspect-ratio:1; border-radius:8px; display:flex; align-items:center; justify-content:center;
  font-size:11px; background:#fff; border:1px solid var(--line); color:var(--ink); cursor:pointer;
}
.cal-day.sel{ background:var(--sky); color:#fff; border:none; font-weight:600; }
.cal-day.off{ color:#D8D2C2; cursor:default; }
.slot-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.slot{ padding:8px 10px; border-radius:10px; font-size:11.5px; border:1.5px solid var(--sky); color:var(--sky-deep); font-weight:600; cursor:pointer; background:#fff; }
.slot.taken{ border-color:var(--line); color:#C7C1B0; text-decoration:line-through; background:#F4F0E6; cursor:default; }
.slot.sel{ background:var(--sky); color:#fff; border-color:var(--sky); }
.tz-note{
  font-size:10px; color:var(--grey); background:var(--cream); padding:8px 10px; border-radius:10px; margin-bottom:14px;
  display:flex; gap:6px; align-items:flex-start;
}
.paybox{ background:var(--cream); border:1px solid var(--gold-light); border-radius:14px; padding:12px; margin-top:6px; }
.paybox h4{ font-size:12.5px; margin-bottom:8px; color:var(--grey-dark); }
.pay-opt{
  display:flex; align-items:center; justify-content:space-between; background:#fff; border:1px solid var(--line);
  border-radius:10px; padding:10px 12px; margin-bottom:7px; font-size:11.5px; font-weight:600; color:var(--ink); cursor:pointer;
}
.pay-opt.sel{ outline:2px solid var(--sky); }
.tipo-toggle{ display:flex; gap:8px; margin-bottom:14px; }
.tipo-opt{
  flex:1; text-align:center; background:#fff; border:1.5px solid var(--line); border-radius:12px; padding:10px; cursor:pointer;
}
.tipo-opt b{ display:block; font-size:12.5px; }
.tipo-opt span{ font-size:11px; color:var(--grey); }
.tipo-opt.sel{ border-color:var(--sky); background:#EAF6FC; }
.tema-chips{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.chip{ font-size:10.5px; padding:6px 10px; border-radius:20px; background:#fff; border:1px solid var(--line); color:var(--grey-dark); cursor:pointer; }
.chip.sel{ background:var(--grey-dark); color:#fff; border-color:var(--grey-dark); }

/* Chat Rab */
.chat-msg{ display:flex; margin-bottom:12px; }
.chat-msg.user{ justify-content:flex-end; }
.bubble{ max-width:78%; padding:9px 12px; border-radius:14px; font-size:12.5px; line-height:1.45; }
.chat-msg.user .bubble{ background:var(--sky); color:#fff; border-bottom-right-radius:3px; }
.chat-msg.bot .bubble{ background:#fff; border:1px solid var(--line); border-bottom-left-radius:3px; color:var(--ink); }
.bubble .src{ font-size:9.5px; color:var(--grey); margin-top:5px; font-style:italic; }
.bubble .lockcard{ margin-top:8px; background:var(--gold-light); border-radius:8px; padding:7px 9px; display:flex; align-items:center; justify-content:space-between; }
.lockcard span{ font-size:10.5px; font-weight:600; color:#7A5A20; }
.chat-input{ display:flex; gap:6px; padding:10px 4px 4px; border-top:1px solid var(--line); position:sticky; bottom:0; background:var(--paper); }
.chat-input input{ flex:1; border:1px solid var(--line); border-radius:20px; padding:10px 14px; font-size:12.5px; font-family:inherit; }
.chat-input button{ width:36px; height:36px; border-radius:50%; background:var(--gold); border:none; color:#fff; font-size:14px; cursor:pointer; }

/* Reconocimientos */
.rec-card{ background:#fff; border:1px solid var(--line); border-radius:14px; overflow:hidden; margin-bottom:12px; }
.rec-img{ height:90px; background:linear-gradient(135deg,var(--gold-light),var(--cream)); display:flex; align-items:center; justify-content:center; font-size:30px; }
.rec-card .rec-body{ padding:10px 12px; }
.rec-body h3{ font-size:12.5px; font-weight:600; margin-bottom:3px; }
.rec-body p{ font-size:10.5px; color:var(--grey); line-height:1.4; }

/* Perfil */
.profile-head{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.avatar{ width:52px; height:52px; border-radius:50%; background:var(--gold-light); display:flex; align-items:center; justify-content:center; font-size:20px; border:2px solid var(--gold); }
.profile-head h3{ font-size:14px; font-weight:600; }
.profile-head p{ font-size:10.5px; color:var(--grey); }
.list-item{
  display:flex; align-items:center; justify-content:space-between; background:#fff; border:1px solid var(--line);
  border-radius:12px; padding:10px 12px; margin-bottom:8px; font-size:11.5px; cursor:pointer;
}
.list-item .left{ display:flex; flex-direction:column; gap:2px; }
.list-item .left b{ font-size:12px; }
.list-item .left span{ font-size:10px; color:var(--grey); }
.status-dot{ display:inline-flex; align-items:center; gap:4px; font-size:10px; font-weight:600; }
.status-dot.ok{ color:#3F8A55; }
.status-dot.pend{ color:#B98D3E; }
.clinical-note{ background:var(--cream); border:1px solid var(--gold-light); border-radius:12px; padding:10px 12px; margin-top:6px; margin-bottom:10px; }
.clinical-note h4{ font-size:11px; color:#7A5A20; margin-bottom:5px; }
.clinical-note p{ font-size:11px; color:var(--ink); line-height:1.5; }

/* Nav */
.bottomnav{
  display:flex; justify-content:space-around; align-items:center; background:#fff; border-top:1px solid var(--line);
  padding:8px 4px 10px; flex-shrink:0; position:fixed; bottom:0; left:50%; transform:translateX(-50%);
  width:100%; max-width:480px; z-index:20;
}
.nav-item{ display:flex; flex-direction:column; align-items:center; gap:2px; font-size:8.5px; color:var(--grey); font-weight:600; flex:1; background:none; border:none; cursor:pointer; }
.nav-item.active{ color:var(--sky-deep); }

/* Admin */
.admin-tab{ display:flex; gap:6px; overflow-x:auto; margin-bottom:12px; padding-bottom:2px; }
.admin-pill{ white-space:nowrap; font-size:10.5px; font-weight:600; padding:6px 11px; border-radius:20px; background:var(--cream); color:var(--grey-dark); cursor:pointer; border:none; }
.admin-pill.active{ background:var(--grey-dark); color:#fff; }
.admin-row{ display:flex; align-items:center; justify-content:space-between; background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px 12px; margin-bottom:8px; }
.admin-row .left{ display:flex; flex-direction:column; gap:2px; }
.admin-row .left b{ font-size:12px; }
.admin-row .left span{ font-size:10px; color:var(--grey); }
.fab{
  position:fixed; bottom:88px; left:calc(50% + 180px); width:44px; height:44px; border-radius:50%;
  background:var(--gold); color:#fff; display:flex; align-items:center; justify-content:center; font-size:20px;
  box-shadow:0 6px 14px rgba(185,141,62,0.4); border:none; cursor:pointer; z-index:21;
}
@media (max-width:480px){ .fab{ left:calc(100% - 60px); } }

/* Formularios */
.field{ margin-bottom:12px; }
.field label{ display:block; font-size:11px; color:var(--grey-dark); margin-bottom:4px; font-weight:600; }
.field input, .field textarea, .field select{
  width:100%; border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-size:13px; font-family:inherit; background:#fff;
}
.field textarea{ resize:vertical; min-height:70px; }

.centered-screen{ display:flex; flex-direction:column; justify-content:center; min-height:100vh; padding:24px; }
.auth-logo{ text-align:center; margin-bottom:24px; }
.auth-logo .brand-mark{ width:64px; height:64px; margin:0 auto 10px; }
.auth-title{ font-family:'Fraunces',serif; font-size:22px; text-align:center; color:var(--grey-dark); margin-bottom:4px; }
.auth-sub{ text-align:center; font-size:12px; color:var(--grey); margin-bottom:20px; }
.auth-switch{ text-align:center; font-size:12px; color:var(--sky-deep); margin-top:12px; cursor:pointer; }
.error-msg{ background:#FCEAEA; color:#B23A3A; font-size:11.5px; padding:8px 10px; border-radius:8px; margin-bottom:10px; }
.empty-state{ text-align:center; padding:40px 16px; color:var(--grey); font-size:12.5px; }

.icn{ display:inline-flex; align-items:center; justify-content:center; line-height:0; }
.icn svg{ width:16px; height:16px; }
.nav-item .icn svg{ width:19px; height:19px; color:var(--grey); }
.nav-item.active .icn svg{ color:var(--sky-deep); }
.btn .icn svg{ width:13px; height:13px; }
.btn .icn{ margin-right:4px; vertical-align:-2px; }
