:root {
  box-sizing: border-box;
  --bg: #EDF1EF; --surface: #FFFFFF; --surface-2: #F4F6F5;
  --ink: #1A2321; --ink-soft: #55635D; --line: #D7DEDA; --line-strong: #B9C4BE;
  --primary: #1F4E5F; --primary-dark: #143743; --primary-tint: #E4EEF1;
  --amber: #C97A22; --amber-tint: #FBEEDD;
  --red: #B0392E; --red-tint: #FAE7E4;
  --green: #3E7A57; --green-tint: #E4F0E8;
  --radius: 3px;
  --font-ui: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
}
:root[data-theme="dark"] {
  --bg: #12181A; --surface: #1A2225; --surface-2: #1F2A2D;
  --ink: #E7EDEA; --ink-soft: #9AABA4; --line: #2C3A3D; --line-strong: #3B4C50;
  --primary: #6FA9BD; --primary-dark: #8FC0D2; --primary-tint: #1E343C;
  --amber: #E0A85C; --amber-tint: #3A2F1C;
  --red: #E0847A; --red-tint: #3B211E;
  --green: #86C4A1; --green-tint: #1E3428;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

#app { display: flex; min-height: 100%; }

.sidebar { width: 232px; flex: 0 0 232px; background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.brand { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.brand-mark { font-family: var(--font-mono); font-weight: 600; font-size: 15px; color: var(--primary); letter-spacing: 0.02em; }
.brand-sub { font-size: 11px; color: var(--ink-soft); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); color: var(--ink-soft); cursor: pointer; font-size: 13.5px; font-weight: 500; border-left: 2px solid transparent; transition: background .12s ease, color .12s ease; }
.nav-item svg { flex: 0 0 16px; width: 16px; height: 16px; opacity: .8; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--primary-tint); color: var(--primary-dark); border-left-color: var(--primary); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.sidebar-foot { margin-top: auto; padding: 10px; font-size: 11.5px; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 12px; }
.conn-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 6px; }
.link-action { color: var(--primary); cursor: pointer; font-weight: 600; }
.link-action:hover { text-decoration: underline; }

.main { flex: 1; min-width: 0; padding: 28px 36px 60px; max-width: 1180px; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.view-title { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.view-desc { color: var(--ink-soft); font-size: 13px; margin-top: 3px; }

.btn { font-family: var(--font-ui); font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--primary); background: var(--primary); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.secondary { background: transparent; color: var(--primary); }
.btn.secondary:hover { background: var(--primary-tint); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; border-top: 2px solid var(--line-strong); }
.kpi.accent-amber { border-top-color: var(--amber); }
.kpi.accent-red { border-top-color: var(--red); }
.kpi.accent-green { border-top-color: var(--green); }
.kpi-value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; }
.kpi-label { color: var(--ink-soft); font-size: 12.5px; margin-top: 2px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; overflow: hidden; }
.panel-head { padding: 13px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13.5px; }
.panel-body { padding: 4px 0; }
.empty-state { padding: 34px 16px; text-align: center; color: var(--ink-soft); font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--ink-soft); font-size: 11.5px; padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.cell-main { font-weight: 500; }
.cell-soft { color: var(--ink-soft); }
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.wrap-cell { white-space: normal; max-width: 260px; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 6px; border-radius: 2px; font-size: 11.5px; font-weight: 600; border-left: 2.5px solid; }
.tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag-green { background: var(--green-tint); color: var(--green); border-color: var(--green); }
.tag-amber { background: var(--amber-tint); color: var(--amber); border-color: var(--amber); }
.tag-red { background: var(--red-tint); color: var(--red); border-color: var(--red); }
.tag-neutral { background: var(--surface-2); color: var(--ink-soft); border-color: var(--line-strong); }

.row-actions { display: flex; gap: 6px; }
.icon-btn { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 13px; height: 13px; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 500; color: var(--ink-soft); cursor: pointer; background: var(--surface); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.search-input { flex: 1; min-width: 160px; max-width: 280px; padding: 7px 11px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-family: var(--font-ui); font-size: 13px; }
.search-input:focus, select:focus, input:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 16, 15, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 4px; width: 100%; max-width: 480px; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,0.18); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-weight: 600; font-size: 15px; }
.modal-close { cursor: pointer; color: var(--ink-soft); background: none; border: none; font-size: 18px; line-height: 1; padding: 2px; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 65vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=text], input[type=number], input[type=date], input[type=tel], input[type=email], input[type=password], select, textarea {
  font-family: var(--font-ui); font-size: 13.5px; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); width: 100%;
}
textarea { resize: vertical; min-height: 64px; font-family: var(--font-ui); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(8px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; z-index: 80; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.request-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.request-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.request-card:hover { border-color: var(--line-strong); }

.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 30px 28px; width: 100%; max-width: 380px; box-shadow: 0 8px 28px rgba(0,0,0,0.06); }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 22px; background: var(--surface-2); border-radius: var(--radius); padding: 3px; }
.auth-tab { flex: 1; text-align: center; padding: 8px; border-radius: 2px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-soft); }
.auth-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.auth-error { background: var(--red-tint); color: var(--red); font-size: 12.5px; padding: 8px 10px; border-radius: var(--radius); }
.role-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--primary-tint); color: var(--primary-dark); }

.menu-toggle { display: none; }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .18s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 20px 16px 60px; max-width: 100%; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; cursor: pointer; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 39; }
  .scrim.show { display: block; }
}

/* ---------------- Requester app shell ---------------- */
.rq-app {
  min-height: 100vh; min-height: 100dvh;
  max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.rq-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.rq-greeting { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.rq-date { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; text-transform: capitalize; }
.rq-header-actions { display: flex; gap: 8px; }
.rq-icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft);
  cursor: pointer; font-size: 16px;
}
.rq-icon-btn svg { width: 16px; height: 16px; }
.rq-content { flex: 1; padding: 18px 18px calc(96px + env(safe-area-inset-bottom, 0px)); animation: rq-fade-in .28s ease both; }
@keyframes rq-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.rq-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  max-width: 560px; margin: 0 auto;
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  gap: 6px;
}
.rq-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: 10px; border: none; background: none;
  color: var(--ink-soft); font-family: var(--font-ui); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: color .12s ease, background .12s ease;
}
.rq-tab svg { width: 21px; height: 21px; }
.rq-tab.active { color: var(--primary); background: var(--primary-tint); }

.rq-section-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 2px; }
.rq-section-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }

.rq-chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; -webkit-overflow-scrolling: touch; }
.rq-chip-row::-webkit-scrollbar { display: none; }
.rq-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink);
  cursor: pointer; white-space: nowrap;
}
.rq-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.rq-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(20,30,28,0.04);
}
.rq-field { margin-bottom: 16px; }
.rq-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.rq-field input[type=text], .rq-field textarea {
  font-size: 15px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); width: 100%; font-family: var(--font-ui);
}
.rq-field textarea { min-height: 90px; }

.rq-seg { display: flex; gap: 8px; }
.rq-seg-option {
  flex: 1; text-align: center; padding: 10px 6px; border-radius: 10px;
  border: 1.5px solid var(--line-strong); font-size: 13px; font-weight: 700; cursor: pointer;
  color: var(--ink-soft); background: var(--surface);
}
.rq-seg-option.sel-baja.active { border-color: var(--ink-soft); color: var(--ink); background: var(--surface-2); }
.rq-seg-option.sel-media.active { border-color: var(--amber); color: var(--amber); background: var(--amber-tint); }
.rq-seg-option.sel-alta.active { border-color: var(--red); color: var(--red); background: var(--red-tint); }

.rq-submit-btn {
  width: 100%; padding: 15px; border-radius: 12px; border: none;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(31,78,95,0.28);
}
.rq-submit-btn:active { transform: scale(0.98); }

.rq-req-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 12px; cursor: pointer;
  border-left: 4px solid var(--line-strong);
  animation: rq-fade-in .3s ease both;
}
.rq-req-card.st-pendiente { border-left-color: var(--amber); }
.rq-req-card.st-en-proceso { border-left-color: var(--primary); }
.rq-req-card.st-ejecutado { border-left-color: var(--green); }
.rq-req-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--surface-2);
}
.rq-req-body { flex: 1; min-width: 0; }
.rq-req-title { font-weight: 700; font-size: 14.5px; margin-bottom: 2px; }
.rq-req-meta { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.rq-empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.rq-empty-icon { font-size: 40px; margin-bottom: 10px; }

.month-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 22px; border-radius: 4px; font-size: 10.5px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
}
.month-chip.due { background: var(--primary-tint); color: var(--primary-dark); border-color: var(--primary); font-weight: 700; }
.month-chip.current { box-shadow: 0 0 0 2px var(--amber); }

/* ---------------- Multiempresa (Fase 1) ---------------- */
.banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 18px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); }
.banner.warn { background: var(--amber-tint); border-color: var(--amber); color: var(--ink); }
.banner.danger { background: var(--red-tint); border-color: var(--red); color: var(--ink); }
.banner.info { background: var(--primary-tint); border-color: var(--primary); color: var(--ink); }
.tenant-name { font-size: 12px; font-weight: 600; color: var(--ink); margin-top: 4px; }
.onb-options { display: grid; gap: 10px; margin-top: 6px; }
.onb-option { border: 1px solid var(--line-strong); border-radius: 6px; padding: 14px; cursor: pointer; background: var(--surface); text-align: left; font-family: var(--font-ui); color: var(--ink); }
.onb-option:hover { border-color: var(--primary); background: var(--primary-tint); }
.onb-option-title { font-weight: 600; font-size: 14px; }
.onb-option-desc { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.code-box { font-family: var(--font-mono); font-size: 20px; font-weight: 600; letter-spacing: 0.12em; padding: 10px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); display: inline-block; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .settings-grid { grid-template-columns: 1fr; } }
.hint { font-size: 12px; color: var(--ink-soft); }
.check-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.check-row input { margin-top: 3px; }
#app > .auth-wrap, #app > .rq-app, #app > .empty-state { flex: 1; min-width: 0; }
.btn svg { width: 14px; height: 14px; vertical-align: -2px; }
tr.clickable { cursor: pointer; }
.modal-foot { flex-wrap: wrap; }
.modal { max-width: 560px; }

/* ---------- Fase 2: avisos, pestañas, archivos, firma, checklist, calendario ---------- */
.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.topbar .menu-toggle { margin-bottom: 0; }
.bell-btn { position: relative; width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.bell-btn:hover { background: var(--surface-2); }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-ui); }
.notif { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--primary-tint); }
.notif.unread .notif-title { font-weight: 700; }
.notif-icon { font-size: 18px; line-height: 1.2; }
.notif-title { font-size: 13px; }
.notif-body { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.modal.modal-wide { max-width: 780px; }
.modal-wide .modal-body { max-height: 70vh; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; margin: -6px 0 2px; flex-shrink: 0; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 12px; font: 600 12.5px var(--font-ui); color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
[data-pane] { display: flex; flex-direction: column; gap: 14px; }
[data-pane][style*="none"] { display: none !important; }
.cost-box { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: 12.5px; color: var(--ink-soft); }
.cost-box b { color: var(--ink); font-family: var(--font-mono); margin-left: 4px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.gallery > .hint { grid-column: 1 / -1; }
.thumb { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.thumb a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; text-decoration: none; color: var(--ink-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-doc { font-size: 11px; text-align: center; padding: 4px; word-break: break-all; }
.thumb-del { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }

.sig-pad { width: 100%; height: 150px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-img { max-height: 90px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; display: block; }

.cl-item { display: grid; grid-template-columns: 22px 1fr 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cl-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
.cl-text-ro { font-size: 13px; }
.cl-item:has(.cl-done:checked) .cl-text-ro, .cl-item:has(.cl-done:checked) .cl-text { text-decoration: line-through; color: var(--ink-soft); }
@media (max-width: 600px) { .cl-item { grid-template-columns: 22px 1fr auto; } .cl-item .cl-value { grid-column: 2 / -1; } }

.comments { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.comment { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; max-width: 88%; }
.comment.mine { align-self: flex-end; background: var(--primary-tint); }
.comment-head { font-size: 11.5px; margin-bottom: 2px; }

.logo-box { min-height: 70px; display: flex; align-items: center; padding: 8px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff; }
.logo-box img { max-height: 64px; max-width: 220px; object-fit: contain; }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; }
.rq-photo-btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; border: 1.5px dashed var(--line-strong); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--primary); background: var(--surface); }
.rq-icon-btn.bell-btn { position: relative; }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { padding: 8px; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; border-bottom: 1px solid var(--line); text-align: center; }
.cal-cell { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-empty { background: var(--surface-2); }
.cal-day { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.cal-today { background: var(--primary-tint); }
.cal-today .cal-day { color: var(--primary); }
.cal-ev { font-size: 11px; padding: 2px 5px; border-radius: 2px; border-left: 3px solid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; background: var(--surface-2); border-color: var(--line-strong); }
.cal-ev.ev-open { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-dark); }
.cal-ev.ev-high { background: var(--amber-tint); border-color: var(--amber); }
.cal-ev.ev-late { background: var(--red-tint); border-color: var(--red); color: var(--red); }
.cal-ev.ev-plan { border-style: dashed; }
.cal-ev.ev-done { background: var(--green-tint); border-color: var(--green); color: var(--green); }
.cal-more { font-size: 11px; color: var(--ink-soft); padding-left: 4px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cal-legend .cal-ev { cursor: default; }
.load-row { display: grid; grid-template-columns: 170px 1fr 150px; gap: 12px; align-items: center; padding: 8px 16px; font-size: 13px; }
.load-bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.load-bar span { display: block; height: 100%; background: var(--primary); }
.load-num { font-size: 12px; color: var(--ink-soft); text-align: right; }
@media (max-width: 860px) {
  .cal-cell { min-height: 64px; }
  .cal-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; }
  .cal-legend .cal-ev { font-size: 11px; height: auto; padding: 2px 5px; border-left-width: 3px; }
  .load-row { grid-template-columns: 110px 1fr; } .load-num { grid-column: 1 / -1; text-align: left; }
}
@media print { .sidebar, .topbar, .menu-toggle { display: none !important; } }
.labor-form { display: grid; grid-template-columns: 2fr 1fr 1.3fr auto; gap: 10px; align-items: end; margin-top: 10px; }
@media (max-width: 600px) { .labor-form { grid-template-columns: 1fr 1fr; } .labor-form .field:first-child { grid-column: 1 / -1; } }

/* ---------- Trámite de la labor (Fase 3) ---------- */
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--line-strong); }
.flow { display: flex; flex-direction: column; gap: 14px; }
.flow-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.flow-h { font-weight: 600; font-size: 13px; color: var(--primary-dark); }
.flow-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.flow-actions .hint { flex: 1; min-width: 180px; }
.stepper { display: flex; gap: 0; overflow-x: auto; padding: 2px 0 4px; }
.step { flex: 1; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; text-align: center; }
.step::before { content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before, .step.current::before, .step.skipped::before { background: var(--primary); }
.step-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font: 600 12px var(--font-mono); color: var(--ink-soft); z-index: 1; }
.step.done .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.current .step-dot { border-color: var(--amber); color: var(--amber); background: var(--amber-tint); }
.step.skipped .step-dot { border-style: dashed; }
.step-label { font-size: 11.5px; color: var(--ink-soft); line-height: 1.25; }
.step-label small { display: block; font-size: 10.5px; }
.step.current .step-label { color: var(--ink); font-weight: 600; }
.seg { display: flex; gap: 0; }
.seg-btn { flex: 1; padding: 10px 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); font: 600 13px var(--font-ui); cursor: pointer; }
.seg-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.seg-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
.seg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.seg-btn:disabled { cursor: default; opacity: .7; }
.mat-form { display: grid; grid-template-columns: 2.2fr 1.6fr .8fr .7fr 1fr auto; gap: 8px; align-items: end; }
.mat-form input:disabled { background: var(--surface-2); color: var(--ink-soft); }
@media (max-width: 700px) { .mat-form { grid-template-columns: 1fr 1fr; } .mat-form .field:first-child, .mat-form .field:nth-child(2) { grid-column: 1 / -1; } }
.budget-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.budget-title { font-weight: 600; font-size: 12.5px; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 14px; }
.budget-grid div { display: flex; flex-direction: column; font-size: 11.5px; color: var(--ink-soft); }
.budget-grid b { font: 600 14px var(--font-mono); color: var(--ink); }
.budget-left b { color: var(--green); font-size: 15px; }
.budget-left.neg b { color: var(--red); }
.budget-bar { height: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.budget-bar span { display: block; height: 100%; background: var(--green); }
.budget-bar span.warn { background: var(--amber); }
.budget-bar span.neg { background: var(--red); }
.so-item { display: grid; grid-template-columns: 1fr 80px 130px auto; gap: 8px; align-items: center; margin-bottom: 6px; }
@media (max-width: 600px) { .so-item { grid-template-columns: 1fr 1fr auto; } .so-item .so-desc { grid-column: 1 / -1; } }

/* ---------- Órdenes de compra aparte (Fase 5) ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.choice { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.choice-h { font-weight: 600; font-size: 14px; }
.choice .btn { align-self: flex-start; }
.po-item { display: grid; grid-template-columns: 1.6fr 1.4fr 80px 150px auto; gap: 8px; align-items: center; margin-bottom: 4px; }
.po-item .po-hint { grid-column: 1 / -1; margin-top: -2px; margin-bottom: 4px; }
.po-item.repo { grid-template-columns: 2fr 90px 170px auto; }
@media (max-width: 700px) { .po-item { grid-template-columns: 1fr 1fr auto; } .po-item .po-part, .po-item .po-desc { grid-column: 1 / -1; } }

/* ---------- Orden de trabajo compacta (Fase 6) ---------- */
.ask { border: 1.5px solid var(--amber); background: var(--amber-tint); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ask-q { font-weight: 600; font-size: 14px; }
.ask .seg-btn { background: var(--surface); }
.ask .seg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.ask-pane { display: flex; flex-direction: column; gap: 10px; }
.ask-need { display: flex; gap: 18px; flex-wrap: wrap; }
.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.fold > summary { cursor: pointer; padding: 9px 12px; font-weight: 600; font-size: 13px; color: var(--ink-soft); list-style: none; display: flex; align-items: center; gap: 8px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: '▸'; font-size: 11px; transition: transform .12s ease; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold[open] > summary { color: var(--ink); border-bottom: 1px solid var(--line); }
.fold-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.modal-body > .field-row > .field-row { gap: 12px; }

/* =====================================================================
   Fase 7 — experiencia tipo app de domicilios
   ===================================================================== */
/* Ventanas: aparecen suaves en computador y como hoja inferior en el celular */
.modal-backdrop { animation: bd-in .18s ease both; backdrop-filter: blur(2px); }
@keyframes bd-in { from { background: rgba(10,16,15,0); } }
.modal { border-radius: 14px; overflow: hidden; animation: pop-in .22s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.modal-wide { max-width: 100%; border-radius: 18px 18px 0 0; animation: sheet-up .28s cubic-bezier(.2,.9,.25,1) both; max-height: 92dvh; display: flex; flex-direction: column; }
  .modal .modal-body { max-height: none; flex: 1; }
  .modal-head { position: relative; padding-top: 22px; }
  .modal-head::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-strong); }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.modal-foot.sticky-cta .btn { flex: 1; padding: 13px 16px; font-size: 14px; border-radius: 12px; }
.modal-foot.sticky-cta .btn.ghost { flex: 0 0 auto; }

/* Banner de aviso que baja desde arriba */
#heads-up { position: fixed; top: 10px; left: 50%; z-index: 120; width: min(440px, calc(100vw - 20px)); transform: translate(-50%, -140%); transition: transform .35s cubic-bezier(.2,.9,.25,1.15); }
#heads-up.show { transform: translate(-50%, 0); }
.hu-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,0,0,.18); cursor: pointer; }
.hu-icon { font-size: 22px; width: 38px; height: 38px; flex: 0 0 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--primary-tint); }
.hu-text { flex: 1; min-width: 0; }
.hu-app { font-size: 10.5px; letter-spacing: .06em; color: var(--ink-soft); font-weight: 700; }
.hu-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.hu-body { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hu-close { border: none; background: none; font-size: 18px; color: var(--ink-soft); cursor: pointer; padding: 0 2px; }
.bell-btn.ring { animation: ring .7s ease; }
@keyframes ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-16deg); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-9deg); } 80% { transform: rotate(5deg); } }

/* Invitación a activar notificaciones */
.notif-prompt { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, var(--primary-tint), var(--surface)); border: 1px solid var(--line); margin-bottom: 16px; }
.np-icon { font-size: 24px; }
.np-text { flex: 1; min-width: 180px; display: flex; flex-direction: column; font-size: 13px; }
.np-text span { color: var(--ink-soft); font-size: 12.5px; }
.np-actions { display: flex; gap: 6px; }

/* Pedir: buscador, categorías, urgencia, fotos */
.rq-hero-title { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 12px; line-height: 1.2; }
.rq-search { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line-strong); margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.rq-search input { border: none !important; background: transparent !important; padding: 14px 0 !important; font-size: 15px !important; outline: none; width: 100%; color: var(--ink); }
.rq-place { font-size: 13px; margin: -6px 0 14px; } .rq-place span { color: var(--ink-soft); }
.rq-cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.rq-cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); transition: transform .12s ease, border-color .12s ease; }
.rq-cat:active { transform: scale(.96); }
.rq-cat.active { border-color: var(--primary); background: var(--primary-tint); }
.rq-cat-icon { font-size: 24px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-2); }
.rq-cat-name { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rq-urgency { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rq-urg { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); font: 600 12.5px var(--font-ui); color: var(--ink-soft); cursor: pointer; }
.rq-urg span { font-size: 18px; }
.rq-urg.active.u-baja { border-color: var(--green); color: var(--green); background: var(--green-tint); }
.rq-urg.active.u-media { border-color: var(--amber); color: var(--amber); background: var(--amber-tint); }
.rq-urg.active.u-alta { border-color: var(--red); color: var(--red); background: var(--red-tint); }
.rq-photos { display: flex; gap: 8px; align-items: center; overflow-x: auto; }
.rq-photo-add { flex: 0 0 72px; height: 72px; border-radius: 12px; border: 1.5px dashed var(--line-strong); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; background: var(--surface); }
.rq-photo-add span { font-size: 11px; font-weight: 600; color: var(--primary); }
.rq-thumbs { display: flex; gap: 8px; }
.rq-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); animation: pop-in .2s ease both; }
.rq-sticky { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); padding: 12px 0 4px; background: linear-gradient(transparent, var(--bg) 35%); z-index: 5; }
.rq-submit-btn { border-radius: 14px !important; box-shadow: 0 8px 20px rgba(31,78,95,.25); }
.rq-card { border-radius: 16px; }

/* Mis solicitudes: tarjetas como pedidos */
.rq-group { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 16px 2px 8px; }
.order-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.04); animation: rq-fade-in .3s ease both; transition: transform .12s ease; }
.order-card:active { transform: scale(.985); }
.oc-top { display: flex; gap: 12px; align-items: center; }
.oc-icon { font-size: 22px; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.oc-main { flex: 1; min-width: 0; }
.oc-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-meta { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-emoji { font-size: 24px; }
.oc-status { font-weight: 700; font-size: 13.5px; margin: 10px 0 8px; }
.tone-green .oc-status { color: var(--green); } .tone-amber .oc-status { color: var(--amber); } .tone-primary .oc-status { color: var(--primary); } .tone-red .oc-status { color: var(--red); }
.oc-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.oc-bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--primary), #3FA7A0); position: relative; overflow: hidden; }
.oc-bar span::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.oc-rate { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--amber); }
.oc-stars { margin-top: 6px; color: #E3A008; letter-spacing: 2px; }

/* Seguimiento */
.back-link { border: none; background: none; color: var(--primary); font: 600 13.5px var(--font-ui); padding: 0 0 10px; cursor: pointer; }
.track-hero { border-radius: 20px; padding: 22px 18px 18px; color: #fff; margin-bottom: 14px; text-align: center; position: relative; overflow: hidden; background: linear-gradient(145deg, #1F4E5F, #2F7C80); box-shadow: 0 12px 26px rgba(31,78,95,.25); }
.track-hero.tone-amber { background: linear-gradient(145deg, #B86B17, #E09A3E); }
.track-hero.tone-green { background: linear-gradient(145deg, #2F6E4B, #4FA276); }
.track-hero.tone-red { background: linear-gradient(145deg, #93342A, #C65B4F); }
.th-emoji { font-size: 44px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.th-title { font-size: 20px; font-weight: 800; margin-top: 6px; letter-spacing: -0.01em; }
.th-sub { font-size: 13.5px; opacity: .92; margin-top: 2px; }
.th-order { display: inline-block; margin-top: 12px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.18); }
.person-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.person-card.small { margin-bottom: 0; padding: 10px 12px; }
.pc-avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.person-card.small .pc-avatar { width: 36px; height: 36px; flex-basis: 36px; font-size: 13px; background: var(--surface-2); color: var(--ink); }
.pc-text { flex: 1; min-width: 0; }
.pc-role { font-size: 11.5px; color: var(--ink-soft); }
.pc-name { font-weight: 700; font-size: 15px; }
.pc-chat { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-size: 18px; cursor: pointer; }
.tl { display: flex; flex-direction: column; }
.tl-step { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before { content: ''; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.tl-step:last-child::before { display: none; }
.tl-step.done::before { background: var(--primary); }
.tl-dot { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; z-index: 1; }
.tl-step.done .tl-dot { background: var(--primary); border-color: var(--primary); }
.tl-step.current .tl-dot { border-color: var(--amber); box-shadow: 0 0 0 0 rgba(201,122,34,.5); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(201,122,34,.45); } 70% { box-shadow: 0 0 0 10px rgba(201,122,34,0); } 100% { box-shadow: 0 0 0 0 rgba(201,122,34,0); } }
.tl-label { font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.tl-step.done .tl-label, .tl-step.current .tl-label { color: var(--ink); }
.tl-step.current .tl-label { font-weight: 700; }
.tl-sub { font-size: 12.5px; color: var(--ink-soft); }
.tl-time { font-size: 11.5px; color: var(--ink-soft); }
.card-h { font-weight: 700; font-size: 14.5px; margin-bottom: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv span { color: var(--ink-soft); } .kv.col { flex-direction: column; gap: 2px; border: none; }
.chat-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px 0 10px; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); font-size: 13.5px; align-self: flex-start; animation: pop-in .2s ease both; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-radius: 16px 16px 4px 16px; }
.b-who { font-size: 11px; font-weight: 700; opacity: .75; }
.b-time { font-size: 10.5px; opacity: .65; text-align: right; }
.chat-input { display: flex; gap: 8px; align-items: center; }
.chat-input input { border-radius: 999px !important; padding: 11px 16px !important; }
.chat-send { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; border: none; background: var(--primary); color: #fff; font-size: 16px; cursor: pointer; }
.rate-card { text-align: center; border: 2px solid #F2C94C; }
.rate-stars { display: flex; justify-content: center; gap: 6px; margin: 6px 0; }
.rate-stars .star { font-size: 38px; border: none; background: none; color: var(--line-strong); cursor: pointer; transition: transform .12s ease, color .12s ease; padding: 0 2px; }
.rate-stars .star.on { color: #E3A008; transform: scale(1.12); }
.rate-stars.big { font-size: 30px; color: #E3A008; letter-spacing: 3px; } .rate-stars.big span { color: var(--line-strong); }
.rate-label { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.rate-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
.rate-tag { border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 12px; font: 600 12.5px var(--font-ui); color: var(--ink-soft); cursor: pointer; }
.rate-tag.on { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }
.rate-card textarea { width: 100%; margin-bottom: 12px; border-radius: 12px; }
.rq-card.rated { text-align: center; }

/* Pantalla de éxito */
#celebrate { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(10,16,15,.45); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
#celebrate.show { opacity: 1; pointer-events: auto; }
.cel-card { width: min(360px, 100%); background: var(--surface); border-radius: 22px; padding: 28px 22px 22px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); transform: scale(.9); transition: transform .3s cubic-bezier(.2,.9,.25,1.3); }
#celebrate.show .cel-card { transform: scale(1); }
.cel-check { font-size: 54px; width: 92px; height: 92px; margin: 0 auto 10px; border-radius: 50%; background: var(--green-tint); display: flex; align-items: center; justify-content: center; animation: pop-check .5s cubic-bezier(.2,.9,.25,1.5) both .05s; }
@keyframes pop-check { from { transform: scale(0); } to { transform: scale(1); } }
.cel-title { font-size: 20px; font-weight: 800; }
.cel-sub { font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 18px; }

/* Técnico: tarjetas de trabajo */
.job-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.04); animation: rq-fade-in .3s ease both; }
.job-card.live { border: 2px solid var(--primary); }
.jc-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.jc-num { font: 600 12px var(--font-mono); color: var(--ink-soft); }
.jc-live { font-size: 12px; font-weight: 700; color: var(--primary); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }
.jc-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.jc-place { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 10px; }
.jc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--ink-soft); }
.jc-cta { font-weight: 700; color: #fff; background: var(--primary); padding: 7px 14px; border-radius: 999px; font-size: 12.5px; }
.jc-cta.wait { background: var(--surface-2); color: var(--ink-soft); }
.job-where { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.jw-pin { font-size: 20px; }

/* Tira de pasos (mantenimiento, técnico y compras) */
.strip { display: flex; align-items: flex-start; gap: 0; margin: 2px 0 4px; }
.strip .st { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; min-width: 0; }
.strip .st::before { content: ''; position: absolute; top: 5px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.strip .st:first-child::before { display: none; }
.strip .st span { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); z-index: 1; }
.strip .st.done span { background: var(--primary); border-color: var(--primary); }
.strip .st.done::before, .strip .st.cur::before { background: var(--primary); }
.strip .st.cur span { border-color: var(--amber); background: var(--amber-tint); animation: pulse 1.6s infinite; }
.strip .st em { font-style: normal; font-size: 10.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.strip .st.done em, .strip .st.cur em { color: var(--ink); font-weight: 600; }
.strip.cancel .st.done:last-child span { background: var(--red); border-color: var(--red); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== Fase 8: fuente del presupuesto, autorización del líder ===== */
.src-block { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.src-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.seg.seg-sm .seg-btn { font-size: 12.5px; padding: 6px 10px; }
.src-block .field { margin: 0; }
.src-check:empty { display: none; }
.src-need { border-left: 4px solid var(--red); }
.src-ok { border-left: 4px solid var(--green); }
.auth-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.auth-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.ac-top { display: flex; gap: 10px; align-items: flex-start; }
.ac-lock { font-size: 22px; line-height: 1; }
.ac-main { flex: 1; min-width: 0; }
.ac-title { font-weight: 600; }
.ac-meta { font-size: 12px; color: var(--ink-soft); }
.ac-amount { font-family: var(--font-mono); font-weight: 600; text-align: right; }
.ac-reason { margin: 8px 0; padding: 6px 10px; background: var(--red-tint); border-radius: 8px; font-size: 13px; }
.ac-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .seg.seg-sm { flex-wrap: wrap; } .seg.seg-sm .seg-btn { flex: 1 1 45%; } }
