/* ============================================
   ADMIN PANEL - Styles v2
   ============================================ */

:root {
    --navy: #1a2332;
    --navy-light: #243044;
    --navy-dark: #0f1621;
    --amber: #c8923e;
    --amber-light: #d4a55a;
    --amber-dark: #b07a2e;
    --amber-glow: rgba(200, 146, 62, 0.15);
    --white: #ffffff;
    --off-white: #f8f6f3;
    --cream: #f2efe9;
    --gray-100: #f5f5f5;
    --gray-200: #e8e8e8;
    --gray-300: #d1d1d1;
    --gray-400: #a0a0a0;
    --gray-500: #717171;
    --gray-600: #4a4a4a;
    --gray-700: #333333;
    --text: #2c2c2c;
    --text-light: #666666;
    --green: #2d8a4e;
    --blue: #2563eb;
    --red: #dc3545;
    --purple: #8b5cf6;
    --orange: #f59e0b;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo { margin-bottom: 24px; }

.login-logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.login-card h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--navy);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 32px;
}

.login-form { text-align: left; }
.login-field { margin-bottom: 20px; }

.login-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    transition: var(--transition);
}

.login-field input:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-glow);
}

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 44px; }

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    display: flex;
    align-items: center;
}

.toggle-password:hover { color: var(--amber); }

.login-error {
    color: var(--red);
    font-size: 0.85rem;
    min-height: 24px;
    text-align: center;
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--amber);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-login:hover {
    background: var(--amber-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(200, 146, 62, 0.4);
}

.login-back {
    display: inline-block;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--gray-500);
    text-decoration: none;
    transition: var(--transition);
}

.login-back:hover { color: var(--amber); }

/* ============================================
   PANEL LAYOUT
   ============================================ */
.panel-page {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--navy-dark);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 8px 16px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
    position: relative;
}

.sidebar-link:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.06);
}

.sidebar-link.active {
    color: var(--white);
    background: var(--amber);
}

.sidebar-badge {
    margin-left: auto;
    background: var(--red);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 50px;
    min-width: 20px;
    text-align: center;
    display: none;
}

.sidebar-badge.show { display: inline-block; }

.sidebar-footer {
    padding: 8px 12px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logout-btn { color: rgba(255,255,255,0.4) !important; }
.logout-btn:hover { color: var(--red) !important; background: rgba(220,53,69,0.1) !important; }

/* Main Content */
.panel-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.panel-topbar {
    background: var(--white);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    color: var(--navy);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--gray-500);
    text-decoration: none;
    transition: var(--transition);
}

.topbar-link:hover { color: var(--amber); }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    background: var(--amber);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--navy);
}

/* Sections */
.panel-section {
    display: none;
    padding: 32px;
}

.panel-section.active { display: block; }

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.dash-stat {
    background: var(--white);
    padding: 22px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-stat-number {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}

.dash-stat-label {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dash-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.dash-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dash-card-header h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
}

.dash-card-link {
    font-size: 0.8rem;
    color: var(--amber);
    text-decoration: none;
    font-weight: 600;
}

.dash-card-link:hover { color: var(--amber-dark); }

.dash-card-mini {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 20px;
}

.dash-mini-icon { opacity: 0.8; }

.dash-mini-number {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}

.dash-mini-label {
    font-size: 0.78rem;
    color: var(--gray-500);
}

.dash-recent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.dash-recent-item:hover { background: var(--gray-200); }

.dash-recent-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.dash-recent-item-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-recent-item-meta {
    font-size: 0.78rem;
    color: var(--gray-500);
}

.dash-recent-item-price {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--amber-dark);
    font-size: 0.95rem;
    flex-shrink: 0;
    margin-left: 12px;
}

.dash-recent-item-badge {
    flex-shrink: 0;
    margin-left: 12px;
}

/* ============================================
   PROPERTIES TABLE
   ============================================ */
.section-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.toolbar-search {
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    min-width: 220px;
    transition: var(--transition);
}

.toolbar-search:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-glow);
}

.toolbar-select {
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    cursor: pointer;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    background: var(--amber);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-add:hover {
    background: var(--amber-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(200, 146, 62, 0.4);
}

.properties-table-wrap {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.properties-table { width: 100%; border-collapse: collapse; }

.properties-table th {
    background: var(--gray-100);
    padding: 12px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.properties-table td {
    padding: 13px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.properties-table tr:hover td { background: var(--gray-100); }

.properties-table .ref-cell {
    font-weight: 700;
    color: var(--navy);
    font-size: 0.8rem;
}

.properties-table .price-cell {
    font-weight: 700;
    color: var(--amber-dark);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-venta { background: rgba(200,146,62,0.12); color: var(--amber-dark); }
.badge-alquiler { background: rgba(45,138,78,0.12); color: var(--green); }
.badge-activo { background: rgba(45,138,78,0.12); color: var(--green); }
.badge-reservado { background: rgba(37,99,235,0.12); color: var(--blue); }
.badge-vendido { background: var(--gray-100); color: var(--gray-500); }
.badge-borrador { background: rgba(200,146,62,0.12); color: var(--amber); }
.badge-nueva { background: rgba(220,53,69,0.1); color: var(--red); }
.badge-contactada { background: rgba(37,99,235,0.12); color: var(--blue); }
.badge-en_proceso { background: rgba(245,158,11,0.12); color: var(--orange); }
.badge-cerrada { background: var(--gray-100); color: var(--gray-500); }
.badge-publicado { background: rgba(45,138,78,0.12); color: var(--green); }

.action-btns {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition);
}

.action-btn:hover { border-color: var(--amber); color: var(--amber); }
.action-btn.delete:hover { border-color: var(--red); color: var(--red); background: rgba(220,53,69,0.05); }

.empty-state {
    padding: 60px 24px;
    text-align: center;
    color: var(--gray-400);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-state p { font-size: 1rem; color: var(--gray-500); }

/* ============================================
   CONSULTAS / LEADS
   ============================================ */
.consultas-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.consulta-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    cursor: pointer;
    border-left: 4px solid transparent;
}

.consulta-card:hover { box-shadow: var(--shadow-md); }
.consulta-card.estado-nueva { border-left-color: var(--red); }
.consulta-card.estado-contactada { border-left-color: var(--blue); }
.consulta-card.estado-en_proceso { border-left-color: var(--orange); }
.consulta-card.estado-cerrada { border-left-color: var(--gray-300); }

.consulta-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.consulta-body { flex: 1; min-width: 0; }

.consulta-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.consulta-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--navy);
}

.consulta-date {
    font-size: 0.75rem;
    color: var(--gray-400);
    white-space: nowrap;
}

.consulta-meta {
    display: flex;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.consulta-meta span { display: flex; align-items: center; gap: 4px; }

.consulta-preview {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.consulta-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-self: center;
}

/* ============================================
   BLOG ADMIN
   ============================================ */
.blog-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.blog-admin-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.blog-admin-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.blog-admin-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: var(--gray-100);
}

.blog-admin-body {
    padding: 20px;
}

.blog-admin-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.blog-admin-body h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-admin-body p {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-admin-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-admin-date {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* ============================================
   TESTIMONIOS
   ============================================ */
.testimonios-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.testimonio-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.testimonio-card:hover { box-shadow: var(--shadow-md); }

.testimonio-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.testimonio-stars {
    color: var(--amber);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.testimonio-text {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    line-height: 1.6;
}

.testimonio-author {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--navy);
}

.testimonio-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.testimonio-service {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   ESTADÍSTICAS
   ============================================ */
.stats-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.stats-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.stats-card h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 20px;
}

.stats-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stats-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--gray-600);
}

.stats-bar-label strong {
    color: var(--navy);
}

.stats-bar-track {
    height: 8px;
    background: var(--gray-100);
    border-radius: 50px;
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    border-radius: 50px;
    background: var(--amber);
    transition: width 0.8s ease;
}

.stats-bar-fill.green { background: var(--green); }
.stats-bar-fill.blue { background: var(--blue); }
.stats-bar-fill.purple { background: var(--purple); }
.stats-bar-fill.red { background: var(--red); }
.stats-bar-fill.orange { background: var(--orange); }

.stats-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stats-timeline-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 14px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}

.stats-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
    margin-top: 6px;
    flex-shrink: 0;
}

.stats-timeline-info {
    flex: 1;
    min-width: 0;
}

.stats-timeline-text {
    font-size: 0.85rem;
    color: var(--text);
}

.stats-timeline-date {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.settings-card {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.settings-card h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 24px;
}

.settings-field { margin-bottom: 16px; }

.settings-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.settings-field input {
    width: 100%;
    padding: 10px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    transition: var(--transition);
}

.settings-field input:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-glow);
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-save {
    margin-top: 8px;
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--amber);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-save:hover { background: var(--amber-dark); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-sm { max-width: 480px; }
.modal-lg { max-width: 800px; }

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition);
}

.modal-close:hover { background: var(--gray-200); color: var(--text); }

.modal-body { padding: 24px 28px; }

.modal-field { margin-bottom: 16px; }

.modal-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
    width: 100%;
    padding: 10px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    transition: var(--transition);
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-glow);
}

.modal-field textarea { resize: vertical; }

.modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-row-4 { grid-template-columns: repeat(4, 1fr); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.btn-cancel {
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--white);
    color: var(--gray-600);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel:hover { background: var(--gray-100); }

.btn-delete {
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-delete:hover { background: #c82333; }

.text-muted {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Consulta detail */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.detail-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-field p {
    font-size: 0.92rem;
    color: var(--text);
}

/* ============================================
   GESTIÓN ALQUILERES
   ============================================ */
.alq-notifications {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.alq-notif {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.alq-notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alq-notif-body { flex: 1; }
.alq-notif-body strong { display: block; margin-bottom: 2px; }
.alq-notif-body span { font-size: 0.8rem; opacity: 0.8; }

.alq-notif-action {
    padding: 6px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.alq-notif.urgente {
    background: rgba(220,53,69,0.08);
    border-left: 4px solid var(--red);
    color: #7c1d2a;
}

.alq-notif.urgente .alq-notif-icon { background: rgba(220,53,69,0.15); color: var(--red); }
.alq-notif.urgente .alq-notif-action { background: var(--red); color: var(--white); }
.alq-notif.urgente .alq-notif-action:hover { background: #c82333; }

.alq-notif.aviso {
    background: rgba(245,158,11,0.08);
    border-left: 4px solid var(--orange);
    color: #7c5a10;
}

.alq-notif.aviso .alq-notif-icon { background: rgba(245,158,11,0.15); color: var(--orange); }
.alq-notif.aviso .alq-notif-action { background: var(--orange); color: var(--white); }
.alq-notif.aviso .alq-notif-action:hover { background: #d97706; }

.alq-notif.info {
    background: rgba(37,99,235,0.06);
    border-left: 4px solid var(--blue);
    color: #1e3a5f;
}

.alq-notif.info .alq-notif-icon { background: rgba(37,99,235,0.12); color: var(--blue); }
.alq-notif.info .alq-notif-action { background: var(--blue); color: var(--white); }
.alq-notif.info .alq-notif-action:hover { background: #1d4ed8; }

.alq-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.alq-stat {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    text-align: center;
    border-top: 3px solid var(--green);
}

.alq-stat-warn { border-top-color: var(--orange); }
.alq-stat-info { border-top-color: var(--blue); }
.alq-stat-contact { border-top-color: var(--purple); }

.alq-stat-number {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 4px;
}

.alq-stat-label {
    font-size: 0.78rem;
    color: var(--gray-500);
}

.alq-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.alq-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.alq-card:hover { box-shadow: var(--shadow-md); }

.alq-card-top {
    display: flex;
    align-items: stretch;
}

.alq-card-status {
    width: 5px;
    flex-shrink: 0;
}

.alq-card-status.verde { background: var(--green); }
.alq-card-status.naranja { background: var(--orange); }
.alq-card-status.rojo { background: var(--red); }
.alq-card-status.gris { background: var(--gray-300); }

.alq-card-body {
    flex: 1;
    padding: 18px 22px;
    min-width: 0;
}

.alq-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.alq-card-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--navy);
}

.alq-card-title small {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-left: 8px;
}

.alq-card-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.alq-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 24px;
    margin-bottom: 12px;
}

.alq-card-field {
    display: flex;
    flex-direction: column;
}

.alq-card-field-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    margin-bottom: 2px;
}

.alq-card-field-value {
    font-size: 0.88rem;
    color: var(--text);
}

.alq-card-field-value a {
    color: var(--amber);
    text-decoration: none;
}

.alq-card-field-value a:hover { text-decoration: underline; }

.alq-card-alerts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.alq-alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.alq-alert-chip.alerta-vencimiento { background: rgba(220,53,69,0.1); color: var(--red); }
.alq-alert-chip.alerta-ipc { background: rgba(37,99,235,0.1); color: var(--blue); }
.alq-alert-chip.alerta-contacto { background: rgba(139,92,246,0.1); color: var(--purple); }

.alq-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}

.alq-card-renta {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--amber-dark);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    background: var(--navy);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 300;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .dash-grid, .dash-grid-3, .stats-overview { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .modal-row-4 { grid-template-columns: repeat(2, 1fr); }
    .testimonios-list { grid-template-columns: 1fr; }
    .alq-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .alq-stats { grid-template-columns: 1fr; }
    .alq-card-grid { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .panel-main { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .panel-section { padding: 20px 16px; }
    .panel-topbar { padding: 0 16px; }
    .dashboard-stats { grid-template-columns: 1fr; }
    .toolbar-left { flex-direction: column; }
    .toolbar-search { min-width: auto; }
    .section-toolbar { flex-direction: column; align-items: stretch; }
    .properties-table-wrap { overflow-x: auto; }
    .properties-table { min-width: 700px; }
    .modal-row, .modal-row-4 { grid-template-columns: 1fr; }
    .settings-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .topbar-link { display: none; }
    .blog-admin-grid { grid-template-columns: 1fr; }
    .consulta-card { flex-direction: column; }
    .consulta-actions { align-self: flex-end; }
}
