/* FocusDesk — crema suave, pasteles (mantequilla, salvia, pervinca, rosa empolvado, malva), tinta negra y personajes geométricos */
:root {
  /* Cinco pasteles que conviven (mantequilla, salvia, pervinca, rosa, malva) + crema, beige y tinta */
  --bg: #fbf6ea;
  --surface: #eee8dc;
  --surface-1: #e7e0d2;
  --surface-2: #ded6c6;
  --surface-3: #cfc6b4;
  --ink: #1c1b18;
  --text: #1c1b18;
  --muted: #5e5a52;
  --subtle: #8c877c;
  --outline: #1c1b18;
  --border: #dcd4c4;
  --divider: #e5ddcf;
  /* Paleta de 6 colores bien distintos: lavanda, mostaza, menta, terracota, oliva y rubor.
     Los antiguos "pink", "blue" y "lilac" se remapean para no tener tonos parecidos. */
  --pink: #e3876d; --pink-soft: #f8ddd4; --on-pink: #1c1b18;
  --olive: #95a05d; --olive-soft: #e3e7cf;
  --blue: #b6bcf4; --blue-soft: #e7e9fd;
  --yellow: #ead477; --yellow-soft: #f8efc8;
  --lilac: #b6bcf4; --lilac-soft: #e7e9fd;
  --orange: #e3876d; --orange-soft: #f8ddd4;
  /* colores añadidos (referencia): lavanda, menta, terracota, rubor */
  --lavender: #b6bcf4; --lavender-soft: #e7e9fd;
  --mint: #c4ddd5; --mint-soft: #e6f1ed;
  --terracotta: #e3876d; --terracotta-soft: #f8ddd4;
  --blush: #eed9ce; --blush-soft: #f8eee8;
  --forest: #1c1b18;
  --primary: #1c1b18; --on-primary: #fbf6ea;
  --primary-container: #f8ddd4; --on-primary-container: #1c1b18;
  --secondary-container: #e3876d; --on-secondary-container: #1c1b18;
  --tomato: #e3876d; --tomato-container: #f8ddd4; --on-tomato-container: #1c1b18;
  --break: #9fae6c; --break-container: #e3e8cf;
  --long: #a9bfe6; --long-container: #e2eaf7;
  --ok: #56662a; --ok-container: #e3e8cf;
  --warn: #75590a; --warn-container: #f9efc6;
  --danger: #a8452d; --danger-container: #f8ddd4;
  --p1: #b6bcf4; --p2: #ead477; --p3: #e3876d;
  --accent: var(--ink); --accent-soft: var(--pink-soft);
  --hover: rgba(29, 27, 22, .06); --press: rgba(29, 27, 22, .1);
  --shadow-1: 0 1px 0 rgba(29,27,22,.08), 0 2px 8px rgba(29,27,22,.06);
  --shadow-2: 0 2px 0 rgba(29,27,22,.08), 0 10px 30px rgba(29,27,22,.12);
  --shadow-3: 0 18px 50px rgba(29,27,22,.22);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r-sm: 14px; --r: 22px; --r-lg: 30px;
  --sidebar: 260px;
  /* barra inferior del móvil */
  --tab-bg: #1c1b18; --tab-border: transparent; --tab-fg: rgba(251, 246, 234, .62); --tab-fg-on: #fbf6ea;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151813; --surface: #1f231c; --surface-1: #272c23; --surface-2: #30362b; --surface-3: #3b4235;
    --ink: #f3eee6; --text: #f3eee6; --muted: #bdb6a8; --subtle: #8f897d; --outline: #f3eee6;
    --border: #3b4235; --divider: #30362b;
    --pink-soft: #4f2a20; --olive-soft: #39421f; --blue-soft: #2f3256; --yellow-soft: #4d4216; --lilac-soft: #2f3256; --orange-soft: #55311a;
    --primary: #f3eee6; --on-primary: #151813; --primary-container: #4f2a20; --on-primary-container: #f8ddd4;
    --tomato-container: #4f2a20; --on-tomato-container: #f8ddd4; --break-container: #39421f; --long-container: #2f3256;
    --ok: #c3d68a; --ok-container: #39421f; --warn: #ffd84d; --warn-container: #4d4216; --danger: #f0a58f; --danger-container: #4f2a20;
    --hover: rgba(243, 238, 230, .07); --press: rgba(243, 238, 230, .12);
    --shadow-1: 0 1px 0 rgba(0,0,0,.3); --shadow-2: 0 10px 30px rgba(0,0,0,.35); --shadow-3: 0 18px 50px rgba(0,0,0,.5);
    --tab-bg: #2a2f25; --tab-border: #3b4235; --tab-fg: rgba(243, 238, 230, .62); --tab-fg-on: #f3eee6;
    --lavender-soft: #2f3256; --mint-soft: #26382f; --terracotta-soft: #4f2a20; --blush-soft: #3d302a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151813; --surface: #1f231c; --surface-1: #272c23; --surface-2: #30362b; --surface-3: #3b4235;
  --ink: #f3eee6; --text: #f3eee6; --muted: #bdb6a8; --subtle: #8f897d; --outline: #f3eee6;
  --border: #3b4235; --divider: #30362b;
  --pink-soft: #4f2a20; --olive-soft: #39421f; --blue-soft: #2f3256; --yellow-soft: #4d4216; --lilac-soft: #2f3256; --orange-soft: #55311a;
  --primary: #f3eee6; --on-primary: #151813; --primary-container: #4f2a20; --on-primary-container: #f8ddd4;
  --tomato-container: #4f2a20; --on-tomato-container: #f8ddd4; --break-container: #39421f; --long-container: #2f3256;
  --ok: #c3d68a; --ok-container: #39421f; --warn: #ffd84d; --warn-container: #4d4216; --danger: #f0a58f; --danger-container: #4f2a20;
  --hover: rgba(243, 238, 230, .07); --press: rgba(243, 238, 230, .12);
  --shadow-1: 0 1px 0 rgba(0,0,0,.3); --shadow-2: 0 10px 30px rgba(0,0,0,.35); --shadow-3: 0 18px 50px rgba(0,0,0,.5);
  --tab-bg: #2a2f25; --tab-border: #3b4235; --tab-fg: rgba(243, 238, 230, .62); --tab-fg-on: #f3eee6;
  --lavender-soft: #2f3256; --mint-soft: #26382f; --terracotta-soft: #4f2a20; --blush-soft: #3d302a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; min-height: 100dvh; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font: 15px/1.45 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
code { font-size: 13px; background: var(--surface-1); padding: 2px 7px; border-radius: 8px; }
::selection { background: var(--pink); color: #1d1b16; }
:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
.num { font-variant-numeric: tabular-nums; }
.cap { text-transform: capitalize; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }

/* ---------- iconos y blobs ---------- */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
.ic .f, .ic.f { fill: currentColor; stroke: none; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }
:where(i[data-icon], i:has(> .ic)) { display: inline-flex; font-style: normal; }
.blob { display: block; width: 100%; height: auto; overflow: visible; }
.blob .pupil { animation: peek 7s ease-in-out infinite; }
@keyframes peek { 0%, 40%, 100% { transform: translate(0, 0); } 50%, 70% { transform: translate(2px, -1px); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ---------- estructura ---------- */
.app {
  display: grid; min-height: 100vh; min-height: 100dvh;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-rows: 76px 1fr;
  grid-template-areas: "bar bar" "side main";
}
.appbar { grid-area: bar; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; padding: 12px 20px 12px 14px; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 4px; width: calc(var(--sidebar) - 58px); flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 12px; }
.brand span { font: 600 22px/1 var(--font-display); letter-spacing: -.02em; color: var(--ink); }
.appbar-end { margin-left: auto; display: flex; gap: 6px; padding-left: 12px; }

.search { position: relative; flex: 1; max-width: 680px; }
.search input {
  width: 100%; height: 50px; border: 2px solid transparent; border-radius: 99px; background: var(--surface); padding: 0 52px 0 54px;
  font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--subtle); }
.search input:focus { border-color: var(--ink); box-shadow: var(--shadow-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search-ic { position: absolute; left: 18px; top: 15px; color: var(--muted); pointer-events: none; }
.search-kbd { position: absolute; right: 16px; top: 14px; font: 500 12px var(--font); color: var(--muted); border: 1.5px solid var(--border); border-radius: 8px; padding: 1px 8px; }
.search input:focus ~ .search-kbd { display: none; }
.search-results { position: absolute; top: 58px; left: 0; right: 0; background: var(--surface); border-radius: var(--r); border: 2px solid var(--ink); box-shadow: var(--shadow-3); max-height: 70vh; overflow-y: auto; padding: 10px 0; z-index: 30; }
.sr-group { font: 500 13px var(--font); letter-spacing: 0; color: var(--muted); padding: 10px 20px 4px; }
.sr-item { display: flex; align-items: center; gap: 14px; padding: 9px 20px; cursor: pointer; }
.sr-item:hover, .sr-item.active { background: var(--pink-soft); }
.sr-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sr-item .s { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.sr-empty { padding: 16px 20px; color: var(--muted); }

/* Menú izquierdo: panel plano, sin redondeos, con indicador lateral recto */
.sidebar { grid-area: side; position: sticky; top: 76px; height: calc(100vh - 76px); overflow-y: auto; padding: 0 0 100px; background: var(--surface); border-right: 1px solid var(--divider); border-top: 1px solid var(--divider); scrollbar-width: thin; }
.create-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 56px; padding: 0 22px; margin: 0 0 8px;
  border: 0; border-radius: 0; background: var(--ink); color: var(--bg); font: 500 15px var(--font); cursor: pointer;
  transition: background .15s;
}
.create-btn:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.create-btn .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.nav a { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 18px 0 22px; border-radius: 0; color: var(--muted); font: 400 15px var(--font); position: relative; }
.nav a > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a:hover { background: var(--surface-1); color: var(--ink); }
.nav a.active { background: var(--bg); color: var(--ink); font-weight: 500; box-shadow: inset 4px 0 0 var(--ink); }
.nav .count { font-size: 12px; font-weight: 500; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 0; background: var(--surface-1); color: var(--muted); padding: 0 6px; }
.nav a.active .count { background: var(--terracotta); color: var(--ink); }
.nav .count:empty { display: none; }
.nav-group { font: 500 13px var(--font); letter-spacing: 0; color: var(--subtle); padding: 22px 22px 8px; border-top: 1px solid var(--divider); margin-top: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.nav .pdot { width: 20px; display: grid; place-items: center; }
.nav .pdot .dot { width: 12px; height: 12px; border-radius: 0; }

.main { grid-area: main; min-width: 0; padding: 0 24px 20px 24px; }
.sheet { min-height: calc(100vh - 96px); padding-bottom: 100px; }
.page-head { position: sticky; top: 76px; z-index: 6; display: flex; align-items: flex-end; gap: 14px; padding: 14px 8px 18px; background: var(--bg); }
.page-head h1 { font: 600 clamp(30px, 3.4vw, 44px)/1 var(--font-display); letter-spacing: -.02em; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-bottom: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.view { padding: 0 8px 28px; max-width: 1240px; }
/* Menú oculto con ☰: solo en escritorio (en pantallas estrechas el menú ya es un panel desplegable) */
@media (min-width: 901px) {
  body.nav-hidden .app { grid-template-columns: 0 minmax(0, 1fr); }
  body.nav-hidden .sidebar { visibility: hidden; padding: 0; border: 0; }
  body.nav-hidden .main { padding-left: 24px; }
}

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink); border-radius: 99px;
  cursor: pointer; font-weight: 500; white-space: nowrap; transition: transform .12s, background .15s, box-shadow .15s;
}
.btn .ic { width: 18px; height: 18px; stroke-width: 2.3; }
.btn:has(.ic) { padding-left: 18px; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { box-shadow: 0 4px 0 var(--pink); transform: translateY(-1px); }
.btn.tonal { background: var(--pink); border-color: var(--pink); color: #1d1b16; }
.btn.tonal:hover { box-shadow: 0 4px 0 var(--ink); transform: translateY(-1px); }
.btn.text { border-color: transparent; padding: 0 14px; }
.btn.danger { color: var(--danger); border-color: currentColor; }
.btn.text.danger { border-color: transparent; }
.btn.small { height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn.small:has(.ic) { padding-left: 12px; }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; transform: none; }
.icon-btn { border: 0; background: transparent; cursor: pointer; width: 42px; height: 42px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; color: var(--ink); transition: background .15s; }
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { background: var(--press); }
.icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.icon-btn.sm { width: 34px; height: 34px; }

/* ---------- campos ---------- */
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], input[type=time],
input[type=search]:not(#search-input), input:not([type]), select, textarea {
  width: 100%; height: 50px; padding: 0 16px; border: 2px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
  outline: none; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%238a8478' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 20px; }
select option, select optgroup { background: var(--surface); color: var(--text); }
textarea { height: auto; min-height: 96px; padding: 13px 16px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--surface-3); }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--pink-soft); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: default; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--ink); }
label.field { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
label.field > span { font-weight: 500; padding-left: 4px; }
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 42px; color: var(--text); font-weight: 500; }
.check input { width: 20px; height: 20px; }

/* ---------- superficies ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 22px; border: 0; }
.card.filled { background: var(--surface-1); }
.card h3 { margin: 0 0 14px; font: 500 19px/1.2 var(--font-display); letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.card h3 .ic { width: 22px; height: 22px; }
.section { margin-top: 16px; }
.section-title { font: 600 16px var(--font-display); letter-spacing: -.01em; margin: 0 0 10px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border-radius: var(--r); padding: 18px 20px 20px; position: relative; overflow: hidden; }
.kpi .v { font: 600 clamp(24px, 2.4vw, 34px)/1.05 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.kpi .l { font-size: 13px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.kpis > .kpi:nth-child(4n+1) { background: var(--lavender); color: #1c1b18; }
.kpis > .kpi:nth-child(4n+2) { background: var(--yellow); color: #1c1b18; }
.kpis > .kpi:nth-child(4n+3) { background: var(--mint); color: #1c1b18; }
.kpis > .kpi:nth-child(4n+4) { background: var(--blush); color: #1c1b18; }
.kpis > .kpi .l { color: rgba(28,27,24,.68); }
.kpi.accent { background: var(--terracotta) !important; color: #1c1b18; }
.kpi.accent .l { color: rgba(29,27,22,.7); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; font-size: 12.5px; font-weight: 500; padding: 0 11px; border-radius: 99px; background: var(--surface-1); color: var(--ink); white-space: nowrap; }
.chip .ic { width: 14px; height: 14px; }
a.chip:hover { background: var(--surface-2); }
.badge { display: inline-flex; align-items: center; height: 26px; font-size: 12.5px; font-weight: 600; padding: 0 12px; border-radius: 99px; white-space: nowrap; }
.st-borrador, .st-completado, .st-archivado { background: var(--surface-2); color: var(--muted); }
.st-enviado, .st-emitida { background: var(--lavender); color: #1c1b18; }
.st-aceptado, .st-pagada, .st-activo { background: var(--mint); color: #1c1b18; }
.st-rechazado, .st-vencida, .st-anulada { background: var(--terracotta); color: #1c1b18; }
.st-pausado { background: var(--yellow); color: #1c1b18; }

.tabs { display: inline-flex; gap: 4px; padding: 5px; margin: 0 0 22px; background: var(--surface); border-radius: 99px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 0 20px; height: 40px; cursor: pointer; color: var(--muted); font-weight: 500; border-radius: 99px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { background: var(--ink); color: var(--bg); }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: 99px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: none; padding: 0 16px; height: 38px; cursor: pointer; color: var(--muted); font-weight: 500; border-radius: 99px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--ink); color: var(--bg); }

table.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.table th, .table td { padding: 14px 16px; text-align: left; border-bottom: 1.5px solid var(--divider); }
.table th { font: 500 13px var(--font); letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; transition: background .12s; }
.table tbody tr.click:hover { background: var(--pink-soft); }
.table-wrap { overflow-x: auto; border-radius: var(--r); }

.empty { text-align: center; padding: 40px 20px 56px; color: var(--muted); }
.empty .big { width: 190px; margin: 0 auto 6px; animation: bob 4s ease-in-out infinite; }
.empty h4 { font: 600 26px/1.05 var(--font-display); letter-spacing: -.02em; color: var(--ink); margin: 8px 0 8px; }
.empty > div:not(.big) { max-width: 420px; margin: 0 auto; }

/* ---------- tareas ---------- */
.hello { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; background: var(--lavender); color: #1c1b18; border-radius: var(--r-lg); padding: 26px 28px 0; margin-bottom: 18px; overflow: hidden; }
.hello p { color: rgba(29,27,22,.7) !important; }
.crew { display: flex; align-items: flex-end; padding-right: 6px; }
.crew > span { display: block; width: 118px; margin-left: -20px; transform: translateY(14%) rotate(calc((var(--i) - 1) * 7deg)); animation: bob 4s ease-in-out infinite; animation-delay: calc(var(--i) * -1.3s); }
.crew > span:first-child { margin-left: 0; }
.crew > span:nth-child(2) { width: 134px; z-index: 1; }
.hello h2 { font: 600 clamp(30px, 4vw, 52px)/.95 var(--font-display); letter-spacing: -.02em; margin: 0 0 8px; }
.hello p { margin: 0 0 24px; color: rgba(243,238,230,.75); font-weight: 600; }
.hello .blob { margin-bottom: -2px; }
.task-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.task-summary div { background: var(--surface); border-radius: var(--r); padding: 16px 18px; }
/* Hoy: cada bloque un color distinto y sin parecidos (saludo lavanda; aquí mostaza, menta, rubor y terracota) */
.task-summary div:nth-child(1) { background: var(--yellow); color: #1c1b18; }
.task-summary div:nth-child(2) { background: var(--mint); color: #1c1b18; }
.task-summary div:nth-child(3) { background: var(--blush); color: #1c1b18; }
.task-summary div:nth-child(4) { background: var(--terracotta); color: #1c1b18; }
.task-summary b { display: block; font: 600 30px/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.task-summary span { font-size: 13px; font-weight: 600; opacity: .72; }
.quick-add { display: flex; align-items: center; gap: 6px; height: 60px; padding: 0 8px 0 18px; margin-bottom: 10px; border-radius: 99px; background: var(--surface); border: 2px solid transparent; transition: border-color .15s, box-shadow .15s; }
.quick-add:focus-within { border-color: var(--ink); box-shadow: var(--shadow-2); }
.quick-add > .ic { color: var(--ink); stroke-width: 2.6; }
.quick-add input { flex: 1; border: 0 !important; box-shadow: none !important; background: transparent !important; height: 54px; font-size: 16px; font-weight: 500; }
.quick-add .btn { height: 44px; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.task-list { display: grid; gap: 8px; }
.task { display: flex; align-items: center; gap: 14px; padding: 12px 10px 12px 16px; border-radius: var(--r); cursor: pointer; min-height: 64px; background: var(--surface); transition: transform .12s, box-shadow .12s; }
.task:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.task.done { background: transparent; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.t-check { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--ink); flex: none; cursor: pointer; display: grid; place-items: center; color: transparent; background: transparent; padding: 0; transition: background .15s; }
.t-check .ic { width: 15px; height: 15px; stroke-width: 3.2; }
.t-check:hover { background: var(--pink-soft); color: var(--ink); }
.t-check.p1 { border-color: var(--p1); background: color-mix(in srgb, var(--p1) 18%, transparent); }
.t-check.p2 { border-color: var(--p2); background: color-mix(in srgb, var(--p2) 18%, transparent); }
.t-check.p3 { border-color: var(--p3); background: color-mix(in srgb, var(--p3) 18%, transparent); }
.task.done .t-check { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.t-body { flex: 1; min-width: 0; }
.t-title { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.t-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--muted); align-items: center; }
.t-meta .chip { height: 24px; font-size: 12px; }
.t-meta .chip.late { background: var(--terracotta); color: #1c1b18; }
.t-meta .meta-i { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.t-meta .meta-i .ic { width: 14px; height: 14px; }
.t-play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; flex: none; display: grid; place-items: center; transition: transform .15s, background .15s; }
.t-play .ic { width: 16px; height: 16px; margin-left: 2px; }
.task:hover .t-play { background: var(--pink); color: #1d1b16; transform: scale(1.06); }
.group-title { font: 500 17px var(--font-display); letter-spacing: -.01em; margin: 22px 8px 10px; display: flex; gap: 8px; align-items: center; }
.group-title .n { background: var(--ink); color: var(--bg); font-size: 12px; min-width: 22px; height: 22px; border-radius: 99px; display: inline-grid; place-items: center; padding: 0 6px; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.subtasks { display: grid; gap: 4px; margin-top: 4px; }
.subtask { display: flex; align-items: center; gap: 10px; }
.subtask input[type=text] { height: 42px; border-color: transparent; background: var(--surface-1); }
.subtask.done input[type=text] { text-decoration: line-through; color: var(--muted); }
.subtask input[type=checkbox] { width: 20px; height: 20px; flex: none; }

/* ---------- temporizador ---------- */
.timer-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.timer-card { --c: var(--yellow); --cs: var(--yellow-soft); position: relative; overflow: hidden; text-align: center; padding: 22px 20px 0; background: var(--c); color: #1d1b16; border-radius: 36px; min-height: 600px; display: flex; flex-direction: column; transition: background .4s; }
.timer-card.short { --c: var(--mint); --cs: var(--mint-soft); }
.timer-card.long { --c: var(--lavender); --cs: var(--lavender-soft); }
.timer-card.stopwatch { --c: var(--blush); --cs: var(--blush-soft); }
.timer-card .seg { background: rgba(255,255,255,.45); align-self: center; }
.timer-card .seg button { color: rgba(29,27,22,.7); }
.timer-card .seg button.active { background: #1d1b16; color: #f3eee6; }
.t-stage { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; padding-top: 26px; }
.t-time { font: 600 clamp(84px, 13vw, 150px)/.9 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.t-lbl { font: 500 17px var(--font); margin-top: 10px; opacity: .75; }
.timer-task { margin: 20px auto 0; width: min(440px, 100%); position: relative; z-index: 2; }
.timer-task select { background-color: rgba(255,255,255,.6); border-color: transparent; border-radius: 99px; font-weight: 600; color: #1d1b16; }
.timer-controls { display: flex; justify-content: center; gap: 16px; align-items: center; margin-top: 22px; position: relative; z-index: 2; }
.big-btn { min-width: 150px; height: 70px; padding: 0 34px; border-radius: 99px; border: 0; background: #1d1b16; color: #f3eee6; font: 600 18px var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .15s, box-shadow .15s; }
.big-btn .ic { width: 26px; height: 26px; }
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(29,27,22,.25); }
.round-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); color: #1d1b16; cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.round-btn:hover { background: #fff; }
.cycle-dots { display: flex; gap: 8px; justify-content: center; margin-top: 18px; position: relative; z-index: 2; }
.cycle-dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(29,27,22,.18); }
.cycle-dots span.on { background: #1d1b16; }
.ambient { display: inline-flex; align-self: center; align-items: center; gap: 10px; margin: 18px 0 0; background: rgba(255,255,255,.45); padding: 4px 16px 4px 4px; border-radius: 99px; position: relative; z-index: 2; }
.ambient select { width: auto; height: 40px; border: 0; border-radius: 99px; background-color: rgba(255,255,255,.7); font-weight: 600; color: #1d1b16; }
.ambient input[type=range] { accent-color: #1d1b16; }
.t-blob-wrap { position: relative; height: 230px; margin: 10px -20px 0; overflow: hidden; }
.t-blob { position: absolute; left: 50%; top: 120px; width: 280px; transform: translateX(-50%); transition: top .6s cubic-bezier(.2,.8,.2,1); }
.t-blob .blob { filter: drop-shadow(0 -2px 0 rgba(29,27,22,.06)); }
.goal-bar { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.goal-bar > div { height: 100%; background: var(--terracotta); border-radius: 99px; transition: width .4s; }
.session-item { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1.5px solid var(--divider); }
.session-item:last-child { border-bottom: 0; }
.session-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--terracotta); color: #1c1b18; }
.session-ic.sw { background: var(--lavender); }
.session-ic .ic { width: 18px; height: 18px; }
.timer-side .card:first-child { background: var(--mint); color: #1c1b18; }
.timer-side .card:first-child .muted { color: rgba(29,27,22,.65); }
.timer-side .card:first-child .goal-bar { background: rgba(255,255,255,.55); }
.timer-side .card:first-child .goal-bar > div { background: #1d1b16; }

body.focus-mode .sidebar, body.focus-mode .tabbar, body.focus-mode .appbar, body.focus-mode .page-head,
body.focus-mode .minitimer, body.focus-mode .timer-side, body.focus-mode .fab { display: none !important; }
body.focus-mode .app { grid-template-columns: 1fr; grid-template-rows: 1fr; grid-template-areas: "main"; }
body.focus-mode .main { padding: 0; }
body.focus-mode .view { padding: 0; max-width: none; }
body.focus-mode .timer-wrap { grid-template-columns: 1fr; }
body.focus-mode .timer-card { border-radius: 0; min-height: 100vh; }

.minitimer { position: fixed; right: 24px; bottom: 24px; z-index: 25; display: flex; align-items: center; gap: 2px; background: var(--ink); color: var(--bg); border-radius: 99px; padding: 6px; box-shadow: var(--shadow-3); }
.minitimer .icon-btn { color: var(--bg); }
.minitimer .icon-btn:hover { background: rgba(255,255,255,.12); }
.mt-info { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 4px 12px; border-radius: 99px; color: inherit; }
.mt-mode { width: 14px; height: 14px; border-radius: 50%; background: var(--yellow); }
.mt-mode.short { background: var(--mint); } .mt-mode.long { background: var(--lavender); } .mt-mode.stopwatch { background: var(--blush); }
.mt-time { font: 600 19px var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mt-task { opacity: .7; font-size: 13px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- proyectos ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.pcard { background: var(--surface); border-radius: var(--r-lg); padding: 20px 22px; cursor: pointer; transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden; }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: var(--pc, var(--pink)); }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.pcard h3 { margin: 0; font: 600 21px/1.1 var(--font-display); letter-spacing: -.02em; }
.p-avatar { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; color: #1d1b16; font: 600 20px var(--font-display); flex: none; }
.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 16px 0 8px; }
.progress > div { height: 100%; background: var(--pc, var(--pink)); border-radius: 99px; }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1.5px dashed var(--border); font-size: 12px; color: var(--muted); font-weight: 600; }
.pstats b { display: block; color: var(--ink); font: 600 18px var(--font-display); letter-spacing: -.02em; }

/* ---------- documentos ---------- */
.doc-editor { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 18px; align-items: start; }
.lines { width: 100%; border-collapse: collapse; }
.lines th { font: 500 13px var(--font); letter-spacing: 0; color: var(--muted); text-align: left; padding: 6px 4px; }
.lines td { padding: 4px; vertical-align: top; }
.lines input, .lines select { height: 46px; padding: 0 10px; }
.lines select { padding-right: 30px; background-position: right 6px center; }
.lines textarea { min-height: 46px; height: 46px; padding: 12px 10px; overflow: hidden; resize: none; }
.lines .c-desc { min-width: 180px; }
.lines .c-qty { width: 84px; } .lines .c-price { width: 116px; } .lines .c-iva { width: 92px; }
.lines .c-dto { width: 76px; } .lines .c-tot { width: 110px; text-align: right; padding-top: 16px; font-weight: 500; } .lines .c-del { width: 46px; padding-top: 6px; }
.totals { display: grid; gap: 10px; }
.totals .tr { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.totals .tr span:last-child { color: var(--ink); }
.totals .grand { font: 600 30px var(--font-display); letter-spacing: -.02em; color: var(--ink); border-top: 2px solid var(--ink); padding-top: 14px; margin-top: 6px; }
.doc-editor > .card[style*="sticky"] { background: var(--yellow); color: #1d1b16; }
.doc-editor > .card[style*="sticky"] .tr, .doc-editor > .card[style*="sticky"] .totals .tr span:last-child { color: #1d1b16; }
.doc-editor > .card[style*="sticky"] select { background-color: rgba(255,255,255,.6); border-color: transparent; color: #1d1b16; }
.doc-editor > .card[style*="sticky"] .grand { border-color: #1d1b16; color: #1d1b16; }
.doc-editor > .card[style*="sticky"] label.field { color: rgba(29,27,22,.7); }
.doc-editor > .card[style*="sticky"] .btn { color: #1d1b16; border-color: #1d1b16; }
.doc-editor > .card[style*="sticky"] .btn.tonal { background: #1d1b16; color: var(--yellow); }
.locked-note { display: flex; gap: 12px; align-items: flex-start; background: var(--lavender-soft); color: var(--ink); padding: 16px 18px; border-radius: var(--r); margin-bottom: 16px; font-weight: 500; }
.locked-note .ic { margin-top: 1px; }
.warn-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; font-weight: 600; margin: 12px 0 0; }
.warn-note .ic { width: 16px; height: 16px; }
.warn-note a { text-decoration: underline; }

/* ---------- gráficos ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 210px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .b > div { width: 100%; max-width: 38px; background: var(--pink); border-radius: 12px 12px 4px 4px; min-height: 3px; transition: height .4s; }
.bars .b:hover > div { background: var(--ink); }
.bars .b.money > div { background: var(--olive); }
.bars .b:not(.money):nth-child(6n+1) > div { background: var(--lavender); }
.bars .b:not(.money):nth-child(6n+2) > div { background: var(--yellow); }
.bars .b:not(.money):nth-child(6n+3) > div { background: var(--mint); }
.bars .b:not(.money):nth-child(6n+4) > div { background: var(--terracotta); }
.bars .b:not(.money):nth-child(6n+5) > div { background: var(--olive); }
.bars .b:not(.money):nth-child(6n+6) > div { background: var(--blush); }
.bars .b.money:nth-child(even) > div { background: var(--mint); }
.bars .b:hover > div { background: var(--ink) !important; }
.bars .b span { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 170px 1fr 90px; align-items: center; gap: 14px; margin: 11px 0; font-weight: 600; }
.hbar .track { height: 14px; background: var(--surface-1); border-radius: 99px; overflow: hidden; }
.hbar .track > div { height: 100%; border-radius: 99px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }

/* ---------- diálogos, menús, avisos ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(29,27,22,.45); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out; backdrop-filter: blur(3px); }
.modal { background: var(--surface); border-radius: 34px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-3); animation: pop .2s cubic-bezier(.2,.9,.3,1.2); }
.modal.wide { width: min(800px, 100%); }
.modal header { display: flex; align-items: center; padding: 26px 26px 6px; gap: 8px; }
.modal header h2 { font: 600 30px/1.05 var(--font-display); letter-spacing: -.02em; margin: 0; flex: 1; }
.modal .body { padding: 12px 26px 8px; display: grid; gap: 16px; }
.modal footer { display: flex; gap: 8px; padding: 18px 26px 26px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.menu { position: fixed; z-index: 55; background: var(--surface); border-radius: var(--r); border: 2px solid var(--ink); box-shadow: var(--shadow-3); padding: 8px; min-width: 250px; animation: pop .16s cubic-bezier(.2,.9,.3,1.2); }
.menu button { display: flex; align-items: center; gap: 14px; width: 100%; height: 46px; padding: 0 14px; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 14px; font-weight: 600; }
.menu button:hover { background: var(--pink); color: #1d1b16; }
.menu hr { border: 0; border-top: 1.5px dashed var(--border); margin: 6px 4px; }
.toast { position: fixed; left: 24px; bottom: 24px; transform: translateY(20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); padding: 15px 22px; border-radius: 99px; z-index: 60; transition: .22s cubic-bezier(.2,.9,.3,1.2); max-width: min(560px, calc(100vw - 32px)); font-weight: 600; box-shadow: var(--shadow-3); }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--pink); color: #1d1b16; }

.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; background: var(--bg);
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
.login-card { width: min(420px, 100%); background: var(--surface); border-radius: 32px; overflow: hidden; box-shadow: var(--shadow-2); animation: pop .45s cubic-bezier(.2,.9,.3,1.2); }
.login-art { position: relative; isolation: isolate; background: var(--lavender); height: 176px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.login-art::before { content: ""; position: absolute; z-index: -1; width: 110px; height: 110px; left: -22px; top: -26px; background: var(--yellow); -webkit-mask: var(--st-burst) center / contain no-repeat; mask: var(--st-burst) center / contain no-repeat; animation: spin-slow 40s linear infinite; }
.login-art::after { content: ""; position: absolute; z-index: -1; width: 46px; height: 46px; right: 26px; top: 22px; background: var(--terracotta); -webkit-mask: var(--st-cross) center / contain no-repeat; mask: var(--st-cross) center / contain no-repeat; animation: float 6s ease-in-out infinite; }
.login-art .crew { padding: 0; }
.login-art .crew > span { width: 92px; margin-left: -12px; }
.login-art .crew > span:first-child { margin-left: 0; }
.login-art .crew > span:nth-child(2) { width: 104px; }
.login-body { display: grid; gap: 14px; padding: 24px 28px 30px; }
.login-brand { display: flex; align-items: center; gap: 8px; font: 600 15px var(--font); color: var(--muted); }
.login-brand img { width: 26px; height: 26px; border-radius: 8px; }
.login h2 { font: 600 34px/1.05 var(--font-display); letter-spacing: -.02em; margin: 0; }
.login p { margin: -6px 0 4px; font-size: 15px; }
.login label.field input { background: var(--bg); border-color: var(--border); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.login-btn { width: 100%; height: 52px; font-size: 16px; margin-top: 4px; }
.login-err { min-height: 20px; color: var(--danger); font-size: 14px; font-weight: 500; text-align: center; }
.login-err:empty { min-height: 0; }

.fab { display: none; }
.backdrop { position: fixed; inset: 0; background: rgba(29,27,22,.4); z-index: 35; animation: fade .2s; }

/* ---------- tablet ---------- */
@media (max-width: 1250px) and (min-width: 901px) {
  .doc-editor { grid-template-columns: 1fr; }
  .doc-editor > .card[style*="sticky"] { position: static !important; }
  .timer-wrap { grid-template-columns: minmax(0,1fr) 300px; }
}

/* ---------- móvil ---------- */
.only-mobile { display: none !important; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; grid-template-areas: "bar" "main"; }
  .only-mobile { display: revert !important; }
  .appbar { padding: max(10px, env(safe-area-inset-top)) 14px 8px; }
  .appbar .brand, .appbar-end { display: none; }
  .search { max-width: none; }
  .search input { padding-left: 58px; height: 52px; }
  #menu-btn { position: absolute; left: 20px; top: max(16px, calc(env(safe-area-inset-top) + 6px)); z-index: 2; }
  .search-ic, .search .search-kbd { display: none; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; height: 100vh; height: 100dvh; padding-bottom: calc(40px + env(safe-area-inset-bottom)); width: min(320px, 86vw); transform: translateX(-102%); transition: transform .25s cubic-bezier(.2,0,0,1); background: var(--surface); border-radius: 0; padding-top: 0; border-top: 0; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-3); }
  .sidebar .create-btn { display: none; }
  .main { padding: 0; }
  .sheet { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
  /* iOS: 16 px evita el zoom automático al tocar un campo */
  input, select, textarea, .search input { font-size: 16px !important; }
  /* Distancia a la barra del navegador (Chrome/Safari iOS), medida en vivo por app.js en --vv-gap */
  :root { --safe-b: calc(env(safe-area-inset-bottom) + var(--vv-gap, 0px)); }
  body.kb-open .tabbar, body.kb-open .fab, body.kb-open .minitimer { display: none !important; }
  .page-head { top: 70px; padding: 8px 18px 14px; }
  .page-head h1 { font-size: 34px; }
  .page-actions .btn .lbl { display: none; }
  .page-actions .btn:has(.ic) { padding: 0; width: 44px; }
  .view { padding: 0 14px 24px; }
  .tabbar { position: fixed; bottom: calc(10px + var(--safe-b)); left: 12px; right: 12px; z-index: 30; display: grid !important; grid-template-columns: repeat(5, 1fr); background: var(--tab-bg); border: 1px solid var(--tab-border); border-radius: 99px; padding: 8px 6px; box-shadow: var(--shadow-3); transform: translateZ(0); will-change: bottom; transition: bottom .2s; }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--tab-fg); }
  .tabbar .ind { width: 52px; height: 32px; border-radius: 99px; display: grid; place-items: center; transition: background .2s; }
  .tabbar a.active { color: var(--tab-fg-on); }
  .tabbar a.active .ind { background: var(--pink); color: #1c1b18; }
  .fab { display: grid !important; place-items: center; position: fixed; right: 18px; bottom: calc(96px + var(--safe-b)); z-index: 31; width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--pink); color: #1d1b16; box-shadow: var(--shadow-3); cursor: pointer; }
  .fab .ic { width: 26px; height: 26px; stroke-width: 2.6; }
  body.has-timer .fab { bottom: calc(166px + var(--safe-b)); }
  body.route-timer .fab { display: none !important; }
  .minitimer { left: 14px; right: 14px; bottom: calc(92px + var(--safe-b)); justify-content: space-between; }
  .mt-task { max-width: none; flex: 1; text-align: left; }
  .toast { left: 16px; right: 16px; bottom: calc(100px + var(--safe-b)); border-radius: 22px; }
  .timer-wrap, .doc-editor { grid-template-columns: minmax(0, 1fr); }
  .timer-card { min-height: 560px; border-radius: 30px; padding: 16px 12px 0; }
  .t-blob-wrap { margin: 10px -12px 0; height: 190px; }
  .t-blob { width: 230px; }
  .hello { grid-template-columns: 1fr; }
  .hello .crew { justify-self: end; }
  .hello p { margin-bottom: 4px; }
  .crew > span { width: 84px; margin-left: -14px; }
  .crew > span:nth-child(2) { width: 96px; }
  .timer-card .seg button { padding: 0 11px; }
  .ambient { max-width: calc(100% - 8px); }
  .ambient select { min-width: 0; flex: 1; }
  .ambient input[type=range] { width: 70px !important; flex: none; }
  .timer-card .seg button { padding: 0 10px; font-size: 13.5px; }
  .big-btn { min-width: 0; height: 64px; padding: 0 28px; }
  .kpis, .task-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hello { padding: 20px 20px 0; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 1fr 1fr 1fr 46px; gap: 6px; padding: 10px 0; border-bottom: 1.5px dashed var(--border); }
  .lines td { padding: 0; width: auto !important; }
  .lines td.c-desc { grid-column: 1 / -1; }
  .lines td.c-tot { grid-column: 1 / 4; text-align: left; padding: 4px 0 0; }
  .lines td.c-dto { display: none; }
  .hbar { grid-template-columns: 100px 1fr 70px; }
  .modal-back { align-items: end; padding: 0; }
  .modal, .modal.wide { width: 100%; border-radius: 30px 30px 0 0; max-height: 92vh; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 520px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kpi .v, .task-summary b { font-size: 24px; }
  .quick-add .btn { display: none; }
  .hello h2 { font-size: 30px; }
}

/* ---------- pegatinas (formas decorativas como en la referencia) ---------- */
:root {
  --st-burst: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='98,50 77.7,61.5 83.9,83.9 61.5,77.7 50,98 38.5,77.7 16.1,83.9 22.3,61.5 2,50 22.3,38.5 16.1,16.1 38.5,22.3 50,2 61.5,22.3 83.9,16.1 77.7,38.5' stroke='black' stroke-width='6' stroke-linejoin='round'/%3E%3C/svg%3E");
  --st-flower: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='30' cy='30' r='22'/%3E%3Ccircle cx='70' cy='30' r='22'/%3E%3Ccircle cx='30' cy='70' r='22'/%3E%3Ccircle cx='70' cy='70' r='22'/%3E%3Crect x='25' y='25' width='50' height='50'/%3E%3C/svg%3E");
  --st-heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 90 C20 68 4 52 4 33 C4 17 16 7 30 7 C40 7 46 13 50 19 C54 13 60 7 70 7 C84 7 96 17 96 33 C96 52 80 68 50 90Z'/%3E%3C/svg%3E");
  --st-cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='33' y='4' width='34' height='92' rx='13'/%3E%3Crect x='4' y='33' width='92' height='34' rx='13'/%3E%3C/svg%3E");
}
.kpi, .task-summary div { position: relative; overflow: hidden; isolation: isolate; }
.kpi::after, .task-summary div::after {
  content: ""; position: absolute; right: -16px; bottom: -18px; width: 84px; height: 84px; z-index: -1;
  background: rgba(255,255,255,.4); -webkit-mask: var(--sticker, var(--st-burst)) center / contain no-repeat; mask: var(--sticker, var(--st-burst)) center / contain no-repeat;
  transform: rotate(-12deg); transition: transform .6s cubic-bezier(.3,1.5,.5,1);
}
.kpis > .kpi:nth-child(4n+2)::after, .task-summary div:nth-child(4n+2)::after, .kpis > .kpi:nth-child(4n+4)::after, .task-summary div:nth-child(4n+4)::after { background: rgba(28,27,24,.06); }
.kpis > .kpi:nth-child(4n+2), .task-summary div:nth-child(4n+2) { --sticker: var(--st-flower); }
.kpis > .kpi:nth-child(4n+3), .task-summary div:nth-child(4n+3) { --sticker: var(--st-heart); }
.kpis > .kpi:nth-child(4n+4), .task-summary div:nth-child(4n+4) { --sticker: var(--st-cross); }
.kpi:hover::after, .task-summary div:hover::after { transform: rotate(18deg) scale(1.12); }
.hello { position: relative; isolation: isolate; }
.hello::before, .hello::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.hello::before { width: 130px; height: 130px; right: 300px; top: -40px; background: var(--mint); -webkit-mask: var(--st-burst) center / contain no-repeat; mask: var(--st-burst) center / contain no-repeat; animation: spin-slow 40s linear infinite; opacity: .9; }
.hello::after { width: 62px; height: 62px; right: 34px; top: 18px; background: rgba(255,255,255,.6); -webkit-mask: var(--st-cross) center / contain no-repeat; mask: var(--st-cross) center / contain no-repeat; transform: rotate(14deg); animation: float 6s ease-in-out infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(14deg); } 50% { transform: translateY(-8px) rotate(24deg); } }
.hello .crew { position: relative; z-index: 1; }

/* ---------- animaciones ---------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti-layer i { position: absolute; display: block; will-change: transform, opacity; }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
.bars .b > div { transform-origin: bottom; animation: grow-y .75s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i, 0) * 35ms + 120ms); }
.hbar .track > div, .progress > div, .goal-bar > div { transform-origin: left; animation: grow-x .9s cubic-bezier(.2,.8,.2,1) .2s backwards; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.035, .965); } }
.t-blob .blob { transform-origin: 50% 100%; cursor: pointer; }
.t-blob.running .blob { animation: breathe 2.8s ease-in-out infinite; }
.blob .eyes { transform-box: fill-box; transform-origin: center; animation: blink 6s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
.crew > span { cursor: pointer; }
.crew > span svg { transform-origin: 50% 100%; }

/* microinteracciones */
.task { transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, background .2s; }
.task:hover { transform: translateY(-2px); }
.t-check { transition: background .2s, transform .15s; }
.t-check:active { transform: scale(.85); }
.t-play:active, .icon-btn:active, .round-btn:active, .big-btn:active { transform: scale(.92); }
.kpi, .task-summary div { transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.kpi:hover, .task-summary div:hover { transform: translateY(-3px); }
.pcard { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
.nav a { transition: background .18s, color .18s, box-shadow .25s cubic-bezier(.2,.8,.2,1), padding-left .2s cubic-bezier(.2,.8,.2,1); }
.nav a:hover:not(.active) { padding-left: 27px; }
.nav a .ic { transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.nav a:hover .ic { transform: scale(1.12) rotate(-6deg); }
.menu button { animation: menu-in .3s cubic-bezier(.2,.8,.2,1) backwards; }
.menu button:nth-child(2) { animation-delay: .03s; } .menu button:nth-child(3) { animation-delay: .06s; } .menu button:nth-child(5) { animation-delay: .09s; }
.menu button:nth-child(6) { animation-delay: .12s; } .menu button:nth-child(7) { animation-delay: .15s; } .menu button:nth-child(9) { animation-delay: .18s; } .menu button:nth-child(10) { animation-delay: .21s; }
@keyframes menu-in { from { opacity: 0; transform: translateX(-8px); } }
.table tbody tr { transition: background .15s; }
.badge { transition: transform .2s; }
tr:hover .badge { transform: scale(1.06); }
.fab, .create-btn .ic { transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.create-btn:hover .ic { transform: rotate(-15deg) scale(1.1); }
.fab:hover { transform: rotate(90deg); }
.minitimer { animation: slide-up .45s cubic-bezier(.2,.9,.3,1.2); }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }
.mt-mode { animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); } 50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- tipografía (Plus Jakarta Sans: titulares gruesos y apretados) ---------- */
body { font-weight: 500; letter-spacing: -.005em; }
.page-head h1 { font-weight: 800; letter-spacing: -.04em; }
.hello h2 { font-weight: 800; letter-spacing: -.045em; line-height: .98; }
.login h2, .empty h4 { font-weight: 800; letter-spacing: -.035em; }
.modal header h2 { font-weight: 800; letter-spacing: -.035em; }
.card h3, .group-title, .section-title { font-weight: 700; letter-spacing: -.02em; }
.kpi .v, .task-summary b, .pstats b, .totals .grand { font-weight: 800; letter-spacing: -.035em; }
.t-time { font-weight: 800; letter-spacing: -.055em; }
.brand span { font-weight: 800; letter-spacing: -.035em; }
.btn, .create-btn, .tabs button, .seg button, .badge, .chip { font-weight: 600; }
.t-title { font-weight: 600; letter-spacing: -.01em; }
.nav a { font-weight: 500; }
.nav a.active { font-weight: 700; }
.kpi .l, .task-summary span { font-weight: 600; }

/* ---------- degradados muy sutiles ---------- */
:root {
  --grad-angle: 145deg;
  --g-lavender: linear-gradient(var(--grad-angle), color-mix(in srgb, var(--lavender) 86%, #fff) 0%, var(--lavender) 55%, color-mix(in srgb, var(--lavender) 88%, var(--mint)) 100%);
  --g-yellow: linear-gradient(var(--grad-angle), color-mix(in srgb, var(--yellow) 82%, #fff) 0%, var(--yellow) 55%, color-mix(in srgb, var(--yellow) 88%, var(--terracotta)) 100%);
  --g-mint: linear-gradient(var(--grad-angle), color-mix(in srgb, var(--mint) 80%, #fff) 0%, var(--mint) 55%, color-mix(in srgb, var(--mint) 86%, var(--lavender)) 100%);
  --g-blush: linear-gradient(var(--grad-angle), color-mix(in srgb, var(--blush) 75%, #fff) 0%, var(--blush) 55%, color-mix(in srgb, var(--blush) 88%, var(--yellow)) 100%);
  --g-terracotta: linear-gradient(var(--grad-angle), color-mix(in srgb, var(--terracotta) 84%, #fff) 0%, var(--terracotta) 55%, color-mix(in srgb, var(--terracotta) 88%, var(--yellow)) 100%);
}
body {
  background:
    radial-gradient(800px 520px at -5% 105%, color-mix(in srgb, var(--mint) 22%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.appbar, .page-head { background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.kpis > .kpi:nth-child(4n+1) { background: var(--g-lavender); }
.kpis > .kpi:nth-child(4n+2) { background: var(--g-yellow); }
.kpis > .kpi:nth-child(4n+3) { background: var(--g-mint); }
.kpis > .kpi:nth-child(4n+4) { background: var(--g-blush); }
.kpi.accent { background: var(--g-terracotta) !important; }
.task-summary div:nth-child(1) { background: var(--g-yellow); }
.task-summary div:nth-child(2) { background: var(--g-mint); }
.task-summary div:nth-child(3) { background: var(--g-blush); }
.task-summary div:nth-child(4) { background: var(--g-terracotta); }
.hello, .login-art { background: var(--g-lavender); }
.timer-side .card:first-child { background: var(--g-mint); }
.doc-editor > .card[style*="sticky"] { background: var(--g-yellow); }
.timer-card { background: linear-gradient(var(--grad-angle), color-mix(in srgb, var(--c) 84%, #fff) 0%, var(--c) 50%, color-mix(in srgb, var(--c) 90%, var(--blush)) 100%); }
.pcard { background: linear-gradient(180deg, color-mix(in srgb, var(--pc, var(--surface)) 9%, var(--surface)) 0%, var(--surface) 45%); }
.task { background: linear-gradient(100deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 92%, #fff) 100%); }
.task.done { background: transparent; }

/* ---------- barra inferior (píldora translúcida, icono activo en círculo) ---------- */
@media (max-width: 900px) {
  .tabbar {
    left: 16px; right: 16px; padding: 7px; gap: 2px;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    box-shadow: 0 10px 34px rgba(28,27,24,.14), inset 0 1px 0 rgba(255,255,255,.45);
  }
  .tabbar a { font-size: 0; color: var(--ink); justify-items: center; align-items: center; }
  .tabbar .ind { width: 54px; height: 54px; border-radius: 50%; transition: background .25s, color .25s, transform .25s cubic-bezier(.3,1.5,.5,1); }
  .tabbar .ind .ic { width: 23px; height: 23px; stroke-width: 1.9; }
  .tabbar a:active .ind { transform: scale(.9); }
  .tabbar a.active { color: var(--ink); }
  .tabbar a.active .ind { background: var(--ink); color: var(--bg); box-shadow: 0 6px 16px rgba(28,27,24,.22); }
  .fab { bottom: calc(100px + var(--safe-b)); }
  body.has-timer .fab { bottom: calc(170px + var(--safe-b)); }
  .minitimer { bottom: calc(96px + var(--safe-b)); }
}

/* ---------- brillo degradado en pastillas y elementos de color ---------- */
:root {
  --sheen: linear-gradient(145deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,0) 58%, rgba(28,27,24,.05) 100%);
  --sheen-dark: linear-gradient(145deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 60%);
}
.badge, .t-meta .chip.late, .nav a.active .count, .p-avatar, .session-ic, .fab, .btn.tonal,
.mt-mode, .dot, .cycle-dots span.on, .tabbar a.active .ind, .login-brand img, .chip .dot {
  background-image: var(--sheen) !important;
}
.bars .b > div, .progress > div, .goal-bar > div, .hbar .track > div {
  background-image: linear-gradient(180deg, rgba(255,255,255,.38) 0%, rgba(255,255,255,0) 70%) !important;
}
.hbar .track > div, .progress > div, .goal-bar > div { background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.35) 100%) !important; }
.btn.primary, .create-btn, .big-btn, .t-play, .tabs button.active, .seg button.active, .group-title .n, .minitimer {
  background-image: var(--sheen-dark);
}
.chip { background-image: linear-gradient(145deg, rgba(255,255,255,.35), rgba(255,255,255,0) 60%); }
.st-pagada, .st-aceptado, .st-activo { background-color: var(--mint) !important; }
.st-vencida, .st-rechazado, .st-anulada { background-color: var(--terracotta) !important; }
.st-emitida, .st-enviado { background-color: var(--lavender) !important; }
.st-pausado { background-color: var(--yellow) !important; }
.st-borrador, .st-completado, .st-archivado { background-color: var(--surface-2) !important; }

/* ---------- menú izquierdo con el lenguaje del resto (cristal, icono activo en círculo) ---------- */
@media (min-width: 901px) {
  .sidebar {
    background: color-mix(in srgb, var(--surface) 62%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
    border-right: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-top: 0;
    padding: 14px 0 100px;
  }
  .create-btn { width: calc(100% - 32px); margin: 0 16px 14px; height: 50px; border-radius: 99px; justify-content: center; box-shadow: 0 8px 20px rgba(28,27,24,.18); }
  .create-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(28,27,24,.22); }
}
.nav a { height: 46px; padding: 0 16px 0 14px; gap: 12px; box-shadow: none !important; background: transparent; }
.nav a > i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: background .25s, color .25s, transform .25s cubic-bezier(.3,1.5,.5,1); }
.nav a > i .ic { width: 19px; height: 19px; }
.nav a:hover:not(.active) { background: transparent; padding-left: 14px; }
.nav a:hover:not(.active) > i { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.nav a:hover .ic { transform: none; }
.nav a.active { background: transparent; color: var(--ink); }
.nav a.active > i { background: var(--ink); color: var(--bg); background-image: var(--sheen-dark); box-shadow: 0 6px 14px rgba(28,27,24,.2); }
.nav .count { border-radius: 99px; min-width: 24px; height: 22px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.nav a.active .count { background-color: var(--terracotta); color: #1c1b18; }
.nav-group { border-top: 0; margin-top: 8px; padding: 18px 22px 6px; font-weight: 700; color: var(--subtle); letter-spacing: -.01em; }
.nav .pdot .dot { width: 12px; height: 12px; border-radius: 50%; }
.nav a.active > i.pdot { background: var(--ink); }

/* ---------- impresión (presupuestos/facturas) ---------- */
.print-root { display: none; }
@font-face { font-family: "Gotham DI"; src: url(/fonts/gotham-light.otf) format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Gotham DI"; src: url(/fonts/gotham-book.otf) format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gotham DI"; src: url(/fonts/gotham-medium.otf) format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Gotham DI"; src: url(/fonts/gotham-bold.otf) format("opentype"); font-weight: 700; font-display: swap; }
.doc-paper {
  --dp-blue: #515cff; --dp-pink: #ff4f9a; --dp-red: #ff4956;
  --dp-ink: #2b2b2b; --dp-soft: #8c8c8c; --dp-line: #ededed;
  --dp-font: "Gotham DI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  position: relative; display: flex; flex-direction: column; background: #fff; color: var(--dp-ink);
  width: 210mm; min-height: 297mm; padding: 16mm 17mm 12mm; margin: 0 auto; box-sizing: border-box; overflow: hidden;
  font: 400 8.6pt/1.6 var(--dp-font); box-shadow: var(--shadow-1); font-variant-numeric: tabular-nums;
}
.doc-paper > * { position: relative; }
/* brillos de las esquinas, como en davidiceberk.com */
.dp-corner { position: absolute !important; top: 0; width: 92mm; height: 64mm; pointer-events: none; overflow: hidden; z-index: 0; }
.dp-corner--left { left: 0; background: radial-gradient(82mm 56mm at 0 0, rgba(81,92,255,.6) 0%, rgba(81,92,255,.36) 30%, rgba(81,92,255,.1) 65%, rgba(81,92,255,0) 100%); }
.dp-corner--right { right: 0; background: radial-gradient(82mm 56mm at 100% 0, rgba(81,92,255,.6) 0%, rgba(81,92,255,.36) 30%, rgba(81,92,255,.1) 65%, rgba(81,92,255,0) 100%); }
.dp-corner::after { content: ''; position: absolute; top: -11mm; width: 58mm; height: 41mm; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,79,154,.42), rgba(255,79,154,.14) 60%, rgba(255,79,154,0)); }
.dp-corner--left::after { left: 6mm; }
.dp-corner--right::after { right: 6mm; }
.dp-brand { position: absolute !important; top: 10mm; left: 16mm; width: 22mm; z-index: 1; }
.dp-watermark {
  position: absolute !important; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 0;
  font: 700 84pt var(--dp-font); color: rgba(81,92,255,.06); transform: rotate(-24deg); letter-spacing: .04em;
}
/* cabecera */
.doc-paper .dp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 24mm 0 0; margin: 0; border: 0; background: none; }
.dp-issuer { min-width: 0; }
.dp-logo { max-height: 44px; max-width: 160px; margin-bottom: 10px; display: block; }
.dp-name { font: 500 12.5pt/1.25 var(--dp-font); color: #111; }
.dp-chip { font-size: 8.4pt; color: var(--dp-blue); margin-bottom: 8px; }
.dp-issuer-data { color: var(--dp-soft); font-size: 8pt; line-height: 1.7; }
.dp-docbox { flex: none; width: 68mm; text-align: right; margin-top: -14mm; }
.dp-kind { font: 300 24pt/1 var(--dp-font); color: #111; margin-bottom: 16mm; letter-spacing: -.01em; }
.dp-meta { display: grid; }
.dp-meta > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border-bottom: 1px solid var(--dp-line); }
.dp-meta span { font-size: 7.8pt; color: var(--dp-soft); }
.dp-meta b { font-size: 8.6pt; font-weight: 500; white-space: nowrap; }
.dp-meta > div:first-child b { color: var(--dp-blue); }
/* asunto y cliente */
.dp-subject { margin: 24px 0 0; font: 500 10.5pt/1.45 var(--dp-font); color: #111; }
.dp-rule { margin-top: 20px; }
.dp-client { margin: 18px 0 26px; font-size: 8.4pt; line-height: 1.65; }
.dp-label { display: block; font-size: 7pt; font-weight: 500; color: var(--dp-blue); margin-bottom: 5px; letter-spacing: .14em; text-transform: uppercase; }
.dp-client-name { font: 500 9.6pt var(--dp-font); color: #111; }
.dp-soft { color: var(--dp-soft); }
.dp-small { font-size: 7.4pt; margin-top: 6px; }
/* conceptos */
.dp-lines { width: 100%; border-collapse: collapse; }
.dp-lines th {
  font-size: 6.8pt; font-weight: 500; color: var(--dp-blue); text-transform: uppercase; letter-spacing: .12em;
  text-align: right; padding: 0 6px 8px; white-space: nowrap; border-bottom: 1.5px solid var(--dp-blue);
}
.dp-lines th:first-child, .dp-lines td:first-child { padding-left: 0; }
.dp-lines th:last-child, .dp-lines td:last-child { padding-right: 0; }
.dp-lines td { text-align: right; padding: 10px 6px; border-bottom: 1px solid var(--dp-line); vertical-align: top; white-space: nowrap; }
.dp-lines .l, .dp-paytable .l { text-align: left; }
.dp-lines td.l { white-space: pre-wrap; width: 40%; padding-right: 14px; color: #111; }
.dp-lines .b, .dp-paytable .b { font-weight: 500; color: #111; }
/* totales */
.dp-summary { margin: 18px 0 0 auto; width: 76mm; break-inside: avoid; }
.dp-summary > .dp-label { display: none; }
.dp-totals { display: grid; }
.dp-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.dp-totals span { color: var(--dp-soft); font-size: 8pt; white-space: nowrap; }
.dp-totals b { font-size: 8.6pt; font-weight: 400; white-space: nowrap; }
.dp-totals .dp-grand {
  margin-top: 10px; padding: 11px 14px; align-items: baseline; color: #fff;
  background: linear-gradient(110deg, var(--dp-blue) 0%, #7a63f6 55%, var(--dp-pink) 100%);
}
.dp-totals .dp-grand span { color: rgba(255,255,255,.85); font-size: 7.4pt; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.dp-totals .dp-grand b { font: 500 15pt var(--dp-font); color: #fff; }
.dp-summary .dp-small { text-align: right; }
/* cobro, notas, firma */
.dp-section-title { font-size: 7pt; font-weight: 500; color: var(--dp-blue); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 8px; }
.dp-payment { margin-top: 30px; break-inside: avoid; }
.dp-paytable { width: 100%; border-collapse: collapse; }
.dp-paytable th { font-size: 7.4pt; font-weight: 400; color: var(--dp-soft); text-align: right; padding: 0 6px 6px 0; }
.dp-paytable td { text-align: right; padding: 8px 6px 8px 0; border-top: 1px solid var(--dp-line); border-bottom: 1px solid var(--dp-line); }
.dp-paytable td:last-child, .dp-paytable th:last-child { padding-right: 0; }
.dp-iban { letter-spacing: .4px; font-weight: 500; color: #111; }
.dp-notes { margin-top: 22px; break-inside: avoid; }
.dp-pre { white-space: pre-wrap; color: #555; font-size: 8.2pt; }
.dp-sign { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; }
.dp-sign-line { border-bottom: 1px solid #d6d6d6; height: 46px; margin-bottom: 4px; }
.dp-foot {
  padding-top: 10px; border-top: 1px solid var(--dp-line); display: flex; justify-content: space-between; align-items: center;
  gap: 16px; font-size: 7pt; color: var(--dp-soft); margin-top: 0;
}
.dp-foot span:last-child { white-space: nowrap; color: var(--dp-red); }
.dp-spacer { flex: 1; min-height: 22px; }
.preview-modal .body { display: block; background: var(--surface-1); padding: 16px; overflow: hidden; }
.preview-modal .doc-paper { transform-origin: top left; }

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .app, #modal-root, .toast { display: none !important; }
  .print-root { display: block; }
  .doc-paper { box-shadow: none; width: 210mm; min-height: 297mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* la cabecera fija no debe tapar las tarjetas cuando se elevan al pasar el raton */
.view { padding-top: 8px; }
.page-head { padding-bottom: 10px; }
@media (max-width: 900px) { .page-head { padding-bottom: 8px; } }
