/* ============================================================
   THEME CESTBER — Look de la página vieja (design system)
   Capa de override. Cargar SIEMPRE después del CSS del portal.
   ============================================================ */

/* ---- Fuentes reales del sistema viejo ---- */
@font-face {
  font-family: "TipGruesa";
  src: url("../fonts/BebasNeue-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "TipDelgada";
  src: url("../fonts/Montserrat-Light.ttf") format("truetype");
  font-display: swap;
}

/* ---- Paleta vieja, mapeada SOBRE las variables que ya usa el markup nuevo ---- */
:root {
  --ColorBase:  #0f1a20;
  --ColorBase2: #ff7b1c;
  --ColorBase2_2: #fdcf00;

  --bg-body:   #f4f6f9;
  --bg-card:   #ffffff;
  --bg-input:  #ffffff;
  --border:    #dee2e6;
  --text-main: #2a2a2a;
  --text-muted:#6c757d;

  --accent:        #fdcf00;
  --accent-hover:  #e5bb00;
  --primary:       #0f1a20;

  --success: #139f00;
  --warning: #df9b00;
  --danger:  #dc3545;
  --info:    #00bcbf;

  --radius: 8px;
}

/* ---- Base tipográfica global ---- */
body,
body.theme-dark {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: "TipDelgada", "Montserrat", "Roboto", sans-serif;
}

h1, h2, h3, h4, h5, h6,
.sidebar-header h2,
#titulo-modulo {
  font-family: "TipGruesa", "BebasNeue", sans-serif;
  font-weight: 500;
}

/* ===== CHROME (navegación) al look viejo ===== */
.sidebar {
  background: var(--ColorBase);
  border-right: 3px solid var(--ColorBase2);
  color: #fff;
}
.sidebar-header { border-bottom: 2px solid var(--ColorBase2); }
.sidebar-header h2 { color: #fff; }
.sidebar-header h2 span { color: var(--ColorBase2_2); }

.sidebar-menu a,
.nav-link,
.nav-btn {
  color: #e9ecef;
  font-family: "TipDelgada", sans-serif;
  border-radius: 5px;
}
.sidebar-menu a:hover,
.nav-link:hover,
.nav-link.active,
.nav-btn:hover,
.nav-btn.active {
  background: var(--ColorBase2);
  color: var(--ColorBase);
  font-weight: 700;
}

.topbar {
  background: var(--ColorBase);
  border-bottom: 2px solid var(--ColorBase2);
  color: #fff;
  padding: 12px 20px;
}
.topbar #titulo-modulo { color: #fff; }

.main-content,
.content-area { background: var(--bg-body); color: var(--text-main); }

/* ===== TARJETAS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0px 0px 10px -1px rgba(0,0,0,0.35);
  color: var(--text-main);
}
.header-actions { border-bottom: 1px solid var(--border); }
.header-actions h2, .card h2, .card h3 { color: var(--text-main); }

/* ===== BOTONES ===== */
.btn { border-radius: 5px; font-family: "TipDelgada", sans-serif; font-weight: 600; }
.btn-primary {
  background: var(--ColorBase);
  color: var(--ColorBase2_2);
  border: none;
}
.btn-primary:hover { background: #1b2b34; color: var(--ColorBase2_2); }

.btn-secondary {
  background: var(--ColorBase2);
  color: var(--ColorBase);
  border: none;
}
.btn-secondary:hover { background: var(--accent-hover); }

.btn-danger-outline { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger-outline:hover { background: rgba(220,53,69,0.1); }

/* ===== TABLAS ===== */
.table-modern { color: var(--text-main); }
.table-modern th {
  background: #f1f3f5;
  color: var(--text-main);
  border-bottom: 2px solid var(--border);
  font-family: "TipDelgada", sans-serif;
  font-weight: 700;
}
.table-modern td { color: var(--text-main); border-bottom: 1px solid var(--border); }
.table-modern tr:hover td { background: #f8f9fa; }

/* ===== FORMULARIOS ===== */
.form-control {
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.form-control:focus { border-color: var(--ColorBase); }
.form-control[readonly] { background: #f1f3f5; color: var(--text-muted); }
.form-group label { color: var(--text-muted); font-family: "TipDelgada", sans-serif; }
select.form-control option { color: var(--text-main); background: #fff; }

/* ===== MODALES ===== */
.modal-overlay { background: rgba(0,0,0,0.353); backdrop-filter: blur(5px); }
.modal-content, .modal-box, .modal-overlay .card {
  background: #fff;
  color: var(--text-main);
  border-radius: 8px;
  box-shadow: 0px 0px 11px 2px rgba(0,0,0,0.4);
}
.modal-content h2, .modal-content h3 { color: var(--text-main); font-family: "TipGruesa", sans-serif; }

/* ===== ESTADOS / BADGES ===== */
.text-success, .badge-success { color: var(--success); }
.text-danger,  .badge-danger  { color: var(--danger); }
.text-warning, .badge-warning { color: var(--warning); }
.text-info,    .badge-info    { color: var(--info); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; width: calc(100% - 200px); }
}
@media (max-width: 600px) {
  .sidebar { position: fixed; width: 100%; height: auto; flex-direction: row; overflow-x: auto; }
  .main-content { margin-left: 0; width: 100%; }
}

/* ============================================================
   LOGIN (login_v4): fondo OSCURO + formulario BLANCO + detalles amarillo/blanco
   Estas clases solo existen en las páginas de login, así que es seguro
   definirlas aquí (no afectan otros portales).
   ============================================================ */
body:has(.login-wrapper) {
  background-color: var(--ColorBase);            /* fondo oscuro */
}

/* Formulario: tarjeta blanca con texto oscuro */
.login-card {
  background: #ffffff;
  color: var(--text-main);
}
.login-card .brand-name { border-bottom-color: var(--ColorBase2); }   /* subrayado amarillo */
.login-card .brand-name,
.login-card .brand-welcome { color: var(--text-main); }
.login-card .brand-name span { color: var(--ColorBase2); }            /* acento amarillo */

.login-card .input-icon i { color: var(--ColorBase); }
.login-card .input-icon input {
  background: #f4f6f9;
  color: var(--text-main);
  border: 1px solid var(--border);
}
.login-card .login-footer a { color: var(--ColorBase); }

/* Botón: oscuro con texto amarillo (look viejo) */
.login-card .btn-submit { background: var(--ColorBase); color: var(--ColorBase2_2); }
.login-card .btn-submit:hover { background: #1b2b34; color: var(--ColorBase2_2); }

/* En pantallas chicas login_v4 ponía la tarjeta oscura; la mantenemos blanca */
@media (max-width: 530px) {
  .login-card { background: #ffffff; box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
  .login-card .brand-name { border-bottom-color: var(--ColorBase2); }
  .login-card .brand-name span { color: var(--ColorBase2); }
  .login-card .brand-welcome { color: var(--text-main); }
  .login-card .btn-submit { background: var(--ColorBase); color: var(--ColorBase2_2); }
  .login-card .login-footer a { color: var(--ColorBase); }
}

/* ============================================================
   PORTAL CLIENTES — afinar al look viejo (acento amarillo + contraste)
   El portal ya es claro con top-nav/hero oscuros; el theme cambió
   --accent a amarillo, así que aquí solo corregimos contrastes y acentos.
   Estas clases son propias del portal clientes (seguras a nivel global).
   ============================================================ */
/* Header principal NO sticky (se va hacia arriba al bajar); el sticky lo lleva el header de filtros. */
.top-nav { background: var(--ColorBase); border-bottom: 2px solid var(--ColorBase2); position: static; }

/* Contenido a ancho completo de la página (sin el tope de 1600px), con buen margen/padding. */
.main-container { max-width: none; padding: 30px 4%; }
.nav-brand { font-family: "TipGruesa", sans-serif; letter-spacing: 1px; color: #fff; }
.nav-brand span { color: var(--ColorBase2_2); }
.nav-subtitle { color: #cdd3d8; }

.hero-section { background: var(--ColorBase); border-bottom: 2px solid var(--ColorBase2); }

/* Filtros: activo amarillo con texto OSCURO (no blanco ilegible) */
.btn-filter:hover { border-color: var(--ColorBase); color: var(--ColorBase); }
.btn-filter.active {
  background: var(--ColorBase2);
  color: var(--ColorBase);
  border-color: var(--ColorBase2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Ficha técnica (zebra): filas alternas oscuras con texto blanco */
.lista-detalles li:nth-child(even) { background: var(--ColorBase); color: #fff; }
.lista-detalles li:nth-child(even) .lbl,
.lista-detalles li:nth-child(even) .val { color: #fff; }

/* Enlaces rápidos: hover oscuro (antes amarillo con texto blanco) */
.btn-enlace:hover { background: var(--ColorBase); color: #fff; border-color: var(--ColorBase); }

/* Botones de valuación */
.btn-val { background: rgba(15,26,32,0.06); color: var(--ColorBase); border-color: var(--border); }
.btn-val:hover { background: var(--ColorBase); color: var(--ColorBase2_2); }

/* CTA cuadro financiero: oscuro + amarillo */
.btn-cuadro-fin { background: var(--ColorBase); color: var(--ColorBase2_2); border-color: var(--ColorBase2); }
.btn-cuadro-fin:hover { background: var(--ColorBase2); color: var(--ColorBase); }

/* ============================================================
   CLIENTES — RÉPLICA EXACTA del portal viejo (valores reales de portales.css)
   OJO: los filtros generados por JS usan la clase .btn-filter-large
   (NO .btn-filter), y las tarjetas .obra-card-cliente / .obra-img-wrapper.
   ============================================================ */

/* Logo en la marca del nav (se agrega <img> en el HTML) */
.nav-brand img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; margin-right: 4px; }

/* Hero: foto cuadrada-redondeada (25%) + saludo amarillo como el viejo */
.hero-logo { border-radius: 25%; border: 3px solid var(--ColorBase2); }
.hero-title { color: var(--ColorBase2_2); font-size: 28px; font-family: "TipGruesa", sans-serif; letter-spacing: 1px; }
.hero-rif { color: #ffffff; }

/* Filtros = tabs amarillos grandes (.ItemSeleccionarObras del viejo) */
.filter-container {
  position: sticky; top: 0; z-index: 20;
  background: rgb(248,248,248);
  padding: 12px 10px; border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.btn-filter-large {
  background: var(--ColorBase2);
  color: var(--ColorBase);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 18px 34px;
  font-size: 19px;
  font-weight: 900;
  font-family: "TipDelgada", sans-serif;
  box-shadow: none;
}
.btn-filter-large .icon { font-size: 34px; }
.btn-filter-large .text { font-weight: 900; }
.btn-filter-large .badge { background: rgba(0,0,0,0.15); color: var(--ColorBase); }
.btn-filter-large:hover { background: #ffb303; transform: none; border-color: transparent; box-shadow: none; }
.btn-filter-large.active { background: #e24f00; color: #fff; border-color: #000; }
.btn-filter-large.active .badge { background: rgba(255,255,255,0.2); color: #fff; }

/* Grilla de OBRAS: tope de ancho y centrada (si hay pocas no se estiran gigantes;
   quedan a un tamaño cómodo y centradas). */
.grid-obras {
  grid-template-columns: repeat(auto-fill, minmax(320px, 400px));
  gap: 24px;
  justify-content: center;
  align-content: start;
}
.obra-card-cliente { border: none; border-radius: 8px; box-shadow: 0 0 10px -1px rgba(0,0,0,0.75); }
.obra-card-cliente:hover { border: none; box-shadow: 0 0 14px 0 rgba(0,0,0,0.6); transform: translateY(-4px); }
.obra-img-wrapper { height: 200px; }
.obra-img-wrapper img { border-radius: 8px; }
/* Nombre de la obra en la tarjeta (antes estaba inline a 1.15rem) */
.obra-nombre {
  font-family: "TipGruesa", sans-serif;
  font-size: 1.5rem;
  color: var(--text-main);
  margin: 0 0 10px 0;
  line-height: 1.1;
  word-break: break-word;
}

/* Badge de estatus sobre la imagen (color por clase, no inline) */
.obra-estatus-pos { position: absolute; bottom: 15px; left: 15px; z-index: 2; }
.obra-estatus-badge { color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.obra-estatus-badge.estatus-info     { background: var(--info); }
.obra-estatus-badge.estatus-warning  { background: var(--warning); }
.obra-estatus-badge.estatus-muted    { background: var(--text-muted); }
.obra-estatus-badge.estatus-success  { background: var(--success); }

/* Métricas (progreso físico / estatus de pago) */
.obra-metricas { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; border-top: 1px solid var(--border); padding-top: 15px; gap: 12px; }
.obra-metrica { flex: 1; }
.obra-metrica--right { flex: initial; text-align: right; }
.metrica-label { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 5px; }
.progreso-bar { width: 100%; max-width: 120px; height: 6px; background: var(--bg-body); border-radius: 3px; overflow: hidden; }
.progreso-fill { height: 100%; background: var(--success); width: var(--pct, 0%); }  /* solo el % viene del dato, vía variable CSS */
.pago-valor { font-size: 0.9rem; font-weight: bold; }
.pago-valor.pago-deuda { color: var(--danger); }
.pago-valor.pago-ok    { color: var(--success); }

/* Alertas en las tarjetas de carpeta */
.alerta-carpeta { padding: 6px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; display: inline-block; margin-top: 10px; }
.alerta-deuda    { background: rgba(220,53,69,0.15); color: var(--danger); margin-right: 5px; }
.alerta-urgencia { background: rgba(223,155,0,0.15); color: var(--warning); }

/* Mensajes de estado (cargando / vacío / error) */
.estado-vacio { grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--text-muted); }
.estado-vacio--card { background: var(--bg-card); border-radius: var(--radius); border: 1px dashed var(--border); }
.estado-error { grid-column: 1 / -1; text-align: center; padding: 20px; color: var(--danger); font-weight: bold; }

/* Vista de CARPETAS: tarjetas con tope de ancho, alineadas a la izquierda
   (si hay pocas no se estiran gigantes), icono y nombre más grandes. */
.grid-obras.vista-carpetas {
  grid-template-columns: repeat(auto-fill, minmax(300px, 360px));
  justify-content: center;
}
.carpeta-card {
  padding: 35px 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #eef1f4 100%);
  border-top: 5px solid var(--ColorBase2);
  min-height: 300px;
}
.carpeta-icono { font-size: 10rem; line-height: 1; margin-bottom: 12px; filter: drop-shadow(0 5px 8px rgba(0,0,0,0.25)); }
/* Ícono de carpeta en círculo (mismo estilo que el responsive, ahora también en escritorio).
   En móvil, el bloque @media de abajo lo achica. */
.carpeta-circulo {
  width: 180px; max-width: 80%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid var(--text-main);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.carpeta-circulo i { font-size: 5.5rem; color: var(--ColorBase2, var(--secondary)); }
.carpeta-nombre { margin: 0 0 6px 0; color: var(--text-main); font-family: "TipGruesa", sans-serif; font-size: 1.7rem; line-height: 1.05; }
.carpeta-conteo { color: var(--text-muted); margin: 0; font-size: 0.95rem; font-family: "TipDelgada", sans-serif; }
.carpeta-card .ContBtnObra { width: 100%; margin-top: 15px; }

/* Botón "Volver" del título de sección (al entrar a una carpeta) */
.btn-volver { margin-right: 15px; }

/* Botones dentro de la tarjeta (se agregan en el JS) */
.ContBtnObra { display: flex; justify-content: space-around; gap: 8px; padding: 5px 0; flex-wrap: wrap; }
.ContBtnObra a, .btn_ver_obr {
  padding: 10px 0; border-radius: 4px;
  background: var(--ColorBase); color: var(--ColorBase2_2);
  font-family: "TipDelgada", sans-serif; font-size: 16px;
  text-align: center; flex-grow: 1; cursor: pointer; text-decoration: none;
}
.ContBtnObra a:hover, .btn_ver_obr:hover { background: #1b2b34; }

/* Etiqueta de estado tipo .InfEstadoObra (esquina sup. der.) */
.InfEstadoObra {
  position: absolute; top: 5px; right: 0; z-index: 11;
  padding: 5px; font-size: 12px; background: #b8b8b8;
  font-family: "TipGruesa", sans-serif; border-radius: 4px 0 0 4px; letter-spacing: 1px;
}

/* Banda de información del cliente (se agrega en el HTML/JS) */
.informacion {
  padding: 20px 10px; background: var(--ColorBase);
  display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: wrap;
}
.cont_informacion { flex-grow: 1; display: flex; flex-direction: column; gap: 7px; }
.cont_informacion span { color: #fff; text-align: center; font-family: "TipDelgada", sans-serif; font-size: 13px; font-weight: 700; }
.cont_informacion p { margin: auto; color: #fff; text-align: center; font-family: "TipDelgada", sans-serif; font-size: 13px; }

/* Footer viejo (.colorfondo) */
.colorfondo {
  margin-top: 25px; background: var(--ColorBase);
  padding: 20px 5px 15px; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.contactanossiguenos { font-family: "TipGruesa", sans-serif; color: #fff; letter-spacing: 4px; font-size: 30px; }
.imagenes_footer { width: 80%; display: flex; justify-content: space-around; gap: 10px; flex-wrap: wrap; }
.imagenes_footer a { font-size: 40px; }
.imagenes_footer a i { color: var(--ColorIndv, #fff); }
.copyright { font-size: 16px; color: #fff; text-align: center; }

/* ===== FOOTER PEGADO AL FONDO (evita la franja blanca debajo del footer) =====
   En páginas que tienen footer (.colorfondo): el body ocupa al menos toda la
   ventana, el contenido principal crece y empuja el footer al fondo. Scoped con
   :has(.colorfondo) para NO afectar el login (que no tiene footer). */
body:has(.colorfondo) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 0;   /* anula el padding-bottom: 50px de cliente.css que dejaba la franja */
}
/* margin:0 auto de cliente.css, en un body flex-column, encoge y centra el contenedor
   cuando el contenido es corto. Forzamos ancho completo. */
body:has(.colorfondo) .main-container { flex: 1 0 auto; margin: 0; width: 100%; }
body:has(.colorfondo) .colorfondo { flex-shrink: 0; }

/* ============================================================
   CLIENTES · DETALLE DE OBRA — réplica del viejo (detallesObra)
   ============================================================ */
/* Panel de accesos = caja oscura como .ContBotones del viejo */
.panel-enlaces { background: var(--ColorBase); border: none; }
.panel-enlaces h4 { color: #fff; border-bottom-color: rgba(255,255,255,0.25); }

/* Botones de acceso amarillos (como .ContImgPresupu a del viejo) */
.btn-enlace {
  background: var(--ColorBase2); color: var(--ColorBase);
  border: none; border-radius: 10px;
  font-family: "TipDelgada", sans-serif; font-weight: 700;
}
.btn-enlace:hover { background: #b59300; color: var(--ColorBase); transform: none; }

/* Separador amarillo */
.separador { background: var(--ColorBase2); border: none; height: 2px; }

/* Botones de valuación amarillos */
.btn-val {
  background: var(--ColorBase2); color: var(--ColorBase);
  border: none; min-height: 40px;
  font-family: "TipDelgada", sans-serif; font-weight: 700;
}
.btn-val:hover { background: #b59300; color: var(--ColorBase); }

/* CTA cuadro financiero: amarillo como los demás del panel */
.btn-cuadro-fin { background: var(--ColorBase2); color: var(--ColorBase); border: 2px solid var(--ColorBase); }
.btn-cuadro-fin:hover { background: #b59300; color: var(--ColorBase); }

/* Tabs: activo amarillo + texto oscuro (en vez del azul nuevo) */
.tab-btn.active { background: var(--ColorBase2); color: var(--ColorBase); border: 1px solid var(--ColorBase); }
.tab-btn:hover { color: var(--ColorBase); }

/* Ficha técnica: etiquetas en negrita; panel claro con título oscuro */
.lista-detalles li .lbl { font-family: "TipDelgada", sans-serif; font-weight: 700; }
.col-ficha .info-panel h4 { color: var(--text-main); font-family: "TipGruesa", sans-serif; }

/* ----- Layout 3 columnas del detalle (idéntico a la página vieja) ----- */
.detalle-3col {
  display: grid;
  grid-template-columns: 26% 1fr 22%;
  gap: 1rem;
  background: #cdcdcd;
  border-radius: 10px;
  padding: 1rem;
  align-items: stretch;
}
.det-col-img { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.det-titulo-obra { font-family: "TipGruesa", sans-serif; font-size: 30px; color: #000; text-align: center; line-height: 1.05; letter-spacing: 1px; }
.det-imagen-obra { width: 100%; height: 100%; min-height: 260px; max-height: 480px; object-fit: cover; border-radius: 6px; }

/* Ficha zebra ocupa toda la columna central, sin borde exterior */
.det-ficha { border: none; border-radius: 8px; overflow: hidden; align-self: start; width: 100%; display: flex; height: 100%; flex-direction: column; }
.det-ficha li { padding: 12px 16px; font-size: 14px; gap: 1.5rem; flex-grow: 1;}

/* Panel oscuro de acciones (como .ContBotones del viejo) */
.det-panel-acciones {
  background: var(--ColorBase);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.det-acciones-top { display: flex; flex-direction: column; gap: 10px; }
.det-panel-acciones .btn-enlace,
.det-panel-acciones .btn-cuadro-fin { width: 100%; text-align: center; }
.det-valuaciones-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Botón flotante "Volver al detalle" (la barra de tabs está oculta) */
#btn_volver_detalle { align-items: center; gap: 6px; }

/* Detalle a pantalla completa (sin el max-width del main) */
.main-container:has(.detalle-3col) { max-width: 100%; padding: 1rem 1.5rem; }

/* ============================================================
   OPERADORES — consistencia con el look viejo
   ============================================================ */
.sidebar .brand { font-family: "TipGruesa", sans-serif; color: #fff; letter-spacing: 1px; }
.sidebar .brand span { color: var(--ColorBase2_2); }
.top-header { background: var(--ColorBase) !important; color: #fff; border-bottom: 2px solid var(--ColorBase2); }
.top-header h2 { color: #fff; }
.op-card { background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 0 10px -1px rgba(0,0,0,0.35); }
.op-header { border-bottom: 2px solid var(--ColorBase2); color: var(--text-main); font-family: "TipGruesa", sans-serif; }
.form-control-lg { background: #fff; color: var(--text-main); border: 1px solid var(--border); }
.form-control-lg:focus { border-color: var(--ColorBase); box-shadow: none; background: #fff; }
.table-touch th { color: var(--text-main); border-bottom: 1px dashed var(--border); font-family: "TipDelgada", sans-serif; }
.table-touch td { background: #f8f9fa; color: var(--text-main); }
.input-label { color: var(--text-muted); }

@media (max-width: 900px) {
  .detalle-3col { grid-template-columns: 1fr; }
  .det-imagen-obra { max-height: 300px; }
}

/* ============================================================
   CLIENTES · DETALLE — contenido de pestañas (galería, documentos, tablas)
   Estilos claros y cómodos; reemplazan al CSS que antes iba inline en el JS.
   ============================================================ */
/* Títulos de sección */
.galeria-titulo, .docs-titulo {
  color: var(--text-main);
  font-family: "TipGruesa", sans-serif;
  font-size: 1.4rem;
  margin: 25px 0 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ColorBase2);
}
.galeria-titulo:first-child { margin-top: 0; }
.galeria-vacio { color: var(--text-muted); padding: 10px 0 25px; }

/* Cada sección de la galería (memoria / fotos / videos) se muestra por separado
   según el botón; verGaleria() oculta las demás con .oculto. */
.galeria-seccion .galeria-titulo, .docs-seccion .docs-titulo { margin-top: 0; }
.galeria-seccion.oculto, .docs-seccion.oculto { display: none; }

/* Tarjeta contenedora de cada pestaña: padding cómodo (antes no tenía → contenido pegado al borde) */
.tab-content > .card { padding: 24px 28px; }

/* Grilla de fotos */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.galeria-grid--video { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.galeria-item {
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform .25s ease, box-shadow .25s ease;
}
.galeria-item:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.galeria-thumb { width: 100%; height: 220px; object-fit: cover; display: block; cursor: zoom-in; }
.galeria-video { width: 100%; height: 200px; object-fit: cover; display: block; background: #000; }
.galeria-fecha { padding: 10px; font-size: 0.8rem; color: var(--text-muted); text-align: center; }

/* Documentos */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.doc-card {
  display: flex; align-items: center; gap: 15px;
  padding: 16px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all .25s ease; text-decoration: none;
}
.doc-card:hover { border-color: var(--ColorBase2); box-shadow: 0 6px 16px rgba(0,0,0,0.12); transform: translateY(-2px); }
.doc-icono { font-size: 2.4rem; }
.doc-nombre { color: var(--text-main); font-weight: bold; font-size: 0.95rem; }
.doc-fecha { color: var(--text-muted); font-size: 0.78rem; }

/* Tablas (valuaciones / premium) — sobre .table-modern */
.tabla-scroll { overflow-x: auto; }
.table-modern .tabla-vacia { text-align: center; padding: 20px; color: var(--text-muted); }
.table-modern .col-monto { text-align: right; font-weight: bold; }
.table-modern .col-monto--ok { color: var(--success); }
.table-modern .fila-total td { background: rgba(253,207,0,0.18); font-weight: bold; color: var(--ColorBase); }
.table-modern .fila-total td:last-child { font-size: 1.05rem; }
.panel-premium h4 { color: var(--text-main); font-family: "TipGruesa", sans-serif; border-bottom: 2px solid var(--ColorBase2); padding-bottom: 8px; }

/* Placeholder "Sin valuaciones" (panel oscuro) */
.val-vacio { color: #fff; font-size: 0.85rem; grid-column: 1 / -1; text-align: center; margin: 0; }

/* Bloqueo premium (contrato clásico) */
.bloqueo-premium { background: var(--bg-card); border-radius: var(--radius); border: 1px dashed var(--border); padding: 60px 20px; text-align: center; }
.bloqueo-icono { font-size: 3.5rem; margin-bottom: 15px; opacity: 0.85; }
.bloqueo-titulo { color: var(--text-main); margin: 0 0 10px 0; font-size: 1.5rem; font-family: "TipGruesa", sans-serif; }
.bloqueo-texto { color: var(--text-muted); max-width: 600px; margin: 0 auto 25px auto; line-height: 1.6; }

/* ============================================================
   MÓVIL · Filtros de estatus de obra (portafolio del cliente)
   En escritorio el header de filtros es sticky y los botones son
   grandes; en pantallas chicas eso quedaba pegado arriba y tapaba
   casi toda la vista. En móvil lo convertimos en una SECCIÓN normal
   (no sticky) con botones compactos en grilla, visibles de un vistazo
   y fáciles de tocar, sin robar espacio al listado de obras.
   ============================================================ */
@media (max-width: 768px) {
  .filter-container {
    position: static;            /* deja de ser sticky: ya no tapa la pantalla */
    top: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px;
    margin-bottom: 18px;
    background: rgb(248, 248, 248);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  }

  .btn-filter-large {
    flex-direction: column;       /* icono arriba, texto y contador debajo */
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 8px;
    font-size: 0.72rem;
    text-align: center;
    min-width: 0;                 /* permite que encojan dentro de la grilla */
  }

  .btn-filter-large:hover { transform: none; box-shadow: none; }
  .btn-filter-large .icon { font-size: 20px; }
  .btn-filter-large .text { font-size: 0.72rem; font-weight: 800; line-height: 1.1; }
  .btn-filter-large .badge { font-size: 0.72rem; padding: 1px 8px; }
}

/* Pantallas muy angostas: 2 columnas para que el texto no se apriete. */
@media (max-width: 380px) {
  .filter-container { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   MÓVIL · Pantallas internas del portafolio del cliente.
   - Carpetas: grilla de 2 columnas con tarjetas compactas
     (círculo + ícono de carpeta + nombre).
   - Obras: tarjetas horizontales (foto circular + datos + precio + estatus).
   - Barra "Atrás" y encabezado dinámico del filtro.
   Réplica de ejemplo_portal_cliente_carpetas / _obras.
   ============================================================ */
@media (max-width: 768px) {

  /* Barra superior "Atrás / Cerrar sesión" (el JS la muestra en flex) */
  #barra-atras {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 10px 2px 4px;
  }
  .barra-atras-btn {
    background: transparent; border: none;
    color: var(--text-main); font-size: 1rem; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    font-family: "TipDelgada", sans-serif;
  }

  /* Encabezado del filtro ("TUS OBRAS PAGADAS" + "Elije tu búsqueda") */
  #encabezado-resultados { margin: 4px 0 18px; }
  #titulo-filtro {
    font-family: "TipGruesa", sans-serif;
    font-size: 1.6rem; text-transform: uppercase; font-weight: 800;
    color: var(--text-main); border-bottom: none; margin: 0;
  }
  #subtitulo-resultados {
    text-align: center; color: var(--text-main);
    font-weight: 600; margin: 6px 0 0; font-size: 1rem;
  }

  /* ----- Carpetas: 2 columnas, tarjetas compactas ----- */
  .grid-obras.vista-carpetas {
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
    justify-content: stretch !important;
  }
  .carpeta-card-m {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    padding: 16px 10px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    cursor: pointer; min-height: 0;
  }
  .carpeta-circulo {
    width: 130px; max-width: 75%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px solid var(--text-main);
    display: flex; align-items: center; justify-content: center;
  }
  .carpeta-circulo i { font-size: 3.6rem; color: var(--ColorBase2, var(--secondary)); }
  .carpeta-nombre-m {
    font-family: "TipDelgada", sans-serif;
    font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
    color: var(--text-main); text-align: center; line-height: 1.2;
    word-break: break-word;
  }

  /* ----- Obras: tarjetas horizontales ----- */
  .grid-obras {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    justify-content: stretch !important;
  }
  .obra-card-m {
    display: flex; gap: 12px; align-items: center;
    background: #fff; border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    padding: 14px; cursor: pointer;
  }
  .obra-m-thumb { flex: 0 0 92px; }
  .obra-m-thumb img {
    width: 92px; height: 92px; border-radius: 50%;
    object-fit: cover; border: 1px solid var(--border);
  }
  .obra-m-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
  .obra-m-row { display: flex; gap: 8px; align-items: flex-start; }
  .obra-m-row i { color: var(--ColorBase2, var(--secondary)); margin-top: 3px; flex-shrink: 0; }
  .obra-m-nombre { font-weight: 700; color: var(--text-main); font-size: 0.9rem; line-height: 1.25; }
  .obra-m-dir { color: var(--text-muted); font-size: 0.82rem; line-height: 1.2; }
  .obra-m-precio {
    font-family: "TipGruesa", sans-serif; font-weight: 800;
    color: var(--text-main); font-size: 1.25rem; margin-top: 2px;
  }
  .obra-m-estatus {
    align-self: flex-end; display: flex; align-items: center; gap: 6px;
    font-style: italic; font-weight: 700; font-size: 0.85rem; margin-top: 2px;
  }
  .obra-m-estatus.est-success { color: var(--success); }
  .obra-m-estatus.est-warning { color: var(--warning); }
  .obra-m-estatus.est-muted   { color: var(--text-muted); }
  .obra-m-estatus.est-info    { color: var(--info); }
}


