/* Studio833: azul de marca, marino profundo y la línea dorada de sus láminas */
:root {
  --ink: #0B2545;
  --bg: #EDF2F8;
  --card: #FFFFFF;
  --text: #0E2240;
  --muted: #5A6F8C;
  --line: #D5DFEC;
  --accent: #2F6DB5;
  --accent-ink: #FFFFFF;
  --sel-bg: #0B2545;
  --sel-ink: #FFFFFF;
  --gold: #D6B766;
  --danger: #C23B22;
  --tag-junta: #DCC57E;
  --tag-sesion: #C4666F;
  --tag-contenido: #8C85C8;
  --s0: #8494AB;
  --s1: #C98478;
  --s2: #8C85C8;
  --s3: #5B9FAD;
  --s4: #5E9F83;
  --radius: 16px;
  --nav-h: 64px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #0E2B52;
    --bg: #07162B;
    --card: #0E2342;
    --text: #EAF1FB;
    --muted: #8FA6C6;
    --line: #1B3A63;
    --accent: #6FA8EA;
    --accent-ink: #06182F;
    --sel-bg: #6FA8EA;
    --sel-ink: #06182F;
    --danger: #FF7A5F;
    --gold: #CDB06E;
    --tag-junta: #D4BE80;
    --tag-sesion: #CF7C84;
    --tag-contenido: #A29BD6;
    --s0: #8FA1BD;
    --s1: #D08F85;
    --s2: #A29BD6;
    --s3: #6DAEBB;
    --s4: #72B096;
  }
}
:root[data-theme="dark"] {
    --ink: #0E2B52;
    --bg: #07162B;
    --card: #0E2342;
    --text: #EAF1FB;
    --muted: #8FA6C6;
    --line: #1B3A63;
    --accent: #6FA8EA;
    --accent-ink: #06182F;
    --sel-bg: #6FA8EA;
    --sel-ink: #06182F;
    --danger: #FF7A5F;
    --gold: #CDB06E;
    --tag-junta: #D4BE80;
    --tag-sesion: #CF7C84;
    --tag-contenido: #A29BD6;
    --s0: #8FA1BD;
    --s1: #D08F85;
    --s2: #A29BD6;
    --s3: #6DAEBB;
    --s4: #72B096;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 84px);
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Header: título con la línea dorada de la marca */
.top { padding: 22px 20px 6px; display: flex; align-items: flex-end; gap: 12px; }
.top h1 { margin: 0; font-size: 30px; line-height: 1.05; font-weight: 800; letter-spacing: -0.025em; }
.top h1::after { content: ""; display: block; width: 38px; height: 3px; margin-top: 9px; border-radius: 2px; background: var(--gold); }
.top .sub { color: var(--muted); font-size: 14px; margin-top: 8px; font-weight: 500; }
.back { border: 0; background: none; padding: 8px 4px 8px 0; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
.wrap { padding: 8px 16px 0; max-width: 720px; margin: 0 auto; }

/* Estado de sincronización */
.sync { position: fixed; top: calc(env(safe-area-inset-top) + 10px); right: 12px; z-index: 30; border: 0; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 9px; border-radius: 99px; background: var(--card); color: var(--muted); font-size: 12px; font-weight: 650; box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line); }
.sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--s0); }
.sync[data-s="live"]::before { background: var(--s4); }
.sync[data-s="connecting"]::before { background: var(--gold); }
.sync[data-s="offline"]::before, .sync[data-s="denied"]::before { background: var(--danger); }
.sync[hidden] { display: none; }

/* Secciones */
.sec { margin: 22px 0 8px; display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; }
.sec h2 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -0.01em; }
.sec span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.list { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.empty { padding: 22px 18px; color: var(--muted); font-size: 15px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Filas */
.row { display: flex; align-items: center; gap: 2px; padding: 4px 14px 4px 2px; min-height: 60px; background: transparent; cursor: pointer; }
.row:active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.row-main { flex: 1; min-width: 0; padding: 8px 0; }
.row-title { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.row-sub { color: var(--muted); font-size: 13px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.row-sub .late { color: var(--danger); font-weight: 650; }
.list.roomy .row { min-height: 78px; padding-top: 6px; padding-bottom: 6px; }
.list.roomy .row-main { padding: 12px 0; }
.list.roomy .row-sub { margin-top: 7px; gap: 8px 10px; }
.row-end { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.dot { width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; flex: none; padding: 0; }
.dot::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--c); box-sizing: border-box; background: transparent; }
.dot.done::before { background: var(--c) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.6L13 6.6' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/cover; }
.edot { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.edot::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.dot.mid::before { background: linear-gradient(90deg, var(--c) 50%, transparent 50%); }

.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 650; background: color-mix(in srgb, var(--c, var(--gold)) 26%, transparent); color: var(--text); }
.tag.g { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.tag.s { background: color-mix(in srgb, var(--s2) 22%, transparent); }

/* Marea: carga de la semana */
.tide { --bar-other: #6FA8EA; background: var(--ink); color: #EAF1FB; border-radius: 22px; padding: 16px 12px 12px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.tide-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px 8px; }
.tide-head b { font-size: 15px; font-weight: 700; }
.tide-head span { color: #8FA6C6; font-size: 13px; }
.day { border: 0; background: none; color: inherit; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 112px; gap: 6px; border-radius: 12px; }
.day .bar { width: 100%; max-width: 34px; border-radius: 9px 9px 4px 4px; background: #264C7E; min-height: 6px; }
.day.has .bar { background: none; }
.day .bar { display: flex; flex-direction: column-reverse; overflow: hidden; --bar-other: #6FA8EA; }
.day .bar i { display: block; min-height: 4px; }
.day.today .bar:empty { background: var(--gold); }
.tide-key { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; padding: 2px 6px 0; font-size: 12px; color: #8FA6C6; }
.tide-key span { display: inline-flex; align-items: center; gap: 5px; }
.tide-key i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.day .n { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; height: 16px; }
.day .l { font-size: 12px; color: #8FA6C6; min-height: 28px; text-align: center; line-height: 1.1; }
.day.today .l { color: var(--gold); font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: left; }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.warn b { color: var(--danger); }
button.stat { cursor: pointer; }

/* Filtros */
.search { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 14px; font-size: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 99px; font-size: 14px; font-weight: 600; min-height: 38px; }
.chip[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--sel-bg); }
.toolbar { display: flex; gap: 8px; margin-top: 10px; }
.toolbar select { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 3px; }
.seg button { border: 0; background: none; padding: 8px 12px; border-radius: 11px; font-weight: 650; font-size: 14px; min-height: 38px; }
.seg button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-ink); }

/* Calendario */
.cal { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.cal-head b { font-size: 17px; font-weight: 750; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-today { border: 1px solid color-mix(in srgb, var(--text) 35%, transparent); background: var(--card); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; min-height: 32px; }
.cal-today.on { background: var(--gold); border-color: var(--gold); color: #3A2D0A; }
.liqhint { margin: -4px 2px 10px; }
.cal-today:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn { width: 44px; height: 44px; border: 0; background: none; border-radius: 12px; display: grid; place-items: center; }
.icon-btn:active { background: var(--line); }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.grid .dow { font-size: 12px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.cell { border: 0; background: none; height: 48px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cell.out { visibility: hidden; }
.cell.today { box-shadow: inset 0 0 0 2px var(--gold); }
.cell.sel { background: var(--sel-bg); color: var(--sel-ink); }
.cell.has { color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.65), 0 1px 2px rgba(0,0,0,.5); }
.cell.has.ink { color: #1D1A10; text-shadow: none; }
.cell.sel.has { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--sel-bg); position: relative; z-index: 1; }
.cell.today.has { box-shadow: inset 0 0 0 2px var(--gold); }
.cell.today.sel.has { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 2px var(--card), 0 0 0 4px var(--sel-bg); }
.pips { display: flex; gap: 3px; height: 6px; }
.pips i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--gold)); }

/* Clientes y finanzas */
.client { display: flex; align-items: center; gap: 14px; padding: 14px; min-height: 68px; cursor: pointer; }
.avatar { width: 44px; height: 44px; border-radius: 14px; background: var(--ink); color: var(--gold); display: grid; place-items: center; font-weight: 800; flex: none; font-size: 17px; }
.money { font-weight: 700; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; text-align: left; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; }
.tile b { font-size: 17px; font-weight: 750; }
.tile span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

/* Navegación */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.nav[hidden] { display: none; }
.nav button { border: 0; background: none; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); position: relative; }
.nav button svg { width: 24px; height: 24px; }
.nav button[aria-current="page"] { color: var(--text); }
.nav button[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); z-index: 19; width: 46px; height: 46px; border-radius: 15px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(11, 37, 69, 0.3); }
.fab:active { transform: scale(0.95); }
.fab svg { width: 22px; height: 22px; }
.fab[hidden] { display: none; }

/* Hoja inferior */
.backdrop { position: fixed; inset: 0; background: rgba(4, 14, 30, 0.58); opacity: 0; transition: opacity 0.2s; z-index: 40; }
.backdrop.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92dvh; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); max-width: 720px; margin: 0 auto; }
.sheet.on { transform: none; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 10px; }
.sheet h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -0.02em; }
.sheet p { margin: 0 0 14px; color: var(--muted); }
.field { margin: 0 0 16px; }
.field > label, .field > .lbl { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.field input[type=text], .field input[type=url], .field input[type=email], .field input[type=tel], .field input[type=password], .field input[type=date], .field input[type=time], .field input[type=number], .field textarea, .field select { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px; font-size: 16px; min-height: 48px; }
.field textarea { min-height: 96px; resize: vertical; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1.5px solid var(--line); background: none; border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 14px; min-height: 40px; display: inline-flex; align-items: center; gap: 8px; }
.pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); }
.pill[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, transparent); }
.quick { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.err { color: var(--danger); font-size: 13px; margin-top: 6px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px -20px calc(-20px - env(safe-area-inset-bottom)); padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.btn { border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 700; min-height: 50px; flex: 1; }
.btn.primary { background: var(--accent); color: var(--accent-ink); flex: 2; }
.btn.primary:disabled { opacity: 0.6; }
.btn.ghost { background: var(--bg); }
.btn.danger { background: none; color: var(--danger); flex: none; padding-inline: 12px; }
.note { color: var(--muted); font-size: 13px; margin: 8px 4px 0; }

/* Conexión con el equipo */
.conn { max-width: 460px; margin: 0 auto; padding: 36px 22px 40px; }
.conn .mark { width: 72px; height: 72px; border-radius: 50%; display: block; margin-bottom: 18px; }
.conn h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.025em; line-height: 1.1; }
.conn h1::after { content: ""; display: block; width: 38px; height: 3px; margin-top: 10px; border-radius: 2px; background: var(--gold); }
.conn p { color: var(--muted); margin: 12px 0 20px; }
.conn .btn { width: 100%; margin-top: 4px; }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 650; padding: 10px 0; min-height: 44px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 84px); z-index: 60; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; max-width: 520px; margin: 0 auto; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3); }
.toast span { flex: 1; font-size: 14px; }
.toast button { border: 0; background: none; color: var(--gold); font-weight: 750; padding: 8px; min-height: 40px; }
.shake { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Bloqueo con huella */
.lock { position: fixed; inset: 0; z-index: 9999; background: #0B2545; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.lock img { border-radius: 50%; }
.lock h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.lock h1::after { content: ""; display: block; width: 38px; height: 3px; margin: 10px auto 0; border-radius: 2px; background: var(--gold); }
.lock-msg { margin: 0 0 8px; max-width: 280px; color: rgba(255, 255, 255, .78); }
.lock .btn.primary { width: 100%; max-width: 300px; background: #fff; color: #0B2545; }
.lock .linkbtn { color: #9CC4F2; max-width: 300px; }
.locked #view, .locked #nav, .locked #fab, .locked #sync { visibility: hidden; }

/* Logos y galería de clientes */
.logo { display: block; flex: none; object-fit: contain; background: #fff; border-radius: 22%; border: 1px solid var(--line); }
.avatar.none { background: var(--line); color: var(--muted); }
.avatar { border-radius: 22%; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-top: 12px; }
.gtile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 132px; }
.gtile:active { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.gimg { position: relative; }
.gbadge { position: absolute; top: -6px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--gold); color: #0B2545; font-size: 12px; font-weight: 800; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.gname { font-size: 13px; font-weight: 650; line-height: 1.2; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chead { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.chead .btn { flex: 1; }
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-row .quick { flex: 1; }

/* Tarea compacta: el detalle aparece al tocarla */
.trow + .trow { border-top: 1px solid var(--line); }
.detail { padding: 2px 16px 14px 56px; }
.detail[hidden] { display: none; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta span { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--text); font-weight: 600; white-space: nowrap; }
.meta .st { background: color-mix(in srgb, var(--c) 22%, transparent); }
.meta .none { background: transparent; color: var(--muted); font-weight: 500; border: 1px dashed var(--line); }
.meta .late { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.chipline { margin-top: 5px; gap: 5px; }
.meta .collab { max-width: 100%; white-space: normal; overflow-wrap: anywhere; border-radius: 12px; line-height: 1.3; padding-top: 2px; padding-bottom: 2px; }
.detail .notes { margin: 10px 0 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.btn.small { flex: none; min-height: 40px; padding: 8px 14px; margin-top: 10px; font-size: 14px; }

/* Controles nuevos */
.seg.wide { display: flex; margin: 10px 0 0; }
.seg.wide button { flex: 1; }
.chip .cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 7px; }
.addcat { display: flex; gap: 8px; margin-top: 10px; }
.addcat input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 16px; min-height: 44px; }

/* Presupuesto */
.bnav { margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 8px; }
.bmonth { display: flex; flex-direction: column; align-items: center; }
.bmonth span { font-size: 12px; color: var(--muted); }
.sumcard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 6px 16px; margin-top: 12px; }
.sline { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; color: var(--muted); font-size: 14px; }
.sline + .sline { border-top: 1px solid var(--line); }
.sline b { color: var(--text); font-size: 16px; }
.sline.big { color: var(--text); font-weight: 650; }
.sline.big b { font-size: 24px; letter-spacing: -0.02em; }
.sline.strong { color: var(--text); font-weight: 650; }
.sline.strong b { color: var(--accent); }
.stat .small { display: block; font-size: 12px; margin-top: 2px; }
.calcbox { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--muted); line-height: 1.5; font-variant-numeric: tabular-nums; }
.share-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.share-row label { font-weight: 650; white-space: nowrap; }
.share-row input { width: 84px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px; font-size: 16px; min-height: 44px; }
.field select { width: 100%; }

/* Cobro: montos por socio, interruptor de IVA y total */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 6px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card, transparent); }
.switch-row .lbl { margin: 0; }
.switch { flex: none; width: 52px; height: 30px; border-radius: 99px; border: 0; padding: 3px; background: var(--line); cursor: pointer; transition: background .15s; }
.switch .knob { display: block; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch[aria-checked=true] { background: var(--accent); }
.switch[aria-checked=true] .knob { transform: translateX(22px); }
.switch:focus-visible { outline: 3px solid var(--gold, #D6B766); outline-offset: 2px; }
.calcbox .crow { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.calcbox .crow.big { font-size: 20px; font-weight: 750; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.calcbox .csub { margin-top: 6px; font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .switch, .switch .knob { transition: none; } }

.totalbar { position: sticky; top: 0; z-index: 2; box-shadow: 0 -8px 0 0 var(--card); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--navy, #0B2545); color: #fff; font-size: 13.5px; }
.totalbar strong { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .totalbar { background: #123A6B; } }
:root[data-theme="dark"] .totalbar { background: #123A6B; }

/* Clientes como lista de contactos */
.cview-seg { margin-top: 12px; display: flex; }
.cview-seg .seg { width: 100%; }
.cview-seg .seg button { flex: 1; }
.contacts { margin-top: 12px; }
.contacts .letter { padding: 6px 16px; font-size: 13px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); border-top: 1px solid var(--line); }
.contacts .letter:first-child { border-top: 0; border-radius: 14px 14px 0 0; }
.contacts .contact { padding-left: 14px; border-top: 1px solid var(--line); }
.contacts .letter + .contact { border-top: 0; }
.contact .chev { color: var(--muted); display: inline-flex; margin-left: 4px; }
.gbadge.inline { position: static; flex: none; }

.row.paid .row-title { color: var(--muted); }
.row.paid .money { opacity: .6; }
.calcbox { margin-bottom: 14px; }

/* Selector «Agregar para este cliente» */
.picklist { display: grid; gap: 10px; margin: 6px 0 14px; }
.pickrow { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.pickrow b { font-size: 17px; }
.pickrow span { font-size: 13px; color: var(--muted); }
.pickrow:active { background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.field[hidden] { display: none; }
.quick .chip[hidden] { display: none; }

.cobrobox { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-align: left; cursor: pointer; color: var(--text); }
.cobrobox .cb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cobrobox .cb-lbl { color: var(--muted); font-size: 13px; }
.cobrobox b { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cobrobox b small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.cobrobox .cb-next { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cobrobox.warn .cb-next { color: var(--danger); }
.cobrobox .chev { color: var(--muted); display: flex; }
.row-end .when { font-weight: 700; color: var(--text); }

/* ---- Juntas y minutas ---- */
.chip.go { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.meetbox { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rec { position: fixed; inset: 0; z-index: 50; background: var(--bg); color: var(--text); display: flex; flex-direction: column; gap: 10px; padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 14px); }
.rechead { display: flex; flex-direction: column; gap: 4px; }
.rectitle { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.recsub { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.rec[data-state="listening"] .recdot { background: var(--tag-sesion); animation: recpulse 1.6s ease-in-out infinite; }
.rec[data-state="retry"] .recdot { background: var(--gold); }
@keyframes recpulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .rec[data-state="listening"] .recdot { animation: none; } }
.rectime { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.recnote { font-size: 13px; color: var(--muted); }
.recwarn { background: color-mix(in srgb, var(--danger) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line)); color: var(--text); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.recwarn[hidden] { display: none; }
.rectext { flex: 1; min-height: 120px; width: 100%; resize: none; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); padding: 12px; font-size: 16px; line-height: 1.5; }
.recpartial { min-height: 22px; color: var(--muted); font-style: italic; font-size: 15px; }
.recbar { display: flex; gap: 10px; }
.rec[hidden] { display: none; }
.rec.aud .recnote { flex: 1; line-height: 1.5; }
.reclevel { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.reclevel i { display: block; height: 100%; width: 0; background: var(--tag-sesion); border-radius: 8px; transition: width .35s ease-out; }
.rec.aud[data-state="paused"] .reclevel i, .rec.aud[data-state="off"] .reclevel i { background: var(--muted); }
.rec.aud[data-state="off"] .recdot { background: var(--danger); }
.recmini { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 30; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 8px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px 8px 14px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22); }
.recmini[hidden] { display: none; }
.recmini .recdot { background: var(--tag-sesion); animation: recpulse 1.6s ease-in-out infinite; }
.recmini[data-state="paused"] .recdot, .recmini[data-state="off"] .recdot { background: var(--muted); animation: none; }
.recmini-t { flex: 1; font-size: 15px; font-variant-numeric: tabular-nums; }
.recmini-t b { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .recmini .recdot { animation: none; } }
.recbar .btn { flex: 1; }
.mn h3 { margin: 16px 0 6px; font-size: 15px; letter-spacing: 0; }
.mn-meta { color: var(--muted); font-size: 14px; }
.mn-sum { color: var(--text); font-size: 16px; line-height: 1.5; margin: 0; }
.sheet .mn ul { margin: 0; padding-left: 20px; line-height: 1.5; }
.mn li { margin: 3px 0; }
.mn-task { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.mn-tx { min-width: 0; line-height: 1.35; }
.mn-sub { color: var(--muted); font-size: 13px; }
.mn-ok { color: var(--s4); font-size: 13px; font-weight: 650; flex: none; }
.mn-busy { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 14px 0; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
.mn-tr { margin-top: 14px; }
.mn-tr summary { cursor: pointer; font-weight: 650; padding: 8px 0; }
.mn-tr pre { white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto; background: var(--bg); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.5; margin: 6px 0 0; }

.btn.big { flex: 1 1 100%; order: -1; min-height: 58px; font-size: 18px; border-radius: 16px; }
.btn.big.go { background: var(--gold); color: #1D1A10; }
.btn.big.ghost { min-height: 50px; font-size: 16px; }

.jobbar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 29; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px 8px 14px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22); }
.jobbar[data-err="1"] { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.jobbar-t { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-x { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex: none; }
body:has(.recmini:not([hidden])) .jobbar { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 70px); }
body:has(.recmini:not([hidden]), .jobbar) .fab { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 74px); }
body:has(.recmini:not([hidden])):has(.jobbar) .fab { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 136px); }

.paidbox { margin-top: 22px; }
.paidbox > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 700; font-size: 16px; }
.paidbox > summary::-webkit-details-marker { display: none; }
.paidbox > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -3px 2px 0 4px; flex: none; transition: transform .2s; }
.paidbox[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.paidbox > summary .paidn { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.paidbox[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.paidbox > .list { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }

/* Plan de rodaje */
.rodaje { margin-top: 18px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.rod-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rod-h h2 { margin: 0; font-size: 17px; }
.rod-h .btn { flex: none; padding: 8px 18px; min-height: 0; }
.rod-link { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.rod-link b { color: var(--accent, var(--text)); }
.rod-link span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rod-txt { margin-top: 10px; }
.rod-txt > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.rod-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; padding: 10px 12px; margin-top: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; max-height: 360px; overflow: auto; }
button.rod-link { width: 100%; text-align: left; font: inherit; cursor: pointer; margin-bottom: 8px; }
.rod-ses b { color: var(--s4); }
.rod-add { width: 100%; justify-content: center; margin-bottom: 4px; }
.rod-link + .rod-link, .rod-ses + .rod-link { margin-top: 0; }

/* Con una hoja abierta, lo de atrás no se desplaza */
html.sheet-open, html.sheet-open body { overflow: hidden; overscroll-behavior: none; }
.sheet { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.backdrop { touch-action: none; }
.row-sub .cn + .cn::before { content: "·"; margin-right: 10px; color: var(--muted); }

/* Formulario de tareas: tarjetas por tema y emoji */
.pill[data-e]::before { content: attr(data-e); font-size: 16px; line-height: 1; }
.pill[data-e][aria-pressed="true"] { border-color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 22%, transparent); }
.field > label[data-e]::before, .field > .lbl[data-e]::before { content: attr(data-e); margin-right: 7px; font-size: 16px; }
.tform .fcard { background: color-mix(in srgb, var(--bg) 45%, var(--card)); border: 1px solid var(--line); border-radius: 18px; padding: 16px 14px 2px; margin: 0 0 12px; }
.tform .fcard[hidden] { display: none; }
.tform .fcard > .field:last-child { margin-bottom: 14px; }
.tform .field > label, .tform .field > .lbl { font-size: 14px; color: var(--text); opacity: .8; display: flex; align-items: center; }
.tform .field > label[data-e]:first-child { letter-spacing: 0; }
.tform input[type=text] { font-size: 18px; font-weight: 650; }
.tform .pills { gap: 8px; }
.tform .pill { min-height: 42px; padding: 8px 14px 8px 12px; gap: 7px; }
.tform .hint { margin-top: 8px; }

.rod-part { margin-top: 12px; }
.rod-part:first-of-type { margin-top: 4px; }
.rod-sub { font-weight: 700; font-size: 14px; margin: 0 0 8px; opacity: .85; }
.rod-pack b { display: block; font-size: 17px; margin-bottom: 6px; }
.rod-incl { max-height: none; }

.emopick { display: flex; flex-wrap: wrap; gap: 6px; }
.emo-b { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 22px; line-height: 1; }
.emo-b:active { background: color-mix(in srgb, var(--accent) 25%, var(--bg)); }

.addcl { width: 100%; margin: 18px 0 8px; }

.rod-body { max-height: 420px; }

.rod-linkrow { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.rod-linkrow input { flex: 1; min-width: 0; }
.rod-txtbtn { width: 100%; justify-content: center; margin: 0 0 4px; }
.rod-txtin { margin: 4px 0 0; }
.rod-save { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.rod-btns { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.rod-btns .chip { width: 100%; justify-content: center; }
.rod-sel { width: 100%; margin: 0 0 8px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px; font-size: 16px; min-height: 48px; }
.rod-sel[hidden] { display: none; }

/* Calendario de contenido del cliente: un desplegable por mes con etiqueta de color */
.ccwrap { display: flex; flex-direction: column; gap: 10px; }
.ccm { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--mc); border-radius: 18px; overflow: hidden; }
.ccm > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; min-height: 52px; }
.ccm > summary::-webkit-details-marker { display: none; }
.ccm > summary::after { content: '▾'; color: var(--muted, #8a96ad); font-size: 16px; margin-left: 2px; transition: transform .15s; }
.ccm:not([open]) > summary::after { transform: rotate(-90deg); }
.ccm-tag { background: var(--mc); color: #fff; font-weight: 750; font-size: 15px; padding: 6px 12px; border-radius: 999px; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.ccm-n { margin-left: auto; font-size: 13px; color: var(--muted, #8a96ad); }
.ccm-body { padding: 0 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.ccm-go { align-self: flex-start; }
.ccm-und { margin-top: 4px; }
.ccm-undh { font-size: 13px; font-weight: 650; color: var(--muted, #8a96ad); margin: 4px 4px 8px; }

/* Leyenda del calendario de contenido */
.cclegend { display: flex; gap: 16px; justify-content: center; margin: 8px 0 0; font-size: 13px; color: var(--muted, #8a96ad); }
.cclegend span { display: inline-flex; align-items: center; gap: 6px; }
.cclegend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* Archivo (papelera) */
.arch-row { padding-left: 14px; cursor: default; }
.arch-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.arch-rec { font-weight: 700; }
.arch-del { color: var(--danger, #c0463f); }
.chips + .list { margin-top: 12px; }

/* iPhone (Safari): que la hoja no se deslice hacia los lados. Los campos de fecha y hora de iOS traen un ancho propio
   que empuja el contenido más allá de la pantalla; aquí se les quita y se oculta el desplazamiento horizontal. */
.sheet { overflow-x: hidden; touch-action: pan-y; }
.sheet .field input, .sheet .field select, .sheet .field textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
.field input[type=date], .field input[type=time] { -webkit-appearance: none; appearance: none; display: block; text-align: left; line-height: 1.3; }
.field input[type=date]::-webkit-date-and-time-value, .field input[type=time]::-webkit-date-and-time-value { text-align: left; min-height: 1.3em; margin: 0; }
.field input[type=date]::-webkit-datetime-edit, .field input[type=time]::-webkit-datetime-edit { padding: 0; }
.sheet .quick > *, .sheet .pills > * { min-width: 0; }

/* Apariencia: claro, oscuro o el del teléfono */
.themebtns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Campañas: pasos con plantilla */
.camp-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.camp-sub { color: var(--muted); font-size: 14px; }
.camp-prog { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.camp-prog .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.camp-prog .bar i { display: block; height: 100%; border-radius: 99px; background: var(--s4); }
.camp-ph { display: flex; align-items: center; gap: 8px; margin: 18px 0 2px; font-weight: 700; font-size: 15px; }
.camp-ph i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.camp-ph span { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 13px; }
.step { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.step .chk { position: relative; flex: none; width: 26px; height: 26px; margin-top: 1px; padding: 0; border-radius: 50%; border: 2px solid var(--muted); background: transparent; color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.step .chk::before { content: ''; position: absolute; inset: -9px; }
.step .chk[aria-pressed="true"] { background: var(--s4); border-color: var(--s4); }
.step .chk[aria-pressed="true"]::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.step-main { flex: 1; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.step-t { display: block; font-weight: 600; overflow-wrap: anywhere; }
.step.done .step-t { color: var(--muted); text-decoration: line-through; }
.step-m { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.step-m span { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--text); font-weight: 600; white-space: nowrap; }
.step-m .none { background: transparent; color: var(--muted); font-weight: 500; border: 1px dashed var(--line); }
.step-m .late { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }

/* Etiqueta de colaboración al lado del concepto (en la misma línea que «Reseña») */
.row-sub .collab { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 12px; font-weight: 600; line-height: 1.3; padding: 2px 8px; border-radius: 12px; color: var(--text); background: color-mix(in srgb, var(--c) 22%, transparent); }
.pickbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; }
.pickbar span { flex: 1; color: var(--muted); font-size: 14px; font-weight: 600; }
.camp-ph .chip { margin-left: auto; padding: 4px 10px; font-size: 12px; }
.camp-ph .chip + span { margin-left: 0; }
.step.pick .step-main { cursor: pointer; }
.step.pick.off .step-t { opacity: .5; text-decoration: line-through; }
.step.pick .chk[aria-pressed="false"] { border-radius: 8px; }
.step.pick .chk[aria-pressed="true"] { border-radius: 8px; }
.step.none-yet { align-items: center; justify-content: space-between; }
.step.none-yet .chip { padding: 4px 10px; font-size: 12px; min-height: 0; }
.camp .pickbar .chip { padding: 6px 14px; min-height: 0; }
.camp-ph .chip { min-height: 0; }
/* Hoja de campaña: acciones en una sola fila a lo ancho (como la barra de abajo) para no tapar la lista */
.sheet-actions.row { flex-wrap: nowrap; gap: 8px; padding-top: 10px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.sheet-actions.row .btn, .sheet-actions.row .btn.big { flex: 1 1 0; min-width: 0; order: 0; min-height: 46px; padding: 8px 6px; font-size: 14px; border-radius: 12px; }
.sheet-actions.row .btn.big.go { flex: 1.5 1 0; }
/* Campaña: letra más pequeña para ver más pasos a la vez */
.camp { font-size: 14px; }
.camp-sub { font-size: 12.5px; }
.camp-prog { font-size: 12.5px; margin-bottom: 2px; }
.camp-prog .bar { height: 6px; }
.camp-head { margin-bottom: 8px; }
.camp-ph { font-size: 13.5px; margin-top: 12px; }
.camp-ph span { font-size: 12px; }
.camp-ph .chip { padding: 3px 9px; font-size: 11.5px; }
.step { gap: 10px; padding: 7px 0; }
.step .chk { width: 22px; height: 22px; font-size: 13px; }
.step-t { font-size: 14.5px; line-height: 1.3; }
.step-m { margin-top: 3px; gap: 4px; }
.step-m span { font-size: 10.5px; padding: 0 7px; }
.step.none-yet .chip { padding: 3px 9px; font-size: 11.5px; }
.camp .pickbar .chip { padding: 4px 12px; font-size: 13px; }
.pickbar span { font-size: 12.5px; }
.camp .picklist .pickrow b { font-size: 15px; }
.sheet-actions.row .btn, .sheet-actions.row .btn.big { min-height: 42px; font-size: 13px; }

/* Proyectos (Tampico Mágico) y Agenda › Próximos */
.cell.win { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.cstrip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 2px 0; }
.cstrip-l { font-size: 13px; font-weight: 650; color: var(--muted); margin-right: 2px; }
.cols > div > .seg.wide:first-child { margin-top: 14px; }
.prox-top { margin: 14px 0 4px; }
.pov { background: var(--ink); color: #EAF1FB; border-radius: 22px; padding: 16px 16px 14px; margin-top: 12px; }
.pov-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pov-head b { font-size: 15px; font-weight: 700; }
.pov-head span { color: #8FA6C6; font-size: 13px; }
.pov-big { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 4px 0 10px; line-height: 1.1; }
.pov-big small { font-size: 15px; font-weight: 650; color: #8FA6C6; margin-left: 8px; letter-spacing: 0; }
.pov .pbar { background: rgba(255,255,255,.16); }
.pov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.pov-grid div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pov-grid span { color: #8FA6C6; font-size: 12px; }
.pov-grid b { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pov-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.14); color: #8FA6C6; font-size: 12.5px; }
.pbar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 24%, transparent); overflow: hidden; margin-top: 8px; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--gold)); min-width: 0; }
.pdetail { padding-left: 14px; padding-right: 14px; }
.prow { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 11px 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font-size: 14px; }
.prow span { color: var(--muted); }
.prow b { font-variant-numeric: tabular-nums; }
.dgrid-wrap { padding: 0 14px 12px; }
.dgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dchip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 2px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 55%, var(--line)); background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--text); text-align: center; }
.dchip span { font-size: 11px; color: var(--muted); line-height: 1.15; }
.dchip b { font-size: 12px; font-weight: 700; line-height: 1.15; }
.pmini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.pmini-t { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.pmini-t b { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 360px) { .dchip span { font-size: 10px; } .dchip b { font-size: 11px; } }

.contactline { align-items: center; gap: 4px 10px; }
.contactline .cname { color: var(--text); font-weight: 650; }
.cbtns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.cbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none; border: 1px solid transparent; }
.cbtn.call { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.cbtn.wa { background: #1FA855; color: #fff; }
.cbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cbtns.sm .cbtn { min-height: 28px; padding: 2px 10px; font-size: 12px; }
.contactbox { margin-top: 8px; }
.contactbox .cbrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.contactbox .cname { font-weight: 650; color: var(--text); font-size: 14px; }

.htmlfull { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
html.html-open, html.html-open body { overflow: hidden; }
.hf-bar { display: flex; align-items: center; gap: 12px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px 8px; background: var(--card); border-bottom: 1px solid var(--line); flex: none; }
.hf-close { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px 0 8px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.hf-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hf-t { min-width: 0; display: flex; flex-direction: column; }
.hf-t b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-t span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-msg { padding: 16px; color: var(--muted); }
.htmlview { display: block; flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: #fff; }
.shootdoc { align-items: center; }
.shootdoc .chip.go { background: var(--gold); border-color: var(--gold); color: #1D1A10; font-size: 17px; font-weight: 750; min-height: 50px; padding: 10px 22px; }
.rod-doc { margin-top: 4px; }
/* ===== Versión para PC y laptop (≥ 1024 px): barra lateral, dos columnas y ventanas centradas.
   En el celular nada de esto se aplica. ===== */
.cols, .colL, .colR { display: block; }
@media (min-width: 1024px) {
  :root { --nav-h: 0px; --side: 236px; }
  body { --cw: 940px; padding-bottom: 110px; }
  body[data-v="hoy"], body[data-v="tareas"], body[data-v="agenda"], body[data-v="agenda-contenido"], body[data-v="clientes"], body[data-v="clientes-ficha"], body[data-v="clientes-proy"] { --cw: 1180px; }
  body:has(.nav:not([hidden])) { padding-left: var(--side); }

  /* Barra lateral */
  .nav { top: 0; right: auto; width: var(--side); display: flex; flex-direction: column; gap: 4px; padding: 28px 14px 20px; border-top: 0; border-right: 1px solid var(--line); overflow-y: auto; }
  .nav::before { content: "Studio833"; display: block; padding: 0 14px 24px; margin-bottom: 8px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); background: linear-gradient(var(--gold), var(--gold)) 14px calc(100% - 10px) / 38px 3px no-repeat; }
  .nav::after { content: "Atajos\A N · crear nuevo\A / · buscar tarea\A Esc · cerrar ventana"; white-space: pre-line; margin-top: auto; padding: 14px; font-size: 12px; line-height: 1.7; color: var(--muted); }
  .nav button { flex: none; flex-direction: row; justify-content: flex-start; height: 46px; padding: 0 14px; gap: 12px; font-size: 15px; border-radius: 12px; text-align: left; }
  .nav button[aria-current="page"] { background: var(--bg); }
  .nav button[aria-current="page"]::before { top: 11px; left: 0; width: 3px; height: 24px; border-radius: 0 3px 3px 0; }
  .nav button:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text); }
  .nav button[aria-current="page"]:hover { background: var(--bg); }

  /* Encabezado y contenido alineados al mismo ancho */
  .top { max-width: var(--cw); margin: 0 auto 0 0; padding: 34px 24px 6px; box-sizing: border-box; }
  .top h1 { font-size: 34px; }
  .wrap { max-width: var(--cw); margin: 0 auto 0 0; padding: 10px 24px 0; box-sizing: border-box; }
  .cview-seg { max-width: 320px; }
  .search { max-width: 520px; }
  .toolbar select { max-width: 320px; }
  .chead { justify-content: flex-start; gap: 18px; }
  .chead .btn { flex: 0 0 auto; }
  .chips { padding-bottom: 8px; }
  .sync { top: 18px; right: 24px; }
  .seg.wide { max-width: 360px; }

  /* Dos columnas */
  .cols { display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; gap: 0 32px; align-items: start; }
  .colL, .colR { display: block; min-width: 0; }
  .cols > div > .sec:first-child { margin-top: 4px; }
  body[data-v="agenda"] .colL, body[data-v="agenda-contenido"] .colL { position: sticky; top: 16px; }

  /* Listas en dos columnas (Tareas y Clientes en lista) */
  body[data-v="tareas"] .list, body[data-v="clientes"] .list.contacts, body[data-v="clientes-proy"] .list { display: grid; grid-template-columns: 1fr 1fr; }
  body[data-v="tareas"] .list > *, body[data-v="clientes"] .list.contacts > *, body[data-v="clientes-proy"] .list > * { border-top: 0; box-shadow: -1px -1px 0 var(--line); }
  body[data-v="clientes-proy"] .pov { max-width: 760px; }
  body[data-v="clientes-proy"] .pmini, body[data-v="clientes-proy"] .sumcard { max-width: 760px; }
  body[data-v="clientes"] .list.contacts > .letter { grid-column: 1 / -1; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .stats { gap: 12px; }

  /* Cursor y pasar el mouse */
  .row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
  .gtile:hover, .tile:hover, .stat:hover, .cobrobox:hover { border-color: var(--accent); }
  .cell:hover { filter: brightness(1.08); outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -2px; }
  .chip:hover, .pill:hover { filter: brightness(0.96); }
  .btn:hover { filter: brightness(1.06); }

  /* Botón de crear: con su nombre, abajo a la derecha */
  .fab { right: 32px; bottom: 84px; width: auto; height: 50px; padding: 0 22px 0 16px; border-radius: 16px; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
  .fab::after { content: attr(aria-label); font-size: 15px; }
  .fab:hover { filter: brightness(1.08); }

  /* Avisos y barras flotantes respetan la barra lateral */
  .toast { left: calc(var(--side) + 24px); right: auto; width: min(520px, calc(100vw - var(--side) - 48px)); bottom: 84px; }
  .recmini, .jobbar { left: calc(var(--side) + 12px); }
  .rec { padding-left: max(16px, calc(50vw - 380px)); padding-right: max(16px, calc(50vw - 380px)); }

  /* Las hojas se vuelven ventanas centradas */
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; margin: 0; width: min(700px, calc(100vw - 48px)); max-width: none; max-height: min(94vh, 1200px); border-radius: 20px; padding: 24px 28px 24px; transform: translate(-50%, -46%) scale(0.98); opacity: 0; transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s; box-shadow: 0 30px 80px rgba(2, 10, 24, 0.45); }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
  .sheet-actions { margin: 8px -28px -24px; padding: 14px 28px 18px; bottom: -24px; }
  .sheet-actions.row { padding-bottom: 14px; }
}
/* La hoja de una campaña (lista de pasos) ocupa casi toda la altura de la pantalla en PC */
@media (min-width: 1024px) {
  .sheet:has(.camp) { width: min(860px, calc(100vw - 48px)); min-height: min(90vh, 1000px); display: flex; flex-direction: column; }
  .sheet:has(.camp) .sheet-actions { margin-top: auto; }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) { .sheet { transition: none; } }
@media (min-width: 1024px) and (max-width: 1239px) { .cols { grid-template-columns: minmax(320px, 5fr) 6fr; gap: 0 24px; } }

/* Sesiones: etiqueta de confirmación (rojo = sin confirmar, verde = confirmada) */
.conf { display: inline-block; border: 0; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; line-height: 1.5; font-family: inherit; }

.conf.no { background: #C23B22; }
.conf.yes { background: #2E8B57; }
.conf.maybe { background: var(--gold); color: #3A2D0A; }
.rod-ses b .conf { margin-left: 2px; }

/* Finanzas: tres pestañas, balance entre socios y contabilidad */
.seg3 button { padding-left: 6px; padding-right: 6px; font-size: 13.5px; }
.balcard { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.bal-h { font-weight: 750; font-size: 16px; margin-bottom: 8px; }
.bal-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.bal-h + .bal-row { border-top: 0; }
.bal-n { flex: 1; font-weight: 650; }
.bal-row b { font-size: 20px; font-variant-numeric: tabular-nums; }
.bal-t { width: 66px; text-align: right; color: var(--muted); font-size: 13px; }
.bal-row.pos b { color: #2E8B57; }
.bal-row.neg b { color: var(--danger); }
.bal-sum { margin-top: 8px; padding: 9px 12px; border-radius: 12px; background: var(--bg); font-weight: 650; font-size: 14.5px; }
.balcard .hint { margin-top: 8px; }
.balcard .hint.warn { color: var(--danger); }
.balcard .paidbox { margin-top: 12px; }

/* Barra de publicacion del proyecto (100 planes) */
.pubbar{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px 16px;margin:0 0 14px}
.pubbar-t{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.pubbar-t b{font-size:15px}
.hint.ok{color:var(--s4)}
.hint.warn{color:var(--gold)}
