/* ==========================================================================
   PATRIMONIO 360 - Design System & Stylesheet
   Aesthetic: Atelier Private Wealth / Luxury Real Estate (Soft & Luminous)
   Palette: Warm Cashmere, Alabaster White, Champagne Bronze, Forest Emerald & Rose
   ========================================================================== */

:root {
  /* Core Soft Luxury Canvas */
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  
  /* Hairline Borders */
  --border-subtle: #e2e8f0;
  --border-card: rgba(226, 232, 240, 0.9);
  --border-gold: #c59b27;
  --border-gold-soft: rgba(197, 155, 39, 0.25);
  
  /* Accent Gold / Champagne Bronze */
  --gold-primary: #b8860b;
  --gold-light: #dfb15b;
  --gold-dark: #8c6508;
  --gold-gradient: linear-gradient(135deg, #c59b27 0%, #a67c1e 100%);
  --gold-bg-soft: #fefce8;
  --gold-glow: 0 4px 14px rgba(184, 134, 11, 0.15);
  
  /* Classification Status Colors (Soft Pastel BGs with High Contrast Text) */
  --productivo: #059669;
  --productivo-light: #10b981;
  --productivo-bg: #ecfdf5;
  --productivo-border: #a7f3d0;
  
  --no-productivo: #d97706;
  --no-productivo-light: #f59e0b;
  --no-productivo-bg: #fffbeb;
  --no-productivo-border: #fde68a;
  
  --conflictivo: #e11d48;
  --conflictivo-light: #f43f5e;
  --conflictivo-bg: #fff1f2;
  --conflictivo-border: #fecdd3;

  --info-cyan: #0284c7;
  --info-cyan-bg: #f0f9ff;
  --info-purple: #7c3aed;
  
  /* Text */
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  /* Geometry & Soft Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(226, 232, 240, 0.8);
  
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-canvas);
  background-image: 
    radial-gradient(circle at 10% 5%, rgba(197, 155, 39, 0.03), transparent 35%),
    radial-gradient(circle at 90% 40%, rgba(5, 150, 105, 0.02), transparent 40%),
    radial-gradient(circle at 50% 95%, rgba(2, 132, 199, 0.02), transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: #0f172a;
  margin-top: 0;
  letter-spacing: -0.02em;
}

.font-numeric {
  font-family: 'JetBrains Mono', 'Plus Jakarta Sans', monospace;
  font-feature-settings: "tnum";
}

.gold-gradient-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  font-weight: 800;
}

a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--gold-dark);
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Soft Slate Elegance) */
.app-sidebar {
  width: 275px;
  background: #0f172a;
  border-right: 1px solid #1e293b;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-gold-soft);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5b869;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #e5b869;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  padding: 14px 14px 6px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10.5px 14px;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-md);
  margin-bottom: 3px;
  transition: var(--transition);
  position: relative;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #64748b;
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}
.nav-item:hover i {
  color: #e5b869;
}

.nav-item.active {
  background: rgba(229, 184, 105, 0.12);
  color: #ffffff;
  font-weight: 600;
  border-left: 3px solid #e5b869;
}
.nav-item.active i {
  color: #e5b869;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(229, 184, 105, 0.15);
  color: #f5d491;
}

/* Buscador Rápido de Módulos en Sidebar */
.sidebar-search-box {
  padding: 0 10px 12px;
  position: relative;
}
.sidebar-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 7px 12px 7px 32px;
  color: #ffffff;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}
.sidebar-search-input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}
.sidebar-search-icon {
  position: absolute;
  left: 20px;
  top: 9px;
  font-size: 12px;
  color: #64748b;
  pointer-events: none;
}

/* Grupos Acordeón Desplegables (Collapsible Nav Groups) */
.nav-group {
  margin-bottom: 4px;
}
.nav-group-header {
  all: unset;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9.5px 14px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}
.nav-group-header:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  border-color: rgba(212, 175, 55, 0.25);
}
.nav-group-header:hover i:first-child {
  color: var(--gold-primary);
}
.nav-group-header.active-parent {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}
.nav-group-header.active-parent i:first-child {
  color: var(--gold-primary);
}
.nav-group-arrow {
  margin-left: auto;
  font-size: 10px;
  color: #64748b;
  transition: transform 0.25s ease;
}
.nav-group.open .nav-group-arrow {
  transform: rotate(180deg);
  color: var(--gold-primary);
}
.nav-group-body {
  display: none;
  padding-left: 6px;
  margin: 3px 0 6px 20px;
  border-left: 1.5px solid rgba(255, 255, 255, 0.09);
}
.nav-group.open .nav-group-body {
  display: block;
}
.nav-subitem {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 6px;
  margin-bottom: 2px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.nav-subitem i {
  font-size: 12.5px;
  width: 16px;
  text-align: center;
  color: #64748b;
  transition: all 0.15s ease;
}
.nav-subitem:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
.nav-subitem:hover i {
  color: var(--gold-primary);
}
.nav-subitem.active {
  background: rgba(212, 175, 55, 0.14);
  color: #ffffff;
  font-weight: 700;
  border-left: 2.5px solid var(--gold-primary);
}
.nav-subitem.active i {
  color: var(--gold-primary);
}
.nav-subitem .nav-badge {
  margin-left: auto;
  font-size: 9.5px;
  padding: 1px 5px;
}


.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #1e293b;
  background: rgba(0, 0, 0, 0.15);
}

.user-profile-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e5b869, #b8860b);
  color: #0f172a;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.user-info-text {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 11px;
  color: #e5b869;
}

/* Main Area */
.app-main {
  flex: 1;
  margin-left: 275px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Navbar */
.app-navbar {
  height: 72px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 9999 !important;
}

.navbar-search {
  position: relative;
  width: 360px;
}
.navbar-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.navbar-search input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.12);
}
.navbar-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.client-selector-form select {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.client-selector-form select:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.page-content {
  padding: 32px;
  flex: 1;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 20px;
}
.page-title {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

.bento-col-1 { grid-column: span 1; }
.bento-col-2 { grid-column: span 2; }
.bento-col-3 { grid-column: span 3; }
.bento-col-4 { grid-column: span 4; }
.bento-col-5 { grid-column: span 5; }
.bento-col-6 { grid-column: span 6; }
.bento-col-7 { grid-column: span 7; }
.bento-col-8 { grid-column: span 8; }
.bento-col-9 { grid-column: span 9; }
.bento-col-10 { grid-column: span 10; }
.bento-col-11 { grid-column: span 11; }
.bento-col-12 { grid-column: span 12; }

@media (max-width: 1200px) {
  .bento-col-3, .bento-col-4, .bento-col-5 { grid-column: span 6; }
  .bento-col-7, .bento-col-8, .bento-col-9, .bento-col-10, .bento-col-11 { grid-column: span 12; }
}
@media (max-width: 768px) {
  .bento-col-1, .bento-col-2, .bento-col-3, .bento-col-4, .bento-col-5,
  .bento-col-6, .bento-col-7, .bento-col-8, .bento-col-9, .bento-col-10,
  .bento-col-11, .bento-col-12 { grid-column: span 12; }
  .app-sidebar { transform: translateX(-100%); }
  .app-main { margin-left: 0; }
}

/* Soft Luxury Cards */
.bento-card, .card-custom {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: var(--transition);
}

.bento-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(197, 155, 39, 0.3);
}

.card-header-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
}

.card-title-clean {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.card-title-clean i {
  color: var(--gold-primary);
}

/* KPI Metric Cards */
.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.kpi-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.kpi-icon.gold { background: var(--gold-bg-soft); color: var(--gold-primary); border: 1px solid var(--border-gold-soft); }
.kpi-icon.emerald { background: var(--productivo-bg); color: var(--productivo); border: 1px solid var(--productivo-border); }
.kpi-icon.amber { background: var(--no-productivo-bg); color: var(--no-productivo); border: 1px solid var(--no-productivo-border); }
.kpi-icon.ruby { background: var(--conflictivo-bg); color: var(--conflictivo); border: 1px solid var(--conflictivo-border); }
.kpi-icon.cyan { background: var(--info-cyan-bg); color: var(--info-cyan); border: 1px solid #bae6fd; }

.kpi-value {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.kpi-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

/* Badges and Status Pills */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background-color: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.badge-emerald {
  background: var(--productivo-bg);
  color: var(--productivo);
  border: 1px solid var(--productivo-border);
}
.badge-amber {
  background: var(--no-productivo-bg);
  color: var(--no-productivo);
  border: 1px solid var(--no-productivo-border);
}
.badge-ruby {
  background: var(--conflictivo-bg);
  color: var(--conflictivo);
  border: 1px solid var(--conflictivo-border);
}
.badge-gold {
  background: var(--gold-bg-soft);
  color: var(--gold-primary);
  border: 1px solid var(--border-gold-soft);
}
.badge-slate {
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* CEE Official Style Badge */
.cee-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  background: #f8fafc;
  border-left: 4px solid var(--cee-color, #10b981);
  border-top: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

/* Buttons */
.btn-gold {
  background: var(--gold-gradient);
  color: #ffffff;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
  transition: var(--transition);
}
.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(184, 134, 11, 0.35);
  color: #ffffff;
}

.btn-secondary-dark {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.btn-secondary-dark:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.font-numeric {
  font-family: 'JetBrains Mono', 'Plus Jakarta Sans', monospace;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

/* Custom Table Styles (Haute Horlogerie / Luminous) */
.table-responsive, .custom-table-container {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.table-responsive::-webkit-scrollbar, .custom-table-container::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.table-custom, .custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: auto;
}

.table-custom th, .custom-table th {
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
  background: #f8fafc;
  white-space: nowrap;
}

.table-custom td, .custom-table td {
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.table-custom td.font-numeric, .custom-table td.font-numeric {
  white-space: nowrap;
}

.table-custom tr:last-child td, .custom-table tr:last-child td {
  border-bottom: none;
}

.table-custom tr:hover td, .custom-table tr:hover td {
  background: #f8fafc;
}


/* Leaflet Map Customization */
.leaflet-container {
  z-index: 1 !important;
  isolation: isolate;
}
.leaflet-pane, .leaflet-top, .leaflet-bottom, .leaflet-control {
  z-index: 10 !important;
}

#miniDashboardMap .leaflet-control-attribution,
.map-container-luxury .leaflet-control-attribution {
  display: none !important;
}

.map-container-luxury {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}
.leaflet-popup-content-wrapper {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
}
.leaflet-popup-tip {
  background: #ffffff !important;
}

/* Custom Map Marker Pins */
.custom-map-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  border: 2px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.pin-productivo { background: #059669; }
.pin-no_productivo { background: #d97706; }
.pin-conflictivo { background: #e11d48; }

/* ==========================================================================
   TABS & SEGMENTED CONTROLS (LUMINOUS LUXURY)
   ========================================================================== */
.tabs-wrapper {
  margin-bottom: 28px;
}

.tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tabs-nav::-webkit-scrollbar {
  height: 4px;
}
.tabs-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.tab-btn i {
  font-size: 14px;
  color: var(--text-muted);
  transition: var(--transition);
}

.tab-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}
.tab-btn:hover i {
  color: var(--gold-primary);
}

.tab-btn.active {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}
.tab-btn.active i {
  color: #e5b869;
}

.tab-content-pane {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   MODAL DIALOGS & OVERLAYS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

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

.modal-content-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content-box.modal-xl {
  max-width: 1000px;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-modal {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.btn-close-modal:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================================================
   FORM CONTROLS & DROPZONE
   ========================================================================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-control, .form-control-luxury {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.form-control:focus, .form-control-luxury:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.12);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.dropzone-container {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.dropzone-container:hover, .dropzone-container.dragover {
  border-color: var(--gold-primary);
  background: var(--gold-bg-soft);
}
.dropzone-icon {
  font-size: 32px;
  color: var(--gold-primary);
  margin-bottom: 8px;
}

/* ==========================================================================
   TIMELINE (EXPEDIENTES & HITOS)
   ========================================================================== */
.timeline-list {
  position: relative;
  padding-left: 20px;
}
.timeline-list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #e2e8f0;
}
.timeline-item {
  position: relative;
  padding-bottom: 14px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--gold-primary);
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.15);
}
.timeline-date {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 2px;
}
.timeline-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==========================================================================
   BADGES & UTILITIES
   ========================================================================== */
.badge-primary {
  background: var(--gold-bg-soft);
  color: var(--gold-primary);
  border: 1px solid var(--border-gold-soft);
}
.badge-secondary {
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.badge-success {
  background: var(--productivo-bg);
  color: var(--productivo);
  border: 1px solid var(--productivo-border);
}
.badge-warning {
  background: var(--no-productivo-bg);
  color: var(--no-productivo);
  border: 1px solid var(--no-productivo-border);
}
.badge-danger {
  background: var(--conflictivo-bg);
  color: var(--conflictivo);
  border: 1px solid var(--conflictivo-border);
}
.badge-info {
  background: var(--info-cyan-bg);
  color: var(--info-cyan);
  border: 1px solid #bae6fd;
}

.text-primary { color: var(--gold-primary) !important; }
.text-success { color: var(--productivo) !important; }
.text-warning { color: var(--no-productivo) !important; }
.text-danger { color: var(--conflictivo) !important; }
.text-info { color: var(--info-cyan) !important; }

/* ==========================================================================
   PROPERTY CARDS (LUXURY GRID & PORTAL)
   ========================================================================== */
.property-card-luxury,
.property-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}
.property-card-luxury:hover,
.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(197, 155, 39, 0.45);
}

.property-card-cover,
.property-card-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  background-color: #0f172a;
}
.property-card-cover::before,
.property-card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.6) 0%, transparent 40%, rgba(15, 23, 42, 0.75) 100%);
  pointer-events: none;
}
.property-card-top-badges,
.property-card-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.property-card-bottom-info {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.property-card-body-luxury,
.property-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
}

.property-title-luxury {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.3;
}
.property-title-luxury a {
  color: #0f172a;
  transition: var(--transition);
}
.property-title-luxury a:hover {
  color: var(--gold-primary);
}

.property-address-luxury {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.property-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #f1f5f9;
  margin-bottom: 16px;
}
.metric-box-label {
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  display: block;
}
.metric-box-val {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

.property-health-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.property-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================================================
   GENERIC BUTTON SYSTEM
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}
.btn-primary {
  background: var(--gold-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
}
.btn-primary:hover {
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(184, 134, 11, 0.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}
.btn-success {
  background: var(--productivo-bg);
  color: var(--productivo);
  border: 1px solid var(--productivo-border);
}
.btn-warning {
  background: var(--no-productivo-bg);
  color: var(--no-productivo);
  border: 1px solid var(--no-productivo-border);
}
.btn-danger {
  background: var(--conflictivo-bg);
  color: var(--conflictivo);
  border: 1px solid var(--conflictivo-border);
}
.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}

/* ==========================================================================
   MODALES LUXURY & FORMULARIOS
   ========================================================================== */
.modal-custom, .modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-custom.active, .modal-backdrop.active {
  display: flex;
}

.modal-dialog-luxury, .modal-content-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.btn-close-alert {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-close-alert:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.form-group-luxury {
  margin-bottom: 16px;
}
.form-label-luxury, .form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control-luxury, .form-control {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  font-family: inherit;
}
.form-control-luxury:focus, .form-control:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.12);
}


