/* InmoAdmin — estilos
   Paleta: tinta azul profundo (#1B2A41), latón (#C8963E), papel (#F7F5F0),
   grafito (#3B4254), verde estado (#2E7D5B), rojo aviso (#B5402E) */

:root {
  --tinta: #0A0A0A;
  --tinta-suave: #1A1A1A;
  --laton: #000000;
  --papel: #FAFAFA;
  --blanco: #FFFFFF;
  --grafito: #404040;
  --linea: #E5E5E5;
  --verde: #171717;
  --rojo: #DC2626;
  --ambar: #525252;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  color: var(--grafito);
  background: var(--papel);
  display: flex;
  min-height: 100vh;
}

/* ----- Barra lateral ----- */
.lateral {
  width: 230px;
  background: var(--tinta);
  color: #cfd6e2;
  display: flex;
  flex-direction: column;
  padding: 24px 0 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  overflow: hidden;
}

.marca {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  padding: 0 24px 18px;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.marca::after {
  content: '';
  display: block;
  width: 28px;
  height: 3px;
  background: #fff;
  margin-top: 8px;
}
.marca.grande { font-size: 32px; padding: 0 0 8px; }

.menu { display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; padding-bottom: 8px; }
.menu::-webkit-scrollbar { width: 6px; }
.menu::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

.menu-item {
  display: block;
  color: #bdbdbd;
  text-decoration: none;
  padding: 11px 24px;
  font-weight: 500;
  font-size: 14.5px;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.menu-item:hover { background: #1a1a1a; color: #fff; }
.menu-item.on {
  background: #1a1a1a;
  color: #fff;
  border-left-color: #fff;
}

/* Cabecera de grupo desplegable */
.menu-cab {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6b6b6b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 14px 24px 8px;
}
.menu-cab:hover { color: #aaa; }
.menu-cab .flecha { font-size: 11px; transition: transform .2s; }
.menu-grupo.abierto .menu-cab .flecha { transform: rotate(180deg); }

/* Sub-items: ocultos por defecto, visibles si el grupo está abierto */
.menu-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.menu-grupo.abierto .menu-sub { max-height: 300px; }

.lateral-pie {
  padding: 16px 24px 0;
  border-top: 1px solid var(--tinta-suave);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lateral-pie a { color: var(--laton); text-decoration: none; }
.lateral-pie a:hover { text-decoration: underline; }

/* ----- Contenido ----- */
.contenido { flex: 1; padding: 36px 44px; max-width: 1200px; }

.titulo-pagina {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 30px;
  color: var(--tinta);
  margin-bottom: 28px;
}

/* ----- Tarjetas de métricas ----- */
.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.tarjeta {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 10px;
  padding: 20px 22px;
}
.tarjeta .dato {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--tinta);
}
.tarjeta .etiqueta { font-size: 13px; color: #7a8194; margin-top: 4px; }

/* ----- Bloques y tablas ----- */
.bloque {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 10px;
  padding: 24px 26px;
  margin-bottom: 24px;
}
.bloque h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 19px;
  color: var(--tinta);
  margin-bottom: 16px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #8a8f9e;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 2px solid var(--linea);
}
td { padding: 10px; border-bottom: 1px solid var(--linea); vertical-align: top; }
tr:last-child td { border-bottom: none; }

.acciones a { color: var(--tinta); font-weight: 500; margin-right: 10px; font-size: 13px; }
.acciones a:hover { color: var(--laton); }

.vacio { color: #8a8f9e; font-style: italic; padding: 8px 0; }

/* ----- Pills de estado ----- */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.pill.ocupada, .pill.activo, .pill.resuelto, .pill.pagado, .pill.baja { background: #e3f0ea; color: var(--verde); }
.pill.disponible, .pill.media, .pill.en.proceso, .pill.en_proceso { background: #ece9f5; color: #5b4f9e; }
.pill.mantenimiento, .pill.alta, .pill.vencido, .pill.abierto { background: #f7ecd8; color: var(--ambar); }
.pill.urgente, .pill.terminado { background: #f6e3df; color: var(--rojo); }

/* ----- Formularios ----- */
.formulario label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--grafito);
  margin-bottom: 14px;
  flex: 1;
}
.formulario .fila { display: flex; gap: 16px; flex-wrap: wrap; }
.formulario .fila label { min-width: 180px; }

input, select, textarea {
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--linea);
  border-radius: 7px;
  background: var(--papel);
  color: var(--grafito);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--laton);
  outline-offset: 1px;
  border-color: var(--laton);
}

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 7px;
  border: 1px solid var(--linea);
  background: var(--blanco);
  color: var(--tinta);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--laton); }
.btn.primario { background: var(--tinta); color: var(--blanco); border-color: var(--tinta); }
.btn.primario:hover { background: var(--tinta-suave); }
.btn.chico { padding: 5px 12px; font-size: 13px; }
.btn.ancho { width: 100%; }

.filtros { display: flex; gap: 8px; margin-bottom: 16px; }
.filtros a {
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--grafito);
  border: 1px solid var(--linea);
}
.filtros a.on { background: var(--tinta); color: var(--blanco); border-color: var(--tinta); }

/* ----- Login ----- */
.cuerpo-login {
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(160deg, var(--tinta) 0%, var(--tinta) 45%, transparent 45.2%),
    var(--papel);
}
.caja-login {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 14px;
  padding: 40px 38px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 18px 50px rgba(27,42,65,.25);
}
.caja-login .marca { color: var(--tinta); }
.sub-login { color: #8a8f9e; font-size: 14px; margin: 4px 0 24px; }
.caja-login label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 500; margin-bottom: 16px;
}
.alerta {
  background: #f6e3df;
  color: var(--rojo);
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alerta.ok { background: #e3f0ea; color: var(--verde); }

/* ----- Galería de documentos ----- */
.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.ficha {
  border: 1px solid var(--linea);
  border-radius: 10px;
  overflow: hidden;
  background: var(--papel);
}
.ficha img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
.ficha .doc-icono {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 130px;
  font-size: 44px;
  text-decoration: none;
  background: var(--blanco);
}
.ficha-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
}
.ficha-info strong { font-size: 13.5px; color: var(--tinta); }
.ficha-info span { color: #8a8f9e; }
.ficha-info .eliminar { color: var(--rojo); text-decoration: none; font-weight: 500; margin-top: 4px; }
.ficha-info .eliminar:hover { text-decoration: underline; }

/* ----- Botón WhatsApp ----- */
.btn.wa { background: #1f8a5b; color: var(--blanco); border-color: #1f8a5b; }
.btn.wa:hover { background: #176e48; }

.ayuda { font-size: 13.5px; color: #8a8f9e; margin-bottom: 14px; }

/* ----- Responsive ----- */
@media (max-width: 760px) {
  body { flex-direction: column; }
  .lateral { width: 100%; height: auto; position: static; padding: 16px 0; }
  .lateral nav { flex-direction: row; flex-wrap: wrap; padding: 0 12px; }
  .lateral nav a { border-left: none; border-bottom: 2px solid transparent; padding: 8px 12px; }
  .lateral nav a.on { border-bottom-color: var(--laton); }
  .contenido { padding: 20px 16px; }
  .formulario .fila { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ----- Firma de contratos ----- */
.cuerpo-firma {
  display: block;
  background: var(--papel);
}
.hoja {
  background: var(--blanco);
  max-width: 720px;
  margin: 30px auto;
  padding: 40px 44px;
  border: 1px solid var(--linea);
  border-radius: 12px;
}
.contrato-texto {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--grafito);
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: 8px;
  padding: 24px 26px;
  max-height: 440px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.firma-zona {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 16px;
}
#lienzo {
  border: 2px dashed var(--linea);
  border-radius: 8px;
  background: var(--blanco);
  width: 100%;
  max-width: 600px;
  touch-action: none;
  cursor: crosshair;
}
.checkbox {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px !important;
  font-size: 14px !important;
  font-weight: 400 !important;
}
.checkbox input { width: auto; margin-top: 3px; }
code {
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12.5px;
}

/* ----- Aviso de categoría de contrato ----- */
.aviso-categoria {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}
.aviso-categoria.vivienda { background: #e3f0ea; color: var(--verde); }
.aviso-categoria.comercial { background: #f7ecd8; color: var(--ambar); }

/* ----- Botón grande de envío WhatsApp ----- */
.btn.grande-wa {
  font-size: 16px;
  padding: 14px 26px;
  display: inline-block;
}

/* ----- Chips de reglas de prioridad ----- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
}
.chip a {
  color: var(--rojo);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}
.chip a:hover { color: #8a1f12; }

/* ----- Tarjetas de propiedades por tipo ----- */
.props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 260px));
  gap: 20px;
  margin-bottom: 10px;
  justify-content: start;
}
.prop-card {
  border: 1px solid var(--linea);
  border-radius: 14px;
  overflow: hidden;
  background: var(--blanco);
  transition: box-shadow .15s, transform .15s;
  max-width: 260px;
}
.prop-card:hover { box-shadow: 0 8px 24px rgba(27,42,65,.12); transform: translateY(-2px); }
.prop-foto { position: relative; height: 160px; background: var(--papel); }
.prop-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prop-sinfoto {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: #b3b8c4; font-size: 14px; font-style: italic;
}
.prop-estado {
  position: absolute; top: 10px; right: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.prop-info {
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: center;
  align-items: center;
}
.prop-info strong { font-size: 15px; color: var(--tinta); line-height: 1.3; }
.prop-info span {
  font-size: 13px;
  color: #7a8194;
  width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.4;
}
.prop-canon { color: var(--laton) !important; font-weight: 700; font-size: 15px !important; margin-top: 2px; }
.prop-info .acciones { margin-top: 10px; display: flex; gap: 14px; justify-content: center; }

/* Pestañas por tipo de propiedad — estilo píldora moderno */
.tabs-tipo { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.tab-tipo {
  font: inherit; font-weight: 600; font-size: 15px;
  background: var(--papel);
  border: 1.5px solid var(--linea);
  cursor: pointer;
  color: var(--grafito);
  padding: 11px 22px;
  border-radius: 999px;
  transition: all .15s;
}
.tab-tipo:hover { border-color: var(--laton); color: var(--tinta); }
.tab-tipo.on {
  background: var(--tinta);
  color: var(--blanco);
  border-color: var(--tinta);
  box-shadow: 0 3px 10px rgba(27,42,65,.20);
}

/* ----- Centro de notificaciones del panel ----- */
.notis { display: flex; flex-direction: column; gap: 10px; }
.noti {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--linea);
  background: var(--papel);
  border-left: 4px solid var(--linea);
}
.noti.urg-0 { border-left-color: var(--rojo); background: #fdf3f1; }
.noti.urg-1 { border-left-color: var(--ambar); background: #fdf8ef; }
.noti.urg-2 { border-left-color: var(--tinta); }
.noti-icono { font-size: 20px; flex-shrink: 0; }
.noti-texto { flex: 1; font-size: 14px; line-height: 1.45; }
.noti .btn { flex-shrink: 0; }
@media (max-width: 620px) {
  .noti { flex-wrap: wrap; }
  .noti-texto { flex-basis: 100%; }
}

.prop-carac { font-size: 12px !important; color: #9aa0ad !important; }

/* ----- Portal del inquilino: opciones de acción ----- */
.opciones-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.opcion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  font: inherit;
  font-size: 26px;
  background: var(--papel);
  border: 1.5px solid var(--linea);
  border-radius: 14px;
  cursor: pointer;
  color: var(--tinta);
  transition: all .15s;
}
.opcion-btn span { font-size: 13px; font-weight: 600; }
.opcion-btn:hover {
  border-color: var(--laton);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27,42,65,.10);
}
@media (max-width: 480px) {
  .opciones-grid { grid-template-columns: 1fr; }
  .opcion-btn { flex-direction: row; justify-content: center; font-size: 20px; }
}

/* ============================================
   REFINAMIENTOS MINIMALISTAS NEGRO Y BLANCO
   ============================================ */

/* Pills de estado: minimalistas, con borde en vez de color fuerte */
.pill {
  background: var(--blanco) !important;
  border: 1px solid var(--linea);
  color: var(--grafito) !important;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: lowercase;
}
.pill.disponible, .pill.activo { border-color: #171717; color: #171717 !important; }
.pill.ocupada, .pill.vencido { background: #171717 !important; color: #fff !important; border-color: #171717; }
.pill.mantenimiento, .pill.urgente { background: var(--rojo) !important; color: #fff !important; border-color: var(--rojo); }
.pill.alta { border-color: var(--rojo); color: var(--rojo) !important; }

/* Botones: negro sólido, look limpio */
.btn.primario {
  background: #0A0A0A;
  border-color: #0A0A0A;
  color: #fff;
  letter-spacing: .01em;
}
.btn.primario:hover { background: #2A2A2A; border-color: #2A2A2A; }
.btn {
  border-radius: 8px;
  transition: all .15s;
}

/* Sidebar minimalista */
.sidebar, .barra-lateral, nav.lateral {
  background: #0A0A0A !important;
}

/* Tarjetas y bloques: bordes sutiles, sin sombras pesadas */
.bloque {
  border: 1px solid var(--linea);
  box-shadow: none;
  border-radius: 12px;
}

/* Tabs tipo píldora en negro */
.tab-tipo.on {
  background: #0A0A0A;
  color: #fff;
  border-color: #0A0A0A;
  box-shadow: none;
}

/* Aviso de marcas en plantillas */
.aviso-marcas {
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: 10px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.marcas-lista { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; }
.marcas-lista code {
  background: #0A0A0A;
  color: #fff;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 12px;
}

/* ============================================
   MENÚ AGRUPADO + COLOR DE ACENTO PERSONALIZABLE
   ============================================ */

/* Títulos de grupo en el menú lateral */
.nav-grupo {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6b6b6b;
  padding: 16px 24px 6px;
  font-weight: 600;
}

/* El acento (línea de marca, item activo) usa el color personalizado */
.marca::after { background: var(--acento, #fff); }
.lateral nav a.on { border-left-color: var(--acento, #fff); }

/* En sidebar negro, el item activo se ve con barra de acento */
.lateral nav a:hover, .lateral nav a.on {
  background: #1a1a1a;
  color: #fff;
}
.lateral-pie a { color: #bbb; }
.lateral-pie small { text-transform: capitalize; opacity: .7; }

/* Botón primario y acentos usan el color personalizado cuando aplica */
.btn.acento {
  background: var(--acento, #0A0A0A);
  border-color: var(--acento, #0A0A0A);
  color: #fff;
}

/* Vista previa de color en ajustes */
.color-preview {
  display: inline-block; width: 40px; height: 40px;
  border-radius: 8px; border: 1px solid var(--linea);
  vertical-align: middle;
}
