/**
 * Propiedades — refuerzo visual del listado, ficha y formularios
 * (convive con premium_tech.css y Bootstrap)
 */

/* ═══════════════════════════════════════════════════════════════════
   PROPERTY VIEW — FULL-SCREEN SIDEBAR LAYOUT  (pv-*)
   Layout full-width · sin max-width · sidebar sticky real
   ═══════════════════════════════════════════════════════════════════ */

/* ── Wrapper externo: ocupa todo el content area ── */
#screenContent {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.pv-ficha-header {
    flex-shrink: 0;
    background: linear-gradient(135deg, #0c1222 0%, #1a2640 60%, #0f1f35 100%);
    border-bottom: 2px solid #0ea5e9;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.pv-ficha-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0%, rgba(14, 165, 233, 0.04) 50%, transparent 100%),
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(14, 165, 233, 0.04) 20px);
    pointer-events: none;
}

.pv-ficha-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.pv-ficha-icon {
    width: 36px;
    height: 36px;
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pv-ficha-icon i {
    color: #38bdf8;
    font-size: 1rem;
}

.pv-ficha-title {
    font-size: 1rem;
    font-weight: 900;
    color: #f1f5f9;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.pv-ficha-meta {
    font-size: 0.6rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
}

.pv-ficha-project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.pv-ficha-project-link:hover {
    background: rgba(99, 102, 241, 0.35);
    color: #fff;
    transform: translateY(-1px);
}

.pv-ficha-header-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.pv-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: all 0.15s ease;
}

.pv-btn-back:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.22);
}

.pv-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.4);
    color: #38bdf8;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.pv-btn-action:hover {
    background: rgba(14, 165, 233, 0.28);
    color: #fff;
    border-color: rgba(14, 165, 233, 0.7);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.2);
}

.pv-btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: all 0.15s ease;
}

.pv-btn-pdf:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* ── Body: CSS Grid full-width, colores claros del sistema ── */
.pv-fullscreen-sheet {
    width: 100%;
    background: #f4f6f8;
}

.pv-layout-grid {
    display: grid !important;
    grid-template-columns: 7fr 3fr;
    align-items: start;
    gap: 16px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Columna principal ── */
.pv-main-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    width: 100%;
    background: transparent;
    align-self: start;
}

/* Los bloques en la col principal no necesitan margin-top extra — gap lo maneja */
.pv-main-col>.tech-data-block {
    margin-top: 0 !important;
}

/* ── Sidebar ── */
.pv-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    width: 100%;
    background: transparent;
    position: -webkit-sticky;
    position: sticky;
    top: 16px;
    align-self: start;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.pv-sidebar-col::-webkit-scrollbar {
    width: 4px;
}

.pv-sidebar-col::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* ── Cards: sin overrides de color — usa el sistema base (blanco) ── */
.pv-main-col .tech-data-block,
.pv-sidebar-col .tech-data-block {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Compactar ligeramente los headers colapsables */
.pv-main-col .tech-section-header,
.pv-sidebar-col .tech-section-header {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
}

/* Responsive */
@media (max-width: 1100px) {
    .pv-layout-grid {
        grid-template-columns: 1fr 270px;
    }
}

@media (max-width: 900px) {
    .pv-layout-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .pv-main-col,
    .pv-sidebar-col {
        height: auto;
        overflow-y: visible;
    }

    .pv-sidebar-col {
        border-left: none;
        border-top: 1px solid #dde4eb;
        position: static;
    }
}

/* ——— Listado ——— */
.properties-list-page {
    padding-top: 0.35rem;
}

.prop-list-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1rem;
    padding: 1.35rem 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #334155 42%, #0f172a 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 12px 40px -12px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.prop-list-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 90% 70% at 100% 0%, rgba(59, 130, 246, 0.18), transparent 55%);
    pointer-events: none;
}

.prop-list-hero-main {
    position: relative;
    z-index: 1;
    flex: 1 1 220px;
    min-width: 0;
}

.prop-list-hero h1 {
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.03em;
    margin: 0 0 0.4rem 0;
    line-height: 1.2;
}

.prop-list-hero p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(226, 232, 240, 0.88);
    max-width: 38rem;
    line-height: 1.5;
}

.prop-list-stats {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.prop-stat-card {
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    min-width: 102px;
    text-align: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.prop-stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.prop-stat-card .stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.prop-stat-card .stat-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(226, 232, 240, 0.78);
    font-weight: 700;
    margin-top: 0.28rem;
}

.prop-stat-card.stat-project .stat-value {
    color: #6ee7b7;
}

.prop-stat-card.stat-inquiry .stat-value {
    color: #fcd34d;
}

.prop-list-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.15rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 0.68rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.prop-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.prop-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.prop-legend-dot.project {
    background: #10b981;
}

.prop-legend-dot.inquiry {
    background: #f59e0b;
}

.prop-legend-dot.ph {
    background: #d97706;
}

.prop-legend-dot.tierra {
    background: #94a3b8;
}

.prop-legend-dot.debt {
    background: #ef4444;
}

.prop-list-legend-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    flex: 1 1 240px;
    min-width: 0;
    justify-content: flex-end;
}

.prop-list-search-slot {
    flex: 1 1 160px;
    min-width: min(100%, 160px);
    max-width: 320px;
    margin: 0;
}

.prop-list-perpage-slot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.prop-list-perpage-slot .datatable-selector,
.prop-list-perpage-slot .dataTable-selector {
    float: none !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    gap: 0.35rem;
}

.prop-list-perpage-slot select {
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    font-size: 0.8rem !important;
    padding: 0.28rem 1.75rem 0.28rem 0.5rem !important;
}

.prop-list-search-slot .dataTable-search,
.prop-list-search-slot .datatable-search {
    width: 100%;
    margin: 0 !important;
}

.prop-list-search-slot .dataTable-search input,
.prop-list-search-slot .dataTable-search .datatable-input,
.prop-list-search-slot .datatable-search input,
.prop-list-search-slot input {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 0.8rem !important;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

@media (max-width: 576px) {
    .prop-list-legend-controls {
        flex-basis: 100%;
        justify-content: stretch;
    }

    .prop-list-search-slot {
        flex-basis: 100%;
        max-width: none;
    }

    .prop-list-perpage-slot {
        width: 100%;
        justify-content: flex-start;
    }
}

.properties-list-page .prop-bulk-bar {
    border-radius: 12px !important;
    border: 1px solid #bfdbfe !important;
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%) !important;
    box-shadow: 0 4px 20px -4px rgba(37, 99, 235, 0.18) !important;
}

.properties-list-page .properties-table-wrap {
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 8px 32px -8px rgba(15, 23, 42, 0.16),
        0 0 0 1px rgba(15, 23, 42, 0.04);
}

.properties-list-page .property-card-container {
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
    transition:
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%) !important;
}

.properties-list-page tr:hover .property-card-container {
    box-shadow: 0 8px 26px -6px rgba(15, 23, 42, 0.12) !important;
    border-color: #cbd5e1 !important;
}

.properties-list-page .action-buttons .btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.properties-list-page .action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

/* Simple DataTables — listado propiedades (dataTable- y datatable-) */
.properties-list-page .dataTable-top,
.properties-list-page .datatable-top {
    padding: 0.65rem 1rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

.properties-list-page .dataTable-search input,
.properties-list-page .dataTable-input,
.properties-list-page .datatable-search input,
.properties-list-page .datatable-input {
    border-radius: 10px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
    min-width: 200px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.properties-list-page .dataTable-search input:focus,
.properties-list-page .dataTable-input:focus,
.properties-list-page .datatable-search input:focus,
.properties-list-page .datatable-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    outline: none;
}

.properties-list-page .dataTable-selector,
.properties-list-page .datatable-selector {
    border-radius: 8px !important;
    border-color: #cbd5e1 !important;
}

.properties-list-page .dataTable-info,
.properties-list-page .datatable-info {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.properties-list-page .dataTable-pagination a:hover,
.properties-list-page .dataTable-pagination button:hover,
.properties-list-page .datatable-pagination a:hover,
.properties-list-page .datatable-pagination button:hover {
    background: #f1f5f9;
}

/* ——— Ficha (vista) ——— compacta y plana */
.property-ficha-page .prop-ficha-sheet {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 0 0 1px #e5e7eb;
    background: #fff;
}

.prop-ficha-head {
    padding: 0.45rem 0.75rem 0.4rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

@media (min-width: 576px) {
    .prop-ficha-head {
        padding: 0.5rem 1rem 0.45rem;
    }
}

.prop-ficha-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem 0.65rem;
}

.prop-ficha-head-left {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    min-width: 0;
    flex: 1 1 180px;
}

.prop-ficha-back--compact {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.prop-ficha-back--compact:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}

.prop-ficha-back-txt {
    display: none;
}

@media (min-width: 480px) {
    .prop-ficha-back-txt {
        display: inline;
    }
}

.prop-ficha-head-titles {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.06rem;
}

.prop-ficha-idpill {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
    line-height: 1.2;
}

.prop-ficha-h1 {
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0;
    color: #0f172a;
}

.prop-ficha-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    justify-content: flex-end;
    max-width: 100%;
}

.prop-ficha-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.22rem;
    align-items: center;
    margin-right: 0.15rem;
}

.prop-ficha-pill {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.18rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    color: #64748b;
    background: #f9fafb;
    line-height: 1.2;
}

.prop-ficha-pill--tierra {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.prop-ficha-pill--ph {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.prop-ficha-pill--neutral {
    text-transform: none;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 0.62rem;
}

.prop-ficha-pill--warn {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.prop-ficha-pill--info {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.prop-ficha-pill--danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.prop-ficha-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.32rem 0.55rem;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #475569;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
    white-space: nowrap;
}

.property-ficha-page .prop-ficha-btn span {
    display: none;
}

@media (min-width: 400px) {
    .property-ficha-page .prop-ficha-btn span {
        display: inline;
    }
}

.prop-ficha-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #d1d5db;
}

.prop-ficha-btn--primary {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff !important;
}

.prop-ficha-btn--primary:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff !important;
}

.prop-ficha-subline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.45rem;
    margin-top: 0.35rem;
    padding-top: 0.3rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.4;
}

.prop-ficha-subline-item i {
    margin-right: 0.15rem;
    color: #94a3b8;
    font-size: 0.65rem;
}

.prop-ficha-subdot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}

.prop-ficha-body-v2 {
    padding: 0.75rem 0.75rem 1.1rem;
    background: #eef1f4;
}

@media (min-width: 768px) {
    .prop-ficha-body-v2 {
        padding: 0.9rem 1rem 1.35rem;
    }
}

.prop-ficha-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.property-ficha-page .prop-ficha-card {
    border-radius: 10px !important;
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
    transition:
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.property-ficha-page .prop-ficha-card:hover {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
    border-color: #d1d5db !important;
}

.property-ficha-page .prop-ficha-card .tech-section-header {
    padding: 0.5rem 0.75rem !important;
    min-height: 0;
    font-size: 0.65rem !important;
    letter-spacing: 0.06em !important;
    background: #fafafa !important;
    border-bottom: 1px solid #f4f4f5 !important;
    border-top: none !important;
    box-shadow: none !important;
}

.property-ficha-page .prop-ficha-card .tech-section-header:hover {
    background: #f4f4f5 !important;
}

.property-ficha-page .prop-ficha-card .tech-section-content {
    border-top: none;
}

.property-ficha-page .nom-display-val {
    font-weight: 600;
    font-size: 0.82rem;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.prop-ficha-prose {
    font-size: 0.84rem;
    line-height: 1.55;
    color: #475569;
    background: #fafafa;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
}

.prop-ficha-photo-box {
    min-height: 140px;
    max-height: 200px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.prop-ficha-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prop-ficha-chart-wrap {
    height: 96px;
    position: relative;
}

@media (min-width: 992px) {
    .property-ficha-page .prop-ficha-sidebar {
        position: sticky;
        top: 0.5rem;
        align-self: flex-start;
    }

    .prop-ficha-layout {
        align-items: flex-start;
    }
}

/* Bloques de métricas dentro de la ficha */
.property-ficha-page .prop-ficha-card .bg-light.rounded.border {
    border-color: #f1f5f9 !important;
    background: #fafafa !important;
    border-radius: 8px !important;
}

.property-ficha-page .prop-ficha-card .tech-data-table {
    font-size: 0.8rem;
}

.property-ficha-page .prop-ficha-card .pill-btn {
    font-size: 0.62rem;
    padding: 4px 10px 4px 8px;
}

.property-ficha-page .prop-ficha-card .list-group-item {
    padding: 0.55rem 0.75rem !important;
    font-size: 0.8rem;
}

.property-ficha-page .prop-ficha-card .property-task-item .tech-grid {
    padding: 0.65rem 0.75rem !important;
}

/* ——— Formularios alta / edición ——— */
.property-form-page .premium-card {
    box-shadow:
        0 16px 48px -12px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(15, 23, 42, 0.05);
    border-radius: 14px;
}

@media (max-width: 768px) {
    .prop-list-hero {
        padding: 1rem 1.15rem;
    }

    .prop-list-stats {
        width: 100%;
        justify-content: space-between;
    }

    .prop-stat-card {
        flex: 1;
        min-width: 0;
    }

    .prop-ficha-head-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .prop-ficha-pills {
        width: 100%;
        margin-right: 0;
    }
}

/* ════════════════════════════════════════════════
   TAREAS Y GASTOS — SISTEMA COMPACTO TERMINAL (tg-*)
   Cyber-Brutalismo / Estética CAD · Alta densidad
   ════════════════════════════════════════════════ */

/* ─── COUNT BADGE ─── */
.tg-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: #0ea5e9;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* ─── SUB-HEADERS ─── */
.tg-subheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px 5px 12px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    gap: 0.5rem;
}

.tg-subheader-alt {
    margin-top: 0;
    border-top: 2px solid #e2e8f0;
}

.tg-subheader-label {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    white-space: nowrap;
}

/* ─── ACTION BUTTONS ─── */
.tg-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.1s ease;
    line-height: 1.5;
}

.tg-action-btn:hover {
    transform: translateY(-1px);
}

.tg-btn-blue {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.35);
    color: #0369a1;
}

.tg-btn-blue:hover {
    background: rgba(14, 165, 233, 0.2);
    color: #0284c7;
}

.tg-btn-teal {
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.35);
    color: #0f766e;
}

.tg-btn-teal:hover {
    background: rgba(20, 184, 166, 0.2);
    color: #0d9488;
}

.tg-btn-ghost {
    background: rgba(100, 116, 139, 0.08);
    border-color: rgba(100, 116, 139, 0.25);
    color: #475569;
}

.tg-btn-ghost:hover {
    background: rgba(100, 116, 139, 0.15);
    color: #334155;
}

/* ─── TASK TABLE ─── */
.tg-tasks-table {
    border-bottom: 1px solid #f1f5f9;
}

.tg-task-row {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s ease;
}

.tg-task-row:hover {
    background: #fafbfc;
}

.tg-task-row:last-child {
    border-bottom: none;
}

/* Grid de la fila principal: 7 columnas */
.tg-task-main {
    display: grid;
    grid-template-columns:
        /* id   */
        minmax(100px, auto)
        /* st   */
        80px
        /* ttl  */
        1fr
        /* resp */
        minmax(100px, 140px)
        /* dates*/
        auto
        /* cost */
        70px
        /* acts */
        50px;
    align-items: center;
    gap: 0;
    padding: 5px 8px 5px 0;
    min-height: 34px;
}

/* Col 1 — ID */
.tg-task-id {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    flex-wrap: wrap;
    row-gap: 2px;
}

.tg-id-code {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.64rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.tg-type-tag {
    font-size: 0.55rem;
    font-weight: 800;
    padding: 1px 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    color: #64748b;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.tg-proj-link {
    font-size: 0.56rem;
    font-weight: 700;
    padding: 1px 5px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 3px;
    color: #6366f1;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.tg-proj-link:hover {
    background: rgba(99, 102, 241, 0.18);
    color: #4f46e5;
}

/* Col 2 — Status */
.tg-task-status {
    padding: 3px 4px;
}

.tg-status-badge {
    display: inline-block;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}

.tg-status-warn {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #854d0e;
}

.tg-status-blue {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.4);
    color: #0369a1;
}

.tg-status-ok {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

/* Col 3 — Título */
.tg-task-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Col 4 — Responsable */
.tg-task-resp {
    font-size: 0.68rem;
    color: #64748b;
    padding: 3px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Col 5 — Fechas */
.tg-task-dates {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    white-space: nowrap;
}

.tg-date-item {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.64rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 3px;
}

.tg-date-sep {
    color: #cbd5e1;
    font-size: 0.65rem;
}

.tg-overdue {
    color: #dc2626 !important;
    font-weight: 700;
}

/* Col 6 — Costo */
.tg-task-cost {
    font-size: 0.7rem;
    font-weight: 700;
    color: #374151;
    padding: 3px 6px;
    text-align: right;
    white-space: nowrap;
}

/* Col 7 — Acciones */
.tg-task-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    padding: 3px 6px 3px 2px;
}

/* ─── ICON BUTTONS ─── */
.tg-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 0.62rem;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease;
    color: inherit;
    padding: 0;
}

.tg-icon-edit {
    color: #64748b;
}

.tg-icon-edit:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}

.tg-icon-del {
    color: #ef4444;
}

.tg-icon-del:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

/* ─── EXPAND BUTTON ─── */
.tg-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.5rem;
    color: #94a3b8;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.12s ease, transform 0.2s ease;
}

.tg-expand-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

.tg-expand-btn.tg-expanded i {
    transform: rotate(180deg);
}

.tg-expand-btn i {
    display: block;
    transition: transform 0.2s ease;
}

/* ─── DESCRIPTION PANEL ─── */
.tg-task-desc-panel {
    display: none;
    padding: 6px 12px 8px 16px;
    background: #f8fafc;
    border-top: 1px dashed #e2e8f0;
    font-size: 0.73rem;
    color: #475569;
    line-height: 1.55;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.tg-task-desc-panel.tg-open {
    display: block;
}

/* ─── SHARED UTILS ─── */
.tg-mono {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.tg-icon-faint {
    opacity: 0.35;
    font-size: 0.6rem;
}

/* ─── EMPTY STATE ─── */
.tg-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 10px;
    font-size: 0.72rem;
    color: #94a3b8;
    font-style: italic;
}

.tg-empty-state i {
    opacity: 0.35;
    font-size: 0.9rem;
}

.tg-empty-sm {
    padding: 8px 10px;
    font-size: 0.68rem;
}

.tg-empty-last {
    border-bottom: none;
}

/* ─── FINANCIAL TABLE (Gastos / Cobros) ─── */
.tg-fin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
    border-bottom: 1px solid #f1f5f9;
}

.tg-fin-last {
    border-bottom: none;
}

.tg-fin-table thead tr {
    background: #f8fafc;
    border-bottom: 1px solid #e8ecf2;
}

.tg-fin-table thead th {
    padding: 4px 8px;
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
    border: none;
    white-space: nowrap;
}

.tg-fin-table thead th.tg-num {
    text-align: right;
}

.tg-fin-table tbody tr {
    border-bottom: 1px solid #f8fafc;
    transition: background 0.1s ease;
}

.tg-fin-table tbody tr:hover {
    background: #fafbfc;
}

.tg-fin-table tbody td {
    padding: 5px 8px;
    vertical-align: middle;
    border: none;
}

.tg-date-col {
    width: 68px;
    white-space: nowrap;
    font-size: 0.66rem;
    color: #64748b;
}

.tg-fin-concept {
    display: block;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.74rem;
}

.tg-fin-sub {
    display: block;
    font-size: 0.62rem;
    color: #94a3b8;
    margin-top: 1px;
}

.tg-fin-sub i {
    opacity: 0.5;
}

.tg-num {
    text-align: right;
    white-space: nowrap;
}

.tg-expense-amt {
    font-size: 0.72rem;
    font-weight: 700;
    color: #0369a1;
}

.tg-payment-amt {
    font-size: 0.72rem;
    font-weight: 700;
    color: #059669;
}

.tg-fin-action {
    width: 28px;
    text-align: center;
    padding: 5px 4px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
    .tg-task-main {
        grid-template-columns: auto 75px 1fr auto 40px;
        grid-template-rows: auto auto;
    }

    .tg-task-resp,
    .tg-task-dates,
    .tg-task-cost {
        display: none;
    }
}

/* ════════════════════════════════════════════════
   CLIENTES Y TITULARES — SISTEMA COMPACTO (ct-*)
   Consistent with Tareas y Gastos (tg-*)
   ════════════════════════════════════════════════ */

.ct-list {
    display: flex;
    flex-direction: column;
}

.ct-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s ease;
}

.ct-row:hover {
    background: #fafbfc;
}

.ct-row:last-child {
    border-bottom: none;
}

.ct-icon-cell {
    width: 24px;
    display: flex;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.ct-main-cell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-width: 0;
}

.ct-name-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ct-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-role {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #3b82f6;
    margin-top: -1px;
}

.ct-data-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ct-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #475569;
    white-space: nowrap;
}

.ct-badge i {
    opacity: 0.4;
    margin-right: 3px;
}

.ct-empty {
    padding: 12px;
    font-size: 0.72rem;
    color: #94a3b8;
    font-style: italic;
    text-align: center;
}

/* ─── FORM HEADER BANNER ─── */
.tech-header-banner {
    border-bottom: 2px solid var(--tech-accent);
}

.tech-header-banner h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 850;
    margin-bottom: 0;
}

.tech-header-banner p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tech-header-banner .badge {
    vertical-align: middle;
    font-family: 'Outfit', sans-serif;
}

.tech-header-banner .progress {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ─── FIELD HELPERS ─── */
.tech-field-c {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tech-label-c {
    font-size: 0.64rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Outfit', sans-serif;
}

.tech-input-c {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #1e293b;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tech-input-c:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #fff;
}

.tech-select-c {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
}

.tech-textarea-c {
    min-height: 100px;
    resize: vertical;
}

.nom-variant-box {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nom-field {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 4px;
    width: 100%;
    height: 32px;
}

.nom-field:focus {
    border-color: #3b82f6;
    background: #f0f9ff;
    outline: none;
}

.nom-display-field {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px;
    width: 100%;
    min-height: 28px;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === PROPERTY PREMIUM UI UPGRADES === */
.tech-sheet-container {
    background: #f8fafc;
    border-radius: 0 0 14px 14px;
    border: 1px solid #e2e8f0;
    border-top: none;
    overflow: hidden;
}

.tech-data-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tech-data-block:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.tech-section-header {
    background: #f1f5f9;
    padding: 0.85rem 1.25rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.tech-section-header:hover {
    background: #e2e8f0;
}

.tech-section-header.collapsed {
    border-bottom: none;
}

/* PILL BUTTONS */
.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 11px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    border-left-color: #94a3b8;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: all 0.15s ease;
    line-height: 1.5;
    white-space: nowrap;
    font-family: 'Outfit', sans-serif;
    color: #334155;
}

.pill-btn i {
    font-size: 0.65rem;
    opacity: 0.75;
}

.pill-btn:hover {
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12), 0 1px 4px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
    text-decoration: none;
    color: #0f172a;
}

.pill-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.pill-edit {
    color: #475569;
    border-left-color: #3b82f6;
}

.pill-edit:hover {
    color: #1d4ed8;
    border-left-color: #2563eb;
    background: #f0f6ff;
}

.pill-action-primary {
    color: #1e3a5f;
    border-left-color: #2563eb;
}

.pill-action-primary:hover {
    color: #1d4ed8;
    border-left-color: #1d4ed8;
    background: #eff6ff;
}

.pill-action-teal {
    color: #134e4a;
    border-left-color: #10b981;
}

.pill-action-teal:hover {
    color: #047857;
    border-left-color: #059669;
    background: #f0fdf9;
}

.pill-action-violet {
    color: #3b0764;
    border-left-color: #7c3aed;
}

.pill-action-violet:hover {
    color: #6d28d9;
    border-left-color: #6d28d9;
    background: #f5f3ff;
}

.pill-action-secondary {
    color: #374151;
    border-left-color: #94a3b8;
}

.pill-action-secondary:hover {
    color: #111827;
    border-left-color: #64748b;
    background: #f8fafc;
}

.pill-danger {
    color: #991b1b;
    border-left-color: #ef4444;
}

.pill-danger:hover {
    color: #7f1d1d;
    border-left-color: #dc2626;
    background: #fef2f2;
}

.pill-view {
    color: #1e3a8a;
    border-left-color: #6366f1;
}

.pill-view:hover {
    color: #3730a3;
    border-left-color: #4f46e5;
    background: #eef2ff;
}

.pill-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

/* COMPACT EDITOR */
.pe-form-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0.75rem;
    padding: 0.75rem;
    align-items: start;
}

@media (max-width: 992px) {
    .pe-form-grid {
        grid-template-columns: 1fr;
    }
}

.pe-left {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.pe-right {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    position: sticky;
    top: 0;
}

.pe-card {
    background: #fff;
    border-radius: 11px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.pe-card-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 0.55rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.pe-card-header h6 {
    margin: 0;
    color: #f1f5f9;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.pe-accent-dot {
    width: 3px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.pe-card-body {
    padding: 0.75rem;
}

.tech-grid-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem 0.7rem;
}

.pe-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1.4rem;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    text-transform: uppercase;
}

.pe-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

.pe-btn-discard {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: #ffffff;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pe-btn-discard:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}