/* ===== INTERFAZ MEJORADA PARA USUARIOS NO TÉCNICOS ===== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Sora:wght@400;500;600;700&display=swap');

/* Variables con colores más amigables */
:root {
  --color-primary: #0f766e;
  --color-success: #16a34a;
  --color-warning: #f97316;
  --color-danger: #dc2626;
  --color-info: #0284c7;
  --color-light: #f8f5f1;
  --color-dark: #1f2933;
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-large: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --nav-height: 70px;
  --subhead-height: 60px;
}

/* Layout general más espacioso */
body {
  padding-top: calc(var(--nav-height, 70px) + 40px);
  font-family: 'Sora', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(130deg, #f8f4ee 0%, #eef2f6 55%, #edf7f1 100%);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

body.has-subhead {
  padding-top: calc(var(--nav-height, 70px) + var(--subhead-height, 0px) + 40px);
}

h1, h2, h3, .display-5, .card-title {
  font-family: 'Playfair Display', 'Sora', serif;
  letter-spacing: 0.01em;
}

/* Header más prominente y amigable */
.navbar {
  height: var(--nav-height);
  box-shadow: var(--shadow-large);
  backdrop-filter: blur(15px);
  background: linear-gradient(130deg, #1f1b16 0%, #3a332b 55%, #1c1916 100%) !important;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
  font-size: 1.75rem !important;
  font-weight: 800;
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.navbar-brand img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Subcinta mejorada */
.subhead-dark {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  height: var(--subhead-height);
  background: linear-gradient(130deg, #3a332b 0%, #4a4338 100%);
  z-index: 1029;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.subhead-dark .progress {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.subhead-dark .progress-bar {
  background: linear-gradient(90deg, var(--color-primary), #f97316);
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* Contenedor principal más espacioso */
.container,
.container-fluid {
  max-width: 1400px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ===== MENÚ PRINCIPAL (HOME TILES) ===== */
#home-tiles {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: minmax(200px, auto);
  align-items: stretch;
  justify-items: stretch;
  grid-auto-flow: row;
  gap: 1.25rem;
  padding: 1.25rem;
  margin-top: 1.25rem;
  border-radius: 28px;
  background:
    radial-gradient(240px 240px at 10% 20%, rgba(15, 118, 110, 0.12), transparent 70%),
    radial-gradient(260px 260px at 85% 25%, rgba(249, 115, 22, 0.12), transparent 70%),
    linear-gradient(135deg, #fff9f1 0%, #f1f5f9 55%, #ecfdf3 100%);
  border: 1px solid rgba(60, 57, 52, 0.1);
  box-shadow: 0 35px 70px -55px rgba(28, 25, 22, 0.5);
  overflow: hidden;
}

#home-tiles::before,
#home-tiles::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  opacity: 0.45;
  pointer-events: none;
}

#home-tiles::before {
  top: -80px;
  left: -60px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.35), transparent 70%);
}

#home-tiles::after {
  bottom: -90px;
  right: -50px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.3), transparent 70%);
}

#home-tiles .tile-card {
  min-height: 200px;
  padding: 1.5rem;
  border-radius: 24px;
  background: #ffffff;
  color: #1f2933;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.9rem;
  text-decoration: none !important;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  border: 1px solid rgba(60, 57, 52, 0.08);
  box-shadow: 0 16px 30px -24px rgba(28, 25, 22, 0.45);
  width: 100%;
  height: 100%;
}

#home-tiles .tile-card::before {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 42px;
  background: var(--tile-accent, rgba(15, 118, 110, 0.2));
  opacity: 0.18;
  transform: rotate(12deg);
  pointer-events: none;
}

#home-tiles .tile-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 55px -40px rgba(28, 25, 22, 0.7);
  border-color: rgba(15, 118, 110, 0.25);
}

#home-tiles .tile-card.tile-feature {
  min-height: 240px;
}

#home-tiles .tile-card .tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#home-tiles .tile-card .tile-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f3f3a;
  background: rgba(15, 118, 110, 0.16);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.35);
}

#home-tiles .tile-card .tile-kicker {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(31, 41, 55, 0.6);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#home-tiles .tile-card .tile-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(15, 118, 110, 0.2);
}

#home-tiles .tile-card i {
  font-size: 1.6rem;
  color: #0f3f3a;
}

#home-tiles .tile-card .tile-title {
  font-family: 'Playfair Display', 'Sora', serif;
  font-size: 1.45rem;
  line-height: 1.25;
  color: #1f2933;
}

#home-tiles .tile-card .tile-desc {
  font-size: 0.95rem;
  color: rgba(31, 41, 55, 0.7);
  max-width: 26ch;
}

#home-tiles .tile-card .tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

#home-tiles .tile-card .tile-cta {
  font-size: 0.92rem;
  color: #0f766e;
  opacity: 0.95;
}

#home-tiles .tile-card .tile-arrow {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.12);
  transition: transform 0.3s ease;
}

#home-tiles .tile-card:hover .tile-arrow {
  transform: translateX(4px) translateY(-4px);
}

#home-tiles .tile-card.tile-rooms {
  --tile-accent: rgba(15, 118, 110, 0.4);
}

#home-tiles .tile-card.tile-stats { --tile-accent: rgba(249, 115, 22, 0.4); }
#home-tiles .tile-card.tile-tenants { --tile-accent: rgba(2, 132, 199, 0.4); }
#home-tiles .tile-card.tile-owners { --tile-accent: rgba(16, 185, 129, 0.4); }

.home-hero {
  position: relative;
  z-index: 2;
  margin-bottom: 2rem;
}

.home-main { padding-top: 0; }

.home-hero h1 {
  color: #1f2933;
}

.home-hero .lead,
.home-main .lead.text-muted {
  display: none;
}

/* ===== TARJETAS MEJORADAS ===== */
.card {
  border: none !important;
  border-radius: var(--border-radius-lg) !important;
  box-shadow: var(--shadow-soft) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  background: white;
  overflow: hidden;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-info));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-large) !important;
  transform: translateY(-4px);
}

.card:hover::before {
  opacity: 1;
}

.card-body {
  padding: 2rem !important;
}

.card-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-bottom: 2px solid #e2e8f0 !important;
  padding: 1.5rem 2rem !important;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ===== PISOS - DISEÑO MÁS INTUITIVO ===== */
.piso-card {
  cursor: pointer;
  padding: 2rem !important;
  border-radius: var(--border-radius-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  position: relative;
  overflow: hidden;
}

.piso-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-info));
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.piso-card:hover::before {
  transform: scaleY(1);
}

.piso-card:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  transform: translateX(8px);
  box-shadow: var(--shadow-medium);
}

.piso-card h6 {
  font-size: 1.4rem !important;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 0.75rem !important;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.piso-card h6::before {
  content: '🏢';
  font-size: 1.5rem;
}

.piso-card small {
  font-size: 1rem !important;
  color: #6b7280;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.piso-card small::before {
  content: '👆';
  opacity: 0.7;
}

/* ===== HABITACIONES - CHIPS MÁS GRANDES Y CLAROS ===== */
.hab-chip {
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  padding: 1.5rem !important;
  font-size: 1.1rem;
  background: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 1rem !important;
  position: relative;
  overflow: hidden;
}

.hab-chip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.hab-chip:hover::before {
  transform: scaleY(1);
}

.hab-chip:hover {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  transform: translateX(8px);
  box-shadow: var(--shadow-soft);
}

.hab-chip strong {
  font-size: 1.4rem;
  color: var(--color-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hab-chip strong::before {
  content: '🚪';
  font-size: 1.2rem;
}

/* ===== ESTADOS CON EMOJIS Y COLORES INTUITIVOS ===== */
.pill-libre {
  background: linear-gradient(135deg, var(--color-success), #34d399);
  color: white;
  border-radius: 20px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pill-libre::before {
  content: '✅';
}

.pill-ocupada {
  background: linear-gradient(135deg, var(--color-danger), #f87171);
  color: white;
  border-radius: 20px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pill-ocupada::before {
  content: '🔴';
}

.pill-caducada {
  background: linear-gradient(135deg, var(--color-warning), #fbbf24);
  color: white;
  border-radius: 20px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pill-caducada::before {
  content: '⚠️';
}

/* ===== BOTONES MÁS GRANDES Y AMIGABLES ===== */
.btn {
  border-radius: var(--border-radius) !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  padding: 1rem 2rem !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: none !important;
  text-transform: none !important;
  letter-spacing: 0.025em;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px; /* Mínimo para touch */
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-sm {
  padding: 0.75rem 1.5rem !important;
  font-size: 1rem !important;
  min-height: 40px;
}

.btn-lg {
  padding: 1.25rem 2.5rem !important;
  font-size: 1.3rem !important;
  min-height: 56px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #14b8a6) !important;
  box-shadow: 0 4px 14px 0 rgba(15, 118, 110, 0.35) !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0f5f58, var(--color-primary)) !important;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px 0 rgba(15, 118, 110, 0.45) !important;
}

.btn-success {
  background: linear-gradient(135deg, var(--color-success), #34d399) !important;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.4) !important;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669, var(--color-success)) !important;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px 0 rgba(16, 185, 129, 0.5) !important;
}

.btn-warning {
  background: linear-gradient(135deg, var(--color-warning), #fbbf24) !important;
  box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.4) !important;
  color: white !important;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706, var(--color-warning)) !important;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px 0 rgba(245, 158, 11, 0.5) !important;
  color: white !important;
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), #f87171) !important;
  box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.4) !important;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, var(--color-danger)) !important;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px 0 rgba(239, 68, 68, 0.5) !important;
}

/* Botones outline más llamativos */
.btn-outline-primary {
  border: 2px solid var(--color-primary) !important;
  color: var(--color-primary) !important;
  background: rgba(59, 130, 246, 0.1) !important;
}

.btn-outline-primary:hover {
  background: var(--color-primary) !important;
  color: white !important;
  transform: translateY(-2px);
}

.btn-outline-success {
  border: 2px solid var(--color-success) !important;
  color: var(--color-success) !important;
  background: rgba(16, 185, 129, 0.1) !important;
}

.btn-outline-success:hover {
  background: var(--color-success) !important;
  color: white !important;
  transform: translateY(-2px);
}

/* ===== FORMULARIOS MÁS AMIGABLES ===== */
.form-control {
  border-radius: var(--border-radius) !important;
  border: 2px solid #e5e7eb !important;
  padding: 1.25rem !important;
  font-size: 1.1rem !important;
  transition: all 0.3s ease !important;
  background: white;
  min-height: 48px; /* Touch-friendly */
}

.form-control:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
  transform: translateY(-1px);
  background: #fefefe;
}

.form-control-lg {
  padding: 1.5rem !important;
  font-size: 1.2rem !important;
  min-height: 56px;
}

.form-label {
  font-weight: 700 !important;
  color: var(--color-dark) !important;
  font-size: 1.1rem !important;
  margin-bottom: 1rem !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-text {
  font-size: 0.95rem;
  margin-top: 0.5rem;
  color: #6b7280;
}

/* ===== ALERTAS MÁS IMPACTANTES ===== */
.alert {
  border-radius: var(--border-radius) !important;
  border: none !important;
  padding: 1.5rem !important;
  font-size: 1.1rem !important;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-danger {
  background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
  color: #b91c1c !important;
  border-left: 5px solid var(--color-danger) !important;
}

.alert-danger::before {
  content: '❌';
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alert-success {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7) !important;
  color: #15803d !important;
  border-left: 5px solid var(--color-success) !important;
}

.alert-success::before {
  content: '✅';
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alert-warning {
  background: linear-gradient(135deg, #fffbeb, #fef3c7) !important;
  color: #b45309 !important;
  border-left: 5px solid var(--color-warning) !important;
}

.alert-warning::before {
  content: '⚠️';
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alert-info {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe) !important;
  color: #0c4a6e !important;
  border-left: 5px solid var(--color-info) !important;
}

.alert-info::before {
  content: 'ℹ️';
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ===== BADGES MÁS VISIBLES ===== */
.badge {
  font-size: 1rem !important;
  padding: 0.75rem 1.25rem !important;
  border-radius: 25px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-soft);
}

.text-bg-danger {
  background: linear-gradient(135deg, var(--color-danger), #f87171) !important;
  color: white !important;
}

.text-bg-warning {
  background: linear-gradient(135deg, var(--color-warning), #fbbf24) !important;
  color: white !important;
}

.text-bg-success {
  background: linear-gradient(135deg, var(--color-success), #34d399) !important;
  color: white !important;
}

.text-bg-info {
  background: linear-gradient(135deg, var(--color-info), #38bdf8) !important;
  color: white !important;
}

/* ===== SIDEBAR MEJORADA ===== */
.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--subhead-height) + 2rem);
}

.mini-kpi {
  border: none !important;
  border-radius: var(--border-radius-lg) !important;
  padding: 2rem !important;
  background: linear-gradient(135deg, white, #f8fafc) !important;
  box-shadow: var(--shadow-soft);
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mini-kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-info));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mini-kpi:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

.mini-kpi:hover::before {
  opacity: 1;
}

.mini-kpi h5 {
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--color-dark);
  font-size: 1.2rem;
}

.mini-kpi .display-4 {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-info));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== VENCIMIENTOS Y CADUCADOS ===== */
.v-item,
.cad-item {
  border: 2px solid #e5e7eb !important;
  border-radius: var(--border-radius-lg) !important;
  padding: 2rem !important;
  background: white !important;
  margin-bottom: 1.5rem !important;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.v-item::before,
.cad-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--color-info);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.cad-item::before {
  background: var(--color-danger);
}

.v-item:hover::before,
.cad-item:hover::before {
  transform: scaleY(1);
}

.v-item:hover,
.cad-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-medium);
  transform: translateY(-4px);
}

.v-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.v-acciones .btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

/* ===== MODALES MÁS AMIGABLES ===== */
.modal-content {
  border-radius: var(--border-radius-lg) !important;
  border: none !important;
  box-shadow: var(--shadow-large) !important;
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-bottom: 2px solid #e2e8f0 !important;
  padding: 2rem !important;
}

.modal-title {
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  color: var(--color-dark);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-body {
  padding: 2.5rem !important;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  background: #f8fafc !important;
  border-top: 2px solid #e2e8f0 !important;
  padding: 2rem !important;
  gap: 1rem;
}

/* ===== BÚSQUEDA MEJORADA ===== */
#calle {
  border-radius: 25px !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  background: rgba(255, 255, 255, 0.15) !important;
  color: white !important;
  backdrop-filter: blur(10px);
  font-size: 1.1rem !important;
  padding: 1rem 2rem !important;
  min-height: 48px;
  transition: all 0.3s ease;
}

#calle::placeholder {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 500;
}

#calle:focus {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1) !important;
  transform: translateY(-2px);
}

/* ===== RESPONSIVE MEJORADO ===== */
@media (max-width: 768px) {
  :root {
    --nav-height: 80px;
    --subhead-height: 70px;
  }
  
  body {
    font-size: 18px;
    padding-top: calc(var(--nav-height) + var(--subhead-height) + 15px);
  }
  
  .container,
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .btn {
    padding: 1.25rem 1.75rem !important;
    font-size: 1.2rem !important;
    width: 100%;
    justify-content: center;
  }
  
  .btn-group .btn {
    width: auto;
  }
  
  .hab-chip {
    padding: 2rem !important;
  }
  
  .hab-chip .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }
  
  .piso-card {
    padding: 2.5rem 1.5rem !important;
  }
  
  .v-acciones {
    flex-direction: column;
  }
  
  .v-acciones .btn {
    width: 100%;
    min-width: unset;
  }
  
  .card-body {
    padding: 1.5rem !important;
  }
  
  .modal-body {
    padding: 1.5rem !important;
    max-height: 75vh;
  }
  
  .modal-header {
    padding: 1.5rem !important;
  }
  
  .modal-footer {
    padding: 1.5rem !important;
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
  
  #home-tiles {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  #home-tiles .tile-card,
  #home-tiles .tile-card.tile-feature {
    min-height: 210px;
    padding: 1.4rem;
  }
  
  #home-tiles .tile-card .tile-title {
    font-size: 1.35rem;
  }
  
  /* Subcinta responsive */
  .subhead-dark .container-fluid {
    padding: 1rem;
  }
  
  .subhead-dark .row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .subhead-dark .progress {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }
  
  .btn {
    padding: 1rem 1.5rem !important;
    font-size: 1.1rem !important;
  }
  
  .form-control {
    font-size: 16px !important; /* Evita zoom en iOS */
  }
  
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
/* Focus más visible para navegación por teclado */
button:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 3px solid rgba(59, 130, 246, 0.5) !important;
  outline-offset: 2px !important;
}

/* Mejores contrastes */
.text-muted {
  color: #6b7280 !important;
}

/* ===== ANIMACIONES SUAVES ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.card {
  animation: fadeInUp 0.6s ease forwards;
}

.hab-chip {
  animation: slideInRight 0.5s ease forwards;
}

.piso-card {
  animation: fadeInUp 0.5s ease forwards;
}

/* Stagger animation para listas */
.hab-chip:nth-child(1) { animation-delay: 0.1s; }
.hab-chip:nth-child(2) { animation-delay: 0.2s; }
.hab-chip:nth-child(3) { animation-delay: 0.3s; }
.hab-chip:nth-child(4) { animation-delay: 0.4s; }
.hab-chip:nth-child(5) { animation-delay: 0.5s; }

/* ===== LOADING STATES MÁS ATRACTIVOS ===== */
.spinner-border {
  border-color: var(--color-primary) transparent var(--color-primary) transparent !important;
  animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

/* ===== FORMULARIOS DE CONTRATO MEJORADOS ===== */
#formularioContrato {
  animation: fadeInUp 0.8s ease forwards;
}

#formularioContrato .card {
  margin-bottom: 2rem;
  border-left: 4px solid var(--color-primary);
}

#formularioContrato .card-header {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-dark);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#formularioContrato .form-label::before {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

#formularioContrato .form-label[for*="documento"]::before { content: '🆔'; }
#formularioContrato .form-label[for*="nombre"]::before { content: '👤'; }
#formularioContrato .form-label[for*="telefono"]::before { content: '📱'; }
#formularioContrato .form-label[for*="fecha"]::before { content: '📅'; }
#formularioContrato .form-label[for*="renta"]::before,
#formularioContrato .form-label[for*="fianza"]::before,
#formularioContrato .form-label[for*="iban"]::before { content: '💰'; }

/* ===== PADS DE FIRMA MEJORADOS ===== */
.pad-firma {
  width: 100%;
  height: 200px;
  border: 3px dashed #d1d5db;
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  touch-action: none;
  user-select: none;
  cursor: crosshair;
  transition: all 0.3s ease;
  position: relative;
}

.pad-firma::before {
  content: '✍️ Firmar aquí';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #9ca3af;
  font-size: 1.1rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0.7;
}

.pad-firma:hover {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.pad-firma:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* ===== WIZARD DE PASOS MEJORADO ===== */
.wizard-contrato {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-soft);
}

.wizard-contrato .step {
  background: #e5e7eb;
  color: #6b7280;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

.wizard-contrato .step span {
  background: #d1d5db;
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.wizard-contrato .step.active {
  background: linear-gradient(135deg, var(--color-primary), #60a5fa);
  color: white;
  transform: scale(1.05);
  box-shadow: var(--shadow-soft);
}

.wizard-contrato .step.active span {
  background: rgba(255, 255, 255, 0.3);
}

.wizard-contrato .step.done {
  background: linear-gradient(135deg, var(--color-success), #34d399);
  color: white;
}

.wizard-contrato .step.done span {
  background: rgba(255, 255, 255, 0.3);
}

.wizard-contrato .step.done span::before {
  content: '✓';
  font-weight: 900;
}

.wizard-contrato .bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  margin-top: 1rem;
  overflow: hidden;
}

.wizard-contrato .bar .progress {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #60a5fa);
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.wizard-contrato .bar .progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== MEJORAS ESPECÍFICAS MOBILE-FIRST ===== */
/* Área de toque más grande para móviles */
.btn,
.form-control,
.hab-chip,
.piso-card {
  min-height: 44px; /* Apple HIG recommendation */
}

/* Prevenir zoom en inputs en iOS */
.form-control,
.form-select {
  font-size: 16px !important;
}

/* Mejor scroll en móviles */
.modal-body {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Gestos touch más responsivos */
.btn:active,
.piso-card:active,
.hab-chip:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* ===== MEJORAS DE CONTRASTE PARA ACCESIBILIDAD ===== */
.text-muted {
  color: #4b5563 !important; /* Mejor contraste */
}

.form-text {
  color: #4b5563 !important; /* Mejor contraste */
}

/* ===== ESTADOS DE CARGA GLOBAL ===== */
#globalLoading {
  backdrop-filter: blur(5px);
  background: rgba(0, 0, 0, 0.5) !important;
}

#globalLoading > div {
  background: white !important;
  color: var(--color-dark) !important;
  box-shadow: var(--shadow-large) !important;
  border-radius: var(--border-radius-lg) !important;
  padding: 2rem !important;
  min-width: 300px;
  text-align: center;
}

#globalLoading .spinner-border {
  width: 3rem;
  height: 3rem;
  margin-right: 1rem;
}

/* ===== TRANSICIONES SUAVES PARA EXPANSIÓN ===== */
.expansion {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.expansion.is-open {
  opacity: 1;
}

.expansion:not(.is-open) {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* ===== MEJORAS DE TOOLTIPS VISUALES ===== */
[title]:hover::after {
  content: attr(title);
  position: absolute;
  z-index: 1000;
  background: var(--color-dark);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  white-space: nowrap;
  transform: translateX(-50%);
  margin-top: 0.5rem;
  box-shadow: var(--shadow-soft);
}

/* ===== PRINT STYLES ===== */
@media print {
  .navbar,
  .subhead-dark,
  .sidebar,
  .btn,
  .modal,
  #toast-host {
    display: none !important;
  }
  
  body {
    padding-top: 0 !important;
    background: white !important;
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
}


/* =====================
   FIXES CABECERA (2025-09-16)
   - Subcinta de altura auto
   - Body compensa altura real con !important
   - Menú: dropdown por encima, offcanvas móvil bajo barras
   - Buscador: full width + sin desplazamiento en focus
   ===================== */

:root{
  --nav-height: var(--nav-height, 56px);
  --subhead-height: var(--subhead-height, 0px);
}

/* El body respeta SIEMPRE la altura real del header + subcinta */
body{
  padding-top: calc(var(--nav-height) + var(--subhead-height) + env(safe-area-inset-top, 0px)) !important;
}

/* Subcinta con altura automática y sin recortes */
.subhead-dark{
  height: auto !important;
  overflow: visible !important;
  padding-top: .35rem !important;
  padding-bottom: .5rem !important;
}

/* Asegurar layout flex del contenedor del navbar */
.navbar .container-fluid{
  display: flex;
  align-items: center;
}

/* Dropdown visible por encima de la subcinta en escritorio */
@media (min-width: 992px){
  .navbar .dropdown-menu{
    z-index: 1100;
    margin-top: .5rem;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
  }
}

/* Offcanvas móvil: bajo navbar + subcinta, sin taparlas */
.offcanvas.menu-offcanvas{
  z-index: 1200;
  top: calc(var(--nav-height) + var(--subhead-height));
  height: calc(100dvh - (var(--nav-height) + var(--subhead-height)));
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}

/* Buscador: ocupar ancho y evitar “salto” en focus */
#calle{
  width: 100% !important;
  max-width: none !important;
}
#calle:focus{
  box-shadow: none !important;
  transform: none !important;
}

/* ===== MODO COMPACTO EN MÓVIL (≤576px) ===== */

/* El contenedor del navbar no se parte en dos líneas */
.navbar .container-fluid{
  display:flex;
  align-items:center;
  gap:.5rem;
}
@media (max-width:576px){
  .navbar .container-fluid{ flex-wrap: nowrap; }
}

/* Navbar más bajita */
@media (max-width:576px){
  .navbar{ padding-top:.25rem; padding-bottom:.25rem; }
  .navbar .navbar-brand{ font-size:1.05rem; }
  #brandLogo{ height:22px !important; }
}

/* El botón que abre el offcanvas: tamaño real, NO a todo el ancho */
@media (max-width:576px){
  .navbar .btn[data-bs-target="#menuOffcanvas"]{
    width:auto !important;
    min-width:0 !important;
    display:inline-flex !important;
    align-items:center;
    gap:.35rem;
    padding:.35rem .6rem !important;
    line-height:1.1;
    border-radius:10px !important;
    background:transparent !important;         /* fuera look de “pastilla” */
    border:1px solid rgba(255,255,255,.45) !important;
    box-shadow:none !important;
  }
  .navbar .btn[data-bs-target="#menuOffcanvas"] .bi{ font-size:1rem; }
}

/* Subcinta más apretada y progreso más fino */
@media (max-width:576px){
  .subhead-dark{
    padding:.35rem 0 .45rem 0 !important;
    height:auto !important;
    overflow:visible !important;
  }
  .subhead-dark .row{ gap:.4rem .6rem; }
  .subhead-dark .progress{ height:.4rem !important; }
}

/* Buscador: compacto y sin “salto” en focus */
@media (max-width:576px){
  #calle{
    height:40px !important;
    border-radius:10px !important;
    width:100% !important;
    max-width:none !important;
  }
  #calle:focus{ box-shadow:none !important; transform:none !important; }
}

/* Offcanvas móvil: bajo navbar + subcinta, sin taparlas */
.offcanvas.menu-offcanvas{
  z-index:1200;
  top: calc(var(--nav-height,56px) + var(--subhead-height,0px));
  height: calc(100dvh - (var(--nav-height,56px) + var(--subhead-height,0px)));
  border-top-left-radius:14px;
  border-bottom-left-radius:14px;
  box-shadow:0 10px 28px rgba(0,0,0,.28);
}

/* Dropdown de escritorio por encima de la subcinta */
@media (min-width:992px){
  .navbar .dropdown-menu{
    z-index:1100;
    margin-top:.5rem;
    border-radius:12px;
    box-shadow:0 12px 30px rgba(0,0,0,.25);
  }
}
/* =========================
   SOLO MÓVIL (≤576px)
   - Menú: botón y offcanvas con look acorde
   - Subcinta compacta
   - Progreso con % legible dentro de la barra
   - Buscador compacto y sin “saltos”
   ========================= */
@media (max-width:576px){

  /* Navbar compacto */
  .navbar{ padding-top:.25rem; padding-bottom:.25rem; }
  .navbar .container-fluid{ display:flex; align-items:center; gap:.5rem; flex-wrap:nowrap; }

  /* Botón que abre el offcanvas (móvil) */
  .navbar .btn[data-bs-target="#menuOffcanvas"]{
    width:auto !important;
    min-width:0 !important;
    display:inline-flex !important;
    align-items:center;
    gap:.4rem;
    padding:.38rem .7rem !important;
    line-height:1.1;
    border-radius:10px !important;
    border:1px solid rgba(255,255,255,.35) !important;
    background: rgba(255,255,255,.06) !important;
    color:#fff !important;
    backdrop-filter: blur(6px);
    box-shadow:none !important;
  }
  .navbar .btn[data-bs-target="#menuOffcanvas"]:hover{
    background: rgba(255,255,255,.10) !important;
  }

  /* Panel offcanvas bajo navbar + subcinta */
  .offcanvas.menu-offcanvas{
    z-index:1200;
    top: calc(var(--nav-height,56px) + var(--subhead-height,0px));
    height: calc(100dvh - (var(--nav-height,56px) + var(--subhead-height,0px)));
    background: linear-gradient(180deg, rgba(17,24,39,.92), rgba(31,41,55,.92));
    color:#e5e7eb;
    border-left:1px solid rgba(255,255,255,.08);
    border-top-left-radius:14px;
    border-bottom-left-radius:14px;
    backdrop-filter: blur(10px);
    box-shadow:0 10px 28px rgba(0,0,0,.28);
  }
  .offcanvas.menu-offcanvas .offcanvas-header{ border-bottom:1px solid rgba(255,255,255,.06); }
  .offcanvas.menu-offcanvas .list-group-item{
    background:transparent; color:#e5e7eb; border-color:rgba(255,255,255,.06);
  }
  .offcanvas.menu-offcanvas .list-group-item-action:hover{
    background:rgba(255,255,255,.08); color:#fff;
  }

  /* Subcinta y progreso compactos */
  .subhead-dark{ padding:.35rem 0 .45rem 0 !important; height:auto !important; overflow:visible !important; }
  .subhead-dark .row{ gap:.4rem .6rem; }
  .subhead-dark .progress{
    height:14px !important;
    background: rgba(255,255,255,.14) !important;
    border-radius:999px !important;
    position:relative; overflow:visible !important;
  }
  .subhead-dark .progress-bar{
    border-radius:999px !important;
    background: linear-gradient(90deg,#60a5fa,#3b82f6) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 2px 8px rgba(59,130,246,.45);
    position:relative;
  }
  .subhead-dark .progress-bar::after{
    content: attr(aria-valuenow) '%';
    position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
    font-weight:700; font-size:11px; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.65);
    pointer-events:none;
  }
  .subhead-dark .text-end{ color:#e5e7eb !important; font-weight:600; text-shadow:0 1px 2px rgba(0,0,0,.45); }

  /* Buscador compacto y estable al enfocar */
  #calle{
    height:40px !important;
    border-radius:10px !important;
    width:100% !important;
    max-width:none !important;
  }
  #calle:focus{ box-shadow:none !important; transform:none !important; }
}

/* Opcional: ultra-compacto en pantallas muy estrechas (≤360px)
   — deja solo el icono del botón Menú
*/
@media (max-width:360px){
  .navbar .btn[data-bs-target="#menuOffcanvas"]{
    padding:.38rem .5rem !important;
  }
  .navbar .btn[data-bs-target="#menuOffcanvas"] i { margin-right:0 !important; }
  /* Si el botón tiene texto "Menú" tras el <i>, lo ocultamos colapsando el ancho del texto */
  .navbar .btn[data-bs-target="#menuOffcanvas"]{ letter-spacing:-.3em; }
  .navbar .btn[data-bs-target="#menuOffcanvas"] i{ letter-spacing:normal; }
}
/* ===== % MUY LEGIBLE SOLO EN MÓVIL ===== */
@media (max-width:576px){
  .subhead-dark .progress{
    height: 12px !important;
    overflow: visible !important;           /* deja salir la burbuja */
    background: rgba(255,255,255,.14) !important;
  }
  .subhead-dark .progress-bar{
    position: relative;
    background: linear-gradient(90deg,#60a5fa,#3b82f6) !important;
  }
  /* Burbuja con el % (lee aria-valuenow, sin tocar HTML) */
  .subhead-dark .progress-bar::after{
    content: attr(aria-valuenow) '%';
    position: absolute;
    left: 50%;
    top: -18px;                              /* encima de la barra */
    transform: translateX(-50%);
    padding: 2px 8px;
    font: 700 12px/1.1 system-ui, -apple-system, Segoe UI, sans-serif;
    color: #fff;
    background: rgba(17,24,39,.92);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
    text-shadow: none;
    pointer-events: none;
    white-space: nowrap;
  }
  /* El numerito de la derecha también más legible */
  .subhead-dark .text-end{
    color:#e6edf7 !important;
    font-weight:600;
    text-shadow:0 1px 2px rgba(0,0,0,.45);
  }
}
/* === Visor PDF dentro de modal === */
#modalPreviewContrato .modal-body { padding: 0 !important; }
#previewPdfFrame { display:block; width:100%; height:75vh; min-height:60vh; }

/* Móvil: usar dvh para evitar barras del navegador iOS/Android */
@media (max-width: 576px) {
  #modalPreviewContrato .modal-dialog { margin:0; max-width:100%; height:100dvh; }
  #modalPreviewContrato .modal-content { height:100dvh; border-radius:0; }
  #modalPreviewContrato .modal-header,
  #modalPreviewContrato .modal-footer { flex-shrink:0; }
  #modalPreviewContrato .modal-body { height:calc(100dvh - 120px); /* aprox header+footer */ }
  #previewPdfFrame { height:100%; }
}
/* Visor PDF a pantalla completa en móvil */
@media (max-width: 576px) {
  #modalPreviewContrato .modal-dialog { margin: 0; max-width: 100%; height: 100dvh; }
  #modalPreviewContrato .modal-content { height: 100dvh; border-radius: 0; }
  #modalPreviewContrato .modal-body { padding: 0; height: calc(100dvh - 120px); }
  #previewPdfFrame { width: 100%; height: 100%; display: block; border: 0; }
}
.collapse-toggle { cursor: pointer; }
.collapse-toggle .toggle-caret { transition: transform .18s ease; }
.collapse-toggle.collapsed .toggle-caret { transform: rotate(-90deg); }


/************ DNI MÁS ANCHO EN ESCRITORIO ************/
@media (min-width: 992px){
  /* ancho cómodo aunque esté en grid o form-floating */
  .row [class*="col"]:has(input[placeholder*="dni" i]),
  .row [class*="col"]:has(input[id*="dni" i]),
  .row [class*="col"]:has(input[name*="dni" i]),
  .row [class*="col"]:has(input[name*="documento" i]),
  .row [class*="col"]:has(input[name*="nif" i]),
  .row [class*="col"]:has(input[name*="nie" i]) {
    flex: 0 0 360px !important;
    max-width: 360px !important;
  }

  input[placeholder*="dni" i],
  input[id*="dni" i],
  input[name*="dni" i],
  input[name*="documento" i],
  input[name*="nif" i],
  input[name*="nie" i]{
    
    max-width: 100% !important;
  }
}

/* si va dentro de .input-group, que el input crezca y el botón no */
.input-group input[placeholder*="dni" i],
.input-group input[id*="dni" i],
.input-group input[name*="dni" i]{
  flex: 1 1 auto !important;
  min-width: 300px !important;
}



/******** 2) “Renta mensual / Fianza (€) *” en dos líneas ********/
/* Mantén la etiqueta en una sola línea y céntrala verticalmente */
.form-label {
  white-space: nowrap;            /* evita el salto a la segunda línea */
  margin-bottom: .35rem !important;
}
@media (min-width: 768px){
  .form-horizontal .row > [class*="col"]{
    display: flex; flex-direction: column; justify-content: center;
  }
}

/******** 3) Anchos cómodos para importes en escritorio ********/
@media (min-width: 992px){
  input[name*="renta" i],
  input[name*="mensual" i],
  input[name*="fianza" i],
  input[name*="precio" i],
  input[name*="importe" i]{
    min-width: 240px !important;
    width: 260px !important;
  }
}

/******** 4) Alturas y padding coherentes en esa sección ********/
input.form-control,
select.form-select{
  min-height: 40px !important;
  padding: .6rem .8rem !important;
}
/* quita el “puntito” y adornos del óvalo */
.nav-pills .nav-link::before,
.nav-pills .nav-link::after,
.btn-group .btn::before,
.btn-group .btn::after,
.btn-check + .btn::before,
.btn-check + .btn::after,
input[type="radio"] + label::before,
input[type="radio"] + label::after,
input[type="radio"] + .btn::before,
input[type="radio"] + .btn::after {
  content: none !important;
}

/* estado activo: simple y legible, sin alfombra */
.nav-pills .nav-link.active,
.btn-group .btn.active,
.btn-check:checked + .btn,
input[type="radio"]:checked + label,
input[type="radio"]:checked + .btn {
  background-color: #2563eb !important;
  color: #fff !important;
  border: 1px solid #2563eb !important;
  box-shadow: none !important;
}

/* evita que el grupo se estire de extremo a extremo */
.nav-pills, .nav.nav-pills, .btn-group, [role="tablist"] {
  gap: .75rem !important;
  justify-content: flex-start !important;
}

/************* B) CAMPOS QUE SE QUEDAN CHIQUITOS (DNI / importes) *************/
/* No uso :has() ni cambio HTML. Forzamos el ancho del input y evitamos que el botón lo aplaste */
@media (min-width: 992px){
  /* DNI o documento (incluye placeholder como el tuyo de “DNI / NIE / Pasaporte”) */
  input.form-control[id*="dni" i],
  input.form-control[name*="dni" i],
  input.form-control[name*="documento" i],
  input.form-control[name*="nif" i],
  input.form-control[name*="nie" i],
  input.form-control[placeholder*="dni" i]{
    width: 360px !important;      /* ancho cómodo */
    max-width: 100% !important;
  }
  /* si está en .input-group con “Buscar”, que el input tenga prioridad */
  .input-group input.form-control[id*="dni" i],
  .input-group input.form-control[name*="dni" i],
  .input-group input.form-control[placeholder*="dni" i]{
    flex: 1 1 auto !important;
    min-width: 300px !important;
  }
  .input-group .btn{ padding:.35rem .7rem !important; min-height:36px !important; }
}

/* Renta / Fianza / Importes: ancho decente en desktop y labels sin partirse */
.form-label{ white-space: nowrap !important; margin-bottom:.35rem !important; }
@media (min-width: 992px){
  input.form-control[name*="renta" i],
  input.form-control[name*="fianza" i],
  input.form-control[name*="importe" i],
  input.form-control[name*="precio" i]{
    width: 260px !important;
    min-width: 240px !important;
  }
}

/* Altura y padding homogéneos para que no “bailen” */
input.form-control, select.form-select{
  min-height: 40px !important;
  padding: .6rem .8rem !important;
}
@media (min-width: 992px) {
  #dniBox .form-check .form-check-input { transform: scale(.95); }
  #dniBox .form-check-label { font-weight: 600; }
}
/* ---- Fix específico: radios DNI normales, sin píldora ---- */
#dni-upload .form-check-label {
  display: inline-block !important;
  padding: 0 .25rem !important;
  line-height: 1.2 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 4px !important;
  color: inherit !important;
}
#dni-upload .form-check-input {
  margin-top: .2rem;          /* alinea el circulito */
}
#dni-upload .form-check-input:checked + .form-check-label {
  color: #0d6efd !important;  /* marca visual sin botón */
  font-weight: 600;
}
/* ===== HOTFIX: quitar óvalo en radios/labels ===== */
.form-group:has(input[type="radio"]) label,
.row:has(input[type="radio"]) label,
[class*="col"]:has(input[type="radio"]) label,
input[type="radio"] + label,
input[type="radio"] + .btn,
.btn-check + .btn,
.btn-group .btn,
.nav-pills .nav-link {
  border-radius: 8px !important;         /* antes 999px */
  background: transparent !important;
  box-shadow: none !important;
}

/* ========== FINAL FIX (2025-09-24): Radios y pills sin óvalo gigante ========== */

/* 1) Normaliza pills y botones-segmento (desktop y móvil) */
.nav-pills .nav-link,
.nav.nav-pills .nav-link,
.btn-group .btn,
.btn-check + .btn,
input[type="radio"] + label,
input[type="radio"] + .btn {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  border-radius: 8px !important;
  padding: .42rem .9rem !important;
  min-height: 36px !important;
  line-height: 1.2 !important;
  width: auto !important;
}

/* 2) Estado activo plano */
.nav-pills .nav-link.active,
.btn-group .btn.active,
.btn-check:checked + .btn,
input[type="radio"]:checked + label,
input[type="radio"]:checked + .btn {
  background-color: #2563eb !important;
  color: #fff !important;
  border: 1px solid #2563eb !important;
  box-shadow: none !important;
}

/* 3) Quita pseudo-elementos que dibujaban la “alfombra” y el punto */
.nav-pills .nav-link::before,
.nav-pills .nav-link::after,
.btn-group .btn::before,
.btn-group .btn::after,
.btn-check + .btn::before,
.btn-check + .btn::after,
input[type="radio"] + label::before,
input[type="radio"] + label::after,
input[type="radio"] + .btn::before,
input[type="radio"] + .btn::after {
  content: none !important;
}

/* 4) Espaciado del grupo */
.nav-pills, .nav.nav-pills, .btn-group, [role="tablist"] {
  gap: .75rem !important;
  justify-content: flex-start !important;
}

/* 5) Específico DNI: que los radios sean de formulario normal */
#dniBox .form-check-label,
#dni-upload .form-check-label {
  display: inline-block !important;
  padding: 0 .25rem !important;
  line-height: 1.2 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 4px !important;
  color: inherit !important;
}
#dniBox .form-check-input,
#dni-upload .form-check-input { margin-top: .2rem; }
#dniBox .form-check-input:checked + .form-check-label,
#dni-upload .form-check-input:checked + .form-check-label {
  color: #0d6efd !important;
  font-weight: 600;
}

/* ========== FIN FINAL FIX ========== */
/* Centrado del bloque Contrato actual en móvil */
@media (max-width: 576px){
  .card-contrato .icono{ margin: 0 auto; }
  .card-contrato .acciones{ justify-content: center; }
  .card-contrato .col-fechas{ text-align: center; }
  .card-contrato .progress-movil-centro{
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 576px){
  .card-contrato .acciones .btn{ width: 100%; }
}
/* Centrar tarjeta de contrato en móvil */
@media (max-width: 576px){
  .card-contrato .card-body{ padding: 1.25rem !important; }

  /* Bloque izq: icono arriba y todo centrado */
  .card-contrato-col-izq{ text-align: center; }
  .card-contrato-col-izq .icono{ margin: 0 auto .5rem; }

  /* Acciones a ancho completo y centradas */
  .card-contrato .acciones{ justify-content: center; }
  .card-contrato .acciones .btn{ width: 100%; }

  /* Fechas y progreso centrados */
  .card-contrato .col-fechas{ text-align: center; }
  .card-contrato .col-fechas .row{ justify-content: center; }
  .card-contrato .progress-movil-centro{
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }
}
/* ====== HABITACIÓN CHIP: CONSISTENCIA GLOBAL ====== */
.hab-chip {
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  padding: 1.25rem !important;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

/* Cabecera */
.hab-head { gap: 1rem; }
.hab-title { display: flex; gap: .75rem; align-items: flex-start; }
.hab-icon { font-size: 1.25rem; line-height: 1; margin-top: .25rem; }
.hab-nombre { font-weight: 800; font-size: 1.1rem; color: var(--color-dark); }
.hab-sub { font-size: .95rem; }

/* Estado + Vence alineados y con tamaños coherentes */
.hab-right { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  height: 40px; padding: 0 .9rem; border-radius: 999px;
  font-weight: 700; font-size: .95rem;
  box-shadow: var(--shadow-soft);
}
.pill-libre   { background: linear-gradient(135deg, var(--color-success), #34d399); color: #fff; }
.pill-ocupada { background: linear-gradient(135deg, var(--color-danger),  #f87171); color: #fff; }
.pill-caducada{ background: linear-gradient(135deg, var(--color-warning), #fbbf24); color: #fff; }

.badge-vence {
  height: 32px; display: inline-flex; align-items: center;
  border-radius: 999px; font-weight: 700; padding: 0 .75rem;
}

/* Acciones como grid: siempre mismo tamaño */
.hab-actions {
  display: grid; gap: .75rem; margin-top: 1rem;
  grid-template-columns: 1fr;        /* móvil: 1 por fila */
}
@media (min-width: 768px){
  .hab-actions { grid-template-columns: 1fr 1fr; } /* desktop: 2 iguales */
}

/* Botones normalizados (altura, icono, tipografía) */
.btn-hab {
  min-height: 44px;                   /* touch-friendly */
  font-weight: 800 !important;
  font-size: 1rem !important;
  justify-content: center;
}
.btn-hab i { font-size: 1.05rem; }

/* Variante secundaria con mismo look & feel */
.btn-secundaria {
  border: 2px solid var(--color-info) !important;
  background: rgba(6, 182, 212, .08) !important; /* var(--color-info) con opacidad */
  color: var(--color-info) !important;
}
.btn-secundaria:hover {
  background: var(--color-info) !important;
  color: #fff !important;
  transform: translateY(-2px);
}

/* Evitar “bailes” por wraps largos */
.hab-chip .btn-hab, .hab-chip .pill, .hab-chip .badge {
  white-space: nowrap;
}
/* ===== Chips centrados e intuitivos ===== */
.hab-chip-centered{
  padding: 1.25rem !important;
}
.hab-icon-lg{
  font-size: 1.5rem; line-height: 1;
}
.hab-nombre{
  font-weight: 800; font-size: 1.1rem; color: var(--color-dark);
}

/* Pila de estado: pill + badge del mismo ancho */
.hab-status-stack{
  display: grid; gap: .55rem; grid-template-columns: 1fr;
}
.pill{
  display: inline-flex; align-items: center; gap: .5rem;
  height: 44px; padding: 0 1rem; border-radius: 999px;
  font-weight: 800; font-size: .98rem;
  box-shadow: var(--shadow-soft);
}
.pill .indicador-dot{
  width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.75);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.1);
}
.hab-badge{
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; border-radius: 999px; font-weight: 800;
}

/* Acciones: 1 por fila en móvil, 2 iguales desde md */
.hab-actions-grid{
  display: grid; gap: .75rem; grid-template-columns: 1fr;
}
@media (min-width: 768px){
  .hab-actions-grid{ grid-template-columns: 1fr 1fr; }
}

/* Botones habitación – mismos tamaños */
.btn-hab{
  min-height: 44px; font-weight: 800 !important; font-size: 1rem !important;
  justify-content: center; letter-spacing: .1px;
}
.btn-hab i{ font-size: 1.05rem; }
/* ===== Habitación chip V2 – claro y centrado ===== */
.hab2.centered { text-align: center; padding: 1.25rem !important; }
.hab2-head { display:flex; gap:.75rem; align-items:center; justify-content:center; margin-bottom:.5rem; }
.hab2-head > i { font-size:1.25rem; line-height:1; }
.hab2-title { font-weight:800; font-size:1.1rem; color:var(--color-dark); }
.hab2-sub { font-size:.95rem; color:#6b7280; }

.hab2-status-row{
  display:grid; grid-template-columns:1fr; gap:.5rem; margin-top:.5rem;
}
@media (min-width: 576px){
  .hab2-status-row{ grid-template-columns:1fr 1fr; } /* pill + badge a la misma altura */
}

.hab2-pill{
  display:inline-flex; align-items:center; justify-content:center;
  height:44px; padding:0 1rem; border-radius:999px; font-weight:800; font-size:.98rem;
  box-shadow: var(--shadow-soft); width:100%;
}
.hab2-badge{
  display:inline-flex; align-items:center; justify-content:center;
  height:44px; border-radius:999px; font-weight:800; width:100%;
}

/* Progreso fino y centrado */
.hab2-progress{ height:8px; margin:.6rem auto 0; max-width:260px; }

/* Acciones: 1 por fila en móvil, 2 iguales desde md */
.hab2-actions{ display:grid; gap:.75rem; grid-template-columns:1fr; margin-top:1rem; }
@media (min-width: 768px){ .hab2-actions{ grid-template-columns:1fr 1fr; } }
.btn-hab2{ min-height:44px; font-weight:800 !important; font-size:1rem !important; justify-content:center; }
.btn-hab2 i{ font-size:1.05rem; }

/* Evitar saltos por textos largos */
.hab2 .pill, .hab2 .badge, .hab2 .btn { white-space:nowrap; }
  /* ===== Centrado y alineado perfecto del chip de habitación ===== */
.hab-chip{
  text-align: center;
}

/* Cabecera: icono + título centrados */
.hab-head{
  justify-content: center !important;
  gap: .75rem;
}
.hab-title{ display:flex; gap:.6rem; align-items:flex-start; justify-content:center; }
.hab-nombre{ text-align:center; }
.hab-sub{ text-align:center; }

/* Bloque derecho (estado + vence) centrado y con mismo ancho */
.hab-right{
  width:100%;
  justify-content: center !important;
  gap: .55rem;
}
.hab-right .pill,
.hab-right .badge,
.hab-right .badge-vence{
  width:100%;
  max-width: 320px;      /* fija anchura visual */
  min-width: 220px;
  justify-content: center;
}

/* Acciones: mismo ancho y centradas */
.hab-actions{
  display: grid;
  grid-template-columns: 1fr;   /* móvil: 1 por fila */
  gap: .75rem;
  max-width: 360px;
  margin: 12px auto 0;          /* centra el bloque entero */
}
@media (min-width: 768px){
  .hab-actions{ grid-template-columns: 1fr 1fr; } /* desde md: 2 columnas iguales */
}
.hab-actions .btn{ width:100%; min-height:44px; }

/* Progreso (si lo usas) centrado */
.hab2-progress{
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

/* Ajuste del punto “dot” para que no desplace visualmente */
.pill .indicador-dot{
  margin-left: -2px;   /* compensa el padding del icono */
}

/* Evita sensación de “desalineado” por el contorno de foco azul */
.hab-chip:focus-within{
  outline-offset: 0 !important;
}
/* iOS/modern: usa svh cuando esté disponible */
@supports (height: 100svh) {
  #modalPreviewContrato .modal-dialog,
  #modalPreviewContrato .modal-content { height: 100svh; }
  #modalPreviewContrato .modal-body { height: calc(100svh - 120px); }
  #previewPdfFrame { height: 100%; }
}

/* Fallback Safari iOS antiguo */
#modalPreviewContrato .modal-body { overflow: hidden; }
#previewPdfFrame { display:block; width:100%; height:100%; border:0; }

/* Evita que el modal recorte el visor */
@media (max-width: 576px){
  #modalPreviewContrato .modal-dialog { margin:0; max-width:100%; }
  #modalPreviewContrato .modal-content { border-radius:0; }
}
.modal { z-index: 2000 !important; }
.modal-backdrop { z-index: 1990 !important; }
/* deja un pelín de hueco entre los botones de la tarjeta */
.hab2-actions .btn + .btn { margin-left: .5rem; }

/* Oculta cualquier botón de compartir dentro de modales */
.modal [data-action="share"],
.modal .btn-share,
.modal .btn.btn-outline-success i.bi-link-45deg { 
  display: none !important;
}
.pill-reservada{
  display:inline-flex; align-items:center; gap:.5rem;
  background:#fff3cd; color:#856404;
  border:1px solid #ffeeba; border-radius:999px;
  padding:.25rem .75rem; font-weight:600;
}
