/* Friendly Studio · Gestión — estilos del equipo
   Colores y tipografía salen de studio_settings (variables --bg, --ink, --accent). */
@import url("https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #E4E2DB; --paper: #F4F3EF; --card: #FFFFFF; --ink: #111111; --muted: #6E6C66; --line: #D3D0C7;
  --accent: #111111; --ok: #2F7D4F; --warn: #B7791F; --bad: #B4413A; --info: #3B6EA8;
  --r: 14px; --head: "Syne", system-ui, sans-serif; --body: "Inter", system-ui, -apple-system, sans-serif;
  --side: 232px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -.01em; margin: 0; line-height: 1.1; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- layout */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); background: var(--bg); }
.brand { padding: 4px 10px 18px; }
.brand b { font-family: var(--head); font-size: 20px; font-weight: 800; display: block; line-height: 1; }
.brand span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.brand img { width: 150px; height: auto; display: block; }
.side .made { margin-top: auto; width: 118px; height: auto; padding: 0 10px; opacity: .55; }
.side .made + .me { margin-top: 6px; }
.mbrand, .mfoot { display: none; }
.lglogo { width: 230px; max-width: 80%; display: block; margin: 0 0 12px; }
.lgmade { width: 150px; display: block; margin: 0 0 22px; opacity: .6; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a:hover { background: rgba(0,0,0,.04); color: var(--ink); }
.nav a.on { background: var(--ink); color: var(--paper); }
.nav a .ic { width: 18px; text-align: center; }
.nav .badge { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; }
.side .me { margin-top: auto; padding: 10px; font-size: 12px; color: var(--muted); }
.main { padding: 28px 32px 80px; max-width: 1240px; width: 100%; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); z-index: 30; overflow-x: auto; background: var(--paper); }
  .brand, .side .me, .side .made { display: none; }
  .mbrand { display: block; margin: 0 0 18px; } .mbrand img { width: 140px; height: auto; display: block; }
  .mfoot { display: block; text-align: center; padding: 28px 0 0; } .mfoot img { width: 120px; opacity: .45; }
  .nav { display: flex; gap: 2px; width: 100%; justify-content: space-between; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 8px; min-width: 56px; }
  .nav a .ic { font-size: 18px; }
  .nav .badge { position: absolute; margin: 0 0 0 20px; }
  .main { padding: 18px 16px 110px; }
  h1 { font-size: 24px; }
}

/* ---------- piezas */
.card { background: var(--card); border-radius: var(--r); padding: 18px; border: 1px solid rgba(0,0,0,.04); }
.card + .card { margin-top: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: var(--r); padding: 16px 18px; }
.kpi .v { font-family: var(--head); font-size: 26px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.dark { background: var(--ink); color: var(--paper); } .kpi.dark .s, .kpi.dark .eyebrow { color: #B9B6AD; }

.btn { border: 1px solid var(--ink); background: transparent; border-radius: 99px; padding: 8px 16px; cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; white-space: nowrap; }
.btn:hover { background: rgba(0,0,0,.05); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { opacity: .88; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.ghost { border-color: transparent; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: .45; cursor: default; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 5px 12px; cursor: pointer; font-size: 12.5px; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
input, select, textarea { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 11px; font-size: 14px; outline: none; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); background: #fff; }
textarea { resize: vertical; min-height: 70px; }
input[type=checkbox] { width: auto; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }
form .grid2, form .grid3 { margin-bottom: 12px; }
form > label { margin-bottom: 12px; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: #EEECE6; color: var(--muted); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.t-solicitud { color: var(--info); background: #E5ECF5; }
.t-agendada { color: #111; background: #ECEAE3; }
.t-realizada { color: var(--warn); background: #F7EEDC; }
.t-entregada { color: #6B4FA0; background: #EEE8F7; }
.t-pagada { color: var(--ok); background: #E2F0E7; }
.t-cancelada, .t-descartada { color: var(--bad); background: #F6E4E2; }
.t-borrador { color: var(--muted); } .t-publicada { color: var(--info); background: #E5ECF5; } .t-seleccion_enviada { color: var(--warn); background: #F7EEDC; } .t-cerrada { color: var(--ok); background: #E2F0E7; }

.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid #EFEDE7; cursor: pointer; }
.li:last-child { border-bottom: 0; }
.li:hover { background: #FAF9F6; }
.li .when { width: 74px; flex: none; font-size: 12px; color: var(--muted); line-height: 1.25; }
.li .when b { display: block; color: var(--ink); font-family: var(--head); font-size: 15px; }
.li .what { flex: 1; min-width: 0; }
.li .what b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .why { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .amt { text-align: right; font-weight: 600; white-space: nowrap; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px; border-bottom: 1px solid #EFEDE7; vertical-align: top; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #FAF9F6; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

/* ---------- agenda semanal */
.week { display: grid; grid-template-columns: 52px repeat(7, 1fr); background: var(--card); border-radius: var(--r); overflow: hidden; position: relative; }
.week .hd { padding: 10px 6px; text-align: center; font-size: 12px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 2; }
.week .hd b { display: block; font-family: var(--head); font-size: 18px; }
.week .hd.today b { background: var(--ink); color: var(--paper); border-radius: 99px; width: 30px; height: 30px; line-height: 30px; margin: 2px auto 0; }
.week .hours { border-right: 1px solid #EFEDE7; }
.week .h { height: 48px; font-size: 10.5px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; }
.week .col { position: relative; border-right: 1px solid #F1EFEA; }
.week .slot { height: 48px; border-bottom: 1px solid #F3F1EC; cursor: copy; }
.week .slot:hover { background: #FAF9F6; }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 7px; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer; background: var(--ink); color: var(--paper); border-left: 3px solid #fff3; }
.ev small { display: block; opacity: .75; }
.ev.c-renta { background: #2B2A27; } .ev.c-cumpleanos { background: #C2577A; } .ev.c-perfil { background: #3B6EA8; } .ev.c-book { background: #6B4FA0; }
.ev.c-pareja { background: #B7791F; } .ev.c-maternidad { background: #8E6A5B; } .ev.c-podcast { background: #2F7D4F; } .ev.c-video { background: #1F5F6B; } .ev.c-visita { background: #9A978E; }
.ev.solicitud { background: repeating-linear-gradient(45deg, #E5ECF5, #E5ECF5 6px, #DCE5F1 6px, #DCE5F1 12px); color: var(--info); border: 1px dashed var(--info); }
.ev.fuera { opacity: .7; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 1; }
@media (max-width: 900px) { .week { display: none; } }
.daylist { display: none; } @media (max-width: 900px) { .daylist { display: block; } }

/* ---------- panel lateral (drawer) */
.veil { position: fixed; inset: 0; background: rgba(17,17,17,.35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.veil.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--paper); z-index: 41; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.12); }
.drawer.on { transform: none; }
.drawer .dh { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drawer .db { padding: 20px 22px 40px; overflow-y: auto; flex: 1; }
.drawer .df { padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--paper); }
.x { border: 0; background: transparent; font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px; }
.sec { margin-top: 22px; } .sec > h3 { margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.sum { background: #fff; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.sum .r { display: flex; justify-content: space-between; padding: 3px 0; } .sum .r.tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 15px; }
.warnbox { background: #F7EEDC; color: #7A5212; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; }
.okbox { background: #E2F0E7; color: #1F5A37; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; }
.suggest { position: relative; }
.suggest .opts { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; z-index: 5; max-height: 220px; overflow: auto; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.suggest .opts div { padding: 8px 11px; cursor: pointer; font-size: 13px; color: var(--ink); } .suggest .opts div:hover { background: var(--paper); }

/* ---------- galerías (lado equipo) */
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 28px; text-align: center; color: var(--muted); background: var(--paper); cursor: pointer; }
.drop.over { border-color: var(--ink); background: #fff; color: var(--ink); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.thumbs .th { position: relative; aspect-ratio: 1; background: #ECEAE3; border-radius: 8px; overflow: hidden; }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .th .fav { position: absolute; top: 6px; right: 6px; background: var(--ink); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.thumbs .th input { position: absolute; top: 6px; left: 6px; }
.thumbs .th .nm { position: absolute; bottom: 0; left: 0; right: 0; font-size: 10px; background: linear-gradient(transparent, rgba(0,0,0,.6)); color: #fff; padding: 10px 6px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; background: #E7E4DC; border-radius: 99px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .2s; }

/* ---------- login y avisos */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(400px, 100%); padding: 30px; }
.login h1 { font-size: 34px; margin-bottom: 4px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 99px; font-size: 13px; z-index: 60; opacity: 0; transition: all .2s; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%); }
@media (max-width: 900px) { .toast { bottom: 90px; } }
.msg { font-size: 12.5px; color: var(--bad); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
