/* ============================================================
   Martin Todres Propiedades — App CSS
   ============================================================ */

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

:root {
    --color-primary:      #1a3a5c;
    --color-primary-mid:  #2d6a9f;
    --color-primary-light:#e8f0f8;
    --color-success:      #16a34a;
    --color-success-bg:   #f0fdf4;
    --color-warning:      #d97706;
    --color-warning-bg:   #fffbeb;
    --color-danger:       #dc2626;
    --color-danger-bg:    #fef2f2;
    --color-gray:         #6b7280;
    --color-gray-bg:      #f3f4f6;
    --color-border:       #e5e7eb;
    --color-text:         #111827;
    --color-text-muted:   #6b7280;
    --font:               'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius:             10px;
    --radius-sm:          6px;
    --shadow:             0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:          0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
    --navbar-h:           60px;
}

html { font-size: 16px; }

body {
    font-family: var(--font);
    color: var(--color-text);
    background: #f0f4f8;
    line-height: 1.5;
}

/* ---- NAVBAR ---- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--color-primary);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1.5rem;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-logo-icon { width: 24px; height: 24px; fill: #fff; }
.nav-brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    color: #fff;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 0 0 auto;
}
.nav-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .4rem;
    max-width: 300px;
    margin-left: 1rem;
}
.nav-search .form-control {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
    color: #fff;
    height: 34px;
    font-size: .85rem;
}
.nav-search .form-control::placeholder { color: rgba(255,255,255,0.6); }
.nav-search .form-control:focus { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.5); }
.nav-search .btn { height: 34px; padding: 0 .65rem; flex-shrink: 0; }
.nav-link {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}
.nav-user-name {
    color: rgba(255,255,255,0.9);
    font-size: 0.88rem;
    font-weight: 500;
}
.btn-logout {
    color: rgba(255,255,255,0.65);
    display: flex;
    align-items: center;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}
.btn-logout:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-top: var(--navbar-h);
    padding: 2rem 1.5rem;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- PAGE HEADER ---- */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
}
.page-subtitle { color: var(--color-text-muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ---- STATS GRID ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; fill: #fff; }
.stat-icon--blue   { background: linear-gradient(135deg, #1a3a5c, #2d6a9f); }
.stat-icon--green  { background: linear-gradient(135deg, #15803d, #16a34a); }
.stat-icon--orange { background: linear-gradient(135deg, #b45309, #d97706); }
.stat-icon--purple { background: linear-gradient(135deg, #6d28d9, #7c3aed); }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--color-primary); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.2rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---- CARDS ---- */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.card-title { font-size: 1rem; font-weight: 600; color: var(--color-primary); }
.card-body  { padding: 1.25rem; }

/* ---- BADGES ---- */
.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.badge-admin  { background: var(--color-primary); color: #fff; }
.badge-broker { background: #e0e7ff; color: #3730a3; }

.badge-estado  { padding: 0.25rem 0.7rem; border-radius: 100px; font-size: 0.75rem; font-weight: 600; }
.badge-green   { background: var(--color-success-bg); color: var(--color-success); }
.badge-blue    { background: var(--color-primary-light); color: var(--color-primary); }
.badge-orange  { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-gray    { background: var(--color-gray-bg); color: var(--color-gray); }
.badge-red     { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-sky     { background: #e0f2fe; color: #0369a1; }
.badge-violet  { background: #ede9fe; color: #6d28d9; }
.badge-yellow  { background: #fef9c3; color: #a16207; }

/* ---- ESTADO GRID ---- */
.estado-grid { display: grid; gap: 1rem; }
.estado-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.75rem; }
.estado-label { display: flex; align-items: center; gap: 0.5rem; min-width: 170px; }
.estado-count { font-weight: 600; font-size: 0.9rem; }
.estado-pct   { font-size: 0.8rem; color: var(--color-text-muted); min-width: 36px; text-align: right; }
.progress-bar { background: var(--color-gray-bg); border-radius: 100px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; transition: width 0.5s ease; }
.progress-green  { background: var(--color-success); }
.progress-blue   { background: var(--color-primary-mid); }
.progress-orange { background: var(--color-warning); }
.progress-gray   { background: #9ca3af; }

/* ---- QUICK ACTIONS ---- */
.quick-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-mid));
    color: #fff;
}
.quick-action-btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.quick-action-btn:hover { opacity: 0.88; }
.quick-action-btn:active { transform: scale(0.97); }
.quick-action-btn--secondary {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary   { background: var(--color-primary); color: #fff; }
.btn-secondary { background: var(--color-primary-light); color: var(--color-primary); }
.btn-success   { background: var(--color-success); color: #fff; }
.btn-danger    { background: var(--color-danger); color: #fff; }
.btn-warning   { background: var(--color-warning); color: #fff; }
.btn-ghost     { background: transparent; color: var(--color-primary); border: 1.5px solid var(--color-border); }

.btn:hover:not(:disabled) { opacity: 0.88; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--color-text);
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: var(--font);
}
.form-control:focus {
    border-color: var(--color-primary-mid);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45,106,159,0.12);
}
select.form-control { cursor: pointer; }

/* ---- TABLE ---- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    text-align: left;
    white-space: nowrap;
}
tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }

/* ---- ALERTS ---- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.alert svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid #bbf7d0; }
.alert-error   { background: var(--color-danger-bg);  color: var(--color-danger);  border: 1px solid #fca5a5; }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid #fde68a; }
.alert-info    { background: var(--color-primary-light); color: var(--color-primary); border: 1px solid #bfdbfe; }

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 520px;
    transform: translateY(20px);
    transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--color-primary); }
.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-gray);
    padding: 0.2rem;
    border-radius: var(--radius-sm);
    display: flex;
}
.modal-close:hover { color: var(--color-text); background: var(--color-gray-bg); }
.modal-body   { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ---- UTILITIES ---- */
.mt-4    { margin-top: 1rem; }
.mt-6    { margin-top: 1.5rem; }
.text-muted { color: var(--color-text-muted); }
.text-sm    { font-size: 0.82rem; }
.text-right { text-align: right; }
.text-center{ text-align: center; }
.d-flex     { display: flex; }
.align-center { align-items: center; }
.gap-2    { gap: 0.5rem; }
.flex-1   { flex: 1; }
.fw-600   { font-weight: 600; }
.text-danger  { color: var(--color-danger); }
.text-success { color: var(--color-success); }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}
.empty-state svg { width: 48px; height: 48px; fill: #d1d5db; margin-bottom: 1rem; }
.empty-state p   { font-size: 0.9rem; }

/* ---- SPINNER ---- */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--color-primary-mid);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- TOAST ---- */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    background: #1f2937;
    color: #fff;
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
    max-width: 340px;
    pointer-events: all;
    animation: toastIn 0.25s ease;
}
.toast.toast-success { background: var(--color-success); }
.toast.toast-error   { background: var(--color-danger); }
@keyframes toastIn { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }

/* ---- MOBILE NAV ---- */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: .3rem;
    margin-left: auto;
}
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--navbar-h);
    left: 0; right: 0;
    background: var(--color-primary);
    z-index: 101;
    flex-direction: column;
    padding: .5rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    padding: .75rem 1.5rem;
    font-size: .9rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.mobile-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.mobile-nav-logout { color: #fca5a5; }

/* ---- FILTERS ---- */
.filters-form { padding: 1rem 1.25rem; }
.filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
}
.filter-group { min-width: 150px; }
.filter-group label { display: block; font-size:.78rem; font-weight:600; color:#444; text-transform:uppercase; letter-spacing:.4px; margin-bottom:.3rem; }
.filter-search { flex: 1; min-width: 220px; }
.filter-actions { display: flex; gap: .5rem; align-items: flex-end; padding-bottom: 1px; }
.input-icon { position: relative; }
.input-icon svg { position:absolute; left:.6rem; top:50%; transform:translateY(-50%); width:16px; height:16px; fill:#9ca3af; pointer-events:none; }
.input-icon input { padding-left: 2.1rem; }

/* ---- TABLE extras ---- */
.codigo-mto { font-family: monospace; font-size:.82rem; background: var(--color-gray-bg); padding:.15rem .45rem; border-radius:4px; color: var(--color-text-muted); }
.td-propiedad { display: flex; align-items: center; gap: .6rem; min-width: 220px; }
.prop-thumb { width:52px; height:40px; object-fit:cover; border-radius:6px; flex-shrink:0; }
.prop-titulo { color: var(--color-primary); font-weight: 600; text-decoration: none; font-size:.88rem; }
.prop-titulo:hover { text-decoration: underline; }
.prop-dir { font-size:.78rem; color: var(--color-text-muted); margin-top:.1rem; }
.text-nowrap { white-space: nowrap; }

/* ---- ROW ACTIONS ---- */
.row-actions { display: flex; gap: .3rem; justify-content: flex-end; flex-wrap: wrap; }
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: var(--color-gray-bg);
    color: var(--color-gray);
    transition: background .15s, color .15s;
    text-decoration: none;
}
@media (max-width: 768px) {
    .action-btn { width: 44px; height: 44px; }
    .action-btn svg { width: 20px; height: 20px; }
}
.action-btn svg { width: 16px; height: 16px; fill: currentColor; }
.action-btn:hover { background: var(--color-primary-light); color: var(--color-primary); }
.action-btn--wa:hover  { background: #dcfce7; color: #15803d; }
.action-btn--danger:hover { background: var(--color-danger-bg); color: var(--color-danger); }

/* ---- PAGINATION ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: .5rem;
}
.pagination-info  { font-size: .82rem; color: var(--color-text-muted); }
.pagination-btns  { display: flex; gap: .3rem; flex-wrap: wrap; }
.btn-sm           { padding: .35rem .7rem; font-size: .8rem; }
.link-wa          { color: #15803d; text-decoration: none; font-weight: 500; }
.link-wa:hover    { text-decoration: underline; }

/* ---- PROP LAYOUT (ver) ---- */
.prop-layout {
    display: flex;
    gap: 1.25rem;
    margin-top: 1rem;
    align-items: flex-start;
}
.prop-layout > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}
.prop-layout > div:last-child {
    flex: 0 0 320px;
    width: 320px;
}
@media(max-width: 900px) {
    .prop-layout { flex-direction: column; }
    .prop-layout > div:first-child { order: 2; width: 100%; overflow: visible; }
    .prop-layout > div:last-child { order: 1; width: 100%; flex: none; }
}

/* ---- SPECS ---- */
.specs-grid { display: grid; gap: .75rem; }
.spec-item  { display: flex; align-items: center; gap: .75rem; }
.spec-icon  { font-size: 1.2rem; width: 28px; text-align: center; flex-shrink: 0; }
.spec-label { font-size: .75rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .4px; }
.spec-val   { font-size: .95rem; font-weight: 600; color: var(--color-text); }

/* ---- BROKER AVATAR ---- */
.broker-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem;
    flex-shrink: 0;
}

/* ---- FORM GRIDS ---- */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.form-col-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.autofill-row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.input-group  { display: flex; gap: .5rem; }
.input-group .form-control { flex: 1; }

/* ---- AUTOFILL / INFO CARD ---- */
.badge-sync { background: #ede9fe; color: #6d28d9; }

/* ---- BROKERS ---- */
.row-inactive td { opacity: .55; }
.row-inactive td:last-child { opacity: 1; }

.broker-avatar--sm {
    width: 32px; height: 32px;
    font-size: .8rem;
}
.broker-avatar--inactive {
    background: #9ca3af;
}
.props-count-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: .875rem;
}
.props-count-link:hover { text-decoration: underline; }

.action-btn--reactivate:hover { background: #dcfce7; color: #15803d; }

/* ---- SIN BROKER ---- */
.row-sin-broker td { background: #fefce8; }
.row-sin-broker:hover td { background: #fef9c3; }
.badge-sin-broker {
    display: inline-block;
    padding: .2rem .5rem;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    white-space: nowrap;
}

/* Checkbox filter */
.filter-group--checkbox { justify-content: flex-end; }
.checkbox-filter {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    font-size: .875rem;
    color: #374151;
    padding: .6rem 0;
    user-select: none;
}
.checkbox-filter input[type=checkbox] {
    width: 16px; height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ---- FILTER COLLAPSE ---- */
.filters-toggle-btn {
    display: none; /* oculto en desktop */
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .nav-links    { display: none; }
    .nav-search   { display: none; }
    .nav-hamburger{ display: flex; }
    .nav-user .nav-user-name { display: none; }
    .main-content { padding: 1rem; margin-top: var(--navbar-h); }
    .stats-grid   { grid-template-columns: repeat(2, 1fr); }
    .estado-item  { grid-template-columns: 1fr; gap: 0.3rem; }
    .quick-actions{ flex-direction: column; }
    .quick-action-btn { justify-content: center; }
    .filters-grid { flex-direction: column; }
    .filter-group { min-width: 100%; }
    .form-grid-2  { grid-template-columns: 1fr; }
    .form-grid-5  { grid-template-columns: repeat(2, 1fr); }
    .td-propiedad { min-width: 160px; }

    /* Inputs/selects a altura mínima 44px para táctil */
    .form-control  { min-height: 44px; }

    /* Botón toggle filtros en mobile */
    .filters-toggle-btn {
        display: flex;
        align-items: center;
        gap: .5rem;
        width: 100%;
        padding: .7rem 1rem;
        background: var(--color-primary);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: .9rem;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: .5rem;
    }
    .filters-toggle-btn svg { transition: transform .2s; }
    .filters-toggle-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

    /* Cuando collapsed: ocultar la grilla */
    .filters-grid.collapsed { display: none; }

    /* Modal scroll en mobile — evitar que el teclado virtual lo corte */
    .modal-overlay {
        align-items: flex-start;
        overflow-y: auto;
    }
    .modal {
        max-height: calc(100dvh - 2rem);
        overflow-y: auto;
        margin: auto; /* centrar cuando el contenido es corto */
    }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
