/* Obra Clara — Rediseño editorial premium (papel técnico, grafito cálido, terracota) */

:root {
  --bg: #F4F1EA;
  --bg-soft: #ECE8DF;
  --surface: #FFFFFF;
  --surface-subtle: #FAF8F4;
  --text: #0E0D0C;
  --text-2: #4F4B45;
  --text-3: #666057;
  --border: #DFDCD3;
  --border-strong: #CDC8BC;
  --accent: #C2410C;
  --accent-dim: #A53609;
  --accent-soft: #FDF2EC;
  --accent-border: rgba(194, 65, 12, 0.24);
  --lima: var(--accent);
  --lima-dim: var(--accent-dim);
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --success-ink: #14532D;
  --pending: #B45309;
  --warn-bg: #FEF6E6;
  --warn-border: #F2DEC0;
  --warn-text: #854D0E;
  --nav: #0E0D0C;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(14, 13, 12, 0.03), 0 6px 18px rgba(14, 13, 12, 0.045);
  --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(14, 13, 12, 0.04);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 68px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: clip; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-soft);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app {
  min-height: 100dvh;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
}

@media (min-width: 560px) {
  #app {
    box-shadow: 0 0 0 1px var(--border), 0 24px 64px rgba(14, 13, 12, 0.08);
  }
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ——— Shell ——— */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
}
.app-shell.no-nav { padding-bottom: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title p {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.top-new { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; white-space: nowrap; }

.avatar {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.icon-btn {
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 13px; font-weight: 600; flex-shrink: 0;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn:active { background: var(--bg-soft); }
.icon-btn-subtle {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.icon-btn-subtle:hover { background: var(--surface); border-color: var(--border-strong); color: var(--text); }

main.page {
  flex: 1;
  padding: 16px 18px 28px;
  animation: pageIn 0.24s var(--ease);
}

/* ——— Bottom nav ——— */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 500px;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 5px 8px var(--safe-b);
  background: rgba(14, 13, 12, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(244, 241, 234, 0.08);
  display: flex; align-items: stretch; justify-content: space-around; gap: 4px;
  z-index: 40;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 28px rgba(14, 13, 12, 0.16);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: rgba(244, 241, 234, 0.6);
  font-size: 11px; font-weight: 600;
  min-height: 48px;
  margin: 2px 0;
  border-radius: 14px;
  position: relative;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), transform 0.15s var(--ease);
}
.nav-item:active { transform: scale(0.95); }
.nav-item.active {
  color: #FFFFFF;
  background: rgba(244, 241, 234, 0.09);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 2.5px;
  border-radius: 99px;
  background: var(--accent);
}
.nav-item.active svg { color: #FFFFFF; }
.nav-item svg { width: 21px; height: 21px; }
.nav-badge {
  position: absolute;
  top: 7px; right: calc(50% - 20px);
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--accent); color: #FFFFFF;
  border: 2px solid var(--nav);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ——— Cards & lists ——— */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.16s var(--ease);
}
.card-press { transition: transform 0.16s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.card-press:hover { border-color: var(--border-strong); }
.card-press:active { transform: scale(0.985); }

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 22px 0 10px 2px;
  letter-spacing: 0.08em;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 22px 2px 10px;
}
.section-head .section-label { margin: 0; }
.section-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}

/* ——— Stats row ——— */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 14px 6px;
  text-align: center;
  min-width: 0;
}
.stat.highlight {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
  box-shadow: 0 6px 20px rgba(14, 13, 12, 0.14);
}
.stat-value {
  font-size: clamp(14px, 4vw, 17px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  white-space: nowrap;
  line-height: 1.25;
}
.stat-label {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  font-weight: 600;
}
.stat.highlight .stat-label { color: rgba(244, 241, 234, 0.72); }

/* ——— Filters ——— */
.filters {
  display: flex; gap: 8px; overflow-x: auto;
  margin-bottom: 14px; padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex-shrink: 0;
  min-height: 38px;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.filter:hover { border-color: var(--border-strong); color: var(--text); }
.filter.active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

/* ——— Obra row ——— */
.obra-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.obra-card:active { background: var(--surface-subtle); }
.obra-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.obra-name { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.obra-meta { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.pct-pill {
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  padding: 4px 9px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.progress-track {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  margin: 14px 0 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.5s var(--ease);
}
.obra-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-3);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  font-size: 11px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
  letter-spacing: 0.01em;
}
.chip-lima { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
.chip-muted { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }

/* ——— Attention block ——— */
.attention {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.attention-title {
  font-size: 13px; font-weight: 700; color: var(--warn-text);
  margin-bottom: 3px;
}
.attention p { font-size: 13px; color: var(--warn-text); line-height: 1.4; }

/* ——— Buttons ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 48px; padding: 0 18px;
  border-radius: 13px;
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.14s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease), opacity 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.btn:active { transform: scale(0.975); }
.btn-lima {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(194, 65, 12, 0.22);
}
.btn-lima:hover { background: var(--accent-dim); }
.btn-dark {
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 2px 8px rgba(14, 13, 12, 0.14);
}
.btn-dark:hover { background: #23211E; }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-subtle); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; font-size: 13px; padding: 0 14px; border-radius: 11px; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* ——— Login ——— */
.login-wrap {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 28px 22px;
  background: var(--bg);
}
.login-brand { text-align: center; margin-bottom: 30px; }
.login-logo {
  width: 58px; height: 58px; border-radius: 16px;
  background: var(--text); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; letter-spacing: -0.03em;
  margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(14, 13, 12, 0.16);
}
.login-logo span, .brand-slash { color: var(--accent); }
.login-brand h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.035em; }
.login-brand p { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.login-card {
  background: var(--surface);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 26px 22px;
}
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-2); margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%;
  height: 48px; padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-subtle);
  font-size: 16px;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.field textarea { height: auto; min-height: 78px; padding: 12px 14px; }
.field input[type="file"] { height: auto; padding: 10px 14px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.login-error {
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
  font-size: 13px; font-weight: 600; padding: 11px 14px; border-radius: 12px;
  margin-bottom: 14px;
}
.demo-hint {
  margin-top: 16px; text-align: center;
  font-size: 12px; color: var(--text-3);
  display: flex; justify-content: center; flex-wrap: wrap; column-gap: 12px;
}
.demo-hint button {
  color: var(--text); font-weight: 600; text-decoration: underline;
  min-height: 44px;
}

/* ——— Phase progress (client) ——— */
.phase-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.phase-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
}
.phase-now { font-size: 19px; font-weight: 700; letter-spacing: -0.025em; }
.phase-pct {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 800; letter-spacing: -0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.phase-dots { display: flex; gap: 6px; margin: 14px 0 10px; }
.phase-dot { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-soft); }
.phase-dot.done { background: var(--success); }
.phase-dot.current { background: var(--accent); }
.phase-sub {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--text-3);
}

/* ——— List rows ——— */
.row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row-title { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; }
.row-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }
.row-amount {
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-2);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.status-ok { background: var(--success-soft); color: var(--success-ink); }
.status-wait { background: var(--warn-bg); color: var(--warn-text); }
.status-bad { background: var(--danger-soft); color: var(--danger); }

/* ——— Client hero & pending extras box ——— */
.pending-box {
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 16px 6px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(194, 65, 12, 0.08);
}
.pending-title {
  display: inline-flex;
  align-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.pending-box .card {
  box-shadow: none;
  background: var(--surface-subtle);
  border-color: var(--border);
  padding: 14px;
  border-radius: 14px;
}
.pending-box .btn-row .btn-ghost { flex: 0 0 auto; padding: 0 15px; }
.pending-box .btn-row .btn-lima { flex: 1; white-space: nowrap; }

.client-hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  background: #1C1B19;
  aspect-ratio: 16/10;
  position: relative;
  display: flex; align-items: flex-end;
  box-shadow: var(--shadow);
}
.client-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14, 13, 12, 0.55) 0%, rgba(14, 13, 12, 0) 48%);
  pointer-events: none;
}
.client-hero-label {
  position: absolute; left: 14px; bottom: 14px; right: 14px;
  z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
}
.client-hero-label span {
  background: rgba(14, 13, 12, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  max-width: 70%;
}
.client-hero-label .photo-count {
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ——— Company photo gallery & viewer ——— */
.job-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.job-photo-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #1C1B19;
  border: 1px solid var(--border);
  transition: transform 0.16s var(--ease);
}
.job-photo-thumb:active { transform: scale(0.97); }
.job-photo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.job-photo-label {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  background: rgba(14, 13, 12, 0.8);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.photo-modal-img {
  display: block;
  width: 100%;
  max-height: 55dvh;
  object-fit: contain;
  background: var(--text);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* ——— Empty / loading ——— */
.empty { text-align: center; padding: 38px 20px; color: var(--text-3); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; letter-spacing: -0.015em; }
.spinner {
  width: 28px; height: 28px; margin: 0 auto 12px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page > .chips { margin: 8px 0 14px; }
.client-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  margin-bottom: 10px;
}
.client-status-pill.is-done {
  background: var(--success-soft);
  color: var(--success-ink);
  border-color: rgba(22, 163, 74, 0.25);
}
.client-status-pill svg { width: 13px; height: 13px; }
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.18);
}
.client-title { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.18; }
.approved-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  background: var(--success-soft);
  border-color: rgba(22, 163, 74, 0.25);
  color: var(--success-ink);
  box-shadow: none;
}
.approved-extras-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}
.approved-extras-label svg { width: 15px; height: 15px; color: var(--success); flex-shrink: 0; }
.approved-extras strong {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.extra-hint {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 8px;
  line-height: 1.4;
}
.share-link { margin-top: 10px; }
.btn:disabled { opacity: 0.55; cursor: wait; }
.login-message {
  background: var(--success-soft); color: var(--success-ink);
  border: 1px solid rgba(22, 163, 74, 0.25);
  font-size: 13px; font-weight: 600;
  padding: 11px 14px; border-radius: 12px;
  margin-bottom: 14px;
}
.row-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  text-align: right;
  flex-shrink: 0;
}
.phase-row, .list-button { width: 100%; text-align: left; }
.phase-row { display: flex; align-items: center; gap: 12px; }
.phase-row .row-title, .phase-row .row-sub { display: block; }
.phase-index {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-soft); color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
}
.phase-index.hecha { background: var(--success-soft); color: var(--success); }
.phase-index.en_curso { color: #FFFFFF; background: var(--accent); }
.hero-img, .photo-card img { display: block; width: 100%; object-fit: cover; }
.hero-img { position: absolute; inset: 0; height: 100%; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photo-card { overflow: hidden; padding: 0; }
.photo-card img { aspect-ratio: 1; }
.photo-card figcaption { padding: 10px 12px; }

/* ——— Modals ——— */
@keyframes sheetUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(14, 13, 12, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: flex-end;
}
.modal {
  width: min(100%, 500px); background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 14px 18px calc(22px + var(--safe-b));
  max-height: 88dvh; overflow: auto;
  box-shadow: 0 -12px 40px rgba(14, 13, 12, 0.22);
  animation: sheetUp 0.22s var(--ease);
}
.modal-handle { width: 40px; height: 4px; border-radius: 99px; background: var(--border-strong); margin: 0 auto 16px; }
.modal-title { font-size: 19px; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 6px; }
.modal > .row-sub { margin-bottom: 16px; }
.extra-ok-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.extra-ok-amount {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 6px 0;
}
.quick-budget-preview {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

/* ——— Quick concept chips (Cobros) ——— */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 14px;
}
.quick-chip {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.14s var(--ease), color 0.14s var(--ease), border-color 0.14s var(--ease);
}
.quick-chip:active { background: var(--text); border-color: var(--text); color: #FFFFFF; }

/* ——— Budget editor (2-row responsive for 375px iPhone) ——— */
.budget-fields {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.budget-part {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, .9fr) minmax(0, 1.35fr) minmax(0, 1.2fr);
  gap: 6px; align-items: end;
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 10px; margin-bottom: 10px;
  background: var(--surface-subtle);
}
.budget-fields .field, .budget-part .field { margin: 0; min-width: 0; }
.budget-fields input, .budget-fields select, .budget-part input, .budget-part select {
  min-width: 0; height: 42px; padding: 0 8px; font-size: 16px;
}
.budget-part .field:first-child { grid-column: 1 / 4; }
.budget-part .field label { margin-bottom: 3px; font-size: 12px; }
.budget-remove { grid-column: 4; justify-self: end; width: 42px; font-size: 20px; padding: 0; min-height: 42px; }
.budget-line-total { text-align: right; }
.budget-line-total output { display: grid; align-items: center; min-height: 42px; font-family: var(--font-mono); font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.budget-notes { margin-top: 12px; }
.list-button { display: block; }
.budget-summary { min-width: 0; }
.budget-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.budget-table th, .budget-table td {
  padding: 9px 3px; border-bottom: 1px solid var(--border); text-align: right; overflow-wrap: anywhere;
}
.budget-table th:first-child { width: 35%; padding-left: 0; text-align: left; }
.budget-table th:nth-child(2) { width: 17%; }
.budget-table th:last-child, .budget-table td:last-child { padding-right: 0; }
.budget-table thead { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.budget-totals { display: grid; gap: 6px; margin-top: 14px; font-size: 14px; }
.budget-totals div { display: flex; justify-content: space-between; gap: 8px; }
.budget-totals div:last-child { font-size: 17px; font-weight: 800; padding-top: 6px; border-top: 1px solid var(--border); }
.budget-totals dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.budget-detail-notes p { white-space: pre-wrap; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ——— Demo pública ——— */
.demo-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px 9px 16px;
  background: var(--nav); color: var(--bg);
  font-size: 12px;
  border-bottom: 1px solid rgba(244, 241, 234, 0.08);
}
.demo-bar-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.demo-brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #FFFFFF;
}
.demo-brand span { color: var(--accent); margin: 0 2px; }
.demo-bar-note { color: rgba(244, 241, 234, 0.66); font-size: 11px; line-height: 1.25; }
.demo-switch {
  display: flex; flex-shrink: 0; padding: 3px; gap: 2px;
  background: rgba(244, 241, 234, 0.12); border-radius: 999px;
}
.demo-switch a {
  min-height: 32px; padding: 0 13px; border-radius: 999px;
  display: flex; align-items: center;
  font-weight: 700; font-size: 12px;
  color: rgba(244, 241, 234, 0.78);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.demo-switch a[aria-current="page"] { background: var(--accent); color: #FFFFFF; }
.login-note { text-align: center; margin: 16px 0 8px; }

/* ——— Mi empresa ——— */
.avatar-img { background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.avatar-img img { width: 100%; height: 100%; object-fit: contain; }
.business-preview { display: grid; gap: 10px; }
.business-preview-head { display: flex; align-items: center; gap: 12px; }
.business-welcome { color: var(--text-2); font-size: 14px; line-height: 1.5; }
#empresa-form { display: grid; gap: 4px; }
.check-row { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--text-2); }
.contact-card { display: grid; gap: 4px; }

/* ——— Propuestas del cliente ——— */
.chip-proposal { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
.proposal { display: grid; gap: 8px; }
.proposal-answer { font-size: 14px; color: var(--text-2); }
.proposal-form { display: grid; gap: 10px; margin-top: 8px; }
.proposal-form textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 16px; background: var(--surface-subtle); resize: vertical; }

/* ——— Fotos rápidas y diario ——— */
.quick-photo { gap: 8px; cursor: pointer; }
.quick-photo svg { width: 20px; height: 20px; }
.diary-form { display: grid; gap: 10px; }
.diary-form textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 16px; background: var(--surface-subtle); resize: vertical; }
.diary-list { display: grid; gap: 0; }
.diary-entry { padding: 12px 0; border-bottom: 1px solid var(--border); display: grid; gap: 4px; }
.diary-entry:last-child { border-bottom: 0; }
.diary-entry p { font-size: 15px; }
.diary-del { justify-self: start; }

/* ——— Ficha de fase (cliente) ——— */
.phase-link { display: flex; align-items: center; gap: 8px; }
.phase-link .row { flex: 1; }
.phase-chevron { color: var(--text-3); font-size: 22px; line-height: 1; }
.back-link { justify-content: flex-start; gap: 6px; margin-bottom: 10px; }
.phase-detail { display: grid; gap: 8px; }
.phase-desc { font-size: 15px; color: var(--text-2); white-space: pre-line; }
.notice-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quick-phase { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 8px 0 12px; font-size: 13px; color: var(--text-2); }
.quick-phase select { font-size: 15px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); max-width: 62vw; }

/* ——— Plantillas y fases editables ——— */
.empty-phases { display: grid; gap: 10px; }
.template-choice { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.template-choice input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }
.template-choice > span { display: grid; gap: 2px; }
.template-card { display: grid; gap: 8px; }
.templates-hint { margin: -4px 0 12px; }
.phase-tools { margin-top: 8px; }
.btn.danger { color: var(--danger); }
.delete-job { margin-top: 12px; }

/* ——— Prueba y exportación ——— */
.trial-bar { padding: 11px 16px; font-size: 13px; line-height: 1.4; background: var(--warn-bg); color: var(--warn-text); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trial-bar a { font-weight: 700; text-decoration: underline; }
.trial-bar.trial-soon { background: #FFEDD5; color: #9A3412; }
.trial-bar.trial-over { background: var(--danger-soft); color: #991B1B; }
.trial-bar.trial-wait { background: var(--bg-soft); color: var(--text-2); }
.trial-close { min-width: 36px; min-height: 36px; font-size: 20px; line-height: 1; color: inherit; opacity: 0.75; border-radius: 8px; flex-shrink: 0; }
.export-form { display: grid; gap: 12px; }
.export-list { margin: 8px 0 8px 18px; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }

/* Modo consulta */
.read-only .btn-lima:not(.keep), .read-only [data-modal], .read-only .quick-photo, .read-only .quick-phase,
.read-only .quick-strip, .read-only #diario-form, .read-only #empresa-form button, .read-only [data-phase-state],
.read-only [data-pay], .read-only [data-proposal], .read-only #delete-job, .read-only [data-diary-del],
.read-only [data-del-plantilla], .read-only #edit-budget, .read-only #mark-budget-accepted, .read-only .action-tile,
.read-only .task [data-pay], .read-only .phase-done, .read-only [data-photo-del] { display: none !important; }

/* ——— Compact client bar & acciones rápidas ——— */
.wa-link { gap: 6px; }
.wa-link svg { width: 16px; height: 16px; flex: none; }
.notice-share { margin: 0 0 12px; }
.client-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.client-bar .wa-link { flex: 1; }
.phase-done { margin-top: 12px; min-height: 46px; }
.pay-item, .extra-item { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.pay-item:last-child, .extra-item:last-child { border-bottom: 0; padding-bottom: 0; }
.pay-item .btn-row, .extra-item .btn-row { margin-top: 8px; }
.pay-item + .pay-item, .extra-item + .extra-item { padding-top: 10px; }
.tipo-obra { border: 0; }
.tipo-obra legend { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; }
.pick span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.pick input:checked + span { background: var(--text); color: #FFFFFF; border-color: var(--text); }
.pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.more-fields { margin: 8px 0; }
.more-fields summary {
  min-height: 46px; display: flex; align-items: center;
  font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.job-more {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 4px 16px 12px;
  margin-top: 16px;
}
.job-more .btn { margin-top: 8px; }

/* ——— Buscador de obras ——— */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.search-bar svg {
  position: absolute;
  left: 14px;
  color: var(--text-3);
  pointer-events: none;
}
.search-bar input {
  width: 100%;
  height: 44px;
  padding: 0 38px 0 40px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.search-bar input::placeholder { color: var(--text-3); }
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.search-clear {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: var(--text-3);
}
.search-clear:hover { background: var(--bg); color: var(--text); }

/* ——— Financial Pulse Hero (Hoy & Client Pagos) + Executive Job Hero ——— */
.hero-card, .job-hero {
  background: radial-gradient(120% 100% at 100% 0%, rgba(194, 65, 12, 0.24) 0%, rgba(194, 65, 12, 0) 58%), var(--text);
  border-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  padding: 20px 18px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 32px rgba(14, 13, 12, 0.18);
  margin-bottom: 12px;
}
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hero-label-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(244, 241, 234, 0.66);
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.hero-pill-bad { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; }
.hero-pill-ok { background: rgba(34, 197, 94, 0.18); color: #86EFAC; }
.hero-pill-neutral { background: rgba(244, 241, 234, 0.14); color: #F4F1EA; }
.hero-link {
  font-size: 13px;
  font-weight: 700;
  color: rgba(244, 241, 234, 0.88);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244, 241, 234, 0.1);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  white-space: nowrap;
}
.hero-link:hover { background: rgba(244, 241, 234, 0.18); color: #FFFFFF; }
.hero-amount {
  font-family: var(--font-mono);
  font-size: clamp(29px, 8.2vw, 35px);
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin: 10px 0 16px;
  color: #FFFFFF;
}
.hero-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(244, 241, 234, 0.12);
}
.hero-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hero-kpi-label {
  font-size: 11.5px;
  color: rgba(244, 241, 234, 0.62);
  font-weight: 600;
}
.hero-kpi-value {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 700;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Executive Job Hero specifics */
.job-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.job-hero-meta { min-width: 0; }
.job-hero-phase {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-top: 4px;
  color: #FFFFFF;
}
.job-hero-pct {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #FB923C;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  flex-shrink: 0;
}
.job-hero-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(244, 241, 234, 0.14);
  margin: 14px 0 16px;
  overflow: hidden;
}
.job-hero-bar > div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #C2410C, #F97316);
  transition: width 0.5s var(--ease);
}
.client-pay-bar > div {
  background: linear-gradient(90deg, #16A34A, #4ADE80);
}
.job-hero-actions {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(244, 241, 234, 0.12);
}
.btn-dark-ghost {
  background: rgba(244, 241, 234, 0.1);
  border: 1px solid rgba(244, 241, 234, 0.18);
  color: #FFFFFF;
}
.btn-dark-ghost:hover {
  background: rgba(244, 241, 234, 0.18);
  border-color: rgba(244, 241, 234, 0.28);
}
.btn-icon-only {
  flex: none !important;
  width: 44px;
  padding: 0;
}

/* ——— Quick Actions Strip on Hoy ——— */
.quick-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.quick-pill {
  min-height: 46px;
  padding: 0 10px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  gap: 6px;
}
.quick-pill svg { width: 17px; height: 17px; flex-shrink: 0; }
.quick-pill:hover { border-color: var(--border-strong); background: var(--surface-subtle); }
.quick-pill-accent {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}
.quick-pill-accent:hover {
  background: #FBE6DB;
  border-color: rgba(194, 65, 12, 0.36);
}

/* ——— 4-column Apple Control Center dock & Dinero ——— */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 74px;
  padding: 10px 6px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.14s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.action-tile:hover { border-color: var(--border-strong); }
.action-tile svg { width: 21px; height: 21px; }
.action-tile:active { transform: scale(0.96); }
.action-tile.quick-photo {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(194, 65, 12, 0.26);
}
.action-tile.quick-photo:hover { background: var(--accent-dim); border-color: var(--accent-dim); }

.phase-action-card .obra-head { align-items: center; }
.hero-inline-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  white-space: nowrap;
  flex-shrink: 0;
}
.hero-inline-link:hover { background: #FBE6DB; }

.money { display: grid; gap: 8px; }
.money-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
  margin-bottom: 4px;
}
.money-progress > div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #16A34A, #22C55E);
  transition: width 0.5s var(--ease);
}
.money-line { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.money-line span:last-child { white-space: nowrap; font-family: var(--font-mono); font-weight: 600; }
.money-total { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; font-weight: 800; font-size: 17px; }
.money-total span:last-child { font-weight: 800; }

.task {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--accent);
}
.task-money { border-left-color: var(--danger); }
.task-kind {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}
.task-money .task-kind { color: var(--danger); }
.task .btn-row { margin-top: 10px; }
.cobros-add { margin-bottom: 14px; }

/* ——— Diagnóstico de salud de obra ——— */
.obra-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.3;
}
.health-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-ok { background: var(--success-soft); color: var(--success-ink); }
.health-ok .health-dot { background: var(--success); }
.health-warn { background: var(--warn-bg); color: var(--warn-text); }
.health-warn .health-dot { background: #D97706; }
.health-bad { background: var(--danger-soft); color: var(--danger); }
.health-bad .health-dot { background: var(--danger); }

/* ——— Hero pulse & Cobros hero extras ——— */
.hero-pulse {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(253, 186, 116, 0.92);
  margin: -10px 0 14px;
  line-height: 1.35;
}
.hero-pct-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #86EFAC;
  white-space: nowrap;
}
.hero-kpi-danger { color: #FCA5A5; }

/* ——— Parte de obra preview sheet ——— */
.report-preview {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 44dvh;
  overflow: auto;
}

/* ——— Simulador de impacto de saldo en Vista Cliente ——— */
.extra-impact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.extra-impact-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.extra-impact-col span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}
.extra-impact-col strong {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
}
.extra-impact-col.is-after { text-align: right; }
.extra-impact-col.is-after strong { color: var(--accent); font-weight: 800; }
.extra-impact-arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-3);
}

/* ——— Chips rápidos en Diario ——— */
.diary-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.diary-chips::-webkit-scrollbar { display: none; }
.diary-chips .quick-chip { flex-shrink: 0; font-size: 12.5px; min-height: 34px; }

/* ——— Estética de precisión Stripe/Apple/Linear ——— */
.hero-card, .job-hero {
  background:
    radial-gradient(115% 95% at 100% 0%, rgba(194, 65, 12, 0.28) 0%, rgba(194, 65, 12, 0) 56%),
    linear-gradient(rgba(244, 241, 234, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 234, 0.03) 1px, transparent 1px),
    var(--text);
  background-size: auto, 24px 24px, 24px 24px, auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 14px 34px rgba(14, 13, 12, 0.2);
}
.hero-pill-warn { background: rgba(251, 146, 60, 0.2); color: #FDBA74; }

/* Barra segmentada de hitos en Ficha de obra */
.job-hero-segments {
  display: flex;
  gap: 5px;
  margin: 14px 0 16px;
}
.job-seg {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(244, 241, 234, 0.16);
  transition: background 0.3s var(--ease);
}
.job-seg.is-done { background: #22C55E; }
.job-seg.is-current {
  background: linear-gradient(90deg, #C2410C, #FB923C);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.45);
}

/* Squircle icon badges en dock de 4 acciones */
.tile-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s var(--ease);
}
.tile-ico svg { width: 18px; height: 18px; }
.action-tile.quick-photo .tile-ico {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}
.action-tile { min-height: 82px; gap: 6px; }

/* Vista Cliente: fila de estado + bento interactivo + pie de marca */
.client-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.client-status-row .client-status-pill { margin-bottom: 0; }
.client-eta { font-family: var(--font-mono); font-size: 11px; }

.client-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.bento-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 6px;
  border-radius: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
  min-width: 0;
}
.bento-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}
.bento-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bento-tile.is-alert {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.bento-tile.is-alert .bento-value { color: var(--accent); }

.client-footer {
  margin: 26px 0 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
}
.client-footer-brand {
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.client-footer-brand span { color: var(--accent); margin: 0 1px; }

/* ——— Fotos en cola y entrega de obra ——— */
.queue-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px;
  background: var(--warn-bg); color: var(--warn-text); font-size: 13px; font-weight: 600;
}
.queue-bar .btn { flex: none; }
.handover { display: grid; gap: 8px; }