/* ===================== ConstruCORE :: tema verde/blanco mobile-first ===================== */
:root {
  --green-900: #14361f;
  --green-700: #1f6b3a;
  --green-600: #2e8b4f;
  --green-500: #38a169;
  --green-100: #e6f4ea;
  --green-050: #f3faf5;
  --ink: #16241b;
  --muted: #5b6b60;
  --line: #d7e6dc;
  --white: #ffffff;
  --bg: #f6faf7;
  --danger: #c0392b;
  --warn: #b7791f;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(20, 54, 31, 0.08);
  --tap: 48px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.hidden { display: none !important; }

/* ===================== Layout general ===================== */
.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--green-700);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  box-shadow: var(--shadow);
}
.topbar h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: .3px; }
.version-tag { font-size: 10px; font-weight: 600; opacity: .7; align-self: flex-end; margin: 0 0 4px 3px; }
.topbar .brand { min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar .brand svg { width: 26px; height: 26px; flex: 0 0 auto; }
.brand-copy { min-width: 0; }
.brand-title { display: flex; align-items: baseline; min-width: 0; }
.topbar .user { flex: 0 0 auto; font-size: 14px; opacity: .9; display: flex; align-items: center; gap: 8px; }
.topbar-organization {
  min-width: 0;
  max-width: 210px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -1px 0 0;
  padding: 0;
  border: 0;
  color: rgba(255,255,255,.84);
  background: transparent;
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
}
.topbar-organization.switchable { cursor: pointer; }
.topbar-organization-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-organization-pin, .topbar-organization-arrow { flex: 0 0 auto; }
.topbar-organization-arrow { font-size: 9px; }
.icon-btn {
  background: rgba(255,255,255,.15);
  border: 0;
  color: var(--white);
  width: 40px; height: 40px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(96px + var(--safe-bottom));
}

h2.view-title { font-size: 22px; margin: 4px 0 14px; }

/* ===================== Tarjetas ===================== */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.card-row .title { font-weight: 600; font-size: 17px; }
.card-row .subtitle { color: var(--muted); font-size: 14px; margin-top: 2px; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-700);
  white-space: nowrap;
}
.badge.alta { background: #fde8e6; color: var(--danger); }
.badge.media { background: #fdf2dc; color: var(--warn); }
.badge.baja { background: var(--green-100); color: var(--green-700); }
.badge.hecha { background: #e3e8e5; color: var(--muted); }
.badge.personal { background: #e7edf5; color: #355a8c; }
.badge.grupo { background: #eef0fb; color: #4a3a8c; }
.badge.warn { background: #fdf2dc; color: var(--warn); }
.badge.danger { background: #fde8e6; color: var(--danger); }

/* ===================== Dashboard ===================== */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 30px; font-weight: 800; color: var(--green-700); line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 14px; margin-top: 6px; }
.section-title { font-size: 16px; font-weight: 700; margin: 18px 0 8px; color: var(--green-900); }
.list-empty { color: var(--muted); font-style: italic; padding: 8px 0; }

/* ===================== Botones ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: 14px;
  border: 0;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  background: var(--green-600);
  color: var(--white);
}
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--green-100); color: var(--green-700); }
.btn.danger { background: var(--danger); }
.btn.small { min-height: 44px; font-size: 14px; padding: 0 14px; }

.fab {
  position: fixed;
  right: max(16px, calc((100vw - 720px) / 2 + 16px));
  bottom: calc(84px + var(--safe-bottom));
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--green-600);
  color: var(--white);
  border: 0;
  font-size: 30px;
  box-shadow: 0 6px 18px rgba(31, 107, 58, .4);
  cursor: pointer;
  z-index: 30;
}

/* ===================== Formularios ===================== */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--green-900); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px var(--green-100);
}
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.form-actions .btn { flex: 1; }

/* ===================== Buscador / filtros ===================== */
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.toolbar input { flex: 1; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); }

/* ===================== Chat ===================== */
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.chat-head-copy { min-width: 0; display: flex; flex-direction: column; }
.chat-presence { min-height: 17px; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 700; }
.chat-presence.online { color: var(--green-600); }
.chat-head-actions { display: flex; gap: 8px; }
.icon-btn-green { width: 46px; height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--white); font-size: 20px; cursor: pointer; }
.icon-btn-green.active { background: var(--green-100); border-color: var(--green-500); }
.icon-btn-green.listening { background: var(--danger); color: #fff; border-color: var(--danger); animation: pulse 1s infinite; }
.icon-btn-green:disabled { opacity: .4; cursor: not-allowed; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.chat-log { display: flex; flex-direction: column; gap: 10px; padding-bottom: 108px; }
.msg { max-width: 85%; padding: 11px 14px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--green-600); color: var(--white); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-author { font-size: 12px; font-weight: 700; color: var(--green-700); margin-bottom: 3px; }
.msg-media { max-width: 220px; max-height: 280px; border-radius: 10px; display: block; cursor: pointer; }
.msg-audio { width: 230px; max-width: 62vw; display: block; }
.msg-document {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(260px, 68vw);
  padding: 11px;
  border: 1px solid #b9dac4;
  border-radius: 12px;
  color: var(--green-900);
  background: #f7fcf8;
  text-decoration: none;
  white-space: normal;
}
.msg-document-icon { flex: 0 0 auto; font-size: 30px; }
.msg-document-copy { min-width: 0; flex: 1; }
.msg-document-copy strong, .msg-document-copy small { display: block; }
.msg-document-copy small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.msg-document-download { flex: 0 0 auto; color: var(--green-700); font-size: 22px; font-weight: 800; }
.msg-document-caption { margin: 8px 2px 0; font-size: 14px; line-height: 1.35; white-space: pre-wrap; }
.msg-content { white-space: pre-wrap; word-wrap: break-word; }
.msg-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; min-height: 14px; margin-top: 3px; font-size: 10px; line-height: 1; opacity: .86; }
.msg.assistant .msg-meta { justify-content: flex-start; color: var(--muted); }
.msg-time { white-space: nowrap; }
.msg-receipt { min-width: 24px; padding: 0; border: 0; color: rgba(255,255,255,.75); background: transparent; font-size: 14px; font-weight: 900; line-height: 1; cursor: pointer; }
.msg-receipt.delivered { color: #fff; }
.msg-receipt.read { color: #9ee7ff; }
.msg-receipt.pending { color: #fff3b0; cursor: help; }
.msg-receipt.blocked { color: #ffd2cc; cursor: help; }
.msg-edited { font-style: italic; white-space: nowrap; }
.msg.pending { outline: 2px dashed rgba(255,255,255,.58); outline-offset: -4px; }
.msg.pending.blocked { outline-color: #ffd2cc; }
.msg.deleted { opacity: .8; }
.msg-deleted { font-style: italic; opacity: .85; }
/* En chats de grupo/directos, la pulsacion larga abre editar/borrar. */
.chat-deletable .msg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.chat-form {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(76px + var(--safe-bottom));
  z-index: 22;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.chat-form textarea { flex: 1; min-height: 48px; max-height: 120px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--white); }
.chat-outbox {
  position: fixed;
  left: 50%;
  bottom: calc(140px + var(--safe-bottom));
  z-index: 21;
  width: min(calc(100% - 32px), 688px);
  margin: 0;
  transform: translateX(-50%);
  box-shadow: 0 4px 14px rgba(58, 42, 7, .12);
}
.voice-inline-answer { margin: 0 0 8px; }
.voice-inline-proposals { display: flex; flex-direction: column; gap: 6px; padding: 9px; border-radius: 10px; background: var(--green-050); font-size: 14px; }
.voice-inline-actions { display: flex; gap: 7px; margin-top: 9px; }
.voice-inline-undo { display: flex; margin-top: 9px; }
.receipt-details { display: flex; flex-direction: column; gap: 9px; }
.receipt-summary { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px; background: var(--green-050); }
.receipt-summary.read strong, .receipt-person-check.read { color: #087ea4; }
.receipt-summary.delivered strong, .receipt-person-check.delivered { color: var(--green-700); }
.receipt-summary small, .receipt-person small { display: block; margin-top: 3px; color: var(--muted); }
.receipt-person { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.receipt-person-check { flex: 0 0 30px; color: var(--muted); font-size: 17px; font-weight: 900; }
.message-action-list { display: flex; flex-direction: column; gap: 10px; }
.message-editor { display: flex; flex-direction: column; gap: 12px; }
.message-editor p { margin: 0; }
.message-editor textarea { width: 100%; min-height: 150px; resize: vertical; }
.image-viewer-open { overflow: hidden; }
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(5, 14, 8, .94);
}
.image-viewer-content { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.image-viewer-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; touch-action: pinch-zoom; }
.image-viewer-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,.68);
  font-size: 25px;
  cursor: pointer;
}
.image-viewer-status { position: absolute; max-width: 300px; margin: 0; padding: 14px; border-radius: 12px; color: #fff; background: rgba(0,0,0,.7); text-align: center; }
.image-viewer-retry { position: absolute; left: 50%; bottom: 18px; width: min(280px, calc(100% - 32px)); transform: translateX(-50%); }
.image-viewer-save { position: absolute; left: 50%; bottom: 18px; width: min(280px, calc(100% - 32px)); transform: translateX(-50%); }
.image-viewer-retry:not(.hidden) + .image-viewer-save { bottom: 76px; }
.photo-source-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; width: 100%; }
.photo-source-actions .btn { min-height: 48px; white-space: normal; }
.photo-source-note { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.35; }
@media (max-width: 390px) { .photo-source-actions { grid-template-columns: 1fr; } }

/* ===================== Navegacion inferior ===================== */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 25;
  background: var(--white);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 6px 4px calc(6px + var(--safe-bottom));
  max-width: 720px;
  margin: 0 auto;
}
.bottom-nav > a,
.bottom-nav > button {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  padding: 6px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.bottom-nav > a .ico { display: block; font-size: 22px; line-height: 1.1; }
.bottom-nav > a.active { color: var(--green-700); font-weight: 700; }
.bottom-nav-voice { position: relative; align-self: center; margin: 0; padding: 0 2px !important; color: var(--green-800) !important; font-weight: 800; }
.voice-nav-circle {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin: 0 auto 2px;
  border: 4px solid var(--white);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--green-500), var(--green-700));
  box-shadow: 0 6px 17px rgba(20,54,31,.34);
  transition: transform .15s ease, background .15s ease;
}
.voice-nav-circle .ico { font-size: 27px; line-height: 1; }
.voice-nav-label { display: block; line-height: 1; }
.bottom-nav-voice:active .voice-nav-circle { transform: scale(.94); }
.bottom-nav-voice.recording .voice-nav-circle { background: var(--danger); animation: voice-nav-pulse 1.1s infinite; }
.bottom-nav-voice.busy .voice-nav-circle { opacity: .65; }
@keyframes voice-nav-pulse { 50% { transform: scale(1.08); } }

/* Menu desplegable de modulos extra */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; display: flex; align-items: flex-end; }
.sheet {
  background: var(--white);
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(20px + var(--safe-bottom));
  max-height: 80vh;
  overflow-y: auto;
}
.sheet h3 { margin: 4px 0 12px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-grid a {
  text-decoration: none;
  color: var(--ink);
  background: var(--green-050);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}
.sheet-grid a .ico { display: block; font-size: 26px; margin-bottom: 6px; }
.more-section-title { margin: 14px 0 8px; font-size: 13px; font-weight: 800; color: var(--green-700); text-transform: uppercase; letter-spacing: .04em; }
.more-section-title:first-child { margin-top: 0; }

/* Selector seguro de explotación */
.organization-menu { display: flex; flex-direction: column; gap: 9px; }
.organization-help { margin: 0 0 5px; }
.organization-choice {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--white);
  text-align: left;
  cursor: pointer;
}
.organization-choice.active { border-color: #a7d7b7; background: var(--green-050); cursor: default; }
.organization-choice-mark { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--green-100); color: var(--green-700); font-weight: 900; }
.organization-choice-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.organization-choice-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.organization-choice-copy small { color: var(--muted); }
.organization-choice-arrow { color: var(--green-700); font-size: 24px; }
.organization-create { margin-top: 6px; }
.team-context { display: inline-flex; margin: -7px 0 14px; padding: 5px 10px; border-radius: 999px; color: var(--green-700); background: var(--green-100); font-weight: 700; }
.team-link-help { margin-right: 64px; }
.treatment-ack { margin-top: 12px; }
.treatment-start, .treatment-complete { margin-top: 12px; }
.treatment-order-help { margin: 0 0 12px; }
.treatment-result { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; padding: 11px; border-radius: 12px; background: var(--green-050); }
.treatment-result-incident { color: var(--danger); font-weight: 750; }
.treatment-evidence-picker .subtitle { display: block; margin-top: 6px; }
.treatment-weather { margin-top: 12px; padding: 12px; border: 1px solid #e6c86f; border-radius: 13px; background: #fff8df; }
.treatment-weather.high { border-color: #e5a094; background: #fff0ed; }
.treatment-weather.unavailable { border-color: var(--line); background: #f3f6f4; }
.treatment-weather-title { font-weight: 850; line-height: 1.25; }
.treatment-weather p { margin: 6px 0; font-size: 14px; line-height: 1.4; }
.treatment-weather small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.treatment-weather-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.treatment-weather-metrics span { padding: 4px 7px; border-radius: 999px; background: rgba(255,255,255,.72); font-size: 11px; font-weight: 750; }
.treatment-weather-reviewed { margin-top: 8px; color: var(--green-700); font-size: 13px; font-weight: 800; }
.treatment-weather-review, .treatment-weather-reschedule { margin-top: 10px; }
.treatment-weather-disclaimer { margin: 10px 0 0; }
.treatment-schedule-history-button { margin-top: 9px; }
.treatment-schedule-history { display: grid; gap: 9px; }
.treatment-schedule-revision { display: grid; gap: 4px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--green-050); }
.treatment-schedule-revision span { white-space: pre-wrap; }
.treatment-schedule-revision small { color: var(--muted); }
.parcel-responsibilities { display: flex; flex-direction: column; gap: 8px; }
.parcel-worker-picker { display: grid; gap: 7px; max-height: 240px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.parcel-worker-option { display: flex; align-items: center; gap: 9px; min-height: 38px; font-weight: 650; }
.parcel-worker-option input { width: 22px; height: 22px; }

/* ===================== Login ===================== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--white); border-radius: 22px; box-shadow: var(--shadow); padding: 28px 22px; width: 100%; max-width: 380px; }
.login-card .logo { text-align: center; margin-bottom: 18px; }
.login-card .logo svg { width: 64px; height: 64px; }
.login-card h1 { text-align: center; margin: 6px 0 2px; color: var(--green-700); }
.login-card p.sub { text-align: center; color: var(--muted); margin: 0 0 20px; }

/* ===================== Toast ===================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--green-900);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 60;
  box-shadow: var(--shadow);
  max-width: 90%;
}
.toast.error { background: var(--danger); }

/* ===================== Grupos ===================== */
.group-pin { margin: 10px 0; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-pin strong { letter-spacing: 2px; font-size: 17px; color: var(--green-700); }
.group-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.member-list { margin: 0; padding-left: 18px; }
.member-list li { padding: 5px 0; }
.login-switch { text-align: center; margin-top: 16px; }
.login-switch a { color: var(--green-700); font-weight: 600; text-decoration: none; }

/* ===================== Fotos ===================== */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.photo-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(192, 57, 43, .92); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }

/* ===================== El tiempo ===================== */
.weather-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.weather-day { flex: 0 0 auto; min-width: 78px; text-align: center; background: var(--green-050); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; }
.weather-source { display: block; margin-top: 7px; font-size: 10px; }
.wd-date { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.wd-icon { font-size: 26px; margin: 4px 0; }
.wd-temp { font-size: 13px; font-weight: 700; }
.wd-rain { font-size: 12px; color: var(--green-700); margin-top: 2px; min-height: 16px; }

/* ===================== Campana de avisos ===================== */
.icon-btn.bell { position: relative; }
.bell-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ===================== Agenda del día (inicio) ===================== */
.day-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.day-arrow { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); font-size: 22px; line-height: 1; cursor: pointer; color: var(--green-700); }
.day-label { font-weight: 800; font-size: 17px; text-transform: capitalize; color: var(--green-900); }
.day-section { margin-top: 10px; }
.day-section-title { font-size: 13px; font-weight: 700; color: var(--green-700); margin-bottom: 4px; }
.day-item { padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.day-item.overdue { color: var(--danger); }

/* ===================== Diario de campo ===================== */
.diary-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.diary-tabs { display: flex; gap: 8px; margin-bottom: 14px; padding: 4px; background: var(--green-100); border-radius: 14px; }
.diary-tab { flex: 1; min-height: 42px; border: 0; border-radius: 11px; background: transparent; color: var(--green-700); font-weight: 700; cursor: pointer; }
.diary-tab.active { background: var(--white); color: var(--green-900); box-shadow: var(--shadow); }
.diary-day-nav { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.diary-capture { text-align: center; border-color: #b9dac4; background: linear-gradient(180deg, #fff 0%, var(--green-050) 100%); }
.diary-capture-title { font-size: 19px; font-weight: 800; color: var(--green-900); margin-bottom: 2px; }
.diary-capture .subtitle { margin-bottom: 14px; }
.diary-record { width: 100%; min-height: 68px; border: 0; border-radius: 18px; background: var(--green-600); color: #fff; font-size: 18px; font-weight: 800; cursor: pointer; margin-bottom: 10px; box-shadow: 0 5px 16px rgba(31,107,58,.25); }
.diary-record:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }
.diary-record.recording { background: var(--danger); animation: pulse 1.2s infinite; }
.recording-time { font-size: 26px; font-weight: 800; color: var(--danger); margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.offline-banner { background: #fff4dd; border: 1px solid #edcf91; color: #76500d; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.diary-working { border-style: dashed; color: var(--green-700); font-weight: 700; }
.diary-entry { padding: 14px; }
.diary-entry.draft { border-color: #e5c77d; }
.diary-entry.confirmed { border-left: 4px solid var(--green-500); }
.diary-entry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.diary-audio { width: 100%; height: 42px; margin: 4px 0 10px; }
.diary-entry-photo,
.diary-photo-preview { position: relative; overflow: hidden; margin: 5px 0 11px; border: 1px solid var(--line); border-radius: 15px; background: var(--green-050); }
.diary-photo-preview { max-height: 310px; }
.diary-entry-photo img,
.diary-photo-preview img { display: block; width: 100%; max-height: 420px; object-fit: cover; }
.diary-photo-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.diary-photo-remove { position: absolute; top: 8px; right: 8px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 2px solid #fff; border-radius: 50%; color: #fff; background: rgba(164,45,35,.92); box-shadow: 0 3px 9px rgba(0,0,0,.2); font-size: 23px; line-height: 1; cursor: pointer; }
.diary-photo-actions { display: flex; align-items: center; margin: 7px 0 2px; }
.diary-photo-actions .btn { min-height: 42px; }
.diary-new-entry-text { display: block; width: 100%; min-height: 160px; padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); resize: vertical; }
.diary-transcript { width: 100%; min-height: 112px; padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fffdf7; resize: vertical; }
.diary-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.diary-select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); padding: 0 9px; font-size: 14px; }
.diary-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.diary-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 9px; border-radius: 999px; background: var(--green-100); color: var(--green-700); font-size: 12px; font-weight: 700; }
.diary-entry-text { margin: 6px 0 8px; white-space: pre-wrap; }
.diary-entry-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.btn-link { border: 0; background: transparent; color: var(--green-700); text-decoration: underline; font-weight: 700; cursor: pointer; padding: 8px 4px; }
.danger-text { color: var(--danger); }
.diary-proposals { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; margin-top: 8px; }
.diary-proposals .btn { width: 100%; justify-content: flex-start; text-align: left; height: auto; padding-top: 8px; padding-bottom: 8px; }
.diary-empty { text-align: center; color: var(--muted); background: var(--white); border: 1px dashed var(--line); border-radius: 14px; padding: 26px 16px; }
.diary-empty strong, .diary-empty span { display: block; }
.diary-empty-icon { font-size: 34px; margin-bottom: 6px; }
.diary-report-intro strong { font-size: 18px; }
.diary-report-intro .subtitle { margin: 4px 0 12px; }
.report-summary { white-space: pre-wrap; margin: 8px 0; color: var(--ink); }
.weekly-report { border-left: 4px solid var(--green-600); }
.diary-report-editor { width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.diary-report-editor-text {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 280px;
  max-height: 58vh;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
}
.diary-report-editor-text:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px var(--green-100); }

.diary-home-arrow { margin-left: auto; font-size: 30px; }

/* Selector rapido de personas del equipo */
.quick-contacts-intro { margin: -2px 0 12px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.quick-contact-search { width: 100%; min-height: 48px; margin: 0 0 12px; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--green-050); outline: none; }
.quick-contact-search:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(46,139,79,.12); }
.quick-contact-role { margin: 14px 2px 7px; color: var(--green-700); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.quick-contact-role:first-child { margin-top: 2px; }
.quick-contact-list { display: flex; flex-direction: column; gap: 7px; }
.quick-contact {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--white);
  text-decoration: none;
  box-shadow: 0 2px 7px rgba(20,54,31,.05);
}
.quick-contact:active { transform: scale(.99); background: var(--green-050); }
.quick-contact-avatar { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px; background: var(--green-100); font-size: 22px; }
.quick-contact-avatar.role-perito { background: #e9eff8; }
.quick-contact-avatar.role-peon { background: #fff3d9; }
.quick-contact-avatar.role-admin { background: #eeeafa; }
.quick-contact-info { min-width: 0; flex: 1; }
.quick-contact-info strong, .quick-contact-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-contact-info strong { font-size: 16px; }
.quick-contact-info small { margin-top: 1px; color: var(--muted); font-size: 13px; }
.quick-contact-info small.contact-online { color: var(--green-600); font-weight: 800; }
.quick-contact-arrow { padding: 0 5px; color: var(--green-700); font-size: 28px; }
.quick-contact-unread { min-width: 27px; height: 27px; display: grid; place-items: center; padding: 0 7px; border-radius: 999px; color: #fff; background: var(--danger); font-size: 12px; font-weight: 800; }
.dashboard-expense { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: var(--ink); padding: 12px 16px; }
.dashboard-expense strong { color: var(--green-700); }
.parcel-danger-zone { margin: 24px 0 10px; padding: 15px; border: 1px solid #efb4ad; border-radius: var(--radius); background: #fff7f6; }
.parcel-danger-zone strong { color: #8f2f24; }
.parcel-danger-zone p { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
.parcel-danger-zone .btn:disabled { opacity: .55; cursor: wait; }

/* ===================== Salud de notificaciones ===================== */
.notification-warning {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #e8c578;
  border-radius: 15px;
  color: #5f4307;
  background: #fff8e6;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(95,67,7,.07);
}
.notification-warning-icon { flex: 0 0 36px; font-size: 25px; }
.notification-warning strong, .notification-warning small { display: block; }
.notification-warning strong { font-size: 14px; line-height: 1.3; }
.notification-warning small { margin-top: 2px; color: #806526; line-height: 1.3; }
.notification-warning .diary-home-arrow { color: #806526; }
.connection-banner { position: sticky; top: calc(68px + env(safe-area-inset-top, 0px)); z-index: 19; padding: 7px 12px; color: #573d05; background: #ffd978; border-bottom: 1px solid #e0b64d; font-size: 12px; font-weight: 800; text-align: center; }
.connection-banner.hidden { display: none; }
.offline-cache-note { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; color: var(--muted); background: #edf2ef; font-size: 12px; font-weight: 700; }
.journey-facts { color: var(--muted); font-size: 12px; line-height: 1.4; }
.journey-listen { flex: 0 0 42px; width: 42px; height: 42px; border: 0; border-radius: 50%; color: var(--green-800); background: var(--green-100); font-size: 20px; }
.journey-missing { margin-top: 9px; padding: 8px 10px; border-radius: 9px; color: #714a00; background: #fff3d5; font-size: 12px; line-height: 1.35; }
.operational-card { border: 1px solid #cbe2d2; background: linear-gradient(155deg, #fff 45%, #f2faf4); }
.operational-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.operational-subtitle { color: var(--muted); font-size: 12px; }
.operational-counters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.operational-counter { min-width: 0; padding: 10px; border-radius: 12px; background: #edf6ef; }
.operational-counter strong { display: block; color: var(--green-800); font-size: 22px; line-height: 1; }
.operational-counter span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.25; }
.operational-counter.warning { background: #fff4d8; }
.operational-counter.warning strong { color: #925500; }
.operational-counter.danger { background: #ffebe7; }
.operational-counter.danger strong { color: #a43123; }
.operational-counter.success { background: #e5f5e9; }
.operational-counter:last-child:nth-child(odd) { grid-column: 1 / -1; }
.operational-list { margin-top: 12px; border-top: 1px solid var(--line); }
.operational-item { display: flex; align-items: center; gap: 9px; padding: 10px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.operational-item-icon { flex: 0 0 28px; font-size: 20px; text-align: center; }
.operational-item-copy { min-width: 0; flex: 1; }
.operational-item-copy strong, .operational-item-copy small { display: block; }
.operational-item-copy strong { font-size: 13px; line-height: 1.3; }
.operational-item-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.operational-item.danger strong { color: #8e261b; }
.operational-empty { margin-top: 12px; padding: 12px; border-radius: 12px; color: var(--green-800); background: #eaf6ed; font-weight: 800; font-size: 13px; }
.operational-empty.unavailable { color: #6b5725; background: #fff4d8; }
.operational-diary-link {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  box-shadow: 0 6px 16px rgba(31,107,58,.2);
  text-decoration: none;
}
.operational-diary-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.16); font-size: 22px; }
.operational-diary-copy { min-width: 0; flex: 1; }
.operational-diary-copy strong, .operational-diary-copy small { display: block; }
.operational-diary-copy strong { font-size: 17px; line-height: 1.2; }
.operational-diary-copy small { margin-top: 3px; color: rgba(255,255,255,.88); font-size: 11px; line-height: 1.25; }
.operational-diary-arrow { flex: 0 0 auto; font-size: 28px; line-height: 1; }
.day-task-action.treatment { width: auto; padding-inline: 9px; color: var(--green-800); background: #e6f2e9; text-decoration: none; font-size: 11px; }
.day-task { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.day-task > span { flex: 1; }
.day-task-action { flex: 0 0 auto; min-height: 44px; padding: 6px 10px; border: 1px solid var(--green-500); border-radius: 9px; color: var(--green-700); background: var(--white); font-weight: 800; }
.day-task-action.done { color: #fff; background: var(--green-600); }
.push-settings { overflow: hidden; }
.push-status { display: flex; align-items: center; gap: 9px; margin: 3px 0 8px; color: var(--muted); }
.push-status strong { color: inherit; }
.push-status-dot { flex: 0 0 11px; width: 11px; height: 11px; border-radius: 50%; background: #9aa7a0; box-shadow: 0 0 0 4px rgba(154,167,160,.14); }
.push-status.ok { color: var(--green-700); }
.push-status.ok .push-status-dot { background: #2c9b52; box-shadow: 0 0 0 4px rgba(44,155,82,.15); }
.push-status.warning { color: #846000; }
.push-status.warning .push-status-dot { background: #d79b00; box-shadow: 0 0 0 4px rgba(215,155,0,.15); }
.push-status.error { color: var(--danger); }
.push-status.error .push-status-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(190,61,48,.13); }
.push-explanation { margin: 0 0 12px; line-height: 1.42; }
.push-test-result { min-height: 20px; margin: 8px 0 0; font-size: 13px; line-height: 1.35; }
.push-test-result.ok { color: var(--green-700); }
.push-test-result.error { color: var(--danger); }
.push-os-note { margin-top: 13px; padding: 10px 11px; border-radius: 10px; color: var(--muted); background: var(--green-050); font-size: 12px; line-height: 1.42; }

/* Módulos activables (solo superadmin) */
.offline-recovery-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.offline-recovery-row small { display: block; color: var(--muted); margin-top: 3px; }
.offline-recovery-row .form-actions { flex-wrap: nowrap; margin: 0; }
.offline-queue-preview { display: grid; gap: 6px; margin: 8px 0 12px; }
.offline-queue-preview-row { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 10px; background: var(--green-050); }
.offline-queue-preview-row span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offline-queue-preview-row small { color: var(--muted); font-weight: 750; }
.offline-queue-preview-row.blocked { background: #fff0ed; }

.module-settings .subtitle { margin: -2px 0 9px; line-height: 1.4; }
.essential-modules { margin-bottom: 13px; padding: 9px 11px; border-radius: 10px; color: var(--green-800); background: var(--green-050); font-size: 12px; line-height: 1.35; }
.module-settings-list { margin-bottom: 14px; border-top: 1px solid var(--line); }
.module-settings-group { padding: 14px 2px 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.module-setting-row { min-height: 49px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); cursor: pointer; }
.module-setting-icon { width: 27px; font-size: 19px; text-align: center; }
.module-setting-name { flex: 1; color: var(--green-900); font-size: 14px; font-weight: 750; }
.module-setting-row input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.module-setting-switch { position: relative; width: 44px; height: 25px; border-radius: 999px; background: #b8c1bb; transition: background .18s ease; }
.module-setting-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .18s ease; }
.module-setting-row input:checked + .module-setting-switch { background: var(--green-600); }
.module-setting-row input:checked + .module-setting-switch::after { transform: translateX(19px); }
.module-setting-row input:focus-visible + .module-setting-switch { outline: 3px solid rgba(38,132,69,.25); outline-offset: 2px; }
.module-settings > .btn { width: 100%; }

/* ===================== Control privado de costes ===================== */
.cost-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cost-title-row .view-title { margin-bottom: 6px; }
.cost-private-badge { padding: 4px 9px; border-radius: 999px; color: #5a438a; background: #eeeafa; font-size: 11px; font-weight: 800; white-space: nowrap; }
.cost-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 13px; }
.cost-toolbar strong { font-size: 14px; }
.cost-month { min-height: 43px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); }
.cost-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.cost-kpi { min-height: 116px; display: flex; flex-direction: column; justify-content: center; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow); }
.cost-kpi > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.cost-kpi > strong { margin: 4px 0 2px; color: var(--green-900); font-size: 23px; line-height: 1.15; }
.cost-kpi > small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.cost-kpi.projection { color: #fff; border-color: var(--green-700); background: linear-gradient(135deg, var(--green-700), var(--green-500)); }
.cost-kpi.projection > span, .cost-kpi.projection > strong, .cost-kpi.projection > small { color: #fff; }
.cost-kpi.ai { border-left: 4px solid #4b78c4; }
.cost-kpi.fixed { border-left: 4px solid var(--green-600); }
.cost-kpi.account { border-left: 4px solid #8a65b8; }
.cost-empty-notice, .cost-warning, .cost-tracking-note { margin: 0 0 12px; padding: 11px 13px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.cost-empty-notice { display: flex; flex-direction: column; color: var(--green-900); background: var(--green-100); }
.cost-empty-notice span { margin-top: 2px; color: var(--muted); }
.cost-warning { color: #735000; background: #fff3d5; border: 1px solid #ebce8b; }
.cost-tracking-note { color: var(--muted); background: #edf3ef; }
.cost-breakdown-row { padding: 10px 0; border-top: 1px solid var(--line); }
.cost-breakdown-row:first-of-type { border-top: 0; }
.cost-breakdown-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.cost-breakdown-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-breakdown-head strong { color: var(--green-700); white-space: nowrap; }
.cost-breakdown-row > small { color: var(--muted); font-size: 11px; }
.cost-bar { height: 6px; margin: 6px 0 3px; overflow: hidden; border-radius: 999px; background: #e7eee9; }
.cost-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green-600), #62b47b); }
.cost-model-row { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.cost-model-row:first-of-type { border-top: 0; }
.cost-model-row span strong, .cost-model-row span small { display: block; }
.cost-model-row span small { color: var(--muted); font-size: 11px; }
.cost-model-row > strong { color: var(--green-700); }
.cost-settings .subtitle { margin: -3px 0 12px; }
.cost-settings label { display: block; margin: 10px 0; }
.cost-settings label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.cost-settings input, .cost-settings textarea { width: 100%; min-height: 46px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); }
.cost-settings textarea { resize: vertical; }
.cost-settings .btn { width: 100%; margin-top: 5px; }
.cost-disclaimer { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.4; }

/* ===================== Panel privado de salud ===================== */
.health-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.health-title-row .view-title { margin-bottom: 6px; }
.health-private-badge { padding: 4px 9px; border-radius: 999px; color: #5a438a; background: #eeeafa; font-size: 11px; font-weight: 800; white-space: nowrap; }
.health-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.health-checked { color: var(--muted); font-size: 11px; }
.health-refresh { min-height: 44px; padding: 7px 12px; }
.health-overall { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 14px; border: 1px solid; border-radius: 16px; }
.health-overall.healthy { color: #155a32; border-color: #a9d7b8; background: #eaf7ee; }
.health-overall.warning { color: #745000; border-color: #ecd08d; background: #fff5d9; }
.health-overall.error { color: #8f2e25; border-color: #e9ada7; background: #fff0ee; }
.health-overall-icon { flex: 0 0 38px; font-size: 30px; text-align: center; }
.health-overall strong, .health-overall small { display: block; }
.health-overall strong { font-size: 15px; }
.health-overall small { margin-top: 2px; color: inherit; opacity: .85; font-size: 11px; line-height: 1.35; }
.health-alerts { padding-bottom: 7px; }
.health-alert { display: flex; align-items: flex-start; gap: 10px; margin: 0 -2px 8px; padding: 10px; border-radius: 11px; }
.health-alert.warning { color: #715000; background: #fff5d9; }
.health-alert.error { color: #8f2e25; background: #fff0ee; }
.health-alert-icon { flex: 0 0 25px; font-size: 19px; }
.health-alert strong, .health-alert small { display: block; }
.health-alert strong { font-size: 13px; line-height: 1.3; }
.health-alert small { margin-top: 2px; color: inherit; font-size: 11px; line-height: 1.35; }
.health-inline-action { min-height: 44px; margin-top: 7px; padding: 5px 10px; border: 1px solid currentColor; border-radius: 9px; color: inherit; background: rgba(255,255,255,.66); font-size: 11px; font-weight: 800; }
.health-all-clear { margin: 2px 0 8px; padding: 10px 11px; border-radius: 10px; color: var(--green-700); background: var(--green-050); font-size: 12px; line-height: 1.4; }
.health-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.health-kpi { min-height: 113px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--green-600); border-radius: 15px; background: var(--white); box-shadow: var(--shadow); }
.health-kpi > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.health-kpi > strong { margin: 4px 0 3px; overflow-wrap: anywhere; color: var(--green-900); font-size: 21px; line-height: 1.15; }
.health-kpi > small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.health-kpi.database { border-left-color: #547fc0; }
.health-kpi.users { border-left-color: #9a68b3; }
.health-kpi.media { border-left-color: #c58a20; }
.health-kpi.ai { border-left-color: #3c8e86; }
.health-kpi.version { color: #fff; border-color: var(--green-700); background: linear-gradient(135deg, var(--green-800), var(--green-500)); }
.health-kpi.version > span, .health-kpi.version > strong, .health-kpi.version > small { color: #fff; }
.health-section { overflow: hidden; }
.health-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.health-card-head .section-title { margin-bottom: 8px; }
.health-mini-status { padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.health-mini-status.ok { color: #176137; background: #e4f4e9; }
.health-mini-status.warning { color: #745000; background: #fff0c5; }
.health-mini-status.error { color: #8f2e25; background: #ffe3e0; }
.health-metric-row { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); font-size: 12px; }
.health-metric-row > span { color: var(--muted); }
.health-metric-row > strong { max-width: 55%; color: var(--green-900); text-align: right; overflow-wrap: anywhere; }
.health-metric-row.warning > strong { color: #956800; }
.health-metric-row.error > strong { color: var(--danger); }
.health-metric-row.ok > strong { color: var(--green-700); }
.health-wide-action { width: 100%; margin-top: 12px; }
.health-subtitle { margin-top: 14px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.health-storage-user { padding: 9px 0 2px; }
.health-storage-user > div:first-child { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.health-storage-user small { color: var(--muted); font-size: 10px; }
.health-storage-bar { height: 5px; margin-top: 5px; overflow: hidden; border-radius: 99px; background: #e6eee8; }
.health-storage-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-600), #d7a032); }
.health-maintenance-summary { display: block; margin-top: 9px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.health-incident { margin-top: 9px; padding: 11px; border-left: 4px solid #dca225; border-radius: 10px; background: #fff8e6; }
.health-incident.error { border-left-color: var(--danger); background: #fff2f0; }
.health-incident-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.health-incident-head strong { color: var(--green-900); font-size: 12px; }
.health-incident-head span { color: var(--muted); font-size: 10px; font-weight: 800; }
.health-incident p { margin: 5px 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.35; }
.health-incident > small { display: block; color: var(--muted); font-size: 9px; }
.health-resolve { min-height: 44px; margin-top: 8px; padding: 5px 9px; border: 1px solid var(--green-500); border-radius: 9px; color: var(--green-700); background: #fff; font-size: 10px; font-weight: 800; }
.health-backup-note { margin-top: 13px; padding: 11px; border-radius: 11px; color: #654a10; background: #fff3d5; }
.health-backup-note strong, .health-backup-note span { display: block; }
.health-backup-note strong { font-size: 12px; }
.health-backup-note span { margin-top: 3px; font-size: 10px; line-height: 1.4; }
.health-unavailable { display: flex; flex-direction: column; padding: 14px; border: 1px solid #e9ada7; border-radius: 14px; color: #8f2e25; background: #fff0ee; }
.health-unavailable span { margin-top: 3px; font-size: 12px; }

/* ===================== Control universal por voz ===================== */
.dashboard-greeting { margin-bottom: 0 !important; }
.dashboard-intro { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.diary-home-arrow { color: var(--green-700); }
.stat-grid.worker { grid-template-columns: repeat(2, minmax(0, 1fr)); }

body.voice-open { overflow: hidden; }
.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(11,29,17,.58);
  backdrop-filter: blur(4px);
}
.voice-panel {
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 9px 18px calc(22px + var(--safe-bottom));
  border-radius: 26px 26px 0 0;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 -12px 36px rgba(0,0,0,.2);
  animation: voice-sheet-in .2s ease-out;
}
@keyframes voice-sheet-in { from { transform: translateY(24px); opacity: .65; } to { transform: translateY(0); opacity: 1; } }
.voice-grabber { width: 44px; height: 5px; margin: 0 auto 12px; border-radius: 5px; background: #cbd8cf; }
.voice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.voice-head h2 { margin: 0; color: var(--green-900); font-size: 24px; line-height: 1.2; }
.voice-head p { margin: 5px 0 0; color: var(--muted); font-size: 15px; line-height: 1.35; }
.voice-close { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--green-050); color: var(--green-900); font-size: 28px; line-height: 1; cursor: pointer; }
.voice-main-button { width: 100%; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: 24px; padding: 18px; color: #fff; background: linear-gradient(145deg, var(--green-500), var(--green-700)); box-shadow: 0 8px 20px rgba(31,107,58,.24); cursor: pointer; }
.voice-main-icon { display: grid; place-items: center; width: 70px; height: 70px; margin-bottom: 6px; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 37px; }
.voice-main-button strong { font-size: 21px; }
.voice-main-button small { margin-top: 3px; opacity: .88; }
.voice-examples { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
.voice-examples > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.voice-examples button { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--green-900); background: var(--green-050); text-align: left; font-size: 14px; cursor: pointer; }
.voice-wave { height: 130px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.voice-wave span { width: 9px; height: 34px; border-radius: 9px; background: var(--green-600); animation: voice-wave 1s ease-in-out infinite; animation-delay: calc(var(--i) * -.11s); }
@keyframes voice-wave { 0%,100% { height: 24px; opacity: .55; } 50% { height: 92px; opacity: 1; } }
.voice-stop-button { width: 100%; min-height: 70px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 18px; color: #fff; background: var(--danger); font-size: 18px; cursor: pointer; }
.voice-stop-button span { font-size: 25px; }
.voice-privacy { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.voice-spinner { width: 66px; height: 66px; margin: 38px auto 20px; border: 7px solid var(--green-100); border-top-color: var(--green-600); border-radius: 50%; animation: voice-spin .85s linear infinite; }
@keyframes voice-spin { to { transform: rotate(360deg); } }
.voice-working-text { margin: 0 0 46px; text-align: center; color: var(--green-700); font-weight: 700; }
.voice-transcript { padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--green-050); border: 1px solid var(--line); }
.voice-transcript span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.voice-transcript p { margin: 4px 0 0; font-weight: 600; white-space: pre-wrap; }
.voice-proposals { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.voice-selection-help { margin: 0 0 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.voice-selection-after { margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.voice-proposal { min-height: 58px; display: flex; align-items: center; gap: 5px; padding: 5px; border: 1.5px solid #c8d3cc; border-radius: 14px; background: #f5f7f6; transition: border-color .15s ease, background .15s ease; }
.voice-proposal.selected { border-color: var(--green-500); background: #fbfefc; box-shadow: 0 0 0 2px rgba(38,132,69,.08); }
.voice-proposal-main { min-width: 0; flex: 1; min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 5px 7px; border: 0; color: var(--green-900); background: transparent; text-align: left; cursor: pointer; }
.voice-proposal-number { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #9ba8a0; font-size: 14px; font-weight: 800; }
.voice-proposal.selected .voice-proposal-number { background: var(--green-600); }
.voice-proposal strong { line-height: 1.3; }
.voice-proposal-only { flex: 0 0 auto; min-height: 44px; padding: 5px 8px; border: 1px solid #b9dac4; border-radius: 9px; color: var(--green-700); background: #fff; font-size: 10px; font-weight: 800; cursor: pointer; }
.voice-proposal.compact { min-height: 48px; }
.voice-proposal.compact .voice-proposal-main { min-height: 38px; padding: 3px 5px; }
.voice-proposal.compact .voice-proposal-number { flex-basis: 25px; width: 25px; height: 25px; font-size: 11px; }
.voice-proposal.compact strong { font-size: 12px; }
.voice-proposal.compact .voice-proposal-only { min-height: 44px; padding: 4px 6px; }
.voice-confirm-actions { display: grid; grid-template-columns: 1.35fr 1fr; gap: 9px; }
.voice-speech-confirm, .voice-done { width: 100%; min-height: 46px; margin-top: 9px; border: 0; color: var(--green-700); background: transparent; font-weight: 700; cursor: pointer; }
.voice-result-mark { width: 76px; height: 76px; display: grid; place-items: center; margin: 8px auto 16px; border-radius: 50%; color: #fff; background: var(--green-600); font-size: 42px; font-weight: 800; }
.voice-result-mark.muted { background: var(--muted); }
.voice-result-mark.error { background: var(--danger); }
.voice-result-list, .voice-result-errors { display: flex; flex-direction: column; gap: 7px; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--green-050); font-size: 14px; }
.voice-result-errors { color: var(--danger); background: #fff2f0; }
.voice-result-list + .btn, .voice-result-errors + .btn, .voice-panel > .btn + .btn { margin-top: 9px; }
.diary-entry-badges { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.diary-severity-wrap { display: flex; flex-direction: column; gap: 5px; margin: 10px 0 12px; padding: 11px; border: 1px solid #edc3bd; border-radius: 12px; background: #fff7f5; }
.diary-severity-wrap label { color: var(--danger); font-weight: 800; }
.diary-severity-wrap small { color: var(--muted); }

@media (min-width: 721px) {
  .voice-panel { margin-bottom: 14px; border-radius: 26px; }
}

@media (max-width: 380px) {
  .diary-fields { grid-template-columns: 1fr; }
  .diary-entry-head { display: block; }
  .diary-entry-head .badge { margin-top: 6px; }
  .voice-confirm-actions { grid-template-columns: 1fr; }
  .cost-kpi-grid { grid-template-columns: 1fr; }
  .cost-kpi { min-height: 100px; }
  .health-kpi-grid { grid-template-columns: 1fr; }
  .health-kpi { min-height: 95px; }
}

@media (max-width: 470px) {
  .topbar { gap: 7px; padding-left: 12px; padding-right: 12px; }
  .topbar .brand { gap: 7px; }
  .topbar .user { gap: 5px; }
  .topbar .user-name { display: none; }
  .topbar-organization { max-width: 145px; }
}

@media (max-width: 390px) {
  .topbar h1 { font-size: 17px; }
  .version-tag { font-size: 9px; }
  .topbar-organization { max-width: 120px; }
  .topbar .brand svg { width: 24px; height: 24px; }
  .topbar .icon-btn { width: 44px; height: 44px; border-radius: 11px; }
}
/* Incidencias y averias */
.view-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.view-title-row .view-title{margin-bottom:3px}.incident-new-top{flex:0 0 auto;white-space:nowrap}.incident-filters{display:flex;gap:7px;align-items:center;overflow-x:auto;padding:2px 1px 12px}.incident-filter{border:1px solid var(--line);border-radius:999px;background:var(--surface);padding:8px 12px;color:var(--green-900);font-weight:750;white-space:nowrap}.incident-filter.active{background:var(--green-700);border-color:var(--green-700);color:#fff}.incident-mine{display:flex;align-items:center;gap:5px;white-space:nowrap;font-size:12px;font-weight:700}.incident-list{display:grid;gap:12px}.incident-card{position:relative;overflow:hidden;border-left:5px solid var(--line)}.incident-card.priority-critical{border-left-color:#b42318}.incident-card.priority-high{border-left-color:#d97706}.incident-card.priority-normal{border-left-color:var(--green-600)}.incident-card-head{display:flex;justify-content:space-between;gap:10px}.incident-card-head small{display:block;margin-top:4px;color:var(--muted)}.incident-title{font-size:17px}.incident-badges{display:flex;gap:5px;align-items:flex-start;flex-wrap:wrap;justify-content:flex-end}.incident-description{white-space:pre-wrap;margin:12px 0 8px;line-height:1.45}.incident-meta{font-size:12px;color:var(--muted);line-height:1.5}.incident-resolution{margin-top:10px;padding:9px 11px;border-radius:10px;background:var(--green-050);white-space:pre-wrap}.incident-photos{display:flex;gap:7px;overflow-x:auto;margin:12px 0 2px}.incident-photos img{width:105px;height:82px;object-fit:cover;border-radius:10px;border:1px solid var(--line)}.incident-actions{display:flex;flex-wrap:wrap;gap:7px;align-items:center;margin-top:12px}.incident-empty{text-align:center;padding:22px}.incident-history{display:grid;gap:10px}.incident-history-item{display:grid;gap:3px;padding:10px;border-left:3px solid var(--green-500);background:var(--green-050);border-radius:0 9px 9px 0}.incident-history-item span,.incident-history-item small{color:var(--muted)}
@media(max-width:560px){.view-title-row{align-items:stretch}.incident-new-top{font-size:13px;padding-inline:10px}.incident-card-head{display:grid}.incident-badges{justify-content:flex-start}}

/* Planificacion de campana */
.planning-campaigns,.planning-plans{margin-top:15px}.planning-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px}.planning-section-head h3{margin:0}.campaign-rail{display:flex;gap:10px;overflow-x:auto;padding:1px 1px 8px}.campaign-card{min-width:240px;display:grid;gap:7px}.campaign-card span,.campaign-card small,.plan-meta,.plan-task-count{color:var(--muted);font-size:12px}.planning-empty{text-align:center;color:var(--muted)}.plan-list{display:grid;gap:11px}.plan-card{display:grid;gap:9px;border-left:4px solid var(--green-600)}.plan-card.paused{opacity:.72;border-left-color:var(--muted)}.plan-card-head{display:flex;justify-content:space-between;gap:10px}.plan-card p{margin:0;white-space:pre-wrap}.plan-meta{line-height:1.5}.plan-dates{display:flex;align-items:center;gap:6px;overflow-x:auto}.plan-dates span{padding:5px 8px;border-radius:999px;background:var(--green-050);font-size:11px;white-space:nowrap}.planning-help{padding:10px 12px;border-radius:10px;background:var(--green-050);font-size:13px;line-height:1.4;margin-bottom:9px}

/* Cuaderno de campo y trazabilidad */
.fieldbook-heading{align-items:flex-start;gap:12px}.fieldbook-title-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}.fieldbook-filters{margin-bottom:12px;padding:14px}.fieldbook-filters form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.fieldbook-filters form .field{margin:0}.fieldbook-filters form .btn{grid-column:1/-1}.fieldbook-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:12px 0}.fieldbook-metric{background:#edf7f0;border:1px solid #d5eadb;border-radius:14px;padding:13px;display:flex;flex-direction:column;gap:3px}.fieldbook-metric strong{color:#164f2d;font-size:1.55rem;line-height:1}.fieldbook-metric span{color:#385b44;font-size:.82rem;font-weight:700}.fieldbook-metric.good{background:#e5f6eb}.fieldbook-metric.warn{background:#fff3d6;border-color:#f0d78e}.fieldbook-metric.warn strong{color:#9a5b00}.fieldbook-profile-warning{grid-column:1/-1;border:1px solid #e5c56a;border-radius:12px;background:#fff8e4;color:#724600;padding:11px;font-weight:800;text-align:left}.fieldbook-legal-note{margin:10px 0 14px;border-left:4px solid #4b9564;background:#f0f7f2;border-radius:0 10px 10px 0;padding:10px 12px;color:#365643;font-size:.84rem;line-height:1.35}.fieldbook-list{display:grid;gap:10px}.fieldbook-record{padding:15px;display:grid;gap:9px}.fieldbook-record-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.fieldbook-record-head>div{display:grid;gap:3px;min-width:0}.fieldbook-record-head strong{color:#153c25}.fieldbook-record-head span:not(.badge){color:#4b6253;overflow-wrap:anywhere}.fieldbook-record-meta{color:#506458;font-size:.86rem;line-height:1.45}.fieldbook-missing{border-radius:10px;background:#fff2db;color:#805000;padding:9px 10px;font-size:.84rem;font-weight:700;line-height:1.35}.fieldbook-record .btn{justify-self:start}
@media(max-width:700px){.fieldbook-heading{display:grid}.fieldbook-title-actions{justify-content:flex-start}.fieldbook-filters form{grid-template-columns:1fr 1fr}.fieldbook-summary{grid-template-columns:1fr}.fieldbook-record-head{align-items:flex-start}}

/* Indicadores operativos */
.analytics-heading{align-items:flex-start}.analytics-filters{margin-bottom:12px;padding:14px}.analytics-filters form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:end;gap:10px}.analytics-filters form .field{margin:0}.analytics-filters .btn{min-height:44px}.analytics-content{display:grid;gap:12px}.analytics-scope{padding:10px 12px;border:1px solid #cfe4d6;border-radius:12px;background:#eef8f1;color:#315840;font-size:.84rem;font-weight:700;line-height:1.4}.analytics-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.analytics-kpi{min-height:112px;display:flex;flex-direction:column;justify-content:center;gap:5px;padding:14px;border:1px solid #d9e8de;border-radius:15px;background:#f5faf7}.analytics-kpi span{color:#456251;font-size:.8rem;font-weight:800}.analytics-kpi strong{color:#153c25;font-size:1.55rem;line-height:1.05}.analytics-kpi small{color:#607267;line-height:1.3}.analytics-kpi.good{background:#e6f7eb;border-color:#b9dfc5}.analytics-kpi.warn{background:#fff4d9;border-color:#ead28d}.analytics-kpi.warn strong{color:#8a5700}.analytics-section{margin:0;padding:15px}.analytics-section h3{margin:0 0 12px}.analytics-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.analytics-section-head h3{margin:0}.analytics-section-head select{width:auto;min-width:130px}.analytics-chart{min-height:225px;display:flex;align-items:stretch;gap:8px;overflow-x:auto;padding:14px 2px 2px}.analytics-bar-column{min-width:50px;flex:1;display:grid;grid-template-rows:28px 150px 20px;gap:4px;text-align:center}.analytics-bar-value{align-self:end;color:#31533d;font-size:.7rem;font-weight:800;white-space:nowrap}.analytics-bar-track{display:flex;align-items:flex-end;justify-content:center;border-radius:9px 9px 3px 3px;background:#eff5f1;overflow:hidden}.analytics-bar{width:min(30px,70%);border-radius:7px 7px 2px 2px;background:linear-gradient(180deg,#55ae74,#1f7741);transition:height .2s ease}.analytics-bar-column small{color:var(--muted)}.analytics-row{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:10px;padding:10px 0;border-top:1px solid var(--line)}.analytics-row small{color:var(--muted)}.analytics-footnote{margin:10px 0 0;padding:9px 10px;border-radius:9px;background:#f4f7f5;color:#52665a;font-size:.78rem;line-height:1.4}.analytics-parcels{display:grid;gap:9px}.analytics-parcels h3{margin-bottom:3px}.analytics-parcel{display:grid;grid-template-columns:minmax(110px,.7fr) 1.3fr;gap:12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#fbfdfb}.analytics-parcel>div:first-child{display:grid;align-content:start;gap:3px}.analytics-parcel small{color:var(--muted)}.analytics-parcel-values{display:grid;gap:4px;color:#35533f;font-size:.84rem;text-align:right}
@media(max-width:700px){.analytics-filters form{grid-template-columns:1fr 1fr}.analytics-filters form .btn{grid-column:1/-1}.analytics-kpis{grid-template-columns:1fr 1fr}.analytics-parcel{grid-template-columns:1fr}.analytics-parcel-values{text-align:left}.analytics-row{grid-template-columns:1fr auto}.analytics-row small{grid-column:1/-1}}
@media(max-width:390px){.analytics-filters form,.analytics-kpis{grid-template-columns:1fr}.analytics-bar-column{min-width:46px}}

/* PeritIA: observacion visual con validacion humana */
.peritia-primary{background:linear-gradient(135deg,#1f7741,#2e9a58);box-shadow:0 8px 20px rgba(31,119,65,.18)}
.peritia-safety{border-left:5px solid #d39a18;background:#fff9e9}.peritia-safety strong{display:block;color:#684600}.peritia-safety p{margin:7px 0 0;color:#655938;line-height:1.45}
.peritia-create textarea,.peritia-question textarea{width:100%;box-sizing:border-box;min-height:92px;resize:vertical}
.peritia-audio-capture{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:8px}.peritia-audio-button.listening{background:#a92d2d;color:#fff;border-color:#a92d2d;animation:pulse 1.2s infinite}
.peritia-list{display:grid;gap:10px}.peritia-list-card{display:grid;grid-template-columns:82px minmax(0,1fr);gap:12px;align-items:center;color:inherit;text-decoration:none;padding:10px}.peritia-list-card.urgent{border-color:#d84235;box-shadow:inset 4px 0 #d84235}.peritia-list-card>img,.peritia-list-placeholder{width:82px;height:72px;border-radius:12px;object-fit:cover;background:#edf7f0;display:grid;place-items:center;font-size:2rem}.peritia-list-copy{min-width:0;display:grid;gap:7px}.peritia-list-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}.peritia-list-head strong{line-height:1.25}.peritia-list-copy small{color:var(--muted);line-height:1.35}.peritia-awaiting{color:#9a5b00;font-size:.82rem}
.peritia-case-summary{display:grid;gap:12px}.peritia-case-meta{color:var(--muted);font-size:.82rem;line-height:1.45}.peritia-case-summary>p{margin:0;white-space:pre-wrap;line-height:1.5}.peritia-photos{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.peritia-photos img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:11px;cursor:pointer;background:#eef4ef}
.peritia-answer-history{display:grid;gap:8px;padding-top:10px;border-top:1px solid var(--line)}.peritia-answer-history>div{display:grid;gap:3px;padding:8px 10px;border-radius:9px;background:#f4f8f5}.peritia-answer-history small{color:var(--muted);font-weight:700}.peritia-answer-history span{white-space:pre-wrap;line-height:1.4}
.peritia-question-card h3{margin-top:0}.peritia-questions{display:grid;gap:14px}.peritia-question{display:grid;gap:7px;padding:12px;border:1px solid #ead89e;border-radius:13px;background:#fffaf0}.peritia-question small{color:#6f6449}.peritia-photo-request{padding:8px 10px;border-radius:9px;background:#fff0c8;color:#725000;font-size:.82rem;font-weight:700}
.peritia-result{display:grid;gap:13px;border-color:#9ccdaf}.peritia-result-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.peritia-result-head small{color:#51705c;font-weight:800;letter-spacing:.06em}.peritia-result-head h3{margin:4px 0 0;line-height:1.25}.confidence-insufficient{background:#ecefed;color:#536159}.confidence-low{background:#fff0c8;color:#7a5400}.confidence-medium{background:#e7f2ff;color:#185781}.confidence-high{background:#dcf4e4;color:#176333}.peritia-disclaimer{padding:10px 12px;border-radius:10px;background:#fff5dc;color:#664b0c;font-weight:700;line-height:1.4}.peritia-result-section{display:grid;gap:6px}.peritia-result-section ul{display:grid;gap:6px;margin:0;padding:0;list-style:none}.peritia-result-section li{line-height:1.4;color:#344d3b}.peritia-learning-note{padding:10px;border-radius:10px;background:#eef6ff;color:#315978;font-size:.83rem;line-height:1.4}
.peritia-send-card,.peritia-sent{display:grid;gap:9px}.peritia-send-card p{margin:0}.peritia-human-review{border-left:5px solid #2f9555;background:#eef9f1}.peritia-human-review.discarded{border-left-color:#b04a3e;background:#fff1ef}.peritia-human-review h3{margin:7px 0}.peritia-review-button,.peritia-delete-button{margin-top:10px}.peritia-empty{text-align:center}.peritia-empty p{margin-bottom:0}
.msg-peritia{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;min-width:min(270px,70vw);padding:10px;border-radius:11px;background:rgba(255,255,255,.9);color:#174c2b;text-decoration:none}.msg-peritia-icon{font-size:1.55rem}.msg-peritia-copy{display:grid;gap:3px}.msg-peritia-copy small{color:#3d6049;line-height:1.3}
@media(max-width:520px){.peritia-list-head,.peritia-result-head{display:grid}.peritia-list-head .badge,.peritia-result-head .badge{justify-self:start}.peritia-photos{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Licencias y alta guiada */
.commercial-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:12px 0}.commercial-metric{display:grid;gap:4px;padding:14px;border:1px solid #d7e8dd;border-radius:14px;background:#eff8f2}.commercial-metric strong{color:#174f2e;font-size:1.55rem}.commercial-metric span{color:#526a5a;font-size:.8rem;font-weight:700}.commercial-list{display:grid;gap:11px}.commercial-card{display:grid;gap:11px}.commercial-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.commercial-card-head>div{display:grid;gap:2px}.commercial-card-head small{color:var(--muted)}.commercial-card-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;color:#395643;font-size:.84rem}.commercial-notes,.commercial-private-note{margin:0;padding:9px 10px;border-radius:9px;background:#f4f6f4;color:#59665d;font-size:.8rem;line-height:1.4}.license-trial{background:#fff0c7;color:#775000}.license-suspended,.license-cancelled{background:#fde5e1;color:#8d2d20}.license-active{background:#dff3e5;color:#1d6337}.license-overview{display:flex;align-items:center;justify-content:space-between;gap:9px;margin:9px 0}.license-overview>div{display:grid;gap:3px}.license-overview small{color:var(--muted)}.onboarding-title{margin:14px 0 7px;font-weight:850;color:#183d27}.onboarding-step{display:grid;grid-template-columns:24px 1fr auto;align-items:center;gap:7px;padding:9px 0;border-top:1px solid var(--line);color:#705a25}.onboarding-step.done{color:#21643a}.onboarding-step a{color:var(--green-700);font-weight:800}.commercial-setup>.btn{margin-top:10px}
@media(max-width:520px){.commercial-summary{grid-template-columns:1fr}.commercial-card-grid{grid-template-columns:1fr}.license-overview{align-items:flex-start}.onboarding-step{grid-template-columns:22px 1fr}.onboarding-step a{grid-column:2}}

/* Guia de uso */
.guide-entry-card{display:flex;align-items:center;justify-content:space-between;gap:12px}.guide-entry-card p{margin:3px 0 0}.guide-entry-card .btn{flex:0 0 auto}.guide-hero{margin:-2px -2px 14px;padding:22px 20px;border-radius:20px;background:linear-gradient(145deg,#154d2c,#24874a);color:#fff;box-shadow:0 10px 25px rgba(19,76,43,.16)}.guide-kicker{margin-bottom:5px;color:#c9efd5;font-size:.76rem;font-weight:850;text-transform:uppercase;letter-spacing:.08em}.guide-hero h2{margin:0 0 7px;font-size:1.65rem}.guide-hero p{max-width:620px;margin:0;color:#e7f7ec;line-height:1.45}.guide-tools{position:sticky;top:72px;z-index:4;display:flex;align-items:center;gap:9px;margin-bottom:12px;padding:8px;border:1px solid #d4e6da;border-radius:14px;background:rgba(248,252,249,.96);backdrop-filter:blur(8px)}.guide-search{min-width:0;flex:1;margin:0}.guide-count{flex:0 0 auto;color:var(--muted);font-size:.76rem;font-weight:800}.guide-list{display:grid;gap:10px}.guide-topic{padding:0;overflow:hidden}.guide-topic summary{display:grid;grid-template-columns:44px 1fr 24px;align-items:center;gap:10px;padding:15px;cursor:pointer;list-style:none}.guide-topic summary::-webkit-details-marker{display:none}.guide-topic-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:#e8f5ec;font-size:1.35rem}.guide-topic-copy{display:grid;gap:3px}.guide-topic-copy strong{color:#153c25;font-size:1rem}.guide-topic-copy small{color:#53675a;line-height:1.35}.guide-chevron{color:#53705d;font-size:1.2rem;transition:transform .15s}.guide-topic[open] .guide-chevron{transform:rotate(180deg)}.guide-topic-body{padding:0 16px 16px 70px;border-top:1px solid #e5eee8}.guide-steps{margin:13px 0 10px;padding-left:20px}.guide-steps li{margin:0 0 8px;padding-left:4px;color:#2f4b39;line-height:1.45}.guide-steps li::marker{color:#25824a;font-weight:900}.guide-examples-title{margin:12px 0 6px;color:#1d6337;font-size:.75rem;font-weight:850;text-transform:uppercase;letter-spacing:.05em}.guide-example{margin:6px 0;padding:10px 12px;border-left:4px solid #45a766;border-radius:0 10px 10px 0;background:#edf8f0;color:#234c31;font-weight:650;line-height:1.4}
@media(max-width:520px){.guide-entry-card{align-items:stretch;flex-direction:column}.guide-entry-card .btn{width:100%}.guide-tools{top:65px}.guide-topic summary{grid-template-columns:40px 1fr 18px;padding:12px}.guide-topic-icon{width:38px;height:38px}.guide-topic-body{padding:0 12px 13px}.guide-hero{padding:19px 16px}.guide-hero h2{font-size:1.4rem}}
