/* Panel del barbero · estilo dashboard (menú lateral + tarjetas) */
body.admin { background: var(--bg); }
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; max-width: 1360px; margin: 0 auto; padding: 18px; min-height: 100vh; }
body.auth .app { grid-template-columns: 1fr; }
body.auth .side, body.auth .bottom-nav, body.auth .head { display: none; }

/* Menú lateral */
.side { background: var(--card); color: #fff; border: 1px solid #222; border-radius: 28px; padding: 22px 16px; box-shadow: var(--shadow); position: sticky; top: 18px; height: calc(100vh - 36px); display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.side .brand { padding: 0 8px 14px; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: #8d8a83; text-transform: uppercase; padding: 14px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; font-weight: 600; font-size: 15px; color: #d6d2ca; text-align: left; width: 100%; }
.nav-item svg { width: 20px; height: 20px; flex: 0 0 auto; }
.nav-item:hover { background: #222; }
.nav-item.active { background: var(--gold); color: var(--ink); box-shadow: 0 6px 16px rgba(212,177,58,.25); }
.side-promo { margin-top: auto; background: var(--gold); color: var(--ink); border-radius: 20px; padding: 18px; position: relative; overflow: hidden; }
.side-promo .h3 { font-family: var(--display); font-size: 18px; margin: 10px 0 4px; }
.side-promo p { font-size: 12px; color: rgba(17,17,17,.7); }
.side-promo .btn { margin-top: 14px; background: var(--ink); color: var(--gold); width: 100%; }
.side-promo .dots { --dot: rgba(17,17,17,.08); }

/* Encabezado */
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 4px 18px; color: #fff;
  position: sticky; top: 0; z-index: 40; background: rgba(13,13,13,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.head h1 { font-family: var(--display); font-weight: 800; font-stretch: 105%; font-size: 30px; line-height: 1.1; }
.head h1::after { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-left: 6px; vertical-align: 4px; }
.head .date { color: #a8a49b; font-weight: 500; font-size: 14px; }
.head-r { display: flex; align-items: center; gap: 10px; }
.round { width: 44px; height: 44px; border-radius: 50%; background: #1c1c1c; color: #fff; border: 1px solid #2c2c2c; display: grid; place-items: center; box-shadow: var(--shadow); position: relative; }
.round svg { width: 20px; height: 20px; }
.round .ping { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 2px solid #1c1c1c; }
.me { display: flex; align-items: center; gap: 10px; background: #1c1c1c; color: #fff; border: 1px solid #2c2c2c; border-radius: 999px; padding: 5px 16px 5px 5px; box-shadow: var(--shadow); }
.me .av { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.me .av img { width: 100%; height: 100%; object-fit: cover; }
.me b { display: block; font-size: 14px; line-height: 1.1; }
.me small { color: #a8a49b; font-size: 11px; }

/* Barra inferior en el celular */
.bottom-nav { display: none; }

/* Agenda */
.agenda-item { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-sm); background: var(--card-2); }
.agenda-item + .agenda-item { margin-top: 8px; }
.agenda-item .t { font-family: var(--display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.agenda-item .t small { display: block; font-family: var(--body); font-weight: 500; font-size: 11px; color: var(--muted); }
.agenda-item.cancelada, .agenda-item.ausente { opacity: .55; }
.agenda-item.completada { box-shadow: inset 4px 0 0 var(--ok); }
.agenda-item.confirmada { box-shadow: inset 4px 0 0 var(--gold); background: var(--card-2); border: 1px solid var(--line); }
.agenda-item.block { box-shadow: inset 4px 0 0 #6f6b63; background: repeating-linear-gradient(-45deg, #171717 0 8px, #1e1e1e 8px 16px); }
.agenda-item.now { outline: 2px solid var(--gold); }
.agenda-item.free { background: transparent; border: 1.5px dashed #333; color: var(--muted); padding: 8px 12px; }
.acts { display: flex; gap: 6px; }
.ib { width: 36px; height: 36px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 14px; color: var(--text); }
.ib:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.agenda-item.confirmada .ib { background: #262626; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd { background: var(--card-2); border-radius: 14px; padding: 8px 2px; text-align: center; border: 2px solid transparent; }
.wd small { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.wd b { font-family: var(--display); font-size: 18px; }
.wd .n { display: block; font-size: 11px; color: var(--gold-ink); font-weight: 800; min-height: 16px; }
.wd.sel { background: var(--gold); color: var(--ink); }
.wd.sel small { color: rgba(17,17,17,.65); }
.wd.sel .n { color: var(--ink); }
.wd.today:not(.sel) { border-color: var(--gold); }
.wd.sp::after { content: ""; display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin: 3px auto 0; }
.day-hours { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; font-size: 13px; color: var(--muted); }
.day-hours .special { color: var(--gold-ink); }
.tag-mini { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: var(--ink); margin-left: 6px; vertical-align: 2px; }
.tag-mini.gray { background: var(--card-2); color: var(--muted); }
.note-line { font-size: 12px; color: var(--warn); margin-top: 2px; }
.linkish { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.conf { border: 1px solid rgba(224,166,74,.35); background: var(--warn-soft); border-radius: var(--r-sm); padding: 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.danger-chip { color: var(--bad); }
.danger { box-shadow: inset 0 0 0 1.5px var(--bad-soft), var(--shadow); }
.msg-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.msg-row.done { opacity: .45; }
.msg-row .btn { white-space: nowrap; flex: 0 0 auto; }
.msg-list.folded .msg-row:nth-child(n+5) { display: none; }
#msgCard { box-shadow: inset 0 0 0 2px var(--gold), var(--shadow); }

/* Clientes */
.client { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }

/* Gráficos */
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.chart-wrap { display: grid; grid-template-columns: 44px 1fr; gap: 6px; margin-top: 18px; }
.y-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; padding-bottom: 22px; }
.plot { position: relative; }
.plot .grid-lines { position: absolute; inset: 0 0 22px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.plot .grid-lines span { border-top: 1px dashed #2a2a2a; }
.chart { position: relative; display: flex; align-items: flex-end; gap: 8px; height: 220px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; cursor: default; }
.chart .bars { display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: calc(100% - 22px); width: 100%; }
.chart .bars i { display: block; width: 100%; max-width: 30px; background: #f3efe6; border-radius: 999px; min-height: 6px; }
.chart .bars i.g { background: var(--gold); }
.chart .col.dim .bars i { background: #3a3a3a; }
.chart .col small { font-size: 12px; color: var(--muted); white-space: nowrap; height: 16px; }
.chart .col b { font-size: 11px; font-weight: 800; white-space: nowrap; }
.chart.single .bars i { max-width: 34px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 14px; }
.hbar .track { height: 10px; background: var(--card-2); border-radius: 10px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--gold); border-radius: 10px; }
.heat { display: grid; gap: 4px; margin-top: 12px; align-items: center; }
.heat small { font-size: 10px; color: var(--muted); text-align: center; font-weight: 600; }
.heat small.hd { text-align: left; }
.heat .cell { aspect-ratio: 1; border-radius: 6px; background: var(--card-2); position: relative; overflow: hidden; min-height: 14px; }
.heat .cell::after { content: ""; position: absolute; inset: 0; background: var(--gold); opacity: var(--a); }
.tip { position: absolute; z-index: 60; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; pointer-events: none; opacity: 0; transition: opacity .12s; white-space: nowrap; }
.tip.show { opacity: 1; }
.periods { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.periods .chip { background: #1c1c1c; color: #fff; border-color: #2c2c2c; }
.periods .chip.active { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.periods::-webkit-scrollbar { display: none; }
/* Torta de servicios (tarjeta con degradé dorado como la verde de la referencia) */
.card.tint { background: linear-gradient(160deg, #2a2413 0%, #141414 100%); }
.pie-box { display: grid; place-items: center; padding: 14px 0; }
.pie { width: min(240px, 70vw); aspect-ratio: 1; border-radius: 50%; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.pie::after { content: attr(data-center); position: absolute; inset: 30%; border-radius: 50%; background: #1f1b10; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 20px; text-align: center; line-height: 1.1; white-space: pre-line; }
.pie-row { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 14px; }
.pie-row i { width: 12px; height: 12px; border-radius: 4px; }
.pie-row .pct { font-size: 12px; font-weight: 800; background: var(--gold); color: var(--ink); border-radius: 999px; padding: 2px 9px; }
/* Burbujas de clientes */
.bubbles-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; }
.bubbles { position: relative; height: 210px; }
.bubble { position: absolute; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: #fff; box-shadow: 0 0 0 3px var(--card); transform: translate(-50%, -50%); }
.bubble.k0 { background: #f3efe6; color: var(--ink); }
.bubble.k1 { background: var(--gold); color: var(--ink); }
.bubble.k2 { background: #4a4a4a; }
.bubble.k3 { background: #8a6d12; }
.b-row { padding: 6px 0; font-size: 13px; font-weight: 600; }
.b-row .track { height: 7px; border-radius: 7px; background: var(--card-2); margin-top: 5px; overflow: hidden; }
.b-row .track i { display: block; height: 100%; border-radius: 7px; }

/* Horarios / ajustes */
.set-day { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-day:last-child { border-bottom: 0; }
.ranges { display: flex; flex-direction: column; gap: 8px; }
.range { display: flex; gap: 6px; align-items: center; }
.range .input { padding: 9px 8px; font-size: 15px; width: 0; flex: 1 1 0; min-width: 0; }
.range .ib { flex: 0 0 36px; }
.range select.input { text-align: center; text-align-last: center; cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 42px; height: 25px; border-radius: 25px; background: #3a3a3a; position: relative; transition: background .15s; cursor: pointer; flex: 0 0 auto; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: all .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--gold); }
.switch input:checked::after { left: 20px; background: var(--ink); }
.svc-row { display: grid; grid-template-columns: 1fr 90px 100px auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.svc-row .input { padding: 9px 10px; font-size: 15px; }
.svc-row.off { opacity: .5; }
.mini { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 700; min-width: 0; }
.mini .input { color: var(--text); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Elegir horas tocando */
.tchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; }
.tchip { background: var(--card-2); border: 2px solid transparent; border-radius: 12px; padding: 9px 0 7px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: center; line-height: 1.1; font-size: 14px; }
.tchip small { font-size: 9px; font-weight: 600; color: var(--muted); max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.tchip.free:hover { border-color: #3a3a3a; }
.tchip.sel { background: var(--gold); color: var(--ink); }
.tchip.sel small { color: var(--ink); }
.tchip.busy, .tchip.open { opacity: .45; border: 2px dashed #3a3a3a; background: transparent; }
.tchip.past { opacity: .25; }

/* Fotos */
.drop { border: 2px dashed #3a3a3a; border-radius: var(--r); padding: 28px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; display: block; background: var(--card-2); }
.drop:hover, .drop.over { border-color: var(--gold); background: var(--gold-soft); }
.drop .big { font-size: 34px; }
.uploads { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.up-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; background: var(--card-2); border-radius: 12px; padding: 8px; }
.up-row img, .up-row .ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #2a2a2a; display: grid; place-items: center; }
.up-row .bar { margin-top: 6px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.m-item { background: var(--card-2); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; border: 2px solid transparent; }
.m-item.feat { border-color: var(--gold); }
.m-thumb { position: relative; aspect-ratio: 3/4; background: #222; }
.m-thumb img, .m-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.m-badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.7); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 3px 8px; }
.m-star { position: absolute; top: 6px; right: 6px; background: #111 !important; }
.m-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.m-body .input { padding: 8px 10px; font-size: 13px; background: #111; }
.m-acts { display: flex; gap: 4px; justify-content: space-between; }
.m-acts .ib { width: 32px; height: 32px; font-size: 12px; background: #111; }

@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 0 12px calc(100px + env(safe-area-inset-bottom)); }
  .head { margin: 0 -12px 14px; padding: calc(10px + env(safe-area-inset-top)) 14px 12px; border-bottom: 1px solid #222; }
  .side { display: none; }
  .head h1 { font-size: 24px; }
  .me div { display: none; }
  .me { padding: 5px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: #111; border-top: 1px solid #262626; padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    transform: translateZ(0); -webkit-transform: translateZ(0); will-change: transform;
  }
  .bottom-nav .nav-item { flex-direction: column; gap: 3px; font-size: 10px; padding: 8px 2px; color: rgba(255,255,255,.65); justify-content: center; align-items: center; text-align: center; border-radius: 16px; }
  .bottom-nav .nav-item.active { background: var(--gold); color: var(--ink); box-shadow: none; }
  .bottom-nav .nav-item svg { width: 21px; height: 21px; }
}
@media (max-width: 560px) {
  .agenda-item { grid-template-columns: 52px 1fr; }
  .agenda-item .acts { grid-column: 1 / -1; justify-content: flex-end; }
  .agenda-item.free { grid-template-columns: 52px 1fr auto; }
  .set-day { grid-template-columns: minmax(0, 1fr); }
  .svc-row { grid-template-columns: 1fr 1fr auto; }
  .svc-row .svc-name, .svc-row .svc-desc { grid-column: 1 / -1; }
  .grid2 { grid-template-columns: 1fr; }
  .bubbles-box { grid-template-columns: 1fr; }
  .chart { height: 180px; }
  .head .round.hide-m { display: none; }
}

/* Botón para ir a la web como cliente */
.viewweb { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--gold); color: var(--ink); font-weight: 800; font-size: 13px; }
.viewweb svg { width: 18px; height: 18px; }
@media (max-width: 440px) { .viewweb span { display: none; } .viewweb { width: 44px; padding: 0; justify-content: center; } }
/* Ventana de mensajes (campanita) */
.msg-sheet .msg-row:last-child { border-bottom: 0; }
main { min-width: 0; }
.head > div:first-child { min-width: 0; flex: 1 1 auto; }
.head-r { flex: 0 0 auto; }
@media (max-width: 560px) { .head .date { font-size: 12px; line-height: 1.35; } .head-r { gap: 6px; } .round, .viewweb { width: 40px; height: 40px; } .me .av { width: 32px; height: 32px; } }
