/* Bona Mà · área de clientes. Mobile first: la base es móvil (390 px), los @media amplían. */

@font-face { font-family: 'DM Sans'; font-weight: 400; font-display: swap; src: url('/fonts/dm-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-display: swap; src: url('/fonts/dm-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 700; font-display: swap; src: url('/fonts/dm-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 600; font-display: swap; src: url('/fonts/bricolage-grotesque-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 800; font-display: swap; src: url('/fonts/bricolage-grotesque-latin-800-normal.woff2') format('woff2'); }

:root {
  --green: #1F3D2B;
  --green-dark: #142A1D;
  --green-mid: #2C5039;
  --green-soft: #E6EEE7;
  --green-tint: #F0F5F1;
  --mustard: #E0A93B;
  --mustard-soft: #FBEBD0;
  --mustard-dark: #6B4A0E;
  --ink: #17201A;
  --text: #2E3B32;
  --muted: #4A5A4F;
  --line: #DCE2DC;
  --line-strong: #B7C2B9;
  --bg: #F5F6F2;
  --white: #FFFFFF;
  --danger: #A52A1A;
  --danger-soft: #F8E3DF;
  --blue: #1D3E6B;
  --blue-soft: #DCE7F5;
  --grey-soft: #ECEDE8;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 6px 20px rgba(23, 32, 26, 0.07);
  --shadow-lg: 0 14px 40px rgba(23, 32, 26, 0.14);
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --gutter: 16px;
  --topbar-h: 56px;
  --tabbar-h: 68px;
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 8px; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }
[hidden], .is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--white); padding: 10px 14px; border-radius: 8px; z-index: 200; }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; margin: 16px 0; }
.stack > * + * { margin-top: 14px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 2px solid transparent; font-weight: 700; font-size: 0.98rem; text-decoration: none; cursor: pointer; text-align: center; transition: background-color .15s, color .15s, border-color .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(0.98); }
.btn-lg { min-height: 54px; font-size: 1.05rem; }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: 0.92rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); color: var(--white); }
.btn-accent { background: var(--mustard); color: var(--ink); }
.btn-accent:hover { background: #ECBB55; color: var(--ink); }
.btn-outline { border-color: var(--line-strong); color: var(--green); background: var(--white); }
.btn-outline:hover { border-color: var(--green); }
.btn-danger { color: var(--danger); }
.btn-icon { width: 46px; padding: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn { flex: 1 1 auto; }
.btn-link { background: none; border: 0; padding: 8px; color: var(--green); text-decoration: underline; cursor: pointer; min-height: 44px; }
.btn-link.danger { color: var(--danger); }

/* Estructura */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); padding: 0 8px 0 12px; background: var(--green); color: var(--white); display: flex; align-items: center; gap: 8px; padding-top: env(safe-area-inset-top); box-sizing: content-box; }
.top-brand, .top-back { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--white); border-radius: 10px; }
.top-title { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-avatar { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; }
.top-avatar .avatar { box-shadow: 0 0 0 2px var(--mustard); border-radius: 50%; }
.content { width: 100%; max-width: 920px; margin: 0 auto; padding: 16px var(--gutter) calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
.content-wide { max-width: 1100px; }
.page-head { display: none; }

.tabbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 6px 4px env(safe-area-inset-bottom); background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; color: var(--muted); text-decoration: none; font-size: 0.72rem; font-weight: 500; border-radius: 12px; }
.tabbar a.is-active { color: var(--green); font-weight: 700; }
.tabbar a.is-active svg { stroke-width: 2.3; }
.tabbar .tab-new { width: 56px; height: 56px; min-height: 56px; margin: -22px auto 0; border-radius: 50%; background: var(--mustard); color: var(--ink); box-shadow: 0 8px 20px rgba(224, 169, 59, 0.45); }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: var(--green); color: var(--white); }
  .side-brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; padding: 0 8px; }
  .side-new { margin: 4px 0; }
  .sidebar nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #DCE6DE; text-decoration: none; font-weight: 500; }
  .sidebar nav a:hover { background: rgba(255, 255, 255, 0.07); color: var(--white); }
  .sidebar nav a.is-active { background: rgba(255, 255, 255, 0.12); color: var(--white); font-weight: 700; }
  .sidebar nav a.is-active svg { color: var(--mustard); }
  .side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; color: var(--white); text-decoration: none; background: rgba(255, 255, 255, 0.06); }
  .side-user span { display: flex; flex-direction: column; min-width: 0; }
  .side-user strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.95rem; }
  .side-user small { color: #C9D6CC; }
  .topbar, .tabbar { display: none; }
  .content { padding: 32px 40px 64px; }
  .page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
  .page-head h1 { font-size: 2rem; margin: 0; }
}

/* Avisos de sistema */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green); font-weight: 500; margin-bottom: 16px; animation: drop .35s ease; }
.flash-error { background: var(--danger-soft); color: var(--danger); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: 10px; }

/* Tarjetas */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-soft { background: var(--green-tint); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 1.12rem; margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head .card-title { margin: 0; }
.section-title { font-size: 1.15rem; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 0.92rem; text-decoration: none; min-height: 44px; }

/* Inicio */
.hello { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.hello-title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin: 0; letter-spacing: -0.02em; }
.hello .muted { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); transition: transform .15s; }
.kpi:hover { transform: translateY(-2px); }
.kpi strong { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; color: var(--green); }
.kpi span { color: var(--muted); font-size: 0.88rem; }
.kpi-alert { background: var(--mustard-soft); border-color: #F0D59E; }
.kpi-alert strong { color: var(--mustard-dark); }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.banner { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--green); color: var(--white); text-decoration: none; }
.banner span { flex: 1; display: flex; flex-direction: column; }
.banner small { color: #C9D6CC; }
.banner svg:first-child { color: var(--mustard); }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.quick-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.quick-tile:hover { transform: translateY(-2px); border-color: var(--mustard); }
.quick-tile svg { color: var(--green); margin-bottom: 6px; }
.quick-tile small { color: var(--muted); }
@media (min-width: 700px) { .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Lugares (comunidades y casas) */
.place-badge { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 30%; background: var(--pc); color: var(--white); }
.place-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
.place-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); min-width: 0; }
.place-card > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.place-card strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-card small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-card:hover { border-color: var(--line-strong); }
.place-count { display: flex; flex-direction: column; align-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--line-strong); line-height: 1; }
.place-count small { font-family: var(--font-body); font-weight: 500; font-size: 0.7rem; }
.place-count.has { color: var(--mustard-dark); }
@media (min-width: 700px) { .place-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .place-grid-lg { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.place-hero { display: flex; align-items: center; gap: 14px; padding: 18px; margin-bottom: 14px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.place-hero::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--pc); }
.place-hero h2 { font-size: 1.35rem; margin: 0 0 2px; }
.place-hero p { margin: 0; }
.place-line { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 0.8rem; font-weight: 700; }
.chip-xs { padding: 1px 8px; font-size: 0.7rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.quick-actions .btn { flex: 1 1 auto; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 12px 14px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px; }
.tabs a.is-active { color: var(--green); border-bottom-color: var(--mustard); }

/* Listado de avisos */
.inc-list { list-style: none; margin: 0; padding: 0; }
.inc-list.card { padding: 4px 0; }
.inc-list li + li { border-top: 1px solid var(--line); }
.inc-row { display: flex; align-items: center; gap: 12px; padding: 12px; text-decoration: none; color: var(--ink); border-radius: 10px; }
.inc-row:hover { background: var(--green-tint); }
.inc-thumb, .inc-icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; object-fit: cover; }
.inc-icon { display: inline-flex; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green); }
.inc-icon.cat-jardin { background: #E3EFD9; color: #3F6B2A; }
.inc-icon.cat-piscina { background: var(--blue-soft); color: var(--blue); }
.inc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inc-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inc-meta { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 0.8rem; color: var(--muted); }
.inc-when { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; color: var(--green); font-weight: 700; }
.tag-urgent { color: var(--danger); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.st-recibido { background: var(--grey-soft); color: var(--muted); }
.st-presupuesto { background: var(--mustard-soft); color: var(--mustard-dark); }
.st-programado { background: var(--blue-soft); color: var(--blue); }
.st-curso { background: #E9E2F5; color: #4B3A78; }
.st-hecho { background: var(--green-soft); color: var(--green); }
.st-cancelado { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 480px) { .inc-row .badge { display: none; } }

/* Filtros */
.filters { margin-bottom: 12px; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.fchip { flex-shrink: 0; padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--line-strong); background: var(--white); color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.9rem; cursor: pointer; min-height: 40px; }
.fchip.is-active { background: var(--green); color: var(--white); border-color: var(--green); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--white); min-height: 46px; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; padding: 10px 0; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field > span, .field legend, .field .label { font-weight: 700; font-size: 0.93rem; padding: 0; }
.field small { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 11px 13px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--white); font-size: 16px; }
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(31, 61, 43, 0.15); }
.field.compact select { min-height: 46px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 12px; }
.inline-form .grow { flex: 1 1 200px; }
details.field-group { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 14px; }
details.field-group summary { cursor: pointer; font-weight: 700; min-height: 32px; }
details.field-group[open] > .field { margin-top: 12px; }

.segmented { display: flex; gap: 6px; padding: 4px; background: var(--grey-soft); border-radius: 12px; }
.segmented-wrap { flex-wrap: wrap; }
.segmented label { flex: 1 1 auto; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 6px 12px; border-radius: 9px; font-weight: 700; font-size: 0.9rem; color: var(--muted); cursor: pointer; text-align: center; }
.segmented input:checked + span { background: var(--white); color: var(--green); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.segmented input:disabled + span { opacity: 0.4; cursor: not-allowed; }
.segmented input:focus-visible + span { outline: 3px solid var(--mustard); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--sw); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--green); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--mustard); outline-offset: 4px; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; margin-top: 10px; }
.icon-picker label { position: relative; }
.icon-picker input { position: absolute; opacity: 0; inset: 0; }
.icon-picker span:not(.sr-only) { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 12px; border: 1.5px solid var(--line); color: var(--green); cursor: pointer; background: var(--white); }
.icon-picker input:checked + span { background: var(--green); color: var(--mustard); border-color: var(--green); }
.icon-picker input:focus-visible + span { outline: 3px solid var(--mustard); }

.cat-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cat-chip { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; cursor: pointer; font-weight: 700; background: var(--white); }
.cat-chip input { position: absolute; opacity: 0; }
.cat-chip:has(input:checked) { border-color: var(--green); background: var(--green-tint); color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }

.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; background: var(--white); }
.choice input { position: absolute; opacity: 0; }
.choice svg { color: var(--green); margin-bottom: 4px; }
.choice small { color: var(--muted); }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-tint); box-shadow: inset 0 0 0 1px var(--green); }

/* Fotos */
.photo-input { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-add { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; flex: 1 1 140px; padding: 12px; border: 2px dashed var(--line-strong); border-radius: var(--radius); color: var(--green); font-weight: 700; text-align: center; cursor: pointer; background: var(--green-tint); }
.photo-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-add:hover { border-color: var(--green); }
.photo-previews { display: contents; }
.photo-previews img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.gallery a { position: relative; display: block; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.gallery a span { position: absolute; left: 6px; bottom: 6px; background: rgba(23, 32, 26, 0.75); color: var(--white); font-size: 0.7rem; padding: 2px 6px; border-radius: 6px; }
.upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Pedir servicio */
.wizard .card { margin-bottom: 0; }
.job-list { display: grid; gap: 8px; }
.job { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--white); }
.job input { position: absolute; opacity: 0; }
.job-name { font-weight: 700; }
.job-from { color: var(--green); font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
.job-note { grid-column: 1 / -1; color: var(--muted); }
.job:has(input:checked) { border-color: var(--green); background: var(--green-tint); box-shadow: inset 0 0 0 1px var(--green); }
.job-free { border-style: dashed; }
.job-detail { padding-top: 6px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: 12px; overflow: hidden; width: max-content; }
.stepper button { width: 48px; height: 48px; border: 0; background: var(--green-tint); color: var(--green); font-size: 1.4rem; font-weight: 700; cursor: pointer; }
.stepper input { width: 60px !important; text-align: center; border: 0 !important; border-radius: 0 !important; -moz-appearance: textfield; }
.estimate-bar { position: sticky; bottom: calc(var(--tabbar-h) + 10px); z-index: 10; display: grid; grid-template-columns: 1fr auto; gap: 0 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--green); color: var(--white); box-shadow: var(--shadow-lg); animation: drop .3s ease; }
.estimate-bar strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--mustard); }
.estimate-bar small { grid-column: 1 / -1; color: #C9D6CC; font-size: 0.78rem; }
@media (min-width: 960px) { .estimate-bar { bottom: 16px; } }

/* Ficha de aviso */
.inc-head { margin-bottom: 12px; }
.inc-head h2 { font-size: 1.5rem; margin: 6px 0 8px; }
.inc-head-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inc-code { font-weight: 700; color: var(--muted); font-size: 0.85rem; letter-spacing: 0.04em; }
.progress { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); position: relative; }
.progress::before { content: ''; position: absolute; left: 16.6%; right: 16.6%; top: 13px; height: 3px; background: var(--line); border-radius: 3px; }
.progress li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); font-weight: 700; text-align: center; }
.progress .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--white); border: 3px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--white); z-index: 1; }
.progress li.done .dot { background: var(--green); border-color: var(--green); }
.progress li.current .dot { box-shadow: 0 0 0 5px rgba(224, 169, 59, 0.35); }
.progress li.done { color: var(--green); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.88rem; }
.facts dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.desc { margin-top: 14px; white-space: pre-line; }
.budget { border-color: #F0D59E; background: #FFFBF2; }
.budget h3 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.budget-amount { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--green); }
.budget-amount small { font-family: var(--font-body); font-size: 0.9rem; color: var(--muted); font-weight: 400; }
.parte { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.parte header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.parte header span { display: flex; flex-direction: column; }
.parte header small { color: var(--muted); }
.note { display: flex; gap: 6px; align-items: flex-start; background: var(--mustard-soft); padding: 8px 10px; border-radius: 10px; color: var(--mustard-dark); }

/* Antes y después */
.before-after { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--grey-soft); margin: 10px 0; --pos: 50%; }
.before-after > img, .ba-before img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.before-after::after { content: ''; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: var(--white); box-shadow: 0 0 8px rgba(0, 0, 0, 0.4); pointer-events: none; }
.before-after input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba-label { position: absolute; top: 10px; padding: 3px 9px; border-radius: 8px; background: rgba(23, 32, 26, 0.7); color: var(--white); font-size: 0.75rem; font-weight: 700; pointer-events: none; }
.ba-l { left: 10px; } .ba-r { right: 10px; }

/* Historial */
.timeline { list-style: none; margin: 0 0 14px; padding: 0; }
.ev { display: flex; gap: 10px; padding: 10px 0; }
.ev + .ev { border-top: 1px dashed var(--line); }
.ev > div { min-width: 0; flex: 1; }
.ev p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.85rem; }
.ev-meta time { color: var(--muted); }
.ev-internal { background: #FFFBF2; border-radius: 10px; padding: 10px; }
.ev-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--green-soft); flex-shrink: 0; }
.comment-form textarea { min-height: 64px; }
.comment-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.comment-actions .btn-primary { margin-left: auto; }

.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars { position: relative; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; left: 0; top: 0; pointer-events: none; }
.stars label { color: var(--line-strong); cursor: pointer; padding: 4px; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--mustard); }
.stars input:focus-visible + label { outline: 3px solid var(--mustard); border-radius: 6px; }

/* Equipo */
.staff-panel { border: 2px solid var(--green); }
.staff-block { border-top: 1px solid var(--line); padding: 10px 0; }
.staff-block summary { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; min-height: 40px; color: var(--green); }
.staff-block[open] summary { margin-bottom: 10px; }
.day .section-title .chip { margin-left: 6px; }

/* Personas */
.people { list-style: none; margin: 0 0 8px; padding: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.person + .person { border-top: 1px solid var(--line); }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-main small { color: var(--muted); overflow-wrap: anywhere; }
.person-edit { position: relative; }
.person-edit summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; color: var(--green); }
.person-edit summary::-webkit-details-marker { display: none; }
.person-edit[open] { flex-basis: 100%; }
.person-edit[open] summary { background: var(--green-tint); }
.person-edit form { margin-top: 8px; padding: 12px; border-radius: 12px; background: var(--green-tint); }
.add-person h3 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }

/* Perfil y avatar */
.avatar { border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.profile-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-hero h2 { margin: 0; font-size: 1.4rem; }
.profile-hero p { margin: 0; }
.profile-avatar .avatar { box-shadow: 0 0 0 4px var(--white), var(--shadow-lg); }
.builder { display: grid; gap: 18px; }
.builder-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px; border-radius: var(--radius); background: radial-gradient(circle at 50% 40%, var(--white), var(--green-tint)); }
.builder-preview img { border-radius: 50%; box-shadow: var(--shadow-lg); transition: transform .25s; }
.builder-preview img.bump { transform: scale(1.06) rotate(-3deg); }
@media (min-width: 760px) { .builder { grid-template-columns: 220px 1fr; align-items: start; } .builder-preview { position: sticky; top: 24px; } }
.logout { margin: 24px 0; }

/* Facturas */
.invoice-list { list-style: none; padding: 4px 0; }
.invoice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.invoice + .invoice { border-top: 1px solid var(--line); }
.inv-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }
.inv-main { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; }
.inv-main small { color: var(--muted); }
.inv-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Vacío */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty svg { color: var(--line-strong); margin-bottom: 4px; }
.empty h2 { color: var(--ink); font-size: 1.2rem; margin: 0; }
.empty .btn { margin-top: 10px; }

/* Informes */
.report-controls { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; align-items: end; }
@media (min-width: 760px) { .report-controls { grid-template-columns: 2fr 1fr auto; } }
.report { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--line); padding: 22px 18px; box-shadow: var(--shadow); }
.report-head { border-bottom: 3px solid var(--green); padding-bottom: 14px; margin-bottom: 18px; }
.report-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--green); margin-bottom: 14px; }
.report-kicker { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; font-size: 0.75rem; color: var(--mustard-dark); margin: 0; }
.report-head h2 { font-size: 1.8rem; margin: 4px 0; color: var(--green); }
.report-sub { color: var(--muted); margin: 0; }
.report-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.report-kpis div { padding: 12px; border-radius: 12px; background: var(--green-tint); display: flex; flex-direction: column; }
.report-kpis strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--green); line-height: 1.1; }
.report-kpis span { font-size: 0.82rem; color: var(--muted); }
@media (min-width: 760px) { .report { padding: 36px 40px; } .report-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.report-section { margin-bottom: 22px; }
.report-section h3 { font-size: 1.1rem; color: var(--green); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 120px 1fr 32px; gap: 10px; align-items: center; font-size: 0.9rem; }
.bar { height: 12px; background: var(--grey-soft); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.bar-n { text-align: right; font-weight: 700; }
.months-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 150px; align-items: end; }
.mc-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.mc-bar { width: 100%; max-width: 28px; min-height: 2px; background: var(--green); border-radius: 6px 6px 2px 2px; }
.mc-n { font-size: 0.72rem; font-weight: 700; color: var(--green); }
.mc-l { font-size: 0.7rem; color: var(--muted); }
.report-list { list-style: none; padding: 0; margin: 0; }
.report-list li { padding: 12px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.rl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.rl-date { font-weight: 700; color: var(--mustard-dark); font-size: 0.85rem; min-width: 90px; }
.rl-code { color: var(--muted); font-size: 0.8rem; margin-left: auto; }
.rl-meta { color: var(--muted); font-size: 0.85rem; margin: 2px 0; }
.rl-sum { margin: 4px 0; font-size: 0.92rem; }
.rl-photos { display: flex; gap: 8px; margin-top: 6px; }
.rl-photos figure { margin: 0; }
.rl-photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; }
.rl-photos figcaption { font-size: 0.72rem; color: var(--muted); }
.report-open { list-style: none; padding: 0; margin: 0; }
.report-open li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; }
.report-foot { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); text-align: center; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: var(--white); font-size: 11pt; }
  .sidebar, .topbar, .tabbar, .no-print, .flash, .page-head { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .report { border: 0; box-shadow: none; padding: 0; }
  .report-kpis { grid-template-columns: repeat(3, 1fr); }
  .report-kpis div, .bar-fill, .mc-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Acceso y bienvenida */
.app-bare { background: var(--green); min-height: 100vh; }
.bare { min-height: 100vh; padding: 24px var(--gutter) 40px; display: flex; flex-direction: column; align-items: center; gap: 24px; background: radial-gradient(circle at 20% 0%, var(--green-mid), var(--green) 55%); }
.bare-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; margin-top: 8px; }
.login, .welcome { width: 100%; max-width: 440px; }
.login-card, .welcome-card { background: var(--white); border-radius: var(--radius-lg); padding: 26px 22px; box-shadow: var(--shadow-lg); }
.login-card h1, .welcome-card h1 { font-size: 1.7rem; color: var(--green); }
.login-card form { margin: 18px 0 12px; }
.login-points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; color: #DCE6DE; }
.login-points li { display: flex; align-items: center; gap: 10px; }
.login-points svg { color: var(--mustard); flex-shrink: 0; }
.sent { text-align: center; }
.envelope { width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%; background: var(--mustard-soft); color: var(--mustard-dark); display: flex; align-items: center; justify-content: center; animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.dev-note { margin-top: 14px; padding: 10px; border-radius: 10px; background: var(--mustard-soft); font-size: 0.9rem; }
.welcome-avatar { display: flex; justify-content: center; }
.welcome-avatar .avatar { box-shadow: 0 0 0 5px var(--green-soft); }
.welcome-card h1 { text-align: center; }
.welcome-card > .muted { text-align: center; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Panel de empresa ---------- */
.op-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.88rem; color: var(--ink); min-width: 0; }
.op-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-none { padding: 2px 10px; border-radius: 99px; background: var(--mustard-soft); color: var(--mustard-dark); font-size: 0.78rem; }
.tag-warn { color: var(--mustard-dark); font-weight: 700; }

.assist-banner { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 16px; border-radius: var(--radius); text-decoration: none; color: var(--ink); background: linear-gradient(120deg, var(--mustard-soft), #FFF7E6); border: 1px solid #F0D59E; }
.assist-banner span { flex: 1; display: flex; flex-direction: column; }
.assist-banner small { color: var(--mustard-dark); }
.assist-banner > svg:first-child { color: var(--mustard-dark); }

.assist { background: linear-gradient(135deg, var(--green) 0%, var(--green-mid) 100%); color: var(--white); border: 0; }
.assist-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.assist-head svg { color: var(--mustard); flex-shrink: 0; margin-top: 2px; }
.assist h2 { font-size: 1.15rem; margin: 0 0 4px; color: var(--white); }
.assist p { margin: 0; color: #D5E1D8; font-size: 0.92rem; }
.assist .note { color: var(--mustard-dark); margin-bottom: 10px; }
.assist .note a { color: inherit; }

.plan-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.plan-item { padding: 12px; }
.plan-item.is-urgent { border-left: 4px solid var(--danger); }
.plan-item-head { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-height: 48px; }
@media (max-width: 480px) { .plan-item-head .badge { display: none; } }

.sugg { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; background: var(--green-tint); border: 1px solid var(--green-soft); border-radius: var(--radius-sm); }
.sugg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sugg-main strong { font-size: 0.95rem; text-transform: none; }
.reasons { display: flex; flex-wrap: wrap; gap: 4px; }
.reasons span { font-size: 0.74rem; padding: 2px 8px; border-radius: 99px; background: var(--white); color: var(--green); border: 1px solid var(--green-soft); }
.sugg-alt { background: var(--white); border-color: var(--line); padding: 6px 10px; margin-top: 6px; }
.sugg-alt .sugg-main strong { font-weight: 600; font-size: 0.88rem; }
.alts { margin-top: 8px; }
.no-sugg { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; }
.assist-inline { margin-bottom: 12px; }
.assist-label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.82rem; font-weight: 700; color: var(--mustard-dark); text-transform: uppercase; letter-spacing: 0.04em; }

.today-group + .today-group { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.today-op { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list a { display: flex; align-items: center; gap: 10px; padding: 8px 0; min-height: 44px; text-decoration: none; color: var(--ink); }
.mini-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mini-main small { color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--line-strong); }

.load-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.load-list li { display: grid; grid-template-columns: minmax(0, 120px) 1fr auto; align-items: center; gap: 10px; }
.load-list a { text-decoration: none; min-width: 0; }
.load-bar { height: 10px; border-radius: 99px; background: var(--grey-soft); overflow: hidden; }
.load-bar span { display: block; height: 100%; background: var(--green-mid); border-radius: 99px; transition: width .4s; }
.load-bar.is-high span { background: var(--mustard); }
.load-bar.is-full span { background: var(--danger); }

/* Colores de estado en la planificación */
.ps-recibido, .dot.ps-recibido { --ps: var(--line-strong); }
.ps-presupuesto { --ps: var(--mustard); }
.ps-programado { --ps: var(--blue); }
.ps-en_curso { --ps: #6A54A8; }
.ps-hecho { --ps: var(--green-mid); }
.dot[class*="ps-"] { background: var(--ps); }

.week-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.week-nav strong { font-family: var(--font-display); font-size: 1.1rem; min-width: 0; text-align: center; flex: 1; }
@media (min-width: 700px) { .week-nav strong { flex: 0 1 auto; } }
.plan-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 12px; }

.plan-card { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; margin-top: 6px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--ps, var(--line-strong)); text-decoration: none; color: var(--ink); box-shadow: 0 2px 6px rgba(23, 32, 26, 0.05); }
.plan-card strong { font-size: 0.86rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.plan-card small { font-size: 0.74rem; color: var(--muted); }
.plan-card.is-urgent strong::before { content: '● '; color: var(--danger); }
.plan-card .op-chip { margin-top: 4px; font-size: 0.8rem; }

.plan-days { display: grid; gap: 12px; }
.plan-day { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.plan-day.is-today { border-color: var(--mustard); box-shadow: 0 0 0 2px var(--mustard-soft); }
.plan-day h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; }
.plan-day h3 small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 0.8rem; }

.plan-table-wrap { display: none; }
@media (min-width: 960px) {
  .plan-days { display: none; }
  .plan-table-wrap { display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
  .plan-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .plan-table th, .plan-table td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; padding: 8px; }
  .plan-table thead th { background: var(--green-tint); font-size: 0.85rem; text-align: left; }
  .plan-table th[scope="row"] { width: 150px; background: var(--white); }
  .plan-table th[scope="row"] a { text-decoration: none; }
  .plan-table .is-today { background: #FFFBF1; }
  .plan-table thead .is-today { background: var(--mustard-soft); }
  .plan-table td.is-off { background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 6px, var(--white) 6px, var(--white) 12px); }
  .plan-table tr.unassigned td { background: #FFFBF1; }
  .cap { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 700; }
  .cap.is-full { color: var(--danger); }
}

.team-grid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
@media (min-width: 700px) { .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.team-card { margin: 0; }
.team-card.is-inactive { opacity: 0.6; }
.team-head { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-height: 48px; }
.team-head > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.team-head small { color: var(--muted); }
.team-head > svg { color: var(--green); }
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.chip-muted { background: var(--grey-soft); color: var(--muted); }
.chip-outline { background: var(--white); border: 1px solid var(--line-strong); color: var(--text); font-weight: 500; }
.cat-chip-jardin { background: #E3EFD9; color: #3F6B2A; }
.cat-chip-piscina { background: var(--blue-soft); color: var(--blue); }
.team-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); }
.team-stats strong { color: var(--ink); font-size: 1rem; }
.team-hero { display: flex; align-items: center; gap: 14px; }
.team-hero h2 { margin: 0; font-size: 1.25rem; }
.team-hero p { margin: 2px 0 0; }

.toggle-group { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle { position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--white); font-weight: 600; transition: background .15s, border-color .15s, color .15s; }
.toggle input:checked + span { background: var(--green); border-color: var(--green); color: var(--white); }
.toggle input:focus-visible + span { outline: 3px solid var(--mustard); outline-offset: 2px; }
.toggle-sm span { min-height: 40px; padding: 6px 12px; font-size: 0.88rem; font-weight: 500; }
.toggle-days span { min-width: 52px; justify-content: center; }
.specialties summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 6px; color: var(--green); }
.specialties fieldset { margin-top: 8px; }
.field-narrow { max-width: 260px; }

/* ---------- Ayuda y guía ---------- */
.top-help { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: transparent; color: #C9D6CC; border-radius: 10px; cursor: pointer; }
.top-help:hover { color: var(--white); background: rgba(255, 255, 255, 0.08); }
.side-help { display: none; }
@media (min-width: 960px) {
  .side-help { display: flex; align-items: center; gap: 8px; margin-top: auto; margin-bottom: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; background: transparent; color: #C9D6CC; font: inherit; font-weight: 600; cursor: pointer; }
  .side-help:hover { color: var(--white); background: rgba(255, 255, 255, 0.06); }
  .side-help + .side-user { margin-top: 0; }
}
.tour-layer { position: fixed; inset: 0; z-index: 1000; animation: fade .2s ease; }
.tour-layer.is-leaving { opacity: 0; transition: opacity .2s; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(15, 26, 19, 0.62), 0 0 0 3px var(--mustard); transition: all .3s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.tour-tip { position: fixed; z-index: 1001; background: var(--white); border-radius: 18px; padding: 18px 18px 14px; box-shadow: var(--shadow-lg); transition: top .3s, left .3s; animation: pop .25s ease; }
.tour-tip.is-center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(400px, calc(100vw - 32px)) !important; }
.tour-count { margin: 0; font-size: 0.75rem; font-weight: 700; color: var(--mustard-dark); text-transform: uppercase; letter-spacing: 0.06em; }
.tour-title { margin: 4px 0 6px; font-size: 1.2rem; color: var(--green); }
.tour-text { margin: 0 0 12px; color: var(--text); line-height: 1.45; }
.tour-dots { display: flex; gap: 5px; margin-bottom: 12px; }
.tour-dots span { width: 6px; height: 6px; border-radius: 99px; background: var(--line); transition: width .2s; }
.tour-dots span.is-on { width: 18px; background: var(--mustard); }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-actions .btn-link { margin-right: auto; padding-left: 0; color: var(--muted); }
.tour-actions .btn:first-of-type:disabled { visibility: hidden; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.guide-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.guide-card > span { display: flex; align-items: center; gap: 10px; color: var(--green); }
.guide-card > span > span { display: flex; flex-direction: column; color: var(--ink); }
.guide-card small { color: var(--muted); }

/* ---------- Creador de personaje ---------- */
.char-builder { display: grid; gap: 12px; }
.char-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.char-tabs .fchip { white-space: nowrap; }
.char-panel { display: grid; gap: 12px; }
.char-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.char-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 2px solid var(--line); border-radius: 14px; background: var(--white); cursor: pointer; text-align: center; transition: border-color .15s, transform .15s; }
.char-tile:hover { transform: translateY(-2px); }
.char-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.char-tile svg, .char-tile img { border-radius: 10px; width: 52px; height: 52px; }
.char-tile span { font-size: 0.72rem; font-weight: 600; color: var(--muted); line-height: 1.2; }
.char-tile:has(input:checked) { border-color: var(--green); background: var(--green-tint); box-shadow: 0 0 0 2px var(--green-soft); }
.char-tile:has(input:focus-visible) { outline: 3px solid var(--mustard); }
@media (max-width: 759px) {
  .builder-preview { position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 5; flex-direction: row; justify-content: center; padding: 10px; box-shadow: var(--shadow); }
  .builder-preview img { width: 96px; height: 96px; }
  .builder-preview p { display: none; }
}
[data-hide-for][hidden], [data-show-for][hidden] { display: none !important; }

/* ---------- Quién viene y valoraciones ---------- */
.who-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(120deg, var(--white), var(--green-tint)); }
.who-photo { border-radius: 50%; box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--mustard); object-fit: cover; flex-shrink: 0; }
.who-main { min-width: 0; }
.who-main h3 { margin: 0; font-size: 1.2rem; }
.who-main p { margin: 2px 0 0; }
.who-main p svg { vertical-align: -2px; }
.who-kicker { margin: 0 !important; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mustard-dark); }
.rating-card { border: 2px solid var(--mustard-soft); }
.rating-main .stars label svg { width: 36px; height: 36px; }
.aspects { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.aspect { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 0; }
.aspect legend { font-size: 0.85rem; font-weight: 700; padding: 0 4px; }
.aspect .stars label { padding: 2px; }
.aspect .stars label svg { width: 24px; height: 24px; }

.ranking .card-head small { font-size: 0.8rem; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 12px 0; }
.rank-list li + li { border-top: 1px solid var(--line); }
.rank-list li.is-empty { opacity: 0.6; }
.rank-pos { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--grey-soft); color: var(--muted); }
.medal-1 { background: #F2C230; color: #5A4300; }
.medal-2 { background: #D5D9DD; color: #3A4148; }
.medal-3 { background: #D99A6C; color: #4A2A12; }
.rank-who { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.rank-who > span { display: flex; flex-direction: column; min-width: 0; }
.rank-who small { color: var(--muted); }
.rank-score { display: flex; flex-direction: column; align-items: flex-end; }
.rank-score strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--green); line-height: 1; }
.rank-score small { font-size: 0.72rem; color: var(--muted); }
.rank-aspects { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
@media (min-width: 700px) { .rank-aspects { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rank-aspects > span { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 6px; font-size: 0.75rem; }
.rank-aspects small { color: var(--muted); }
.rank-aspects .mini-bar { grid-column: 1 / -1; grid-row: 2; height: 5px; border-radius: 99px; background: var(--grey-soft); overflow: hidden; }
.rank-aspects .mini-bar span { display: block; height: 100%; background: var(--mustard); }
.rank-aspects b { grid-column: 2; grid-row: 1; font-size: 0.78rem; }
.review-list { list-style: none; margin: 0; padding: 0; }
.review-list li { padding: 10px 0; display: flex; flex-direction: column; gap: 2px; }
.review-list li + li { border-top: 1px solid var(--line); }
.review-list a { color: var(--ink); text-decoration: none; }
.review-list p { margin: 4px 0 0; font-style: italic; color: var(--text); }
.review-stars { color: var(--mustard); letter-spacing: 2px; }
.review-stars span { color: var(--line); }
.photo-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.team-hero .grow { flex: 1; min-width: 0; }
.team-hero img.avatar { object-fit: cover; border-radius: 50%; }

/* ---------- Foto de operario ---------- */
.photo-tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; text-align: left; }
.photo-tips li { display: flex; align-items: center; gap: 8px; color: var(--green); }

/* ---------- Demo ---------- */
.demo-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px var(--gutter); background: var(--mustard-soft); color: var(--mustard-dark); font-size: 0.85rem; border-bottom: 1px solid #F0D59E; }
.demo-bar > span { flex: 1 1 240px; }
.demo-bar a { color: var(--mustard-dark); font-weight: 700; }
.demo-bar form { margin: 0; }
.demo-bar .btn-link { color: var(--mustard-dark); font-weight: 700; min-height: 36px; padding: 4px; }
.demo-link { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 12px 14px; border-radius: 12px; background: var(--mustard-soft); color: var(--mustard-dark); text-decoration: none; }
.demo-pick { width: 100%; max-width: 720px; margin: 0 auto; display: grid; gap: 18px; }
.demo-intro { text-align: center; color: var(--white); }
.demo-intro h1 { color: var(--white); margin: 10px 0 6px; }
.demo-intro .muted { color: #C9D6CC; }
.demo-intro .chip { background: var(--mustard); color: var(--ink); }
.demo-roles { display: grid; gap: 10px; }
.demo-role { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 0; border-radius: 18px; background: var(--white); color: var(--ink); text-align: left; font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.demo-role:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.demo-role > span { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.demo-role strong { font-size: 1.05rem; }
.demo-role small { color: var(--muted); }
.demo-role .demo-who { color: var(--green); font-weight: 700; }
.demo-role > svg:last-child { color: var(--green); flex-shrink: 0; }
.demo-pick .center { text-align: center; }
.demo-pick .center a { color: #C9D6CC; }
.tour-tip.is-center { animation: fade .25s ease; }

/* ---------- Acceso con Face ID o huella ---------- */
.passkey-login { display: grid; gap: 8px; }
.passkey-login .or-line { margin: 4px 0 0; text-align: center; font-size: 0.85rem; color: var(--muted); }
.passkey-offer { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(120deg, var(--white), var(--green-tint)); border-color: var(--green-soft); }
.passkey-offer h2 { font-size: 1.05rem; margin: 0 0 2px; }
.passkey-offer p { margin: 0 0 8px; }
.passkey-offer .btn-row { display: flex; align-items: center; gap: 10px; }
.passkey-offer.is-done { color: var(--green); font-weight: 600; }
.pk-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px; background: var(--green); color: var(--mustard); flex-shrink: 0; }
.device-list { list-style: none; margin: 0 0 10px; padding: 0; }
.device-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.device-list li + li { border-top: 1px solid var(--line); }
.device-list li > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.device-list small { color: var(--muted); }
.device-list svg { color: var(--green); }

/* Registro de correos */
.mail-log { list-style: none; padding: 4px 16px; }
.mail-log li { display: flex; align-items: center; gap: 10px; padding: 10px 0; flex-wrap: wrap; }
.mail-log li + li { border-top: 1px solid var(--line); }
.mail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mail-main strong { font-weight: 600; overflow-wrap: anywhere; }
.mail-main small { color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Conversaciones ---------- */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--mustard); color: var(--ink); font-size: 0.72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.tabbar a { position: relative; }
.tabbar .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--mustard); color: var(--ink); font-size: 0.72rem; font-weight: 800; }
.assist-mini { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: linear-gradient(120deg, var(--white), var(--green-tint)); }
.assist-mini > span { display: flex; align-items: center; gap: 10px; color: var(--green); }
.assist-mini > span > span { display: flex; flex-direction: column; color: var(--ink); }
.assist-mini small { color: var(--muted); }
.conv-list { list-style: none; padding: 4px 12px; }
.conv-list li + li { border-top: 1px solid var(--line); }
.conv-list a { display: flex; align-items: center; gap: 12px; padding: 10px 4px; min-height: 64px; text-decoration: none; color: var(--ink); }
.conv-list a.is-unread strong { font-weight: 800; }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 0.75rem; color: var(--muted); }
.pk-sm { width: 44px; height: 44px; border-radius: 50%; }
.chat-head { display: flex; align-items: center; gap: 12px; }
.chat-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head small { color: var(--muted); }
.chat-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: -4px 0 12px; }
.chat-actions form { margin: 0; }
.chat-avisos { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.chip-link { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 0.85rem; white-space: nowrap; }
.chat { list-style: none; margin: 0 0 12px; padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius); background: #E9E4DA radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.04) 1px, transparent 0) 0 0 / 16px 16px; min-height: 260px; }
.msg { max-width: 82%; padding: 8px 10px 6px; border-radius: 14px; background: var(--white); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); align-self: flex-start; display: flex; flex-direction: column; gap: 4px; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.msg img { display: block; max-width: 220px; width: 100%; border-radius: 10px; }
.msg-out { align-self: flex-end; background: #DCF3D6; border-bottom-right-radius: 4px; }
.msg-in { border-bottom-left-radius: 4px; }
.msg-out.msg-humano { background: #FFF1CC; }
.msg-meta { font-size: 0.7rem; color: var(--muted); align-self: flex-end; }
.msg-meta b { color: var(--green); }
.msg-note { align-self: center; max-width: 92%; background: rgba(255, 255, 255, 0.7); box-shadow: none; font-size: 0.78rem; color: var(--muted); text-align: center; flex-direction: row; gap: 8px; align-items: center; border-radius: 10px; }
.msg-note time { font-size: 0.7rem; }
.msg-audio { font-size: 0.85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: calc(var(--tabbar-h) + 8px); background: var(--bg); padding: 6px 0; }
.chat-compose textarea { flex: 1; min-height: 48px; resize: vertical; }
@media (min-width: 960px) { .chat-compose { bottom: 8px; } }
.center { text-align: center; }
