/* Hallmark stamp — Obra Clara premium redesign */
/* Critique: outdoor contrast, thumb-first actions, compact client share bar, company photo gallery, zero dead taps */

:root {
  --bg: #F4F4F0;
  --surface: #FFFFFF;
  --text: #111111;
  --text-2: #4A4A44;
  --text-3: #5C5C56;
  --border: #DDDCD5;
  --lima: #B8F000;
  --lima-dim: #A3D600;
  --danger: #DC2626;
  --success: #15803D;
  --pending: #B45309;
  --warn-bg: #FEF9C3;
  --warn-text: #854D0E;
  --nav: #111111;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::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);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  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(--lima); outline-offset: 2px; }

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title p {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.top-new { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 10px; white-space: nowrap; }

.avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--text); color: var(--lima);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.icon-btn {
  min-width: 40px; height: 40px; padding: 0 8px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.icon-btn:active { background: var(--bg); }

main.page { flex: 1; padding: 12px 16px 24px; }

/* ——— Bottom nav ——— */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 0 8px var(--safe-b);
  background: var(--nav);
  display: flex; align-items: stretch; justify-content: space-around;
  z-index: 40;
  border-radius: 20px 20px 0 0;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: rgba(255,255,255,.72);
  font-size: 11px; font-weight: 600;
  min-height: 44px;
  position: relative;
  transition: color .15s ease;
}
.nav-item.active { color: var(--lima); }
.nav-item svg { width: 22px; height: 22px; }
.nav-badge {
  position: absolute;
  top: 6px; right: calc(50% - 18px);
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--lima); color: var(--text);
  border-radius: 8px; font-size: 10px; font-weight: 800;
  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: 14px 16px;
  margin-bottom: 10px;
}
.card-press { transition: transform .12s ease; }
.card-press:active { transform: scale(0.985); }

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  margin: 16px 0 8px;
  letter-spacing: 0.01em;
}

/* ——— Stats row ——— */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  min-width: 0;
}
.stat.highlight {
  background: var(--lima);
  border-color: var(--lima);
}
.stat-value {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.stat-label { font-size: 11px; color: var(--text-3); margin-top: 2px; font-weight: 600; }
.stat.highlight .stat-label { color: var(--text); }

/* ——— Filters ——— */
.filters {
  display: flex; gap: 6px; overflow-x: auto;
  margin-bottom: 12px; padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.filter {
  flex-shrink: 0;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.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: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.obra-card:active { background: #FAFAF8; }
.obra-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.obra-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.obra-meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.pct-pill {
  flex-shrink: 0;
  background: var(--lima);
  color: var(--text);
  font-size: 12px; font-weight: 800;
  padding: 4px 8px; border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.progress-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin: 12px 0 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--text);
  border-radius: 3px;
  transition: width .4s 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: 10px; }
.chip {
  font-size: 11px; font-weight: 700;
  padding: 4px 8px; border-radius: 6px;
}
.chip-lima { background: var(--lima); color: var(--text); }
.chip-danger { background: #FEE2E2; color: var(--danger); }
.chip-warn { background: var(--warn-bg); color: var(--warn-text); }
.chip-muted { background: var(--bg); color: var(--text-2); }

/* ——— Attention block ——— */
.attention {
  background: var(--warn-bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.attention-title {
  font-size: 13px; font-weight: 700; color: var(--warn-text);
  margin-bottom: 4px;
}
.attention p { font-size: 13px; color: var(--warn-text); }

/* ——— Buttons ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px;
  border-radius: 12px;
  font-size: 15px; font-weight: 700;
  transition: transform .12s ease, opacity .15s;
}
.btn:active { transform: scale(0.97); }
.btn-lima { background: var(--lima); color: var(--text); }
.btn-dark { background: var(--text); color: var(--surface); }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; font-size: 13px; padding: 0 12px; border-radius: 10px; }
.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: 24px 20px;
  background: var(--bg);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--text); color: var(--lima);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; margin-bottom: 12px;
}
.login-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.login-brand p { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.login-card {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px 20px;
}
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  height: 48px; padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;
}
.field textarea { height: auto; min-height: 72px; padding: 10px 14px; }
.field input[type="file"] { height: auto; padding: 10px 14px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--text);
  outline: none;
}
.login-error {
  background: #FEE2E2; color: var(--danger);
  font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 10px;
  margin-bottom: 12px;
}
.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);
  padding: 16px;
  margin-bottom: 12px;
}
.phase-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.phase-now { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.phase-pct {
  font-size: 28px; font-weight: 800; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.phase-dots { display: flex; gap: 6px; margin: 12px 0 8px; }
.phase-dot { flex: 1; height: 6px; border-radius: 3px; background: var(--border); }
.phase-dot.done { background: var(--text); }
.phase-dot.current { background: var(--lima); }
.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: 12px 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row-title { font-size: 14px; font-weight: 700; }
.row-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.row-amount {
  font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.status { font-size: 11px; font-weight: 700; margin-top: 2px; text-align: right; }
.status-ok { color: var(--success); }
.status-wait { color: var(--pending); }
.status-bad { color: var(--danger); }

/* ——— Client hero & pending extras box ——— */
.pending-box {
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: var(--radius);
  padding: 12px 14px 4px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.pending-title {
  display: inline-block;
  background: var(--lima);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.pending-box .card {
  box-shadow: none;
  border-color: var(--border);
  padding: 10px 12px;
}

.client-hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  background: #2A2A28;
  aspect-ratio: 16/10;
  position: relative;
  display: flex; align-items: flex-end;
}
.client-hero-label {
  position: absolute; left: 12px; bottom: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.client-hero-label span {
  background: rgba(0,0,0,.78); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px;
  max-width: 70%;
}
.client-hero-label .photo-count {
  background: var(--lima); color: var(--text);
  font-weight: 800;
}

/* ——— 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: var(--radius-sm);
  overflow: hidden;
  background: #2A2A28;
  border: 1px solid var(--border);
}
.job-photo-thumb:active { transform: scale(.97); }
.job-photo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.job-photo-label {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: rgba(17,17,17,.78);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 5px;
  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: #111111;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

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

.page > .chips { margin: 6px 0 12px; }
.client-title { font-size: 22px; line-height: 1.2; }
.approved-extras { font-size: 14px; }
.approved-extras strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.share-link { margin-top: 10px; }
.btn:disabled { opacity: .55; cursor: wait; }
.login-message {
  background: #DCFCE7; color: #14532D;
  font-size: 13px; font-weight: 600;
  padding: 10px 12px; border-radius: 10px;
  margin-bottom: 12px;
}
.row-end { text-align: right; flex-shrink: 0; }
.phase-row, .list-button { width: 100%; text-align: left; }
.phase-row { display: flex; align-items: center; gap: 10px; }
.phase-row .row-title, .phase-row .row-sub { display: block; }
.phase-index {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg); font-weight: 700;
}
.phase-index.hecha { background: var(--lima); }
.phase-index.en_curso { color: var(--lima); background: var(--text); }
.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: 8px; }
.photo-card { overflow: hidden; padding: 0; }
.photo-card img { aspect-ratio: 1; }
.photo-card figcaption { padding: 8px 10px; }

/* ——— Modals ——— */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45);
  display: flex; justify-content: center; align-items: flex-end;
}
.modal {
  width: min(100%, 480px); background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 12px 16px calc(20px + var(--safe-b)); max-height: 88dvh; overflow: auto;
}
.modal-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 14px; }
.modal-title { font-size: 18px; font-weight: 750; margin-bottom: 6px; }
.modal > .row-sub { margin-bottom: 14px; }
.extra-ok-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 14px;
}
.extra-ok-amount {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
}
.quick-budget-preview {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

/* ——— Quick concept chips (Cobros) ——— */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 12px;
}
.quick-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.quick-chip:active { background: var(--text); color: #fff; }

/* ——— 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: 12px; padding: 10px 8px; margin-bottom: 8px;
}
.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-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: 8px 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-2); font-size: 12px; }
.budget-totals { display: grid; gap: 6px; margin-top: 12px; font-size: 14px; }
.budget-totals div { display: flex; justify-content: space-between; gap: 8px; }
.budget-totals div:last-child { font-size: 17px; font-weight: 700; }
.budget-totals dd { margin: 0; }
.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: 8px 12px 8px 16px;
  background: var(--nav); color: #fff;
  font-size: 12px;
}
.demo-bar-note { color: rgba(255,255,255,.8); line-height: 1.3; }
.demo-switch {
  display: flex; flex-shrink: 0; padding: 3px; gap: 2px;
  background: rgba(255,255,255,.14); border-radius: 999px;
}
.demo-switch a {
  min-height: 32px; padding: 0 12px; border-radius: 999px;
  display: flex; align-items: center;
  font-weight: 700; color: rgba(255,255,255,.82);
}
.demo-switch a[aria-current="page"] { background: var(--lima); color: var(--text); }
.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; }
#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); }
.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: 10px 12px; font-size: 16px; background: var(--surface); 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: 10px 12px; font-size: 16px; background: var(--surface); resize: vertical; }
.diary-list { display: grid; gap: 0; }
.diary-entry { padding: 10px 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: 6px 0 8px; font-size: 13px; color: var(--text-2); }
.quick-phase select { font-size: 16px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); 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(--text); flex-shrink: 0; }
.template-choice > span { display: grid; gap: 2px; }
.template-card { display: grid; gap: 8px; }
.templates-hint { margin: -4px 0 10px; }
.phase-tools { margin-top: 8px; }
.btn.danger { color: var(--danger); }
.delete-job { margin-top: 12px; }

/* ——— Prueba y exportación ——— */
.trial-bar { padding: 10px 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: #FEE2E2; color: #991B1B; }
.trial-bar.trial-wait { background: var(--bg); color: var(--text-2); }
.trial-close { min-width: 36px; min-height: 36px; font-size: 20px; line-height: 1; color: inherit; opacity: .75; border-radius: 8px; flex-shrink: 0; }
.export-form { display: grid; gap: 10px; }
.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 #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: 6px;
  margin-bottom: 10px;
}
.client-bar .wa-link { flex: 1; }
.phase-done { margin-top: 12px; min-height: 48px; }
.pay-item, .extra-item { padding-bottom: 10px; 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: 4px; }
.pay-item + .pay-item, .extra-item + .extra-item { padding-top: 6px; }
.tipo-obra { border: 0; }
.tipo-obra legend { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.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: 42px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 600;
}
.pick input:checked + span { background: var(--text); color: #fff; border-color: var(--text); }
.pick input:focus-visible + span { outline: 2px solid var(--lima); outline-offset: 2px; }
.more-fields { margin: 8px 0; }
.more-fields summary {
  min-height: 44px; display: flex; align-items: center;
  font-size: 14px; font-weight: 650; color: var(--text-2); cursor: pointer;
}
.job-more {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 14px 10px;
  margin-top: 14px;
}
.job-more .btn { margin-top: 8px; }

/* ——— Pantalla Hoy, 4 tiles de trabajo y Dinero ——— */
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 8px; }
.action-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 82px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 15px; font-weight: 700; color: var(--text); cursor: pointer;
}
.action-tile svg { width: 26px; height: 26px; }
.action-tile:active { transform: scale(.98); }
.action-tile.quick-photo { background: var(--lima); border-color: var(--lima); }
.money { display: grid; gap: 6px; }
.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; }
.money-total { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; font-weight: 800; font-size: 17px; }
.owed { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.owed-value { font-size: 28px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.task { display: grid; gap: 2px; }
.task-kind { font-size: 12px; font-weight: 700; color: var(--text-3); }
.task-money .task-kind { color: var(--danger); }
.task .btn-row { margin-top: 8px; }
.cobros-add { margin-bottom: 12px; }

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