@font-face {
  font-family: "Bricolage";
  src: url("/assets/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
/* Mismos colores y tipografía que la web pública (site.css) */
:root {
  --bg: #fffaf6;
  --surface: #ffffff;
  --surface-2: #f8f0ea;
  --border: #efe5dd;
  --text: #16120f;
  --muted: #73665d;
  --primary: #d9480f;
  --accent-2: #ff9f43;
  --primary-text: #ffffff;
  --danger: #d64545;
  --warn: #e08a1e;
  --ok: #2e9d5b;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(60 25 5 / .04);
  --lift: 0 18px 40px -18px rgb(120 40 0 / .35), 0 2px 6px rgb(0 0 0 / .05);
  --display: "Bricolage", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120e0b;
    --surface: #1e1814;
    --surface-2: #2a211b;
    --border: #352a22;
    --text: #f3ede8;
    --muted: #a8998d;
    --primary: #ff8a4c;
    --primary-text: #1d1206;
    --shadow: none;
    --lift: 0 18px 40px -18px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h1 a.muted { color: var(--muted); }
h2 { font-size: 1rem; margin: 0 0 .75rem; }
h2 + h2, .list + h2 { margin-top: 1.25rem; }
.muted { color: var(--muted); }
small { font-size: .82em; }
code { background: var(--surface-2); padding: 0 .3em; border-radius: 4px; }

/* ---------- Barra superior ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: .6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; color: var(--text); }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a { padding: .35rem .7rem; border-radius: 6px; color: var(--muted); }
.topbar nav a:hover { background: var(--surface-2); text-decoration: none; }
.topbar nav a.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.timer-pill {
  margin-left: auto; display: flex; align-items: center; gap: .5rem;
  background: var(--surface-2); padding: .25rem .35rem .25rem .75rem; border-radius: 99px;
}
.timer-pill a { color: var(--text); max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-pill .dot { animation: pulse 1.5s infinite; }
.elapsed { font-variant-numeric: tabular-nums; font-weight: 600; }
@keyframes pulse { 50% { opacity: .3; } }

main { padding: 1.25rem; max-width: 1400px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.flash { background: var(--surface); border-left: 4px solid var(--ok); padding: .6rem 1rem; border-radius: 6px; box-shadow: var(--shadow); }
.alert { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); padding: .5rem .75rem; border-radius: 6px; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.task-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .task-layout { grid-template-columns: 1fr; } }

.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: var(--c, var(--primary)); margin-right: .45rem; flex: none; }
.dot.big { width: .9rem; height: .9rem; }

.btn {
  display: inline-flex; align-items: center; gap: .35rem; font: inherit; cursor: pointer;
  padding: .45rem .9rem; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.small { padding: .2rem .55rem; font-size: .85rem; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: .1rem .3rem; }
.link-btn:hover { color: var(--danger); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 7px; padding: .45rem .6rem; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); border-color: var(--primary); }
input[type=color] { padding: .15rem; height: 2.3rem; width: 4rem; }
textarea { width: 100%; resize: vertical; }
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label, .form-row label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
.form label > input, .form label > select, .form label > textarea { color: var(--text); font-size: .95rem; }
.form-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; }
.form-row > label { flex: 1 1 8rem; }
.form-row.compact { margin-bottom: .75rem; }
.form-row.compact input[name=note] { flex: 1 1 10rem; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.hint { font-size: .82rem; margin: 0; }
.danger-zone { margin-top: 1rem; text-align: right; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; color: var(--muted); font-size: .85rem; box-shadow: var(--shadow); }
.stat span { display: block; font-size: 1.5rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat.warn span { color: var(--danger); }
a.stat { text-decoration: none; }
a.stat:hover { border-color: var(--primary); }
.stat.ok span { color: var(--ok); }
.invoice-toggle { font: inherit; font-size: .8rem; padding: .2rem .6rem; border-radius: 99px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.invoice-toggle:hover { border-color: var(--primary); color: var(--text); }
.invoice-toggle.is-invoiced { background: color-mix(in srgb, var(--ok) 15%, transparent); border-color: transparent; color: var(--ok); font-weight: 600; }
.invoice-toggle small { font-weight: 400; opacity: .8; }
.stat-split { display: flex; gap: 1.5rem; text-decoration: none; }
.stat-split:hover { border-color: var(--primary); }
.stat-split span { display: flex; flex-direction: column; font-size: inherit; font-weight: inherit; color: var(--muted); }
.stat-split b { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.stat-split span:last-child b { color: var(--primary); }
.month-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.task-line a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-line small { color: var(--muted); }
.project-line a { flex: 0 0 40%; display: flex; align-items: center; color: var(--text); }
.progress { flex: 1; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--c); }
.entry > :nth-child(3) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.entry a { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.due { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.due.late { color: var(--danger); font-weight: 600; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; }
td:nth-child(4) { white-space: normal; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.dim td { opacity: .55; }
.badge { font-size: .78rem; padding: .1rem .5rem; border-radius: 99px; background: var(--surface-2); }
.badge.activo { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.pausado { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

.comment { border-bottom: 1px solid var(--border); padding: .4rem 0; }
.comment p { margin: .2rem 0 .3rem; overflow-wrap: anywhere; }
.comment-head { display: flex; justify-content: space-between; align-items: center; }
.settings summary { cursor: pointer; font-weight: 600; }
.settings form { margin-top: .9rem; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: .9rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.column { background: var(--surface-2); border-radius: var(--radius); padding: .6rem; border: 2px solid transparent; }
.column.over { border-color: var(--primary); }
.column header { font-weight: 600; font-size: .9rem; padding: .2rem .3rem .6rem; display: flex; justify-content: space-between; }
.count { color: var(--muted); font-weight: 400; }
.cards { display: flex; flex-direction: column; gap: .5rem; min-height: 2rem; }
.task-card {
  display: flex; flex-direction: column; gap: .3rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c);
  border-radius: 8px; padding: .55rem .7rem; box-shadow: var(--shadow); cursor: grab;
}
.task-card:hover { border-color: var(--primary); border-left-color: var(--c); }
.task-card.dragging { opacity: .45; }
.task-card .title { font-weight: 500; overflow-wrap: anywhere; color: var(--text); }
.task-card .title:hover { color: var(--primary); }
.task-card.prio-2 .title::before { content: "▲ "; color: var(--danger); font-size: .8em; }
.task-card.prio-0 { opacity: .8; }
.task-card .proj { color: var(--muted); font-size: .75rem; }
.task-card .meta { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.column[data-status=hecho] .task-card .title { text-decoration: line-through; color: var(--muted); }
.status-switch { display: flex; gap: 3px; margin-top: .15rem; }
.status-switch button {
  flex: 1; font: inherit; font-size: .72rem; padding: .2rem .25rem; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 5px; background: transparent; color: var(--muted);
}
.status-switch button:hover { background: var(--surface-2); color: var(--text); }
.status-switch button.active { cursor: default; color: #fff; font-weight: 600; border-color: transparent; }
.status-switch .st-pendiente.active { background: var(--muted); }
.status-switch .st-en_curso.active { background: var(--warn); }
.status-switch .st-hecho.active { background: var(--ok); }
.quick-add { margin-top: .5rem; display: flex; flex-direction: column; gap: .35rem; }
.quick-add input, .quick-add select { width: 100%; background: transparent; border-style: dashed; }
.quick-add input:focus { background: var(--surface); border-style: solid; }

/* ---------- Calendario ---------- */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-head { background: var(--surface-2); padding: .4rem; font-size: .8rem; font-weight: 600; text-align: center; color: var(--muted); }
.cal-day { background: var(--surface); min-height: 110px; padding: .3rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-day.empty { background: var(--bg); }
.cal-day.past { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.cal-day.today .cal-num { color: var(--primary); font-weight: 700; }
.cal-num { font-size: .82rem; display: flex; justify-content: space-between; color: var(--muted); }
.cal-num small { color: var(--ok); }
.cal-task {
  font-size: .78rem; padding: .1rem .35rem; border-radius: 4px; color: var(--text);
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-left: 3px solid var(--c);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-task:hover { text-decoration: none; filter: brightness(.95); }
.cal-task.done { text-decoration: line-through; opacity: .55; }
.cal-task.late { outline: 1px solid var(--danger); }

/* ---------- Login ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: min(360px, 100%); display: flex; flex-direction: column; gap: 1rem; box-shadow: var(--shadow); }
.login-box h1 { justify-content: center; }
.login-box label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }

/* ---------- Móvil ---------- */
@media (max-width: 640px) {
  main { padding: .9rem; }
  .topbar { gap: .6rem; padding: .5rem .9rem; }
  .timer-pill { margin-left: 0; width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(3, 85vw); scroll-snap-type: x mandatory; }
  .column { scroll-snap-align: start; }
  .cal-day { min-height: 70px; }
  .cal-task { font-size: 0; height: 6px; padding: 0; border-left: 0; background: var(--c); }
}

/* ---------- Subtareas ---------- */
.sub-progress { margin-bottom: .6rem; }
.subtasks { list-style: none; margin: 0 0 .6rem; padding: 0; }
.subtask { display: flex; align-items: center; gap: .4rem; padding: .15rem 0; border-bottom: 1px solid var(--border); }
.subtask .subtask-rename { flex: 1; min-width: 0; }
.subtask .subtask-rename input { width: 100%; border-color: transparent; background: transparent; padding: .35rem .4rem; }
.subtask .subtask-rename input:hover { border-color: var(--border); }
.subtask .subtask-rename input:focus { background: var(--surface); border-color: var(--primary); }
.subtask.st-hecho .subtask-rename input { text-decoration: line-through; color: var(--muted); }
.sub-symbol {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; cursor: pointer; flex: none;
  font: 600 1.05rem/1 system-ui, sans-serif; display: grid; place-items: center;
  border: 2px solid var(--muted); background: transparent; color: var(--muted);
}
.sub-symbol:hover { transform: scale(1.08); }
.st-en_curso .sub-symbol { border-color: var(--warn); color: var(--warn); }
.st-hecho .sub-symbol { border-color: var(--ok); background: var(--ok); color: #fff; }
.subtask-add { display: flex; gap: .5rem; align-items: flex-start; }
.subtask-add textarea { flex: 1; min-height: 2.3rem; }
.legend { margin-right: .7rem; white-space: nowrap; }
.legend.st-en_curso b { color: var(--warn); }
.legend.st-hecho b { color: var(--ok); }
.task-card .meta .sub-done { color: var(--ok); font-weight: 600; }

/* ---------- Voz ---------- */
.voice-fab {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 30;
  width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 1.5rem; box-shadow: 0 4px 14px rgb(0 0 0 / .25);
}
.voice-fab:hover { filter: brightness(1.08); }
.voice-fab.listening { background: var(--danger); animation: voice-pulse 1.2s infinite; }
@keyframes voice-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 60%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
.voice-panel {
  position: fixed; right: 1.25rem; bottom: 5.5rem; z-index: 30; width: min(440px, calc(100vw - 2.5rem));
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: var(--radius); padding: .8rem 1rem; box-shadow: 0 6px 24px rgb(0 0 0 / .18); cursor: pointer;
}
.voice-panel.ok { border-left-color: var(--ok); }
.voice-panel.error { border-left-color: var(--danger); }
.voice-panel.listening { border-left-color: var(--danger); }
.voice-state { font-weight: 600; font-size: .85rem; color: var(--muted); }
.voice-panel.ok .voice-state { color: var(--ok); }
.voice-panel.error .voice-state { color: var(--danger); }
.voice-text { white-space: pre-line; margin-top: .2rem; }
main { padding-bottom: 6rem; }

.dictate-wrap { position: relative; display: flex; min-width: 0; }
.dictate-wrap > input, .dictate-wrap > textarea { flex: 1; width: 100%; padding-right: 2.2rem; }
.form label > .dictate-wrap { color: var(--text); font-size: .95rem; }
.dictate {
  position: absolute; right: .3rem; top: .3rem; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; font-size: .9rem; opacity: .45;
}
.dictate:hover { opacity: 1; background: var(--surface-2); }
.dictate.listening { opacity: 1; background: var(--danger); animation: voice-pulse 1.2s infinite; }
@media (max-width: 640px) { .voice-fab { right: .9rem; bottom: .9rem; } .voice-panel { right: .9rem; bottom: 5rem; } }

/* Pantalla sin conexión (app instalada) */
.offline-box { align-items: center; text-align: center; }
.offline-box img { border-radius: 16px; }
.offline-box p { margin: 0; }

/* ================= MiKurro ================= */
.brand { display: flex; align-items: center; gap: .45rem; }
.brand img { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.brand b { color: var(--primary); }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.user-menu .who { text-align: right; line-height: 1.15; }
.user-menu .who small { display: block; color: var(--muted); }
.trial-bar { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--text); text-align: center; padding: .4rem 1rem; font-size: .88rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.checklist li { display: flex; gap: .6rem; align-items: center; }
.checklist .tick { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; border: 2px solid var(--border); flex: none; }
.checklist .done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .done span { color: var(--muted); text-decoration: line-through; }
.credentials { border-left: 4px solid var(--primary); }
.credentials code { font-size: 1.05rem; user-select: all; }
.logo-preview { max-width: 180px; max-height: 90px; object-fit: contain; background: var(--surface-2); border-radius: 8px; padding: .5rem; }
.login-logo { max-width: 160px; max-height: 80px; object-fit: contain; align-self: center; }
.role { font-size: .78rem; padding: .1rem .5rem; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.role.owner { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
tr.inactive td { opacity: .5; }

/* ---------- Web pública ---------- */
.site-top { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; max-width: 1100px; margin: 0 auto; }
.site-top .brand { font-size: 1.25rem; }
.site-top nav { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.hero { max-width: 1100px; margin: 0 auto; padding: 3rem 1.25rem 2rem; display: grid; gap: 1.25rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; display: block; max-width: 18ch; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 52ch; margin: 0; }
.hero .actions .btn { font-size: 1.05rem; padding: .7rem 1.2rem; }
.section { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem; }
.section > h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.feature h3 { margin: .2rem 0 .4rem; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); }
.feature .icon { font-size: 1.6rem; }
.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.price { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; display: flex; flex-direction: column; gap: .6rem; }
.price.featured { border: 2px solid var(--primary); }
.price .amount { font-size: 2rem; font-weight: 700; }
.price .amount small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.price ul { margin: 0; padding-left: 1.1rem; color: var(--muted); flex: 1; }
.site-foot { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }
.register-box { width: min(460px, 100%); }
.slug-field { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); overflow: hidden; }
.slug-field input { border: 0; flex: 1; min-width: 0; border-radius: 0; }
.slug-field span { padding: 0 .6rem; color: var(--muted); background: var(--surface-2); align-self: stretch; display: flex; align-items: center; font-size: .9rem; }
.slug-status { font-size: .82rem; min-height: 1.1em; }
.slug-status.ok { color: var(--ok); }
.slug-status.bad { color: var(--danger); }
.check { flex-direction: row !important; align-items: flex-start; gap: .5rem !important; }
.check input { margin-top: .2rem; width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--primary); }

/* ---------- Trabajos ---------- */
.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input[type=search] { flex: 1 1 16rem; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs a { padding: .35rem .75rem; border-radius: 99px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.job-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.job-card { display: flex; flex-direction: column; gap: .2rem; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--muted);
  border-radius: var(--radius); padding: .75rem .9rem; color: var(--text); box-shadow: var(--shadow); }
.job-card:hover { text-decoration: none; border-color: var(--primary); }
.job-card.st-en_curso { border-left-color: var(--warn); }
.job-card.st-terminado { border-left-color: var(--ok); opacity: .8; }
.job-card .small, .small { font-size: .85rem; }
.job-status { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.job-card.st-en_curso .job-status { color: var(--warn); }
.job-card.st-terminado .job-status { color: var(--ok); }
.job-card .meta { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.job-card .meta .late { color: var(--danger); font-weight: 600; }
.people { display: inline-flex; }
.people i { font-style: normal; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .68rem; font-weight: 700;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface)); color: var(--primary); border: 2px solid var(--surface); margin-left: -.35rem; }
.people i:first-child { margin-left: 0; }
.job-status-dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--muted); flex: none; }
.job-status-dot.st-en_curso { background: var(--warn); }
.job-status-dot.st-terminado { background: var(--ok); }
.status-switch .st-terminado.active { background: var(--ok); }
.status-switch.big { margin: 0 0 .9rem; }
.status-switch.big button { flex: 1; padding: .55rem .5rem; font-size: .92rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.description { margin: .9rem 0 0; padding-top: .8rem; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.job-layout { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.subtask-title { flex: 1; padding: .35rem .4rem; }
.people-pick { border: 1px solid var(--border); border-radius: 8px; padding: .5rem .8rem .7rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.people-pick legend { font-size: .85rem; color: var(--muted); padding: 0 .3rem; }
.photo-stage + .photo-stage { margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.photo-stage-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.photo-upload label.btn { cursor: pointer; }
.photo-upload.uploading label.btn { opacity: .6; pointer-events: none; }
.photo-upload.uploading label.btn::after { content: ' subiendo…'; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .4rem; margin-top: .5rem; }
.photo-grid figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid form { position: absolute; top: 4px; right: 4px; }
.photo-del { border: 0; border-radius: 50%; width: 1.6rem; height: 1.6rem; background: rgb(0 0 0 / .55); color: #fff; cursor: pointer; font-size: .8rem; }
@media (max-width: 640px) {
  .status-switch.big button { font-size: .85rem; }
  .job-list { grid-template-columns: 1fr; }
}

/* ---------- Presupuestos ---------- */
.qbadge { font-size: .75rem; padding: .12rem .55rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 600; white-space: nowrap; vertical-align: middle; }
.qbadge.enviado { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.qbadge.aceptado { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.qbadge.rechazado { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
small.late, .late { color: var(--danger); }
.stat.ok span { color: var(--ok); }
.flash.info { border-left-color: var(--warn); }
.lines-table { width: 100%; border-collapse: collapse; }
.lines-table th { font-size: .8rem; color: var(--muted); font-weight: 600; text-align: left; padding: .3rem .3rem; }
.lines-table td { padding: .25rem .3rem; vertical-align: top; border-top: 1px solid var(--border); }
.lines-table td:first-child { width: 100%; min-width: 14rem; }
.lines-table textarea { width: 100%; resize: none; overflow: hidden; min-height: 2.3rem; }
.lines-table input { width: 5.5rem; text-align: right; }
.lines-table input[name$="[vat]"], .lines-table input[name$="[qty]"] { width: 4rem; }
.lines-table .amount { white-space: nowrap; padding-top: .7rem; font-variant-numeric: tabular-nums; }
.lines-table .remove-line { margin-top: .4rem; }
.doc-totals { margin-left: auto; border-collapse: collapse; width: auto; min-width: 260px; font-variant-numeric: tabular-nums; }
.doc-totals th { text-align: left; font-weight: 400; color: var(--muted); padding: .2rem 1.2rem .2rem 0; }
.doc-totals td { text-align: right; padding: .2rem 0; }
.doc-totals .grand th, .doc-totals .grand td { font-size: 1.15rem; font-weight: 700; color: var(--text); border-top: 2px solid var(--text); padding-top: .45rem; }
.accepted-card { border-left: 4px solid var(--ok); }
.accepted-sign { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.accepted-sign img { width: 240px; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.manual-decision { margin-top: .9rem; }
.manual-decision summary, details.reject summary { cursor: pointer; color: var(--muted); font-size: .9rem; }

/* Documento: siempre claro, como un papel */
.doc-page { background: #e9ebee; color: #1d2330; padding: 1rem; color-scheme: light; }
.doc-toolbar, .doc-actions { max-width: 820px; margin: 0 auto 1rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.doc-page .btn { background: #fff; color: #1d2330; border-color: #cfd4da; }
.doc-page .btn.primary { background: #d9480f; border-color: #d9480f; color: #fff; }
.doc-page .btn.danger { color: #c92a2a; }
.doc-page .muted { color: #6b7380; }
.doc-banner { max-width: 820px; margin: 0 auto 1rem; padding: .8rem 1rem; border-radius: 10px; background: #fff3bf; color: #5c4400; }
.doc-banner.ok { background: #d3f9d8; color: #1b5e20; font-weight: 600; }
.doc { --text: #1d2330; --muted: #6b7380; --border: #dde1e6; background: #fff; color: #1d2330; max-width: 820px; margin: 0 auto 1rem; padding: 2.2rem 2.4rem; border-radius: 6px; box-shadow: 0 2px 12px rgb(0 0 0 / .08); }
.doc-preview .doc { box-shadow: var(--shadow); border: 1px solid var(--border); }
.doc-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.doc-company, .doc-meta, .doc-client { display: flex; flex-direction: column; gap: .1rem; font-size: .9rem; }
.doc-company strong { font-size: 1.1rem; }
.doc-logo { max-width: 170px; max-height: 70px; object-fit: contain; align-self: flex-start; margin-bottom: .5rem; }
.doc-meta { text-align: right; }
.doc-meta h1 { display: block; font-size: 1.6rem; letter-spacing: .02em; color: #d9480f; }
.doc-number { font-weight: 700; font-size: 1.05rem; }
.doc-client { background: #f6f7f9; border-radius: 6px; padding: .8rem 1rem; margin-bottom: 1.2rem; }
.doc-client small, .doc-notes small, .doc-accepted small { text-transform: uppercase; letter-spacing: .06em; color: #6b7380; font-size: .7rem; font-weight: 700; }
.doc-title { font-size: 1.1rem; margin: 0 0 .8rem; }
.doc-lines { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: .92rem; }
.doc-lines th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7380; border-bottom: 2px solid #1d2330; padding: .4rem .4rem; }
.doc-lines td { border-bottom: 1px solid #e3e6ea; padding: .5rem .4rem; vertical-align: top; }
.doc-lines .num, .doc-lines th.num { text-align: right; white-space: nowrap; }
.doc .doc-totals th { color: #6b7380; }
.doc .doc-totals .grand th, .doc .doc-totals .grand td { color: #1d2330; border-top-color: #1d2330; }
.doc-notes { margin-top: 1.4rem; font-size: .88rem; }
.doc-notes p { margin: .2rem 0 0; }
.doc-accepted { margin-top: 1.4rem; display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; }
.doc-signature { width: 220px; max-width: 100%; border-bottom: 1px solid #1d2330; }
.accept-box h2 { font-size: 1.2rem; }
.accept-box .form-row label, .accept-box .form label { color: #6b7380; }
.accept-box input, .accept-box textarea { background: #fff; color: #1d2330; border-color: #cfd4da; }
.sign-wrap { position: relative; }
.sign-pad { width: 100%; height: 180px; border: 2px dashed #cfd4da; border-radius: 10px; background: #fff; touch-action: none; display: block; cursor: crosshair; }
.sign-clear { position: absolute; top: .5rem; right: .5rem; }
.sign-hint { position: absolute; left: 1rem; bottom: .6rem; font-size: .8rem; pointer-events: none; }
.big-btn { font-size: 1.05rem; padding: .75rem 1.3rem; align-self: flex-start; }
.reject { margin-top: 1.2rem; }
@media (max-width: 640px) {
  .doc { padding: 1.2rem 1rem; }
  .doc-meta { text-align: left; }
  /* Cada partida en dos líneas: concepto / cantidad × precio ... importe */
  .doc-lines thead { display: none; }
  .doc-lines, .doc-lines tbody { display: block; }
  .doc-lines tr { display: grid; grid-template-columns: auto auto 1fr; column-gap: .4rem; padding: .55rem 0; border-bottom: 1px solid #e3e6ea; }
  .doc-lines td { border: 0; padding: 0; }
  .doc-lines td:nth-child(1) { grid-column: 1 / -1; margin-bottom: .15rem; }
  .doc-lines td:nth-child(2), .doc-lines td:nth-child(3) { color: #6b7380; font-size: .88rem; }
  .doc-lines td:nth-child(3)::before { content: '× '; }
  .doc-lines td:nth-child(4) { display: none; }
  .doc-lines td:nth-child(5) { justify-self: end; font-weight: 600; }
  .doc-lines td[colspan] { grid-column: 1 / -1; }
  .doc-totals { width: 100%; min-width: 0; }
}
@media print {
  .no-print, .topbar, .trial-bar { display: none !important; }
  .doc-page { background: #fff; padding: 0; }
  .doc { box-shadow: none; padding: 0; max-width: none; margin: 0; }
  .doc-lines tr { break-inside: avoid; }
  @page { margin: 16mm 14mm; }
}

/* El atributo hidden manda aunque la clase tenga display */
[hidden] { display: none !important; }

@media (max-width: 640px) {
  /* Menú en una sola línea que se desliza de lado */
  .topbar { gap: .4rem .8rem; padding: .5rem .8rem; }
  .topbar nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -.8rem; padding: 0 .8rem; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { white-space: nowrap; padding: .3rem .6rem; }
  .user-menu .who small { display: none; }
  .brand { font-size: .95rem; }
  main { padding: .9rem .8rem; }
  .card { padding: .9rem; }

  /* Partidas del editor como tarjetas */
  .quote-form .table-wrap { overflow: visible; }
  .lines-table thead { display: none; }
  .lines-table, .lines-table tbody { display: block; }
  .lines-table tr.line { display: grid; grid-template-columns: 1fr 1fr 1.3fr .9fr; gap: .35rem; padding: .6rem 0; border-top: 1px solid var(--border); position: relative; }
  .lines-table td { padding: 0; border: 0; min-width: 0 !important; width: auto !important; }
  .lines-table td:nth-child(1) { grid-column: 1 / -1; padding-right: 1.8rem; }
  .lines-table td:nth-child(6) { grid-column: 1 / -1; text-align: right; padding-top: .1rem; font-weight: 600; }
  .lines-table td:nth-child(7) { position: absolute; top: .55rem; right: 0; }
  .lines-table input, .lines-table select { width: 100% !important; }
  .lines-table td:nth-child(2)::before { content: 'Cant.'; }
  .lines-table td:nth-child(3)::before { content: 'Unidad'; }
  .lines-table td:nth-child(4)::before { content: 'Precio €'; }
  .lines-table td:nth-child(5)::before { content: 'IVA %'; }
  .lines-table td:is(:nth-child(2), :nth-child(3), :nth-child(4), :nth-child(5))::before { display: block; font-size: .72rem; color: var(--muted); text-align: left; margin-bottom: .1rem; }
}
.site-top .brand { gap: 0; }

/* ---------- Agenda ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; min-height: 9rem; display: flex; flex-direction: column; gap: .4rem; }
.day header { display: flex; align-items: baseline; gap: .35rem; font-size: .8rem; color: var(--muted); }
.day header strong { font-size: 1.15rem; color: var(--text); }
.day header .add-appt { margin-left: auto; font-size: 1.2rem; line-height: 1; color: var(--primary); }
.day.today { border: 2px solid var(--primary); }
.day.today header strong { color: var(--primary); }
.day.past { opacity: .65; }
.day .nothing { font-size: .8rem; margin: 0; }
.appt { display: flex; flex-direction: column; gap: .05rem; padding: .4rem .5rem; border-radius: 6px; font-size: .82rem; color: var(--text);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border-left: 3px solid var(--primary); }
.appt:hover { text-decoration: none; filter: brightness(1.05); }
.appt .time { font-weight: 700; font-size: .75rem; color: var(--primary); }
.appt.allday { background: var(--surface-2); border-left-color: var(--muted); }
.appt.allday .time { color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.appt.allday.st-en_curso { border-left-color: var(--warn); }
.appt .note { font-style: italic; color: var(--muted); }
.appt .who { font-size: .76rem; color: var(--muted); }
dialog.card { max-width: 520px; width: calc(100% - 2rem); color: var(--text); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
.add-appt-box summary { list-style: none; display: inline-block; cursor: pointer; }
.add-appt-box summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .day.empty { flex-direction: row; align-items: center; padding: .4rem .6rem; }
  .day.empty header { flex: 1; }
  .day.empty .add-appt { order: 3; }
  .day header strong { order: -1; }
}

/* ---------- Partes de trabajo ---------- */
.report-line { display: flex; gap: .7rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--border); color: var(--text); }
.report-line:hover { text-decoration: none; color: var(--primary); }
.report-line .muted { flex: 1; }
.material-row { display: grid; grid-template-columns: 1fr 5rem 6.5rem auto; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.material-row input, .material-row select { width: 100%; min-width: 0; }
.material-row input[name$="[qty]"] { text-align: right; }
.sign-card { border: 2px solid var(--primary); }
.sign-card .sign-pad { background: #fff; }
@media (max-width: 640px) {
  .material-row { grid-template-columns: 5rem 1fr auto; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
  .material-row input[name$="[description]"] { grid-column: 1 / -1; }
}
main { padding-bottom: 5.5rem; }
.warn-bar { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); }
.support-bar { background: #5f3dc4; color: #fff; }

/* ---------- Panel de administración ---------- */
.admin-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; background: var(--text); color: var(--bg); padding: .1rem .4rem; border-radius: 4px; font-weight: 700; }
.tstatus { font-size: .75rem; padding: .12rem .55rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 600; white-space: nowrap; vertical-align: middle; }
.tstatus.trial { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
.tstatus.active { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.tstatus.past_due { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.tstatus.suspended, .tstatus.expired { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.log-list li { flex-direction: column; align-items: flex-start; gap: .05rem; }

/* Textos legales */
.legal { max-width: 760px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; line-height: 1.6; }
.legal h1 { margin: .8rem 0 .2rem; }
.legal h2 { font-size: 1.15rem; margin: 1.8rem 0 .5rem; }
.legal ul, .legal ol { padding-left: 1.3rem; }
.legal li { margin-bottom: .4rem; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: .5rem 0 1rem; }
.legal-table th, .legal-table td { white-space: normal; text-align: left; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.legal-table th { color: var(--muted); font-weight: 600; }
.legal-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; }
.legal-links a[aria-current] { color: var(--text); font-weight: 600; text-decoration: none; }
.site-foot p { margin: 0 0 .5rem; }
@media (max-width: 600px) {
  .legal-table thead { display: none; }
  .legal-table tr { display: block; border-bottom: 1px solid var(--border); padding: .4rem 0; }
  .legal-table td { display: block; border: 0; padding: .15rem 0; }
  .legal-table td:first-child { font-weight: 600; }
}

/* ================= Estilo común con la web pública ================= */
h1, h2, h3, .brand, .stat span, .stat-split b { font-family: var(--display); letter-spacing: -.015em; }
h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.1rem; font-weight: 700; }
.stat span, .stat-split b { font-weight: 750; font-size: 1.9rem; }

/* Barra superior translúcida, como la de la web */
.topbar { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom-color: var(--border); }
.topbar .brand { font-size: 1.15rem; }
.topbar nav a { border-radius: 99px; padding: .4rem .85rem; font-weight: 500; transition: background .15s ease, color .15s ease; }
.topbar nav a:hover { background: color-mix(in srgb, var(--primary) 9%, transparent); color: var(--text); }
.topbar nav a.active { background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--primary); font-weight: 650; }
.trial-bar { background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), color-mix(in srgb, var(--accent-2) 16%, var(--surface))); }
.admin-tag { background: linear-gradient(90deg, var(--primary), var(--accent-2)); color: #fff; border-radius: 99px; padding: .12rem .5rem; }

/* Botones y campos */
.btn { border-radius: 10px; font-weight: 600; padding: .5rem 1rem; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease; }
.btn:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.btn.primary { box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--primary) 85%, transparent); filter: brightness(1.05); }
.btn.small { border-radius: 8px; }
input, select, textarea { border-radius: 10px; padding: .55rem .7rem; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent); outline-offset: 0; border-color: var(--primary); }

/* Tarjetas */
.card { border-radius: 20px; padding: 1.25rem 1.4rem; }
.flash { border-radius: 12px; }
.stat, .stat-split { border-radius: 18px; padding: 1rem 1.2rem; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent-2)); opacity: 0; transition: opacity .2s ease; }

/* Lo que se puede pulsar se levanta al pasar el ratón */
a.stat, .stat, .stat-split, .card, .job-card, .task-card, .appt, .tabs a {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
a.stat:hover, .stat:hover, a.stat-split:hover, .job-card:hover, .appt:hover {
  transform: translateY(-3px); box-shadow: var(--lift); border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
a.stat:hover::after, .stat:hover::after { opacity: 1; }
.card:hover { border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.doc-page .card:hover, .doc:hover { border-color: inherit; }
.job-card { border-radius: 16px; padding: 1rem 1.1rem; }
.job-card:hover { border-left-color: inherit; }
.job-card.st-pendiente:hover { border-left-color: var(--muted); }
.job-card.st-en_curso:hover { border-left-color: var(--warn); }
.job-card.st-terminado:hover { border-left-color: var(--ok); opacity: 1; }
.task-card { border-radius: 12px; }
.task-card:hover { transform: translateY(-2px); box-shadow: var(--lift); }
.tabs a { padding: .4rem .9rem; }
.tabs a:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }

/* Tablas y listas */
th { text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; }
tbody tr { transition: background .15s ease; }
tbody tr:hover td { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.doc tbody tr:hover td, .doc-totals tr:hover td { background: none; }
.list li { padding: .55rem 0; }

/* Acceso: mismo fondo que la portada */
.login-page { background: radial-gradient(60% 60% at 85% 15%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 70%), radial-gradient(50% 50% at 10% 100%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 70%), var(--bg); }
.login-box { border-radius: 24px; padding: 2.2rem; box-shadow: var(--lift); }
.login-box h1 { font-size: 1.9rem; }

/* Botón de voz con el degradado de la marca */
.voice-fab { background: linear-gradient(135deg, var(--accent-2), var(--primary)); box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--primary) 80%, transparent); transition: transform .15s ease; }
.voice-fab:hover { transform: scale(1.06); }
.voice-panel { border-radius: 16px; }

@media (prefers-reduced-motion: reduce) {
  a.stat, .stat-split, .job-card, .task-card, .appt, .btn, .voice-fab { transition: none; }
  a.stat:hover, .stat:hover, a.stat-split:hover, .job-card:hover, .appt:hover, .task-card:hover, .btn.primary:hover { transform: none; }
}
.login-box h1 { text-align: center; line-height: 1.1; }
.login-box .btn { justify-content: center; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; }

/* Agenda: selector semana/mes y vista de mes */
.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }
.seg a { padding: .35rem .9rem; border-radius: 99px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: var(--text); color: var(--bg); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; margin-bottom: .75rem; }
.mhead { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 .4rem .2rem; }
.mhead .short { display: none; }
.mday { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .35rem .4rem .45rem; min-height: 7.2rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; transition: border-color .15s ease, box-shadow .2s ease; }
.mday:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); box-shadow: var(--lift); }
.mday header { display: flex; align-items: center; }
.mday .mnum { font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--text); width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 50%; }
.mday .mnum:hover { background: var(--surface-2); text-decoration: none; }
.mday .add-appt { margin-left: auto; font-size: 1.15rem; line-height: 1; color: var(--primary); opacity: 0; transition: opacity .15s ease; }
.mday:hover .add-appt, .mday .add-appt:focus { opacity: 1; }
.mday.today { border: 2px solid var(--primary); }
.mday.today .mnum { background: var(--primary); color: var(--primary-text); }
.mday.out { background: transparent; }
.mday.out .mnum { color: var(--muted); font-weight: 500; }
.mday.past:not(.today) { opacity: .7; }
.chip { display: block; font-size: .76rem; line-height: 1.3; padding: .15rem .4rem; border-radius: 6px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--primary) 11%, var(--surface)); border-left: 3px solid var(--primary); }
.chip b { color: var(--primary); font-weight: 700; }
.chip.allday { background: var(--surface-2); border-left-color: var(--muted); }
.chip.allday.st-en_curso { border-left-color: var(--warn); }
.chip:hover { text-decoration: none; filter: brightness(.97); }
.mday .more { font-size: .74rem; font-weight: 600; color: var(--muted); padding-left: .3rem; }
.mdots { display: none; }
@media (max-width: 640px) {
  .page-head .actions { width: 100%; }
  .month { gap: 3px; }
  .mhead { text-align: center; padding: 0; }
  .mhead .long { display: none; }
  .mhead .short { display: inline; }
  .mday { min-height: 3.6rem; padding: .25rem 0; align-items: center; border-radius: 10px; }
  .mday .mnum { font-size: .9rem; width: 1.7rem; height: 1.7rem; }
  /* En el móvil todo el día lleva a su semana */
  .mday .mnum::after { content: ""; position: absolute; inset: 0; }
  .mday .chip, .mday .more, .mday .add-appt { display: none; }
  .mdots { display: flex; gap: 3px; margin-top: .1rem; }
  .mdots i { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
}

/* Suscripción */
.cycle-pick { margin-bottom: 1rem; }
.cycle-pick label { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .9rem; border-radius: 99px; color: var(--muted); font-weight: 600; font-size: .9rem; cursor: pointer; }
.cycle-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cycle-pick label:has(input:checked) { background: var(--text); color: var(--bg); }
.cycle-pick small { color: var(--ok); }
.cycle-pick label:has(input:checked) small { color: inherit; opacity: .8; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
.plan-card { border: 1px solid var(--border); border-radius: 16px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--lift); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.plan-card.current { border: 2px solid var(--primary); }
.plan-card h3 { margin: 0; font-size: 1.2rem; }
.plan-card p { margin: 0; }
.plan-card .price { font-family: var(--display); font-size: 1.8rem; font-weight: 750; margin-top: .4rem; }
.plan-card .price small { font-family: system-ui, sans-serif; font-size: .8rem; font-weight: 400; color: var(--muted); }
.plan-card .btn { margin-top: .6rem; justify-content: center; }
.trial-bar a { color: inherit; font-weight: 700; text-decoration: underline; }
.stripe-box { background: color-mix(in srgb, #635bff 8%, var(--surface)); border: 1px solid color-mix(in srgb, #635bff 25%, var(--border)); border-radius: 12px; padding: .7rem .9rem; margin: 0 0 1rem; font-size: .9rem; }
.tstatus.free { background: color-mix(in srgb, #635bff 14%, transparent); color: #635bff; }
