:root {
  --brand: #da291c;
  --brand-dark: #a91f15;
  --brand-soft: #fce9e7;
  --green: #0f7a3d;
  --green-dark: #005c2e;
  --green-soft: #e6f2ec;
  --red: #c4231a;
  --red-soft: #fdecea;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --blue-soft: #e0ecff;
  --bg: #f6f4f3;
  --card: #ffffff;
  --text: #1f1a1a;
  --muted: #6a6362;
  --line: #e8e2e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 20, 16, 0.06), 0 4px 16px rgba(60, 20, 16, 0.05);
  --sidebar: 208px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.7rem; font-weight: 750; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Layout ---------- */
.layout { display: flex; height: 100vh; height: 100dvh; }
.sidebar {
  width: var(--sidebar);
  flex: none;
  background: var(--brand);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
  gap: 2px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.brand strong { display: block; font-size: 1.25rem; letter-spacing: 0.04em; }
.brand span { font-size: 0.8rem; opacity: 0.85; }
.sidebar a {
  display: flex; align-items: center; gap: 12px;
  color: #fff; text-decoration: none;
  padding: 11px 12px; border-radius: 10px;
  font-weight: 550; opacity: 0.88;
  min-height: 46px;
}
.sidebar a:hover { background: rgba(255, 255, 255, 0.1); opacity: 1; }
.sidebar a.active { background: #fff; color: var(--brand); opacity: 1; box-shadow: inset 4px 0 0 var(--brand-dark); }
.ico { width: 22px; height: 22px; flex: none; }
.logout {
  margin-top: auto; background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff;
  border-radius: 10px; padding: 10px; font: inherit; font-size: 0.9rem; cursor: pointer;
}
main#view {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(22px + env(safe-area-inset-top)) 26px calc(40px + env(safe-area-inset-bottom));
}

.sidebar a .corto { display: none; }
table.simple.centrada td { vertical-align: middle; }

/* Tablet en vertical y móvil: barra inferior */
@media (max-width: 900px) {
  .layout { flex-direction: column-reverse; }
  .sidebar {
    width: 100%; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    overflow-x: auto; overflow-y: hidden; gap: 2px; border-top: 1px solid var(--brand-dark);
  }
  .brand, .logout { display: none; }
  .sidebar a { flex-direction: column; gap: 2px; font-size: 0.74rem; padding: 6px 2px; min-width: 64px; flex: 1; justify-content: center; text-align: center; white-space: nowrap; }
  .sidebar a .largo { display: none; }
  .sidebar a .corto { display: inline; }
  .sidebar a.active { box-shadow: inset 0 -3px 0 var(--brand-dark); }
  main#view { padding: calc(16px + env(safe-area-inset-top)) 16px 30px; }
}

/* ---------- Cabecera de página ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Tarjetas ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card > h2 { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card.span { grid-column: 1 / -1; }
.card + .card { margin-top: 0; }
.stack > * + * { margin-top: 16px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; min-width: 0; }
.kpi b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 0.85rem; }
.empty { padding: 26px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); }
.empty.error { color: var(--red); }

/* ---------- Listas ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .meta { color: var(--muted); font-size: 0.85rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700;
}

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: #eef1ef; color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.err { background: var(--red-soft); color: var(--red); }
.badge.info { background: var(--blue-soft); color: #1d4ed8; }

/* ---------- Botones y formularios ---------- */
.btn {
  appearance: none; border: 0; border-radius: 10px; font: inherit; font-weight: 600;
  padding: 10px 16px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  background: #efebe9; color: var(--text); text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { background: #fff; color: var(--red); border: 2px solid var(--red); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.big { min-height: 52px; font-size: 1.05rem; padding: 12px 22px; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn { border: 0; background: transparent; font-size: 1.2rem; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.link { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 4px; }
.link.danger { color: var(--red); }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); width: 100%;
  border: 1px solid #d9d1ce; border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 44px;
}
input[type='checkbox'], input[type='radio'] { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); flex: none; }
input[type='color'] { padding: 2px; width: 52px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.check.boxed { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; background: #fff; }
.chip input { width: 18px; height: 18px; }
.form-error { color: var(--red); background: var(--red-soft); padding: 10px 12px; border-radius: 10px; margin: 0 20px 12px; }
.note { background: var(--amber-soft); color: #78350f; padding: 10px 12px; border-radius: 10px; font-size: 0.9rem; margin: 8px 0 12px; }
.note.green { background: var(--green-soft); color: var(--green-dark); }
.note.red { background: var(--red-soft); color: #7f1d1d; }
.section-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }

/* ---------- Modal ---------- */
dialog.modal {
  border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(40, 12, 10, 0.45); }
.modal-form { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 8px 20px; }
.modal-body { padding: 8px 20px 12px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 18px; border-top: 1px solid var(--line); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; transition: .25s;
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 1000; font-weight: 600;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 22px; padding: 34px 30px; width: min(380px, 100%); text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.25); border-bottom: 6px solid var(--brand-dark); }
.login-card img { width: 72px; height: 72px; border-radius: 18px; }
.login-card h1 { margin-top: 12px; }
.login-card p { color: var(--muted); margin: 6px 0 20px; }
.login-card input { margin-bottom: 12px; text-align: center; }
.login-card .btn { width: 100%; justify-content: center; }
.login-card .form-error { margin: 12px 0 0; }

/* ---------- Hoy ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { width: 84px; flex: none; font-variant-numeric: tabular-nums; font-weight: 700; }
.timeline li > input { flex: none; }
.timeline li.done { opacity: 0.55; }
.timeline li.done .what { text-decoration: line-through; }
.timeline li.late .when { color: var(--red); }
.countdown { font-size: 0.85rem; color: var(--muted); }
.countdown.soon { color: var(--amber); font-weight: 700; }
.countdown.late { color: var(--red); font-weight: 700; }
.status { font-size: 0.8rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.status.on { background: var(--green-soft); color: var(--green); }
.status.break { background: var(--amber-soft); color: var(--amber); }
.status.off { background: #eef1ef; color: var(--muted); }
.checklist .check { border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0; }
.checklist .check:last-child { border-bottom: 0; }
.checklist .check.done span { color: var(--muted); text-decoration: line-through; }
.progress { height: 6px; background: #e8eee9; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.progress > i { display: block; height: 100%; background: var(--brand); }

/* ---------- Cuadrante ---------- */
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-nav strong { min-width: 220px; text-align: center; }
.roster-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table.roster { border-collapse: collapse; width: 100%; min-width: 760px; table-layout: fixed; }
.roster th, .roster td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; vertical-align: top; }
.roster thead th:first-child { width: 128px; }
.roster thead th:last-child { width: 84px; }
.roster th { background: #f7faf8; font-size: 0.85rem; text-align: center; padding: 10px 6px; }
.roster th.today { background: var(--brand-soft); color: var(--brand); }
.roster th.closed, .roster td.closed { background: repeating-linear-gradient(45deg, #f6f7f6, #f6f7f6 6px, #eff1ef 6px, #eff1ef 12px); }
.roster td.name { width: 128px; font-weight: 650; background: #fbfcfb; }
.roster td.name .meta { font-weight: 400; color: var(--muted); font-size: 0.78rem; }
.roster td.cell { cursor: pointer; height: 74px; overflow: hidden; }
.roster td.cell:hover { background: #f6faf7; }
.shift { border-left: 4px solid; border-radius: 6px; padding: 4px 4px 4px 5px; background: #f5f7f6; font-size: 0.82rem; margin-bottom: 3px; }
.shift b { font-variant-numeric: tabular-nums; display: block; white-space: nowrap; font-size: 0.8rem; letter-spacing: -0.02em; }
.shift .sec { font-size: 0.72rem; color: var(--muted); }
.brk { font-size: 0.72rem; color: var(--amber); }
.libre { color: var(--muted); font-size: 0.85rem; font-weight: 600; text-align: center; padding-top: 14px; }
.absence { border-radius: 6px; padding: 4px 6px; font-size: 0.75rem; font-weight: 700; color: #fff; margin-bottom: 3px; }
.roster td.total { text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.roster td.total.over { color: var(--red); }
.roster td.total.under { color: var(--amber); }
.issues { list-style: none; margin: 0; padding: 0; }
.issues li { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 0.92rem; }
.issues li.error { background: var(--red-soft); color: #7f1d1d; }
.issues li.aviso { background: var(--amber-soft); color: #78350f; }
.issues li.info { background: #f1f5f3; color: var(--muted); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tpl-grid button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px; font: inherit; cursor: pointer; min-height: 56px; }
.tpl-grid button b { display: block; }
.tpl-grid button span { font-size: 0.8rem; color: var(--muted); }
.tramo { display: grid; grid-template-columns: 1fr 1fr 1.3fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin: 10px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Firmas ---------- */
.signs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sign { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; }
.sign-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.sign canvas { width: 100%; height: 130px; touch-action: none; display: block; background: #fbfdfc; border-radius: 8px; }
.sign-line { border-top: 1px dashed #b9c6bd; font-size: 0.72rem; color: var(--muted); text-align: center; padding-top: 2px; }
.sig-img { height: 70px; max-width: 100%; display: block; }

/* ---------- Caja ---------- */
.cajas { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.caja-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.caja-head h2 { font-size: 1.3rem; }
.caja-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ev { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev .t { width: 48px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; padding-top: 2px; }
.ev .body { flex: 1; }
.ev .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.bigcalc { background: var(--green-soft); border-radius: 12px; padding: 14px; text-align: center; margin: 6px 0 14px; }
.bigcalc b { display: block; font-size: 2rem; color: var(--green); font-variant-numeric: tabular-nums; }
.bigcalc.bad { background: var(--red-soft); }
.bigcalc.bad b { color: var(--red); }
.money { font-size: 1.4rem !important; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Tablas simples ---------- */
table.simple { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.simple th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); }
.simple td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.simple td.num, .simple th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* Vacaciones: vista anual */
.yeargrid { display: grid; grid-template-columns: 140px repeat(12, minmax(56px, 1fr)); font-size: 0.8rem; min-width: 860px; }
.yeargrid > div { border-bottom: 1px solid var(--line); padding: 6px 4px; }
.yeargrid .h { font-weight: 700; color: var(--muted); text-align: center; }
.yeargrid .n { font-weight: 650; }
.yeargrid .m { display: flex; gap: 2px; flex-wrap: wrap; align-content: flex-start; }
.yeargrid .m i { display: block; height: 8px; border-radius: 2px; }

/* ---------- Carga de la búsqueda con IA ---------- */
.ia-loader { display: flex; gap: 16px; align-items: center; background: var(--brand-soft); border-radius: 14px; padding: 18px; margin: 4px 0 12px; }
.ia-loader .grow { flex: 1; min-width: 0; }
.ia-loader .ia-paso { color: var(--brand-dark); font-weight: 600; margin-top: 4px; min-height: 1.4em; }
.ia-loader .progress { margin: 10px 0 8px; background: #f6d4d0; height: 8px; }
.ia-loader .progress > i { transition: width 1s linear; }
.spinner { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 4px solid #f3c9c5; border-top-color: var(--brand); animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } }

.ia-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.ia-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.ia-tabla { margin-top: 8px; }
.ia-tabla td { vertical-align: middle; }
.ia-tabla .ia-precio { font-size: 1.1rem; }
.ia-ok { color: var(--green); font-weight: 800; }
.ia-x { color: var(--muted); font-weight: 800; }
.ia-no td { color: var(--muted); background: #faf8f7; }

/* ---------- Calendario de Hoy ---------- */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: -6px 0 16px; }
.seg { display: inline-flex; background: #ece7e5; border-radius: 12px; padding: 4px; gap: 2px; }
.seg a { padding: 8px 18px; border-radius: 9px; text-decoration: none; color: var(--text); font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; }
.seg a.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.notas { border-top: 4px solid var(--amber); }
.recordatorios { border-top: 4px solid var(--brand); }
.recordatorios > h2 > span { display: inline-flex; gap: 10px; align-items: center; }
.rec-nuevo { display: flex; gap: 8px; margin-bottom: 8px; }
.rec-nuevo input[name=texto] { flex: 1; min-width: 0; }
.rec-nuevo input[type=time] { width: 120px; flex: none; }
.sem-rec.hecha, .mes-rec.hecha { text-decoration: line-through; opacity: .6; }
.sem-rec { font-size: .8rem; background: var(--brand-soft); color: var(--brand-dark); border-radius: 8px; padding: 5px 8px; font-weight: 600; }
.mes-rec { font-size: .72rem; background: var(--brand-soft); color: var(--brand-dark); border-radius: 5px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.nota-nueva { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.nota-nueva textarea { min-height: 48px; }
.nota .nota-texto { white-space: pre-wrap; word-break: break-word; }
.nota.hecha .nota-texto { text-decoration: line-through; color: var(--muted); }
.turno-titulo { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 0 4px !important; border-bottom: 0 !important; }

.semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.dia-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; text-decoration: none; color: inherit; min-height: 220px; display: flex; flex-direction: column; gap: 8px; border-top: 4px solid transparent; }
.dia-card:hover { box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow); }
.dia-card.hoy { border-top-color: var(--brand); }
.dia-card.cerrado { background: repeating-linear-gradient(45deg, #faf8f7, #faf8f7 6px, #f3efed 6px, #f3efed 12px); }
.dia-head { display: flex; flex-direction: column; gap: 0; }
.dia-head span { color: var(--muted); font-size: .85rem; }
.dia-card.hoy .dia-head b { color: var(--brand); }
.sem-turno { font-size: .85rem; display: flex; flex-direction: column; }
.sem-turno b { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sem-aus, .mes-aus { color: #fff; border-radius: 6px; padding: 2px 6px; font-size: .75rem; font-weight: 600; }
.sem-notas { font-size: .8rem; background: var(--amber-soft); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; }
.sem-notas div { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sem-notas .hecha, .mes-nota.hecha { text-decoration: line-through; opacity: .6; }

.mes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mes-dow { text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.mes-dia { background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 6px 7px; min-height: 104px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 3px; overflow: hidden; border-top: 3px solid transparent; }
.mes-dia.fuera { opacity: .4; }
.mes-dia.hoy { border-top-color: var(--brand); }
.mes-dia.hoy .mes-num { background: var(--brand); color: #fff; border-radius: 999px; width: 26px; text-align: center; }
.mes-dia.cerrado { background: repeating-linear-gradient(45deg, #faf8f7, #faf8f7 6px, #f3efed 6px, #f3efed 12px); }
.mes-num { font-weight: 700; font-size: .9rem; }
.mes-turno { font-size: .72rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mes-nota { font-size: .72rem; background: var(--amber-soft); border-radius: 5px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .semana { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .dia-card { min-height: 0; }
}
@media (max-width: 600px) {
  .semana { grid-template-columns: 1fr; }
  .mes-turno { display: none; }
  .mes-dia { min-height: 70px; }
}

/* ---------- Bolsa de horas ---------- */
.calc-info { background: var(--green-soft); color: var(--green-dark, #0b5a2d); border-radius: 10px; padding: 10px 12px; font-weight: 600; margin: 0 0 12px; }
.mov { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.mov.menos { color: var(--amber); }
.mov.mas { color: var(--green); }

/* ---------- Marketing ---------- */
.variante { border-top: 1px solid var(--line); padding: 12px 0; }
.variante:first-of-type { border-top: 0; padding-top: 0; }
.post-edit { margin: 6px 0 8px; line-height: 1.5; font-size: 15px; }
.post-texto { white-space: pre-wrap; font-size: .9rem; max-height: 9.5em; overflow: hidden; }

/* ---------- Manuales ---------- */
.chat-card { display: flex; flex-direction: column; min-height: 520px; }
.chat-card > h2 .link { white-space: nowrap; font-size: .85rem; }
.chat { flex: 1; overflow-y: auto; max-height: max(320px, calc(100dvh - 400px)); display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; }
.chat-vacio .chips .chip { font: inherit; font-size: .88rem; text-align: left; }
.msg { border-radius: 14px; padding: 10px 14px; max-width: 92%; line-height: 1.45; }
.msg p { margin: 0 0 6px; }
.msg p:last-child { margin-bottom: 0; }
.msg ul { margin: 4px 0 6px; padding-left: 20px; }
.msg.yo { align-self: flex-end; background: var(--brand); color: #fff; white-space: pre-wrap; }
.msg.ia { align-self: flex-start; background: #f3efed; }
.msg.ia.no { background: var(--amber-soft); }
.msg.pensando { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.fuentes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fuentes .chip { font-size: .8rem; padding: 4px 10px; text-decoration: none; color: var(--brand-dark); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.spinner.pequeno { width: 18px; height: 18px; border-width: 3px; }
mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Impresión ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: 11px; }
  .sidebar, .toolbar, .no-print, .btn, .link { display: none !important; }
  .layout { display: block; height: auto; }
  main#view { overflow: visible; padding: 0; }
  .card, .roster-wrap, .kpi { box-shadow: none; border: 1px solid #ccc; }
  .print-only { display: block; }
  table.roster { min-width: 0; }
  .roster td.cell { height: auto; }
}
