/* Paini Bot — panel. Marca Paini: negro carbón, blanco hueso y rubí. Botones redondeados tipo píldora. Un color por estado. */
:root {
  /* Marca Paini (paini-dev.pages.dev): negro carbón, blanco hueso y rubí de la painita */
  --night: #0C0D0E;        /* barra lateral, login */
  --night-2: #17181A;
  --night-line: #303134;
  --bone: #F5F5F2;         /* texto sobre negro */
  --ink: #141516;          /* botones principales, títulos */
  --ink-2: #2B2D31;
  --ruby: #A31E3D;         /* acento de marca */
  --ruby-2: #C63657;
  --ruby-soft: #EE849B;
  --ruby-faint: #F8EEF1;
  --bg: #F6F5F2;
  --card: #FFFFFF;
  --raised: #ECEBE6;
  --line: #E1E0DA;
  --line-2: #ECEBE6;
  --text: #1B2024;
  --muted: #596168;
  --soft: #F3F2EE;
  /* estados (un color por estado, igual en todo el panel) */
  --s-reserved: #2F5BD3;
  --s-hold: #F5A524;
  --s-in: #6E4BD8;
  --s-done: #1F8A5B;
  --s-noshow: #D92D20;
  --s-cancel: #98A2B3;
  --s-block: #C9CED8;
  --ok: #1F8A5B;
  --danger: #D92D20;
  --r: 16px; --r-sm: 11px; --pill: 999px;
  --shadow: 0 1px 2px rgba(20, 21, 22, .05), 0 1px 3px rgba(20, 21, 22, .04);
  --font: "DM Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url("/fonts/dm-sans-latin.woff2") format("woff2-variations"), url("/fonts/dm-sans-latin.woff2") format("woff2"); }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--ink-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ruby-2); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 1.6rem; line-height: 1.15; margin: 0; letter-spacing: -.035em; font-weight: 600; }
h2 { font-size: 1.08rem; margin: 26px 0 10px; font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: .98rem; margin: 14px 0 6px; font-weight: 650; }
p { margin: .25rem 0 .7rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--night); color: var(--bone); border-right: 1px solid var(--night); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.45rem; letter-spacing: -.055em; color: var(--ink); padding: 2px 8px 16px; text-decoration: none; line-height: 1; white-space: nowrap; }
.logo .wm { display: inline-flex; align-items: baseline; gap: 4px; }
.logo .wm span { font-weight: 400; }
.logo .wm i { width: 5px; height: 5px; border-radius: 50%; background: var(--ruby-2); margin-left: 1px; display: inline-block; }
.side .logo, .login-art .logo { color: var(--bone); }
.logo small { font-weight: 600; font-size: .68rem; color: #9A9C98; letter-spacing: .08em; text-transform: uppercase; margin-left: 2px; align-self: center; }
.biz { margin: 0 4px 12px; padding: 10px 12px; background: var(--night-2); border: 1px solid var(--night-line); border-radius: var(--r-sm); font-size: .88rem; }
.biz b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz span { color: #9A9C98; }
.nav a { display: flex; align-items: center; gap: 11px; color: #C9CAC5; text-decoration: none; padding: 9px 13px; border-radius: var(--pill); font-weight: 500; }
.nav a:hover { background: var(--night-2); color: var(--bone); }
.nav a.on { background: var(--bone); color: var(--ink); font-weight: 650; }
.nav a.on svg { color: var(--ruby); }
.nav .badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 7px; font-weight: 700; line-height: 18px; }
.nav .badge { background: var(--ruby-2); }
.nav a.on .badge { background: var(--ruby); color: #fff; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 14px; }
.main { padding: 24px 32px 90px; max-width: 1240px; width: 100%; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.top .sub { color: var(--muted); margin-top: 3px; }
.mob-top, .tabbar { display: none; }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 14px; border-radius: var(--r); margin-bottom: 14px; background: #FFF6E5; border: 1px solid #FBD38D; }
.banner.red { background: #FEF3F2; border-color: #FDA29B; }
.banner.ink { background: var(--night); color: var(--bone); border: 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 12px 14px 96px; }
  .mob-top { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 14px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); text-decoration: none; padding: 8px 2px 7px; position: relative; font-weight: 600; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on svg { color: var(--ink); }
  .tabbar .dot { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .65rem; display: grid; place-items: center; padding: 0 4px; }
  h1 { font-size: 1.3rem; }
  .top .actions .btn span.lbl { display: none; }
}

/* ---------- Superficies ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.grid > .card, .grid > .todo { margin-top: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 1.5rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: .86rem; }
.todo { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ruby); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.todo.red { border-left-color: var(--danger); }
.todo .big { font-size: 1.7rem; font-weight: 800; min-width: 36px; text-align: center; }
.todo .txt { flex: 1; font-weight: 600; }
.todo .txt span { display: block; font-weight: 400; color: var(--muted); font-size: .86rem; }
.calm { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: #ECFDF3; color: #067647; font-weight: 600; }

/* Listas (en vez de tablas pesadas) */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.item:last-child { border-bottom: 0; }
.item.click { cursor: pointer; }
.item.click:hover { background: var(--soft); }
.item .grow { flex: 1; min-width: 0; }
.item .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 52px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--ruby-faint); color: var(--ruby); display: grid; place-items: center; font-weight: 700; flex: none; font-size: .9rem; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--soft); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--soft); }
.tbl td.r, .tbl th.r { text-align: right; }
.tblwrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* Pastillas de estado: mismo color que en el calendario */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; white-space: nowrap; background: #F2F4F7; color: #344054; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.confirmed { background: #EEF3FF; color: #2952CC; }
.pill.hold, .pill.trial, .pill.pendiente { background: #FFF6E5; color: #B54708; }
.pill.checked_in { background: #F1EEFE; color: #5925DC; }
.pill.completed, .pill.active, .pill.aprobado, .pill.on { background: #ECFDF3; color: #067647; }
.pill.no_show, .pill.past_due, .pill.alert { background: #FEF3F2; color: #B42318; }
.pill.cancelled, .pill.expired, .pill.displaced, .pill.vencido, .pill.off { background: #F2F4F7; color: #667085; }
.pill.suspended { background: var(--night); color: var(--bone); }

/* ---------- Botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--ink); color: #fff; border: 1px solid var(--ink); padding: 0 18px; height: 42px; border-radius: var(--pill); font-weight: 650; transition: background .16s cubic-bezier(.23,1,.32,1), transform .1s; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--ink-2); }
.btn:active { transform: scale(.98); }
.btn.light { background: var(--card); color: var(--ink); border-color: #D6D7D4; box-shadow: none; }
.btn.light:hover { background: var(--soft); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.ok:hover { background: #17724A; }
.btn.danger { background: var(--card); color: var(--danger); border-color: #F5B5AE; }
.btn.danger:hover { background: #FEF3F2; }
.btn.mango, .btn.accent { background: var(--ruby); border-color: var(--ruby); color: #fff; }
.btn.mango:hover, .btn.accent:hover { background: var(--ruby-2); }
.side .btn.mango { background: var(--bone); border-color: var(--bone); color: var(--ink); }
.side .btn.mango svg { color: var(--ruby); }
.side .btn.mango:hover { background: #fff; }
.btn.sm { height: 34px; padding: 0 14px; font-size: .88rem; }
.btn.lg { height: 52px; font-size: 1.02rem; padding: 0 22px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--ruby); font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: .86rem; font-weight: 600; }
.field .hint { font-size: .8rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], input[type=url], select, textarea {
  width: 100%; border: 1px solid #D6D7D4; border-radius: var(--r-sm); padding: 0 12px; height: 42px; background: #fff;
}
textarea { min-height: 96px; padding: 10px 12px; resize: vertical; height: auto; }
input:focus, select:focus, textarea:focus { border-color: var(--ruby); outline: 3px solid rgba(163, 30, 61, .14); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 12px; }
.check { display: flex; align-items: center; gap: 9px; margin: 8px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 13px; font-size: .88rem; cursor: pointer; font-weight: 550; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg { display: inline-flex; background: var(--raised); padding: 3px; border-radius: var(--pill); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: var(--pill); font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
details.more { margin-top: 4px; }
details.more summary { cursor: pointer; color: var(--ruby); font-weight: 600; margin: 6px 0 10px; }

/* ---------- Calendario ---------- */
.cal-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-date { font-weight: 700; font-size: 1.05rem; min-width: 150px; position: relative; }
.cal-date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; box-shadow: var(--shadow); max-height: 70vh; position: relative; }
.cal-inner { position: relative; width: max-content; min-width: 100%; }
.cal-row { display: grid; position: relative; border-bottom: 1px solid var(--line-2); }
.cal-row:last-child { border-bottom: 0; }
.cal-head { position: sticky; top: 0; z-index: 6; background: #FAFAF8; border-bottom: 1px solid var(--line); }
.cal-head .hcell { font-size: .75rem; font-weight: 650; color: var(--muted); padding: 9px 6px; border-left: 1px solid var(--line-2); white-space: nowrap; }
.cal-head .hcell.today { color: var(--ruby); background: var(--ruby-faint); }
.cal-head .hcell.wk { color: #8A92A6; }
.res-name { position: sticky; left: 0; z-index: 5; background: var(--card); padding: 10px 12px; border-right: 1px solid var(--line); font-weight: 650; font-size: .9rem; min-height: 58px; display: flex; flex-direction: column; justify-content: center; }
.cal-head .res-name { background: #FAFAF8; min-height: 0; font-size: .78rem; color: var(--muted); }
.res-name small { color: var(--muted); font-weight: 500; font-size: .76rem; }
.slot { border: 0; border-left: 1px solid var(--line-2); background: transparent; cursor: pointer; min-height: 58px; padding: 0; position: relative; }
.slot.half { border-left-style: dashed; border-left-color: #F0EFEA; }
.slot:hover { background: var(--ruby-faint); }
.slot:hover::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--ruby); font-weight: 700; font-size: 1.1rem; }
.slot.closedday { background: repeating-linear-gradient(135deg, #F7F8FA 0 6px, #F0F2F5 6px 12px); cursor: default; }
.slot.closedday:hover::after { content: none; }
.blk { z-index: 2; margin: 5px 3px; border-radius: 10px; padding: 5px 9px; color: #fff; border: 0; text-align: left; cursor: pointer; overflow: hidden; min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.25; box-shadow: 0 1px 2px rgba(16,24,40,.15); }
.blk b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk span { font-size: .72rem; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk:hover { filter: brightness(1.06); }
.blk.confirmed { background: var(--s-reserved); }
.blk.hold { background: repeating-linear-gradient(135deg, #FFC961 0 7px, var(--s-hold) 7px 14px); color: #3D2400; }
.blk.checked_in { background: var(--s-in); }
.blk.completed { background: var(--s-done); }
.blk.no_show { background: #FEF3F2; color: #B42318; border: 2px solid var(--s-noshow); box-shadow: none; }
.blk.no_show b { text-decoration: line-through; }
.blk.cancelled { background: #fff; color: #667085; border: 1.5px dashed var(--s-cancel); box-shadow: none; }
.blk.closed { background: repeating-linear-gradient(135deg, #E4E7EC 0 7px, var(--s-block) 7px 14px); color: #344054; cursor: default; box-shadow: none; }
.blk.shared { background: repeating-linear-gradient(135deg, #EEF3FF 0 7px, #DCE6FF 7px 14px); color: #2952CC; cursor: default; box-shadow: none; }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; top: 34px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* ---------- Chats / teléfono ---------- */
.chat { display: grid; grid-template-columns: 320px 1fr; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; height: calc(100vh - 150px); min-height: 480px; box-shadow: var(--shadow); }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-list .item.on { background: var(--ruby-faint); }
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: #EFEAE2; min-height: 0; }
.msg { max-width: 80%; padding: 7px 10px 4px; border-radius: 10px; white-space: pre-wrap; word-wrap: break-word; font-size: .93rem; box-shadow: 0 1px .5px rgba(11,20,26,.13); background: #fff; align-self: flex-start; }
.msg.me { background: #D9FDD3; align-self: flex-end; }
.msg.person { background: #DCE8FF; }
.msg.note { align-self: center; background: #FFF6E5; font-size: .82rem; max-width: 92%; }
.msg .meta { display: block; font-size: .68rem; color: #667781; text-align: right; margin-top: 1px; }
.msg.failed { outline: 2px solid var(--danger); }
.msg img { max-width: 220px; border-radius: 6px; display: block; margin-bottom: 4px; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--soft); }
.composer input[type=text] { flex: 1; }
.phone { width: 100%; max-width: 400px; border: 9px solid var(--night); border-radius: 32px; overflow: hidden; background: #EFEAE2; box-shadow: 0 18px 40px rgba(12,13,14,.18); display: flex; flex-direction: column; height: min(720px, calc(100vh - 170px)); }
.phone .bar { background: var(--night); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.phone .bar .avatar { width: 34px; height: 34px; background: var(--ruby); color: #fff; }
.phone .bar b { display: block; font-size: .95rem; }
.phone .bar span { font-size: .75rem; opacity: .8; }
.sim { display: grid; grid-template-columns: minmax(0, 400px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) {
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat-list { max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .msgs { min-height: 50vh; }
  .sim { grid-template-columns: 1fr; }
  .phone { height: 68vh; max-width: none; }
}

/* ---------- Pagos ---------- */
.pay { display: grid; grid-template-columns: 140px 1fr; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.pay + .pay { margin-top: 12px; }
.pay .ph { width: 140px; height: 180px; border-radius: 10px; background: #F2F4F7 center/cover no-repeat; border: 1px solid var(--line); cursor: zoom-in; display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.pay .amt { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.pay .warn { color: #B42318; background: #FEF3F2; border-radius: 8px; padding: 6px 10px; font-size: .86rem; font-weight: 600; margin: 8px 0; }
.steps { display: flex; gap: 10px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); margin: 6px 0 10px; }
.steps b { color: var(--text); }
@media (max-width: 600px) { .pay { grid-template-columns: 1fr; } .pay .ph { width: 100%; height: 220px; } }

/* ---------- Automatizaciones ---------- */
.auto { display: flex; flex-direction: column; gap: 10px; }
.auto-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.auto-head b { font-size: .98rem; }
.auto .bubble { background: #D9FDD3; border-radius: 10px; padding: 8px 10px; font-size: .86rem; white-space: pre-wrap; box-shadow: 0 1px .5px rgba(11,20,26,.13); max-height: 140px; overflow: hidden; position: relative; }
.auto .bubble.off { background: #F2F4F7; color: var(--muted); }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #D0D5DD; border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--ruby-2); outline-offset: 2px; }

/* ---------- Ejemplos ---------- */
.ex { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.ex-list { position: sticky; top: 16px; }
.ex-list .item { padding: 9px 12px; }
.ex .msgs { border-radius: var(--r); min-height: 300px; max-height: none; }
.who { font-size: .7rem; font-weight: 700; color: #667781; display: block; margin-bottom: 1px; }
.msg.owner-chat { border-left: 3px solid var(--ruby); }
@media (max-width: 900px) { .ex { grid-template-columns: 1fr; } .ex-list { position: static; } }

/* ---------- Modal / hoja inferior ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12, 13, 14, .5); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { background: var(--card); width: min(520px, 100%); max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 20px 20px 24px; }
.modal.wide { width: min(860px, 100%); }
@media (min-width: 901px) { .overlay { align-items: center; } .modal { border-radius: 20px; } }
.modal h2 { margin: 0 0 4px; font-size: 1.2rem; }
.modal .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.modal .acts .btn { flex: 1 1 140px; }
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: #D0D5DD; margin: -8px auto 12px; }
@media (min-width: 901px) { .sheet-grab { display: none; } }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--night); color: var(--bone); padding: 11px 18px; border-radius: var(--pill); z-index: 70; max-width: 92vw; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-weight: 550; }
.toast.err { background: var(--danger); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .18s ease-out; } @keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } } .modal { animation: up .18s ease-out; } @keyframes up { from { transform: translateY(16px); opacity: .6; } } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--card); }
.login-art { background: var(--night); color: var(--bone); padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .logo { font-size: 1.8rem; }
.login-art h1 { font-size: 2.7rem; line-height: 1.05; max-width: 14ch; letter-spacing: -.065em; font-weight: 530; }
.login-art h1 em { font-style: normal; }
.login-art h1 em::after { content: ""; display: inline-block; width: .12em; height: .12em; border-radius: 50%; background: var(--ruby-2); margin-left: .08em; }
.login-art p { color: #A9ABA6; max-width: 40ch; font-size: 1.02rem; line-height: 1.7; }
.bubbles { display: flex; flex-direction: column; gap: 8px; max-width: 330px; }
.bubbles div { background: #fff; color: var(--text); padding: 8px 12px; border-radius: 12px; font-size: .9rem; align-self: flex-start; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.bubbles div.me { background: #D9FDD3; align-self: flex-end; }
.bubbles div.ok { background: var(--ruby); color: #fff; font-weight: 650; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-form form { width: min(360px, 100%); }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { padding: 26px 20px; gap: 18px; } .login-art h1 { font-size: 1.8rem; } .bubbles { display: none; } }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .93rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 550; }
pre.code { background: var(--soft); border: 1px solid var(--line); padding: 10px; border-radius: 8px; overflow-x: auto; font-size: .82rem; white-space: pre-wrap; word-break: break-all; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ruby); }
.ok-t { color: var(--ok); font-weight: 700; } .bad-t { color: var(--danger); font-weight: 700; }

/* ---- Ayudas (!) ---- */
.flabel { display: flex; align-items: center; gap: 6px; }
.check-row { display: flex; align-items: center; gap: 6px; }
.check-row .check { margin: 8px 0; }
.tip { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; border: 1.5px solid #A3A5A0; background: #fff; color: var(--muted); font: 800 11px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; cursor: help; padding: 0; }
.tip:hover, .tip:focus-visible { border-color: var(--ruby); color: #fff; background: var(--ruby); }
.tip-pop { position: fixed; z-index: 90; background: var(--night); color: var(--bone); font-size: .84rem; line-height: 1.45; padding: 10px 12px; border-radius: 10px; box-shadow: 0 10px 30px rgba(16,24,40,.25); pointer-events: none; }
h2 .tip, h3 .tip, summary .tip { margin-left: 6px; vertical-align: 2px; }
.explain { background: var(--soft); border: 1px solid var(--line); border-left: 3px solid var(--ruby); border-radius: 12px; padding: 12px 14px; font-size: .88rem; margin-bottom: 14px; }
.explain b { color: var(--ink); }
.explain ul { margin: 6px 0 0; padding-left: 18px; }

/* ---- Calendario desplegable ---- */
button.cal-date { border: 1px solid #D6D7D4; background: var(--card); border-radius: var(--pill); padding: 7px 12px; cursor: pointer; font: inherit; font-weight: 700; color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
button.cal-date:hover { border-color: var(--ink); }
button.cal-date svg { color: var(--ruby); }
.date-pop { position: fixed; z-index: 80; width: 284px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(16,24,40,.18); padding: 12px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head button { border: 0; background: var(--raised); width: 32px; height: 32px; border-radius: 8px; font-size: 1.1rem; cursor: pointer; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-wd span { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 2px 0 4px; }
.dp-grid button { border: 0; background: transparent; height: 34px; border-radius: var(--pill); cursor: pointer; font: 600 .9rem var(--font); color: var(--text); }
.dp-grid button:hover { background: var(--raised); }
.dp-grid button.today { box-shadow: inset 0 0 0 1.5px var(--ruby); color: var(--ruby); }
.dp-grid button.on { background: var(--ink); color: #fff; box-shadow: none; }

/* ---- Fechas de cobro (mi panel) ---- */
.due-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 14px 0; }
.due-card > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); }
.due-card b { display: block; font-size: 1.05rem; }
.due-card .big { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.due-card .red { color: var(--danger); }
.due-card span { color: var(--muted); font-size: .84rem; }
.msg .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg .btns button { border: 1px solid #E5C3CC; background: #fff; color: var(--ruby); border-radius: 999px; padding: 4px 10px; font: 600 .82rem var(--font); cursor: pointer; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.qk { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line); border-top: 4px solid #98A2B3; border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); }
.qk:hover { border-color: #C9C8C2; }
.qk b { font-size: 1.6rem; letter-spacing: -.02em; line-height: 1.1; }
.qk span { font-weight: 650; }
.qk small { color: var(--muted); }
.qk.red { border-top-color: var(--danger); } .qk.amber { border-top-color: var(--s-hold); } .qk.blue { border-top-color: var(--s-reserved); } .qk.grey { border-top-color: var(--night); }
.grid2 > .field { justify-content: flex-end; }
b .tip, .t1 .tip { margin-left: 6px; vertical-align: 1px; }
.side-legal { display: flex; gap: 12px; padding: 10px 13px 0; font-size: .75rem; }
.side-legal a { color: #8D8F8A; text-decoration: none; }
.side-legal a:hover { color: var(--bone); }
.legal-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; font-size: .84rem; }
.legal-links a, .login-form a { color: var(--ruby); }
@media (max-width: 900px) { .tabbar a.on svg { color: var(--ruby); } }
.banner .grow { flex: 1; min-width: 200px; }
