* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Segoe UI, Arial, sans-serif; background: #f4f6f8; color: #17202a; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: #102027; color: #ecf4f1; padding: 24px 18px; }
.brand { font-weight: 800; font-size: 20px; line-height: 1.15; margin-bottom: 26px; }
.brand span { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; color: #b9cbc8; }
.current-project { border: 1px solid #27464f; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #142d35; }
.current-project span { display: block; color: #9fb4af; font-size: 11px; font-weight: 800; text-transform: uppercase; margin-bottom: 4px; }
.current-project strong { display: block; color: #fff; font-size: 14px; line-height: 1.25; }
.current-project a { display: inline-flex; margin-top: 8px; color: #b9cbc8; font-size: 12px; font-weight: 800; }
.sidebar-selector { margin-bottom: 18px; }
.sidebar-selector select { background: #f8fafb; border: 0; padding: 8px 10px; font-size: 13px; }
.nav { display: grid; gap: 8px; }
.accordion-nav { gap: 6px; }
.nav-section { margin-top: 12px; font-size: 11px; color: #9fb4af; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; }
.nav a, .logout { border: 0; width: 100%; text-align: left; display: block; padding: 11px 12px; border-radius: 8px; background: transparent; color: #dce8e4; font: inherit; cursor: pointer; }
.nav a:hover, .logout:hover { background: #1f3b43; }
.sidebar-link.active, .nav a.active { background: #0f766e; color: #fff; font-weight: 800; }
.sidebar-group { border-radius: 8px; overflow: hidden; }
.sidebar-group-toggle { border: 0; width: 100%; display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 8px; background: transparent; color: #ecf4f1; font: inherit; font-weight: 800; cursor: pointer; text-align: left; }
.sidebar-group-toggle::after { content: "+"; margin-left: auto; color: #9fb4af; font-weight: 800; }
.sidebar-group-toggle:hover, .sidebar-group.active > .sidebar-group-toggle { background: #18343d; }
.sidebar-group.open > .sidebar-group-toggle::after { content: "-"; }
.sidebar-group-toggle span { width: 18px; color: #9fd3c7; text-align: center; }
.sidebar-submenu { display: none; padding-top: 4px; }
.sidebar-group.open .sidebar-submenu { display: block; }
.sidebar-submenu a, .nav-disabled { margin-top: 4px; padding-left: 36px; font-size: 14px; }
.nav-disabled { display: block; color: #78908b; padding-top: 10px; padding-bottom: 10px; cursor: default; }
.main { padding: 28px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 22px; }
.title { margin: 0; font-size: 28px; }
.subtitle { font-size: 18px; font-weight: 700; color: #0f766e; margin-top: 4px; }
.muted { color: #6c7a80; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; padding: 10px 14px; background: #0f766e; color: #fff; font-weight: 700; cursor: pointer; }
.btn.secondary { background: #dce4e8; color: #17202a; }
.btn.danger { background: #b42318; }
.check-list { display: grid; gap: 4px; }
.check-row.compact { margin-top: 0; font-weight: 600; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: #fff; border: 1px solid #dce4e8; border-radius: 8px; padding: 18px; box-shadow: 0 1px 2px rgba(16,32,39,.04); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-urbanizaciones { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.project-card { overflow: hidden; background: #fff; border: 1px solid #dce4e8; border-radius: 8px; box-shadow: 0 1px 2px rgba(16,32,39,.04); }
.project-card img, .project-placeholder { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; background: #eef3f4; display: grid; place-items: center; color: #6c7a80; }
.grid-urbanizaciones .project-card img,
.grid-urbanizaciones .project-placeholder { height: 170px; aspect-ratio: auto; object-fit: cover; }
.project-body { display: grid; gap: 12px; padding: 16px; }
.grid-urbanizaciones .project-body { gap: 10px; padding: 14px; }
.grid-urbanizaciones .project-body form .btn { width: 100%; }
.project-body h2 { margin: 0; }
.project-owner { margin: 0; font-size: 13px; color: #4d5d64; }
.project-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 14px; }
.public-page { max-width: 1180px; margin: 0 auto; padding: 28px; }
.public-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 22px; }
.public-header h1 { margin: 0; font-size: 30px; }
.public-header p { margin: 4px 0 0; color: #0f766e; font-weight: 700; }
.public-filter { max-width: none; margin-bottom: 18px; }
.public-link-box,
.public-link-cell { display: grid; gap: 6px; max-width: 360px; }
.public-link-box { margin-top: 10px; }
.public-link-box span,
.public-link-cell span { color: #6c7a80; font-size: 13px; font-weight: 800; }
.public-link-box a,
.public-link-cell a { color: #0f766e; font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
.public-link-qr { width: 110px; height: 110px; border: 1px solid #dce4e8; border-radius: 8px; padding: 6px; background: #fff; }
.public-cta { margin-top: 18px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.hero-panel { display: flex; justify-content: space-between; align-items: center; gap: 18px; background: #fff; border: 1px solid #dce4e8; border-left: 6px solid #0f766e; border-radius: 8px; padding: 22px; margin-bottom: 18px; }
.metric { border-top: 4px solid #0f766e; }
.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.report-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.report-link-card { display: grid; gap: 8px; }
.report-link-card strong { font-size: 18px; color: #0f766e; }
.report-link-card span { color: #6c7a80; font-size: 14px; }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 86px; align-items: center; gap: 10px; }
.bar-track { height: 14px; border-radius: 999px; overflow: hidden; background: #edf2f4; }
.bar-fill { height: 100%; border-radius: 999px; background: #0f766e; }
.bar-fill.disponible { background: #16a34a; }
.bar-fill.vendido { background: #dc2626; }
.bar-fill.reservado { background: #2563eb; }
.bar-fill.bloqueado { background: #6b7280; }
.bar-fill.income { background: #0f766e; }
.footer { margin-top: 28px; padding-top: 16px; border-top: 1px solid #dce4e8; color: #6c7a80; font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 6px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #dce4e8; border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid #e8edf0; text-align: left; vertical-align: top; }
.table th { background: #eef3f4; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #4d5d64; }
.sort-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; cursor: pointer; }
.sort-link:hover, .sort-link.active { color: var(--primary); }
.sort-indicator { font-weight: 900; }
.actions { display: flex; gap: 8px; align-items: center; }
.context-title { margin: 0 0 5px; color: #0f766e; font-size: 14px; font-weight: 800; }
.filter-form { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; align-items: end; max-width: none; margin-bottom: 18px; padding: 16px; }
.filter-form.compact { grid-template-columns: minmax(240px, 1fr) auto; }
.filter-form.list-filters { grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(150px, 1fr)) auto; }
.filter-form.sales-filters { grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(140px, 1fr)) auto; }
.filter-form.cash-filters { grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(130px, 1fr)); }
.filter-form.cash-filters .filter-actions { grid-column: 1 / -1; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-actions .btn { min-height: 42px; }
.list-summary { margin: 0 0 10px; color: #6c7a80; font-size: 14px; font-weight: 700; }
.empty-table { padding: 26px !important; text-align: center !important; color: #6c7a80; font-weight: 700; }
.table-scroll { width: 100%; overflow-x: auto; }
.receipt-verification-page { max-width: 760px; }
.receipt-verification-card { display: grid; gap: 18px; }
.receipt-public-header { display: flex; gap: 14px; align-items: center; border-bottom: 1px solid #dce4e8; padding-bottom: 14px; }
.receipt-public-header img { max-width: 74px; max-height: 74px; object-fit: contain; }
.receipt-public-header h1 { margin: 0; font-size: 24px; }
.receipt-public-header p { margin: 4px 0 0; color: #6c7a80; font-weight: 700; }
.receipt-status { border-radius: 8px; padding: 14px 16px; font-weight: 900; text-align: center; letter-spacing: .04em; }
.receipt-status-valid { background: #dff7ea; color: #125b34; }
.receipt-status-annulled,
.receipt-status-missing { background: #fde7e7; color: #8a1f11; }
.receipt-public-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.receipt-public-details div { border: 1px solid #dce4e8; border-radius: 8px; padding: 12px; background: #f8fafb; }
.receipt-public-details dt { color: #6c7a80; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.receipt-public-details dd { margin: 4px 0 0; font-weight: 800; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 920px; }
.check-row { display: flex; gap: 8px; align-items: center; margin-top: 26px; }
.check-row input { width: auto; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.cliente-search { position: relative; }
.cliente-search-results { display: grid; gap: 4px; position: absolute; left: 0; right: 0; top: 100%; z-index: 30; max-height: 240px; overflow: auto; padding: 6px; border: 1px solid #cbd5da; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(16,32,39,.14); }
.cliente-search-results[hidden] { display: none !important; }
.cliente-search-result { display: grid; gap: 2px; width: 100%; border: 0; border-radius: 6px; padding: 9px 10px; background: #f8fafb; text-align: left; cursor: pointer; }
.cliente-search-results .cliente-search-result + .cliente-search-result { margin-top: 4px; }
.cliente-search-result:hover { background: #dce4e8; }
.cliente-search-result span { color: #6c7a80; font-size: 13px; }
.cliente-selected-card { border: 1px solid #dce4e8; border-left: 4px solid #0f766e; border-radius: 8px; padding: 10px 12px; background: #f8fafb; }
.cliente-selected-card strong { display: block; margin-bottom: 6px; }
.cliente-selected-detail { margin-top: 3px; color: #4d5d64; font-size: 13px; font-weight: 700; }
.cliente-selected-card span { color: #6c7a80; font-size: 13px; }
.cliente-validation-error { color: #b42318; font-size: 13px; font-weight: 700; }
label { font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid #cbd5da; border-radius: 8px; padding: 10px 12px; font: inherit; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
.status { margin-bottom: 16px; padding: 12px 14px; border-radius: 8px; background: #dff7ea; color: #125b34; }
.errors { margin-bottom: 16px; padding: 12px 14px; border-radius: 8px; background: #fde7e7; color: #8a1f11; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.disponible { background: #dff7ea; color: #125b34; }
.reservado { background: #dbeafe; color: #1d4ed8; }
.vendido { background: #fde7e7; color: #8a1f11; }
.bloqueado { background: #e7ecf2; color: #34404a; }
.activa { background: #dff7ea; color: #125b34; }
.convertida { background: #e0f2fe; color: #075985; }
.cancelada { background: #e7ecf2; color: #34404a; }
.parcial { background: #fff2cc; color: #7a4b00; }
.pagada { background: #dff7ea; color: #125b34; }
.pendiente, .vencida { background: #fde7e7; color: #8a1f11; }
.map-section { margin-top: 18px; }
.map-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: 13px; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 999px; margin-right: 6px; vertical-align: -1px; }
.legend-dot.disponible { background: #16a34a; }
.legend-dot.vendido { background: #dc2626; }
.legend-dot.reservado { background: #2563eb; }
.legend-dot.bloqueado { background: #6b7280; }
.empty-plan { border: 1px dashed #cbd5da; border-radius: 8px; padding: 42px; text-align: center; color: #6c7a80; background: #f8fafb; }
.plan-preview { display: block; width: min(720px, 100%); height: auto; border: 1px solid #dce4e8; border-radius: 8px; }
.map-shell { position: relative; }
.map-zoom-controls { position: absolute; top: 12px; right: 12px; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; max-width: min(360px, calc(100% - 24px)); padding: 8px; border-radius: 8px; background: rgba(255,255,255,.92); box-shadow: 0 6px 18px rgba(16,32,39,.18); pointer-events: auto; }
.map-zoom-controls .btn { min-width: 44px; min-height: 42px; padding: 9px 12px; }
.zoom-value { min-width: 54px; text-align: center; font-weight: 800; color: #17202a; }
.map-help { margin-bottom: 12px; }
.plan-map-viewport { position: relative; width: 100%; border-radius: 8px; border: 1px solid #cbd5da; overflow: hidden; background: #f8fafb; touch-action: none; z-index: 1; }
.plan-map-viewport.pannable { cursor: grab; }
.plan-map-viewport.panning { cursor: grabbing; }
.plan-map-viewport.editing { cursor: crosshair; outline: 3px solid #0f766e; }
.map-modal-open .plan-map-viewport { pointer-events: none; }
.plan-map-layer { position: relative; width: 100%; transform-origin: 0 0; will-change: transform; transition: transform .12s ease-out; }
.plan-map-image { display: block; width: 100%; height: auto; user-select: none; pointer-events: none; }
.edit-panel { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; align-items: end; border: 1px solid #dce4e8; border-radius: 8px; padding: 14px; margin-bottom: 14px; background: #f8fafb; }
.edit-panel[hidden] { display: none; }
.map-point,
.lot-point { position: absolute; inline-size: clamp(8px, 1.4vw, 22px); block-size: clamp(8px, 1.4vw, 22px); transform: translate(-50%, -50%); transform-origin: center; border: clamp(1px, .16vw, 2px) solid #fff; border-radius: 999px; box-shadow: 0 3px 10px rgba(0,0,0,.25); cursor: pointer; padding: 0; color: #fff; font-size: clamp(6px, .7vw, 11px); font-weight: 800; z-index: 2; display: inline-grid; place-items: center; }
.map-point span,
.lot-point span { display: block; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.plan-map-layer.zoom-labels-hidden .lot-point span { display: none; }
.map-point.disponible { background: #16a34a; }
.map-point.vendido { background: #dc2626; }
.map-point.reservado { background: #2563eb; }
.map-point.bloqueado { background: #6b7280; }
.map-point.public { pointer-events: none; }
.map-modal { display: none; position: fixed; inset: 0; background: rgba(16,32,39,.45); place-items: center; padding: 24px; z-index: 10; }
.modal-overlay { position: fixed; inset: 0; background: rgba(16,32,39,.45); z-index: 9999; pointer-events: auto; }
.lot-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; pointer-events: auto; }
.lot-modal .map-dialog,
.lot-modal a,
.lot-modal button { pointer-events: auto; }
.map-dialog { position: relative; z-index: 10001; background: #fff; width: min(480px, 100%); border-radius: 8px; padding: 20px; }
.map-grid { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 10px; }
.lot-tile { min-height: 78px; border: 2px solid transparent; border-radius: 8px; padding: 10px; display: grid; gap: 4px; align-content: center; }
.login-page { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #102027, #0f766e); background-position: center; background-repeat: no-repeat; background-size: cover; }
.login-page.has-background::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.login-card { position: relative; z-index: 1; display: grid; gap: 16px; width: min(420px, 100%); padding: 32px; border: 1px solid rgba(255,255,255,.65); border-radius: 16px; background: rgba(255,255,255,.92); box-shadow: 0 20px 50px rgba(0,0,0,.22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.login-heading { display: grid; justify-items: center; gap: 7px; text-align: center; }
.login-heading h1 { margin: 0; font-size: 27px; line-height: 1.15; }
.login-heading p { margin: 0; color: #526168; font-weight: 700; }
.login-heading span { color: #6c7a80; font-size: 13px; }
.login-logo { display: block; max-width: min(220px, 100%); max-height: 100px; margin-bottom: 5px; object-fit: contain; }
.login-field { text-align: left; }
.login-remember { display: flex; gap: 8px; align-items: center; justify-self: start; }
.login-remember input { width: auto; }
.login-submit { width: 100%; }
.image-setting { align-content: start; }
.setting-image-preview { display: grid; place-items: center; min-height: 100px; margin-bottom: 8px; padding: 10px; border: 1px solid #dce4e8; border-radius: 8px; background: #f8fafb; }
.setting-image-preview img { display: block; max-width: 100%; max-height: 90px; object-fit: contain; }
.setting-image-preview.background-preview { min-height: 150px; }
.setting-image-preview.background-preview img { width: 100%; height: 140px; max-height: none; object-fit: cover; }
.pagination-wrapper{
    display:flex;
    justify-content:center;
    margin-top:20px;
    margin-bottom:20px;
    overflow-x:auto;
}
.pagination{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:6px;
    margin-bottom:0;
    padding-left:0;
    list-style:none;
}
.pagination .page-item{ list-style:none; }
.pagination .page-link{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:38px;
    min-height:38px;
    padding:8px 12px;
    border:1px solid #cbd5da;
    border-radius:8px;
    background:#fff;
    color:#17202a;
    font-size:14px;
    font-weight:800;
    text-decoration:none;
}
.pagination .page-link:hover{
    border-color:#0f766e;
    color:#0f766e;
}
.pagination .page-item.active .page-link{
    background:#0f766e;
    border-color:#0f766e;
    color:#fff;
}
.pagination .page-item.disabled .page-link{
    color:#9aa8ae;
    background:#eef3f4;
    pointer-events:none;
}
.phone-with-whatsapp{
    display:inline-flex;
    align-items:center;
    gap:8px;
}
.whatsapp-link{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:28px;
    height:28px;
    border-radius:999px;
    background:#25d366;
    color:#fff;
    font-weight:900;
    text-decoration:none;
}
.whatsapp-link:hover{
    background:#1ebe5d;
    color:#fff;
}
.inline-money-input{
    width:130px;
    min-height:38px;
    padding:8px 10px;
    border:1px solid #cbd5da;
    border-radius:8px;
    font-weight:800;
}
.mini-badge{
    display:inline-flex;
    margin-top:6px;
    padding:3px 7px;
    border-radius:999px;
    background:#e0f2fe;
    color:#075985;
    font-size:12px;
    font-weight:800;
}
.bulk-lotes-panel{
    margin-bottom:18px;
    border:2px solid #b8ddd8;
}
.bulk-check{
    display:inline-flex;
    align-items:center;
    gap:8px;
    min-width:150px;
    font-weight:800;
}
.lote-bulk-checkbox,
.bulk-check input{
    width:18px;
    height:18px;
    accent-color:#0f766e;
}
@media (max-width: 850px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .stats, .form { grid-template-columns: 1fr; }
    .project-grid:not(.grid-urbanizaciones) { grid-template-columns: 1fr; }
    .filter-form, .filter-form.compact { grid-template-columns: 1fr; }
    .public-header, .public-cta { align-items: flex-start; flex-direction: column; }
    .receipt-public-details { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .hero-panel { align-items: flex-start; flex-direction: column; }
    .bar-row { grid-template-columns: 90px 1fr 64px; }
    .edit-panel { grid-template-columns: 1fr; }
    .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .map-zoom-controls { left: 10px; right: 10px; top: 10px; }
    .map-zoom-controls .btn { flex: 1 1 42px; }
}
@media (max-width: 1200px) {
    .grid-urbanizaciones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-form, .filter-form.list-filters, .filter-form.sales-filters, .filter-form.cash-filters { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .filter-form.cash-filters .filter-actions { grid-column: auto; }
}
@media (max-width: 768px) {
    .grid-urbanizaciones { grid-template-columns: 1fr; }
    .filter-form, .filter-form.compact, .filter-form.list-filters, .filter-form.sales-filters, .filter-form.cash-filters { grid-template-columns: 1fr; }
    .map-point,
    .lot-point { inline-size: clamp(6px, 2vw, 16px); block-size: clamp(6px, 2vw, 16px); font-size: clamp(5px, 1vw, 9px); border-width: clamp(1px, .2vw, 2px); }
}
@media print {
    .sidebar, .btn, .no-print, .footer { display: none !important; }
    .shell { display: block; }
    .main, .main-content { margin: 0; padding: 0; }
    body { background: #fff; color: #111; }
    .card, .table { box-shadow: none; break-inside: avoid; }
}
