/* ==========================================================================
   COTIZAPY — MÓDULO CONTROL DE OBRAS (DENTRO DE COTIZAPY OS)
   Soporta Modo Claro y Modo Oscuro (html[data-os-theme="dark"])
   ========================================================================== */

.obras-app-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 1.25rem 2.25rem;
  max-width: 1260px;
  margin: 0 auto;
  width: 100%;
  color: var(--text-primary);
}

/* Top Bar */
.obras-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-card);
}

.obras-topbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 320px;
}

.obras-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 240px;
  min-width: 200px;
}

.obras-select {
  width: 100%;
  max-width: 380px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--text-primary);
}

.obras-topbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.obras-tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.obras-tier-pill.is-pro {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.obras-tier-pill.is-demo {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.obras-google-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.72rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.obras-google-pill:hover {
  border-color: #2563eb;
  color: #1d4ed8;
}
.obras-google-pill.is-connected {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
}

/* Demo upsell banner */
.obras-demo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: linear-gradient(95deg, rgba(245, 158, 11, 0.14), rgba(30, 58, 138, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.84rem;
}

/* Obra Hero Summary Header */
.obras-hero-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #f8fafc;
  border-radius: 12px;
  padding: 1.1rem 1.35rem;
}

.obras-hero-info h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.15rem 0 0.25rem;
  color: #ffffff;
}
.obras-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.8rem;
  color: #cbd5e1;
}
.obras-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.obras-status-badge.st-en-ejecucion { background: rgba(16, 185, 129, 0.25); color: #a7f3d0; }
.obras-status-badge.st-pausada { background: rgba(245, 158, 11, 0.3); color: #fde68a; }
.obras-status-badge.st-finalizada { background: rgba(56, 189, 248, 0.28); color: #bae6fd; }

.obras-hero-progress {
  min-width: 210px;
  flex: 0 1 280px;
}
.obras-hero-pct-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
}
.obras-hero-pct-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #34d399;
}
.obras-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
}
.obras-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #10b981);
  transition: width 0.25s ease;
}
.obras-progress-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.5px;
  background: #fde047;
  box-shadow: 0 0 6px rgba(253, 224, 71, 0.9);
}

/* Sub-tabs Navigation */
.obras-subnav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.35rem;
  padding: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  scrollbar-width: thin;
}

.obras-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.obras-subtab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.obras-subtab-btn.active {
  background: #1e3a8a;
  color: #ffffff;
}
.obras-subtab-btn.is-private-tab.active {
  background: #7c2d12;
  color: #ffffff;
}
.obras-pill-count {
  font-size: 0.7rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
}
.obras-subtab-btn.active .obras-pill-count {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}
.obras-pill-alert {
  background: #dc2626 !important;
  color: #ffffff !important;
}

/* Cards & Grids */
.obras-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}
.obras-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.95rem 1.05rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.obras-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.obras-kpi-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}
.obras-kpi-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.obras-kpi-card.is-private {
  border-left: 4px solid #b45309;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), var(--bg-surface));
}
.obras-kpi-card.is-positive .obras-kpi-value { color: #059669; }
.obras-kpi-card.is-negative .obras-kpi-value { color: #dc2626; }

.obras-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow-card);
}
.obras-panel-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
}
.obras-panel-hdr h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}
.obras-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1rem;
}

/* Forms inside Obras */
.obras-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.65rem;
  align-items: end;
}
.obras-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.obras-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.obras-field input,
.obras-field select,
.obras-field textarea {
  padding: 0.48rem 0.65rem;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
}

/* Tables */
.obras-table-wrap {
  overflow-x: auto;
  width: 100%;
}
.obras-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.obras-table th,
.obras-table td {
  padding: 0.58rem 0.65rem;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: middle;
}
.obras-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  white-space: nowrap;
}
.obras-table td.num,
.obras-table th.num {
  text-align: right;
  white-space: nowrap;
}

/* Progress / Gantt Bars */
.obras-cap-card {
  border: 1px solid var(--border-light);
  border-radius: 9px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: var(--bg-surface);
}
.obras-cap-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.72rem 0.9rem;
  background: var(--bg-subtle);
  cursor: pointer;
}
.obras-cap-bar-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 220px;
  flex: 1 1 260px;
}
.obras-mini-track {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
  position: relative;
}
.obras-mini-fill {
  height: 100%;
  border-radius: 999px;
  background: #10b981;
  transition: width 0.2s ease;
}
.obras-rubro-slider {
  width: 115px;
  accent-color: #1e3a8a;
  cursor: pointer;
}

/* Gantt vs Real visual timeline */
.obras-gantt-row {
  display: grid;
  grid-template-columns: minmax(150px, 230px) 1fr 62px;
  gap: 0.65rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 0.8rem;
}
.obras-gantt-lane {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-subtle);
  overflow: hidden;
}
.obras-gantt-plan {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 5px;
  background: rgba(30, 58, 138, 0.24);
  border: 1px solid rgba(30, 58, 138, 0.5);
  overflow: hidden;
}
.obras-gantt-real {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
}
.obras-gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  z-index: 2;
}

/* Photo Gallery & Bitácora */
.obras-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.75rem;
}
.obras-photo-card {
  border: 1px solid var(--border-light);
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
}
.obras-photo-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #0f172a;
  cursor: zoom-in;
  display: block;
}
.obras-photo-meta {
  padding: 0.5rem 0.6rem;
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.obras-provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
  width: fit-content;
}
.obras-provider-badge.p-gphotos { background: rgba(37, 99, 235, 0.14); color: #1d4ed8; }
.obras-provider-badge.p-gdrive { background: rgba(16, 185, 129, 0.14); color: #047857; }
.obras-provider-badge.p-blob { background: rgba(100, 116, 139, 0.16); color: #334155; }
.obras-provider-badge.p-local { background: rgba(245, 158, 11, 0.16); color: #92400e; }

.obras-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.obras-bitacora-item {
  border: 1px solid var(--border-light);
  border-left: 4px solid #1e3a8a;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  background: var(--bg-surface);
}
.obras-bitacora-item.is-incidencia {
  border-left-color: #dc2626;
}

/* Badges */
.obras-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.obras-badge.ok { background: rgba(16, 185, 129, 0.16); color: #047857; }
.obras-badge.warn { background: rgba(245, 158, 11, 0.18); color: #92400e; }
.obras-badge.danger { background: rgba(220, 38, 38, 0.15); color: #b91c1c; }
.obras-badge.info { background: rgba(37, 99, 235, 0.14); color: #1d4ed8; }

/* Portal & Field Link Share Box */
.obras-link-box {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  margin: 0.5rem 0;
}
.obras-link-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--text-primary);
  min-width: 0;
}
.obras-switch-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.obras-switch-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  font-size: 0.82rem;
  cursor: pointer;
}

/* Private warning banner */
.obras-private-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  background: rgba(180, 83, 9, 0.12);
  border: 1px solid rgba(180, 83, 9, 0.35);
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
}

/* Lightbox / Preview Modal inside Obras */
.obras-dialog {
  max-width: 920px;
  width: 95vw;
  max-height: 90vh;
  margin: auto;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0;
  background: var(--bg-surface);
  color: var(--text-primary);
  overflow: hidden;
}
.obras-dialog::backdrop {
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(4px);
}
.obras-dialog-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
}
.obras-dialog-body {
  padding: 1rem 1.15rem;
  overflow-y: auto;
  max-height: calc(90vh - 60px);
}

/* Dark theme adaptations */
html[data-os-theme="dark"] .obras-app-root,
html[data-os-theme="dark"] .obras-dialog {
  --bg-surface: #111827;
  --bg-page: #0b1120;
  --bg-subtle: #1e293b;
  --border-light: rgba(148, 163, 184, 0.22);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
}
html[data-os-theme="dark"] .obras-tier-pill.is-pro { color: #6ee7b7; }
html[data-os-theme="dark"] .obras-tier-pill.is-demo { color: #fde68a; }
html[data-os-theme="dark"] .obras-google-pill.is-connected { color: #93c5fd; }
html[data-os-theme="dark"] .obras-private-banner { color: #fde68a; }
html[data-os-theme="dark"] .obras-badge.ok { color: #6ee7b7; }
html[data-os-theme="dark"] .obras-badge.warn { color: #fde68a; }
html[data-os-theme="dark"] .obras-badge.danger { color: #fca5a5; }
html[data-os-theme="dark"] .obras-badge.info { color: #93c5fd; }

@media (max-width: 768px) {
  .obras-app-root {
    padding: 0.65rem 0.65rem 4.5rem;
  }
  .obras-gantt-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

/* ==========================================================================
   PACK VISUAL EJECUTIVO: ANILLO, SEMÁFORO, CURVA S, DONA, ANTES/DESPUÉS, DROPZONE
   ========================================================================== */
.obras-hero-right-cluster {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}
.obras-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  margin-left: 0.4rem;
}
.obras-health-pill.hl-ok { background: rgba(16, 185, 129, 0.24); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.45); }
.obras-health-pill.hl-warn { background: rgba(245, 158, 11, 0.28); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.5); }
.obras-health-pill.hl-danger { background: rgba(239, 68, 68, 0.28); color: #fecaca; border: 1px solid rgba(239, 68, 68, 0.55); }

.obras-scurve-wrap {
  width: 100%;
}
.obras-scurve-svg {
  width: 100%;
  height: auto;
  max-height: 225px;
  display: block;
}
.obras-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}
.obras-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.obras-chart-legend i,
.obras-donut-leg-row i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Cost Donut */
.obras-donut-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem;
}
.obras-donut-legend {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}
.obras-donut-leg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}
.obras-donut-leg-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Before / After Interactive Slider */
.obras-ba-card {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface);
}
.obras-ba-hdr {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  background: var(--bg-subtle);
  font-size: 0.85rem;
}
.obras-ba-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}
.obras-ba-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 410px;
  overflow: hidden;
  background: #0f172a;
  user-select: none;
}
.obras-ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.obras-ba-before-clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--ba-pos, 50%)) 0 0);
}
.obras-ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ba-pos, 50%);
  width: 3px;
  margin-left: -1.5px;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 3;
}
.obras-ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.obras-ba-tag {
  position: absolute;
  bottom: 10px;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.76);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  z-index: 4;
  pointer-events: none;
}
.obras-ba-tag.tag-left { left: 10px; }
.obras-ba-tag.tag-right { right: 10px; }
.obras-ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 5;
  margin: 0;
}

/* Drag & Drop Photo Zone */
.obras-dropzone {
  border: 2px dashed rgba(37, 99, 235, 0.4);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  background: rgba(37, 99, 235, 0.04);
  cursor: pointer;
  transition: all 0.16s ease;
}
.obras-dropzone.is-dragover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  transform: scale(1.005);
}
.obras-drop-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.6rem;
}
.obras-drop-previews img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.obras-photo-role-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.2rem;
}
.obras-role-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.42rem;
  border-radius: 5px;
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--text-secondary);
  cursor: pointer;
}
.obras-role-chip.is-active {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}

/* ==========================================================================
   V2 UX: TABLERO MULTI-OBRA, BARRA ACCIÓN RÁPIDA, MATERIALES & TARJETAS MÓVIL
   ========================================================================== */
.obras-quick-strip {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  align-items: center;
}
.obras-quick-strip-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: 0.25rem;
}
.obras-qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.14s ease;
}
.obras-qa-btn:hover {
  border-color: #2563eb;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
}
.obras-qa-btn.qa-pdf {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.38);
  color: #047857;
}
html[data-os-theme="dark"] .obras-qa-btn.qa-pdf { color: #6ee7b7; }

/* Multi-Obra Portfolio Grid */
.obras-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 0.95rem;
}
.obras-portfolio-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.obras-portfolio-card:hover {
  transform: translateY(-2px);
  border-color: #2563eb;
}
.obras-portfolio-card.is-selected {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.obras-pc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.obras-pc-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.obras-pc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  font-size: 0.78rem;
  background: var(--bg-page);
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
}
.obras-pc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

/* Google Photos Album Banner inside Bitácora */
.obras-gphotos-album-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: linear-gradient(100deg, rgba(37, 99, 235, 0.1), rgba(16, 185, 129, 0.1));
  border: 1px solid rgba(37, 99, 235, 0.3);
}

/* Mobile Responsive Card-Tables (Zero Horizontal Scroll on Phones) */
@media (max-width: 768px) {
  .obras-table.obras-mobile-cards thead {
    display: none;
  }
  .obras-table.obras-mobile-cards,
  .obras-table.obras-mobile-cards tbody,
  .obras-table.obras-mobile-cards tr,
  .obras-table.obras-mobile-cards td {
    display: block;
    width: 100%;
  }
  .obras-table.obras-mobile-cards tr {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.65rem;
    background: var(--bg-page);
  }
  .obras-table.obras-mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.32rem 0;
    border-bottom: 1px dashed var(--border-light);
    text-align: right;
  }
  .obras-table.obras-mobile-cards td:last-child {
    border-bottom: none;
  }
  .obras-table.obras-mobile-cards td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: left;
    flex-shrink: 0;
  }
  .obras-table.obras-mobile-cards td.num {
    text-align: right;
  }
}
