/* ========================================================
   REVICASA INSPECTOR MOBILE — APPLE / MAC DESIGN SYSTEM
   ======================================================== */

:root {
  --apple-bg: #F5F5F7;
  --apple-card: #FFFFFF;
  --apple-dark: #1D1D1F;
  --apple-body: #3A3A3C;
  --apple-muted: #86868B;
  --apple-border: rgba(0, 0, 0, 0.08);
  --apple-blue: #0071E3;
  --apple-purple: #AF52DE;
  --apple-ok: #34C759;
  --apple-warn: #FF9500;
  --apple-danger: #FF3B30;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-stack);
  background-color: var(--apple-bg);
  color: var(--apple-dark);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--apple-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--apple-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-tag {
  font-size: 9px;
  background: var(--apple-dark);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.net-status-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.net-status-badge.online {
  background: rgba(52, 199, 89, 0.15);
  color: #34C759;
}

.net-status-badge.offline {
  background: rgba(255, 149, 0, 0.2);
  color: #FF9500;
}

.expediente-input-wrap input {
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 600;
  color: var(--apple-body);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  width: 170px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-action {
  font-family: var(--font-stack);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--apple-border);
  background: white;
  color: var(--apple-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn-action:active {
  transform: scale(0.96);
}

.btn-sync {
  background: var(--apple-dark);
  color: white;
  border: none;
}

.btn-pdf {
  background: rgba(0, 113, 227, 0.08);
  color: var(--apple-blue);
  border-color: rgba(0, 113, 227, 0.2);
}

/* Carrusel de Estancias (Horizontal Scrolling) */
.rooms-nav-wrapper {
  background: white;
  border-bottom: 1px solid var(--apple-border);
  overflow-x: auto;
  white-space: nowrap;
  padding: 10px 16px;
  -webkit-overflow-scrolling: touch;
}

.rooms-nav-wrapper::-webkit-scrollbar {
  display: none;
}

.rooms-nav {
  display: inline-flex;
  gap: 8px;
}

.room-tab {
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--apple-bg);
  color: var(--apple-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.room-tab.active {
  background: var(--apple-dark);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Main Content */
.main-content {
  padding: 16px;
  padding-bottom: 125px; /* Espacio para que el Thumb Dock no tape contenido */
  max-width: 600px;
  margin: 0 auto;
}

.room-header {
  margin-bottom: 12px;
}

.room-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--apple-dark);
  letter-spacing: -0.4px;
}

.room-subtitle {
  font-size: 12px;
  color: var(--apple-muted);
}

/* Chips Rápidos de Elementos - Scroll Horizontal Ergonómico */
.chips-container {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding: 4px 2px 10px 2px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips-container::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  flex-shrink: 0;
  white-space: nowrap;
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--apple-border);
  background: white;
  color: var(--apple-body);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.chip-btn.active {
  background: var(--apple-blue);
  color: white;
  border-color: var(--apple-blue);
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 113, 227, 0.35);
  transform: scale(1.02);
}

/* Tarjeta del Elemento Activo */
.element-card {
  background: var(--apple-card);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--apple-border);
}

.element-card-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.element-card-head h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--apple-dark);
  letter-spacing: -0.3px;
}

.element-category-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--apple-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* Pills de Calificación / Botones Revicasa */
.rating-pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--apple-bg);
  border: 1px solid var(--apple-border);
  border-radius: 16px;
  padding: 10px 14px;
}

.val-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.val-type-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--apple-muted);
}

.val-active-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--apple-dark);
}

.val-buttons-row {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  margin-bottom: 4px;
}

.rev-val-btn {
  flex: 1;
  min-height: 42px;
  border-radius: 10px;
  border: 1.5px solid var(--apple-border);
  background: #F9FAFB;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
  color: var(--apple-body);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0 4px;
}

.rev-val-btn:active {
  transform: scale(0.95);
}

.rev-val-btn .btn-sym {
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.rev-val-btn .btn-lbl {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Colores de Revicasa cuando están activos */
.rev-val-btn.active.c-na {
  background: #86868B;
  border-color: #86868B;
  color: #FFFFFF;
}

.rev-val-btn.active.c-critico {
  background: #9B2335;
  border-color: #9B2335;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(155, 35, 53, 0.4);
}

.rev-val-btn.active.c-malo {
  background: #C0392B;
  border-color: #C0392B;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(192, 57, 43, 0.4);
}

.rev-val-btn.active.c-aceptable {
  background: #27AE60;
  border-color: #27AE60;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(39, 174, 96, 0.4);
}

.rev-val-btn.active.c-bien {
  background: #00D4AA;
  border-color: #00D4AA;
  color: #1D1D1F;
  box-shadow: 0 3px 10px rgba(0, 212, 170, 0.45);
}

/* Área de Notas */
.notes-section {
  margin-bottom: 18px;
}

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.notes-header label {
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-dark);
}

.notes-actions {
  display: flex;
  gap: 6px;
}

.btn-tool {
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 14px;
  border: 1px solid var(--apple-border);
  background: var(--apple-bg);
  color: var(--apple-body);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.btn-tool:active {
  transform: scale(0.96);
}

.btn-ai {
  background: rgba(175, 82, 222, 0.1);
  color: var(--apple-purple);
  border-color: rgba(175, 82, 222, 0.25);
}

.notes-section textarea {
  width: 100%;
  min-height: 85px;
  font-family: var(--font-stack);
  font-size: 13px;
  line-height: 1.45;
  color: var(--apple-dark);
  background: var(--apple-bg);
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}

.notes-section textarea:focus {
  border-color: var(--apple-blue);
  background: white;
}

/* Sección de Fotos */
.photos-section {
  border-top: 1px solid var(--apple-border);
  padding-top: 14px;
}

.photos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.photos-header label {
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-dark);
}

.photos-btn-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-camera {
  font-family: var(--font-stack);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--apple-blue);
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 113, 227, 0.3);
}

.btn-camera:active {
  transform: scale(0.96);
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.photo-card {
  position: relative;
  background: var(--apple-bg);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--apple-border);
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-btn-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
}

.photo-btn-delete:active {
  transform: scale(0.9);
  background: #FF3B30;
}

.photo-btn-expert {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  font-family: var(--font-stack);
  font-size: 10px;
  font-weight: 700;
  padding: 6px;
  border-radius: 8px;
  background: rgba(29, 29, 31, 0.85);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

/* Modales */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: white;
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--apple-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--apple-purple);
}

.btn-close {
  font-size: 20px;
  border: none;
  background: transparent;
  color: var(--apple-muted);
  cursor: pointer;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--apple-body);
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--apple-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--apple-bg);
}

.btn-primary {
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 12px;
  background: var(--apple-blue);
  color: white;
  border: none;
  cursor: pointer;
}

.btn-secondary {
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 12px;
  background: white;
  color: var(--apple-dark);
  border: 1px solid var(--apple-border);
  cursor: pointer;
  text-decoration: none;
}

/* Modal PDF */
.modal-card-pdf {
  max-width: 900px;
  height: 85vh;
}

.modal-body-pdf {
  flex: 1;
  background: #525659;
}

.modal-body-pdf iframe {
  width: 100%;
  height: 100%;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(29, 29, 31, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 300;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Modal Lightbox Foto Grande (Estilo iOS / Mac) */
.modal-lightbox {
  background: rgba(0, 0, 0, 0.95);
  padding: 0;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 999;
}

.lightbox-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lightbox-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-info {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.3px;
}

.lightbox-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  letter-spacing: 0.2px;
}

.lightbox-close {
  color: white;
  font-size: 26px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:active {
  background: rgba(255, 255, 255, 0.4);
}

.lightbox-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.85);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.lightbox-image-wrap img.zoomed {
  transform: scale(2.2);
  cursor: zoom-out;
}

.lightbox-footer {
  padding: 14px 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.photo-zoom-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 4;
}

/* --- Auditor IA y Avisos de Olvidos --- */
.btn-audit {
  background: #FAF5FF;
  border-color: #E9D5FF;
  color: #7E22CE;
}
.btn-audit:hover {
  background: #F3E8FF;
}
.badge-audit-count {
  background: #FF3B30;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s ease;
}
.badge-audit-count.all-done {
  background: #34C759;
}

.room-progress-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  color: #86868B;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.room-progress-badge.done {
  background: #E8F8F0;
  color: #15803D;
}

.room-pill-count {
  font-size: 9px;
  font-weight: 700;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
  color: #48484A;
}
.room-btn.active .room-pill-count {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}
.room-pill-count.done {
  background: #34C759;
  color: white;
}

/* Modal Auditoría y Sugerencias IA */
.modal-audit-card {
  max-width: 620px;
  width: 95%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.audit-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-icon-sparkle {
  font-size: 24px;
}
.modal-subtitle-text {
  font-size: 11px;
  color: #86868B;
  display: block;
  margin-top: 1px;
}
.audit-tabs {
  display: flex;
  background: #F2F2F7;
  padding: 4px;
  border-radius: 12px;
  margin: 10px 16px 0 16px;
  gap: 4px;
}
.audit-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: var(--font-stack);
  font-size: 12px;
  font-weight: 600;
  color: #636366;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.audit-tab-btn.active {
  background: white;
  color: #1D1D1F;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.audit-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.audit-panel {
  display: none;
}
.audit-panel.active {
  display: block;
}
.audit-section-desc {
  font-size: 12px;
  color: #636366;
  margin-bottom: 12px;
}

/* Lista de Pendientes */
.audit-pending-group {
  margin-bottom: 16px;
  background: #F9F9FB;
  border: 1px solid #E5E5EA;
  border-radius: 12px;
  padding: 12px;
}
.audit-pending-group-title {
  font-size: 12px;
  font-weight: 700;
  color: #1D1D1F;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.audit-pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: white;
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid #EFEFF4;
}
.audit-pending-item:last-child {
  margin-bottom: 0;
}
.audit-item-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.audit-item-name {
  font-size: 12px;
  font-weight: 600;
  color: #1D1D1F;
}
.audit-badge-critical {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: #FEE2E2;
  color: #B91C1C;
  letter-spacing: 0.3px;
}
.btn-jump-elem {
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  background: #0071E3;
  color: white;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-jump-elem:active {
  transform: scale(0.95);
}

/* Contenido Sugerencias IA Copilot */
.audit-copilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.copilot-tip {
  font-size: 11px;
  color: #86868B;
}
.ai-copilot-card {
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.ai-copilot-card.alert {
  background: #FFF5F5;
  border-color: #FECACA;
}
.ai-copilot-card.correlation {
  background: #FAF5FF;
  border-color: #E9D5FF;
}
.ai-copilot-card.tip {
  background: #F0F9FF;
  border-color: #BAE6FD;
}
.ai-card-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-copilot-card.alert .ai-card-title { color: #DC2626; }
.ai-copilot-card.correlation .ai-card-title { color: #7E22CE; }
.ai-copilot-card.tip .ai-card-title { color: #0284C7; }
.ai-card-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #374151;
  margin-bottom: 6px;
}
.ai-card-action {
  font-size: 11px;
  font-weight: 600;
  color: #1F2937;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
}
.ai-card-norm {
  font-size: 10px;
  font-weight: 700;
  color: #6B7280;
  margin-top: 4px;
  display: block;
}

/* Selector Modo Dual (Campo Flash vs Forense Argón) */
.dual-mode-wrapper {
  padding: 10px 16px 0 16px;
}
.dual-mode-selector {
  display: flex;
  background: #F2F2F7;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}
.mode-tab-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 700;
  color: #636366;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.mode-tab-btn.active {
  background: white;
  color: #1D1D1F;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.mode-tab-btn.argon-active {
  background: linear-gradient(135deg, #2D1A4C, #4C1D95);
  color: #F5EEFF;
  box-shadow: 0 2px 6px rgba(76, 29, 149, 0.35);
}
.mode-desc-hint {
  font-size: 11px;
  color: #636366;
  margin-top: 6px;
  padding: 0 4px;
  line-height: 1.35;
}
.badge-model-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-model-tag.flash {
  background: #E0F2FE;
  color: #0369A1;
}
.badge-model-tag.argon {
  background: #F3E8FF;
  color: #6B21A8;
  border: 1px solid #D8B4F8;
}


/* ========================================================
   ESTILOS PARA ENCARGOS, VIGILANTE Y TIPOLOGÍAS
   ======================================================== */

.expediente-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.04);
  padding: 3px 8px;
  border-radius: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.expediente-input-wrap input {
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 700;
  color: var(--apple-dark);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  width: 175px;
}

.select-tipologia {
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 700;
  color: #0071E3;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.25);
  border-radius: 8px;
  padding: 3px 8px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select-tipologia:focus {
  border-color: #0071E3;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
}

.btn-encargos {
  background: #F8FAFC;
  border-color: #E2E8F0;
  position: relative;
}

.vigilante-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34C759;
  display: inline-block;
}

.vigilante-dot.pulse {
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

.badge-encargos-count {
  background: #0071E3;
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
}

.modal-encargos-card {
  max-width: 550px;
  width: 95%;
}

.vigilante-status-box {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 16px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vigilante-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.vigilante-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.vigilante-badge .dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulseDot 2s infinite;
}

.vigilante-rule {
  font-size: 10px;
  font-weight: 600;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
}

.vigilante-info-text {
  font-size: 11px;
  color: #CBD5E1;
  line-height: 1.4;
}

.encargos-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 2px;
}

.encargos-col-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #86868B;
  text-transform: uppercase;
}

.encargos-count-label {
  font-size: 11px;
  font-weight: 700;
  color: #0071E3;
}

.encargos-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.encargo-card {
  background: #FFFFFF;
  border: 1px solid #E5E5EA;
  border-radius: 14px;
  padding: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.encargo-card.proximo {
  border: 2px solid #0071E3;
  background: linear-gradient(180deg, #F0F7FF 0%, #FFFFFF 100%);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.14);
}

.encargo-card.activo-actual {
  border: 2px solid #34C759;
  background: #F4FDF7;
}

.encargo-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.encargo-id-tipologia {
  display: flex;
  align-items: center;
  gap: 6px;
}

.encargo-id-badge {
  font-size: 11px;
  font-weight: 800;
  background: #1D1D1F;
  color: white;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.encargo-tipologia-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: #EBF5FF;
  color: #0071E3;
}

.encargo-proximo-tag {
  font-size: 9px;
  font-weight: 800;
  background: #FF9500;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.encargo-honorarios {
  font-size: 12px;
  font-weight: 800;
  color: #10B981;
}

.encargo-direccion {
  font-size: 13px;
  font-weight: 700;
  color: #1D1D1F;
  margin-bottom: 4px;
  line-height: 1.35;
}

.encargo-direccion-extra {
  font-size: 11px;
  color: #636366;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.encargo-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.encargo-fecha-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #1D1D1F;
}

.btn-cargar-encargo {
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: #0071E3;
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-cargar-encargo:hover {
  background: #0077ED;
}

.btn-cargar-encargo.btn-cargado {
  background: #34C759;
  cursor: default;
}


/* ========================================================
   BANCO DE FRASES TIPO Y PÍLDORAS DE AUTOCOMPLETADO
   ======================================================== */

.btn-frases {
  background: #FFFBEB;
  color: #B45309;
  border-color: #FDE68A;
}
.btn-frases:hover {
  background: #FEF3C7;
}

.quick-snippets-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 8px;
  margin-top: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  min-height: 28px;
}
.quick-snippets-bar::-webkit-scrollbar {
  display: none;
}

.snippet-pill {
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.snippet-pill:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
  color: #0F172A;
}
.snippet-pill:active {
  transform: scale(0.96);
  background: #0071E3;
  color: white;
  border-color: #0071E3;
}
.snippet-pill .pill-bolt {
  color: #F59E0B;
  font-size: 12px;
}

.notes-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-save-as-template {
  background: transparent;
  border: none;
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 600;
  color: #86868B;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.btn-save-as-template:hover {
  color: #0071E3;
  background: rgba(0, 113, 227, 0.06);
}

.modal-frases-card {
  max-width: 620px;
  width: 95%;
}

.frases-search-wrap {
  padding: 10px 16px 6px;
  border-bottom: 1px solid #E5E5EA;
}
.frases-search-wrap input {
  width: 100%;
  font-family: var(--font-stack);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #D1D5DB;
  background: #F9FAFB;
  outline: none;
  box-sizing: border-box;
}
.frases-search-wrap input:focus {
  border-color: #0071E3;
  background: white;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.15);
}

.frases-modal-body {
  padding: 16px;
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.frase-categoria-block {
  margin-bottom: 10px;
}
.frase-categoria-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0071E3;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.frase-item-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.frase-item-card:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
}
.frase-item-card:active {
  transform: scale(0.99);
}
.frase-item-text {
  font-size: 12px;
  color: #1E293B;
  line-height: 1.45;
}
.frase-item-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}
.btn-insert-frase {
  font-size: 10px;
  font-weight: 700;
  color: #0071E3;
  background: transparent;
  border: none;
  cursor: pointer;
}

/* ========================================================
   ESTILOS PRESUPUESTO PERICIAL Y ESTADO GENERAL
   ======================================================== */
.btn-presupuesto {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #16A34A;
  font-weight: 600;
}
.btn-presupuesto:hover {
  background: #DCFCE7;
  border-color: #86EFAC;
}

.btn-client-req {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #475569;
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
}
.btn-client-req:hover {
  background: #E2E8F0;
  color: #1E293B;
}
.btn-client-req.active {
  background: #EFF6FF;
  border-color: #3B82F6;
  color: #1D4ED8;
  box-shadow: 0 0 0 1px #3B82F6;
}

.modal-presupuesto-card {
  max-width: 680px;
  width: 95%;
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.presupuesto-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 8px;
  padding: 8px 16px 10px;
}
.stat-badge-box {
  padding: 8px 10px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.badge-defects {
  background: #FEF2F2;
  border: 1px solid #FECACA;
}
.badge-defects .stat-count {
  font-size: 18px;
  font-weight: 800;
  color: #DC2626;
}
.badge-client-req {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
}
.badge-client-req .stat-count {
  font-size: 18px;
  font-weight: 800;
  color: #2563EB;
}
.badge-total-range {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
}
.badge-total-range .stat-val {
  font-size: 15px;
  font-weight: 800;
  color: #15803D;
  white-space: nowrap;
}
.stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: #64748B;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.btn-generate-presupuesto {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0071E3 0%, #4F46E5 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-generate-presupuesto:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.35);
}
.btn-generate-presupuesto:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.textarea-estado-general {
  width: 100%;
  min-height: 180px;
  font-family: var(--font-stack);
  font-size: 12.5px;
  line-height: 1.5;
  color: #1D1D1F;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  padding: 12px;
  box-sizing: border-box;
  resize: vertical;
  transition: border-color 0.2s;
}
.textarea-estado-general:focus {
  outline: none;
  border-color: #0071E3;
  background: #FFFFFF;
}

.presupuesto-partida-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}
.presupuesto-partida-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}
.presupuesto-tag-defecto {
  background: #FEE2E2;
  color: #B91C1C;
}
.presupuesto-tag-cliente {
  background: #DBEAFE;
  color: #1E40AF;
}
.presupuesto-partida-rango {
  font-weight: 700;
  color: #0F172A;
  white-space: nowrap;
}


/* ========================================================
   ESTILOS GEO-ORIENTACIÓN Y GOOGLE MAPS 3D / NORTE
   ======================================================== */
.btn-maps {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #2563EB;
  font-weight: 600;
}
.btn-maps:hover {
  background: #DBEAFE;
  border-color: #93C5FD;
}

.modal-maps-card {
  max-width: 580px;
  width: 95%;
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.btn-open-gmaps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  background: #2563EB;
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.btn-open-gmaps:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
}

.orientacion-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.btn-orientacion-pill {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.btn-orientacion-pill:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}
.btn-ori-sur:hover {
  border-color: #F59E0B;
  background: #FFFBEB;
}
.btn-ori-este:hover {
  border-color: #3B82F6;
  background: #EFF6FF;
}
.btn-ori-oeste:hover {
  border-color: #F97316;
  background: #FFF7ED;
}
.btn-ori-norte:hover {
  border-color: #06B6D4;
  background: #ECFEFF;
}

.ori-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.btn-orientacion-pill b {
  display: block;
  font-size: 12.5px;
  color: #0F172A;
}
.ori-desc {
  display: block;
  font-size: 11px;
  color: #64748B;
  line-height: 1.35;
  margin-top: 2px;
}

.btn-cubierta-template {
  width: 100%;
  padding: 10px 12px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1E293B;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.btn-cubierta-template:hover {
  background: #EFF6FF;
  border-color: #3B82F6;
  color: #1D4ED8;
}


/* ========================================================
   DISEÑO ERGONÓMICO A UNA MANO Y COMANDOS DE VOZ MANOS LIBRES
   ======================================================== */

/* Fila de Título de Elemento y Badge de Índice */
.element-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.element-idx-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0071E3;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Botón y LED de Modo Manos Libres (Comandos por Voz) */
.btn-voice-cmd {
  position: relative;
  border-color: #CBD5E1;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-voice-cmd.active {
  background: #EFF6FF !important;
  border-color: #0071E3 !important;
  color: #0071E3 !important;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.25) !important;
}

.voice-cmd-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94A3B8;
  display: inline-block;
  transition: all 0.2s ease;
}

.btn-voice-cmd.active .voice-cmd-led {
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: ledPulse 1.4s infinite;
}

@keyframes ledPulse {
  0% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.6; transform: scale(0.9); }
}

/* HUD Flotante de Comandos por Voz (Modo Manos Libres) */
.voice-cmd-hud {
  position: sticky;
  top: 56px;
  z-index: 95;
  margin: 6px 16px 10px 16px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: slideDownHud 0.25s ease-out;
}

@keyframes slideDownHud {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.voice-hud-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-wave-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 10px #10B981;
  animation: ledPulse 1.2s infinite;
}

.voice-hud-title {
  font-size: 12px;
  font-weight: 700;
  color: #F8FAFC;
  letter-spacing: 0.2px;
}

.voice-hud-hint {
  font-size: 11px;
  color: #94A3B8;
  text-align: right;
  font-style: italic;
}

/* BARRA FLOTANTE DE PULGAR (THUMB DOCK) */
.thumb-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  padding: 8px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 99;
  max-width: 600px;
  margin: 0 auto;
}

.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 14px;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.dock-btn-label {
  font-size: 11px;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 0.2px;
}

/* Botones de Navegación Anterior / Siguiente */
.dock-btn-nav {
  min-width: 66px;
  height: 52px;
  background: #F2F2F7;
  color: #1D1D1F;
  border-radius: 14px;
  border: 1px solid #E5E5EA;
  flex-direction: row;
  gap: 4px;
}

.dock-btn-nav:active {
  transform: scale(0.93);
  background: #E5E5EA;
}

.dock-btn-next {
  background: #0071E3;
  color: white;
  border-color: #0071E3;
  box-shadow: 0 3px 12px rgba(0, 113, 227, 0.35);
}

.dock-btn-next:active {
  background: #005bb5;
  transform: scale(0.93);
}

.dock-btn-next .dock-btn-label {
  color: white;
  margin-top: 0;
}

/* Botones Circulares de Acción (Foto y Voz) */
.dock-btn-action {
  gap: 2px;
}

.dock-circle-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F2F2F7;
  color: #1D1D1F;
  border: 1.5px solid #E5E5EA;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dock-btn-camera .dock-circle-icon {
  background: #F0F9FF;
  border-color: #BAE6FD;
  color: #0284C7;
}

.dock-btn-camera:active .dock-circle-icon {
  transform: scale(0.92);
  background: #E0F2FE;
}

.dock-btn-voice .dock-circle-icon {
  background: #FDF2F8;
  border-color: #FBCFE8;
  color: #DB2777;
}

.dock-btn-voice:active .dock-circle-icon {
  transform: scale(0.92);
}

.dock-circle-icon.listening {
  background: #EF4444 !important;
  color: white !important;
  border-color: #DC2626 !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.6) !important;
  animation: pulseVoiceListening 1.2s infinite;
}

@keyframes pulseVoiceListening {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.dock-btn-action .dock-btn-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #48484A;
}

/* Responsividad para Móviles (Ergonomía Vertical) */
@media (max-width: 600px) {
  .app-header {
    padding: 8px 12px;
  }
  .header-actions {
    gap: 6px;
  }
  .btn-action span {
    font-size: 11px;
  }
  .room-header h2 {
    font-size: 20px;
  }
  .element-card {
    padding: 14px;
    border-radius: 16px;
  }
  .val-buttons-row {
    gap: 6px;
  }
  .rev-val-btn {
    min-height: 52px;
  }
}


/* ========================================================
   SISTEMA DE PANTALLAS MULTI-SCREEN Y ERGONOMÍA PARA "MANAZAS"
   ======================================================== */

.app-screen {
  display: none;
  width: 100%;
  animation: fadeInScreen 0.22s ease-out;
}

.app-screen.active {
  display: block;
}

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

/* --- PANTALLA 1: INICIO Y EXPEDIENTE (HOME) --- */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--apple-border);
  position: sticky;
  top: 0;
  z-index: 90;
}

.net-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  background: #F2F2F7;
  color: #1D1D1F;
}

.net-status-pill.online {
  background: #E8F5E9;
  color: #2E7D32;
}

.net-status-pill.online .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4CAF50;
  box-shadow: 0 0 6px #4CAF50;
}

.home-content {
  max-width: 620px;
  margin: 0 auto;
  padding: 18px 16px 100px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.home-card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 18px 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--apple-border);
}

.home-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.home-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #64748B;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.home-section-desc {
  font-size: 13px;
  color: #475569;
  margin: 6px 0 14px 0;
  line-height: 1.4;
}

.btn-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #0F172A;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-home-link:active {
  transform: scale(0.96);
  background: #E2E8F0;
}

.expediente-input-group input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: #0F172A;
  background: #F8FAFC;
  border: 2px solid #CBD5E1;
  border-radius: 14px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.expediente-input-group input:focus {
  border-color: #0071E3;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

/* Cuadrícula de Tarjetas Táctiles Gigantes para Tipología */
.tipologia-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .tipologia-grid {
    grid-template-columns: 1fr;
  }
}

.tipo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 76px;
}

.tipo-card-icon {
  font-size: 30px;
  flex-shrink: 0;
}

.tipo-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.tipo-card-name {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
}

.tipo-card-desc {
  font-size: 11px;
  color: #64748B;
  line-height: 1.3;
}

.tipo-check-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.tipo-card.active {
  border-color: #0071E3;
  background: #EFF6FF;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.22);
}

.tipo-card.active .tipo-card-name {
  color: #0071E3;
}

.tipo-card.active .tipo-check-icon {
  background: #0071E3;
  color: #FFFFFF;
}

.tipo-card:active {
  transform: scale(0.97);
}

/* BOTÓN GIGANTE DESTACADO PARA INICIAR INSPECCIÓN */
.home-cta-wrap {
  margin: 6px 0;
}

.btn-giant-cta {
  width: 100%;
  min-height: 70px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #0071E3 0%, #005bb5 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.38);
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-giant-cta:active {
  transform: scale(0.97);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.3);
}

.btn-cta-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.btn-cta-sub {
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0.92;
}

/* Herramientas de Cierre y Documentación */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  min-height: 58px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  color: #1E293B;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tool-tile:active {
  transform: scale(0.97);
  background: #EFF6FF;
  border-color: #0071E3;
}

.tool-tile-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.tool-tile-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tool-tile-text b {
  font-size: 14.5px;
  font-weight: 700;
  color: #0F172A;
}

.tool-tile-text span {
  font-size: 11.5px;
  color: #64748B;
}

/* --- PANTALLA 2: INSPECCIÓN DE CAMPO (INSPECT) --- */
.inspect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--apple-border);
  position: sticky;
  top: 0;
  z-index: 90;
  max-width: 640px;
  margin: 0 auto;
}

.btn-back-home {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 76px;
  height: 44px;
  padding: 0 12px;
  background: #F2F2F7;
  border: 1.5px solid #E5E5EA;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #1D1D1F;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-back-home:active {
  transform: scale(0.95);
  background: #E5E5EA;
}

.inspect-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.inspect-address {
  font-size: 14px;
  font-weight: 800;
  color: #1D1D1F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.inspect-tipo-pill {
  font-size: 10.5px;
  font-weight: 700;
  color: #0071E3;
  background: #EFF6FF;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 2px;
}

/* BOTONES GIGANTES EN CAMPO PARA "MANAZAS" */
.chip-btn {
  min-height: 46px !important;
  padding: 10px 16px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  border-radius: 23px !important;
}

.rev-val-btn {
  min-height: 64px !important;
  border-radius: 16px !important;
  gap: 4px !important;
}

.rev-val-btn .btn-sym {
  font-size: 22px !important;
  font-weight: 900 !important;
}

.rev-val-btn .btn-lbl {
  font-size: 12px !important;
  font-weight: 800 !important;
}

.btn-tool {
  min-height: 46px !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
}

.btn-camera {
  min-height: 50px !important;
  padding: 10px 16px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 14px !important;
}

.btn-client-req {
  min-height: 48px !important;
  font-size: 13.5px !important;
}

.quick-snippet-pill {
  min-height: 42px !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
}

/* ========================================================
   PANTALLA 2: ÍNDICE DE RECORRIDO DE ESTANCIAS (MAPA VISUAL)
   ======================================================== */
.roomlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--apple-border);
  position: sticky;
  top: 0;
  z-index: 90;
  max-width: 640px;
  margin: 0 auto;
}

.roomlist-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
  max-width: 200px;
}

.roomlist-address {
  font-size: 14px;
  font-weight: 800;
  color: #1D1D1F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.roomlist-tipo-pill {
  font-size: 11px;
  font-weight: 700;
  color: #0071E3;
  background: #EFF6FF;
  padding: 2px 10px;
  border-radius: 12px;
  margin-top: 2px;
  white-space: nowrap;
}

.btn-roomlist-presupuesto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #F2F2F7;
  border: 1.5px solid #E5E5EA;
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-roomlist-presupuesto:active {
  transform: scale(0.94);
  background: #E5E5EA;
}

.roomlist-content {
  max-width: 620px;
  margin: 0 auto;
  padding: 16px 14px 110px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.roomlist-summary-card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 18px;
  border: 1px solid var(--apple-border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roomlist-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.roomlist-summary-title {
  font-size: 18px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
}

.roomlist-summary-sub {
  font-size: 12.5px;
  color: #64748B;
  margin: 3px 0 0 0;
}

.roomlist-summary-pct {
  font-size: 24px;
  font-weight: 900;
  color: #0071E3;
  letter-spacing: -0.5px;
}

.roomlist-progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: 6px;
  overflow: hidden;
}

.roomlist-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0071E3 0%, #00D4AA 100%);
  border-radius: 6px;
  transition: width 0.35s ease;
}

.roomlist-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
}

.roomlist-cta-wrap {
  margin: 2px 0 6px 0;
}

.roomlist-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.room-nav-card {
  min-height: 80px;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.room-nav-card:active {
  transform: scale(0.98);
  background: #F8FAFC;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.room-nav-card.is-active-room {
  border-color: #0071E3;
  background: #F0F7FF;
}

.room-nav-card.is-done {
  border-color: #27AE60;
  background: #F5FBF7;
}

.room-nav-card.is-progress {
  border-color: #0071E3;
}

.room-nav-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F1F5F9;
  border-radius: 14px;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.room-nav-card.is-done .room-nav-icon {
  background: #E8F5E9;
}

.room-nav-card.is-active-room .room-nav-icon {
  background: #EFF6FF;
}

.room-nav-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.room-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.room-nav-name {
  font-size: 15.5px;
  font-weight: 800;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.room-status-badge.badge-pending {
  background: #F1F5F9;
  color: #64748B;
}

.room-status-badge.badge-progress {
  background: #EFF6FF;
  color: #0071E3;
}

.room-status-badge.badge-done {
  background: #E8F5E9;
  color: #2E7D32;
  font-weight: 900;
}

.room-nav-sub {
  font-size: 11.5px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.room-nav-mini-bar {
  width: 100%;
  height: 4px;
  background: #E2E8F0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.room-nav-mini-fill {
  height: 100%;
  background: #0071E3;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.room-nav-card.is-done .room-nav-mini-fill {
  background: #27AE60;
}

.room-nav-arrow {
  color: #94A3B8;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

/* Barra Inferior de Navegación entre Estancias (en Pantalla 3 Inspect) */
.room-nav-bottom-bar {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 24px;
}

.btn-room-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-room-nav-btn:active {
  transform: scale(0.96);
  background: #F1F5F9;
}

.btn-room-nav-main {
  background: #EFF6FF;
  border-color: #0071E3;
  color: #0071E3;
  font-weight: 800;
}

.btn-room-nav-main:active {
  background: #DBEAFE;
}

/* Badges de Versión Visible y Botón de Recarga Forzada */
.app-version-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  background: #0071E3;
  color: #FFFFFF;
  padding: 3px 8px;
  border-radius: 8px;
  letter-spacing: 0.2px;
  margin-left: 6px;
  vertical-align: middle;
}

.btn-refresh-cache {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #EFF6FF;
  border: 1.5px solid #0071E3;
  color: #0071E3;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-refresh-cache:active {
  transform: scale(0.95);
  background: #DBEAFE;
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-import-revicasa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #EFF6FF;
  border: 1.5px solid #0071E3;
  color: #0071E3;
  font-size: 13px;
  font-weight: 800;
  padding: 0 14px;
  height: 52px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-import-revicasa:active {
  transform: scale(0.96);
  background: #DBEAFE;
}

/* ========================================================
   OPTIMIZACIÓN SAMSUNG GALAXY S25 ULTRA (120HZ LTPO & AMOLED VISION BOOSTER)
   ======================================================== */
.element-card, .thumb-dock, .home-card, .room-card, .chips-container {
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
}

/* S-Pen Stylus Focus Glow */
body.s-pen-active .rev-val-btn:hover,
body.s-pen-active .dock-btn-nav:hover {
  outline: 2px solid #0071E3;
}

/* Modo Exterior / Alto Contraste */
@media (prefers-contrast: more) {
  .rev-val-btn {
    border-width: 2.5px !important;
    font-weight: 800 !important;
  }
  .element-title-row h3 {
    color: #000000 !important;
  }
}
