:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --border-color: #e2e8f0;
    --border-highlight: rgba(16, 185, 129, 0.35);
    
    /* Paleta de Marca: Verde Esmeralda + Naranja Vibrante */
    --emerald-primary: #059669;
    --emerald-light: #10b981;
    --emerald-bg: rgba(5, 150, 105, 0.08);
    
    --orange-accent: #f97316;
    --orange-hover: #ea580c;
    --orange-bg: rgba(249, 115, 22, 0.1);

    --teal-accent: #0d9488;
    --indigo-accent: #4f46e5;
    
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 4px 20px -4px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 12px 30px -6px rgba(15, 23, 42, 0.12);
    --shadow-orange: 0 4px 15px rgba(249, 115, 22, 0.3);
    --shadow-emerald: 0 4px 15px rgba(5, 150, 105, 0.3);
}

/* Badges de Plataformas Inmobiliarias */
.platform-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.4px !important;
    text-transform: uppercase !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    z-index: 5 !important;
}

.platform-badge.zonaprop {
    background: #2563eb !important;
    color: #ffffff !important;
    border: 1px solid #60a5fa !important;
}

.platform-badge.lavoz {
    background: #e11d48 !important;
    color: #ffffff !important;
    border: 1px solid #fda4af !important;
}

.owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

/* Badges de Índice de Tranquilidad & Seguridad por Barrio */
.safety-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.safety-badge.high {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.safety-badge.medium {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.safety-badge.care {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fdba74;
}

.amenity-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text-heading);
    border: 1px solid var(--border-color);
}

.listing-card.source-lavoz {
    border-top: 4px solid #e11d48 !important;
}

.listing-card.source-zonaprop {
    border-top: 4px solid #2563eb !important;
}

.card-address-box {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-heading);
    background: #f1f5f9;
    border-left: 3px solid var(--emerald-primary);
    padding: 5px 9px;
    border-radius: 4px;
    margin: 6px 0 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-body);
    font-family: var(--font-body);
    min-height: 100vh;
    background-image: 
        radial-gradient(at 10% 10%, rgba(16, 185, 129, 0.04) 0px, transparent 40%),
        radial-gradient(at 90% 90%, rgba(249, 115, 22, 0.04) 0px, transparent 40%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Header Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

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

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--emerald-primary), var(--teal-accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ffffff;
    box-shadow: var(--shadow-emerald);
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-heading);
}

.brand-text h1 span {
    color: var(--orange-accent);
}

.brand-text .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

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

.tab-switcher-main {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tab-main-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-main-btn.active {
    background: #ffffff;
    color: var(--emerald-primary);
    box-shadow: 0 2px 8px rgba(15,23,42,0.08);
}

/* Banner de Información / Guía */
.hero-guide-banner {
    background: linear-gradient(135deg, #ffffff 60%, rgba(249, 115, 22, 0.05));
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--orange-accent);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-card);
}

.guide-text h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--text-heading);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-text p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Layout Matcher */
.matcher-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
}

.matcher-sidebar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    max-height: 80vh;
    overflow-y: auto;
}

.client-item-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-item-card:hover, .client-item-card.active {
    background: #ffffff;
    border-color: var(--emerald-primary);
    box-shadow: 0 4px 12px rgba(5,150,105,0.12);
}

.client-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.client-demand-badge {
    display: inline-block;
    font-size: 11px;
    background: var(--orange-bg);
    color: var(--orange-hover);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 6px;
}

.matcher-content {
    display: flex;
    flex-direction: column;
}

.matcher-header-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.match-reason-pill {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    color: var(--text-heading);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.match-score-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--emerald-primary), var(--teal-accent));
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--emerald-light);
}

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

.metric-icon.emerald { background: var(--emerald-bg); color: var(--emerald-primary); }
.metric-icon.orange { background: var(--orange-bg); color: var(--orange-accent); }
.metric-icon.teal { background: rgba(13, 148, 136, 0.1); color: var(--teal-accent); }
.metric-icon.indigo { background: rgba(79, 70, 229, 0.1); color: var(--indigo-accent); }

.metric-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-data h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
    margin-top: 2px;
}

/* Filter Panel */
.filter-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-card);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.search-box input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px 10px 40px;
    color: var(--text-heading);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--emerald-primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label-sm {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-input {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-heading);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

.select-input.Highlight {
    border-color: var(--orange-accent);
    background: var(--orange-bg);
    color: var(--orange-hover);
    font-weight: 700;
}

.view-toggle {
    display: flex;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.toggle-btn.active {
    background: var(--emerald-primary);
    color: #ffffff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange-accent), #ea580c);
    color: #ffffff;
    box-shadow: var(--shadow-orange);
}

.btn-emerald {
    background: linear-gradient(135deg, var(--emerald-primary), #047857);
    color: #ffffff;
    box-shadow: var(--shadow-emerald);
}

.btn-secondary {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-heading);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Listings Grid */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 22px;
    margin-bottom: 24px;
}

.property-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: var(--shadow-card);
    position: relative;
}

.property-card:hover {
    transform: translateY(-5px);
    border-color: var(--emerald-light);
    box-shadow: var(--shadow-hover);
}

.card-image-wrap {
    position: relative;
    height: 195px;
    background: #e2e8f0;
    overflow: hidden;
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--emerald-primary);
    border: 1px solid rgba(5, 150, 105, 0.3);
}

.price-tag {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.9);
    padding: 6px 14px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 16px;
    color: #ffffff;
}

.card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.card-location {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-specs {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

/* Data Table View */
.table-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    background: #f8fafc;
    padding: 14px 16px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table-thumb {
    width: 55px;
    height: 42px;
    border-radius: 6px;
    object-fit: cover;
}

/* Pagination Bar */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-muted);
    box-shadow: var(--shadow-card);
}

.hidden {
    display: none !important;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card, .modal-box {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 28px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--text-heading);
}

.modal-medium {
    max-width: 580px;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 22px;
    background: #f1f5f9;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-heading);
    text-transform: uppercase;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-control {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-heading);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
}

.form-control:focus {
    border-color: var(--emerald-primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.progress-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-heading);
}

.progress-bar-wrap {
    height: 10px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald-primary), var(--orange-accent));
    transition: width 0.3s ease;
}

/* Tabla SaaS Premium & CRM Styling */
.table-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow-x: auto;
    margin-bottom: 24px;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-body);
    text-align: left;
}

.crm-table th {
    background: #f8fafc;
    color: var(--text-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.crm-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    line-height: 1.4;
}

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

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