/* ==========================================
   Cho Thuê BDS Cần Thơ - Dark Luxury Theme
   ========================================== */

:root {
    --bg-primary: #0f1923;
    --bg-secondary: #1a2a3a;
    --bg-tertiary: #243447;
    --bg-glass: rgba(15, 25, 35, 0.92);
    --bg-glass-light: rgba(26, 42, 58, 0.95);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #5a7a94;
    --accent-primary: #c9a84c;
    --accent-secondary: #b8963e;
    --accent-glow: rgba(201, 168, 76, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --orange: #f97316;
    --pink: #c9a84c;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 8px 40px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 60px;
    --filter-height: 52px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   Loading Screen
   ========================================== */

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #0f1923 0%, #1a2a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--pink));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: loadingPulse 2s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

.loading-icon .material-icons-round {
    font-size: 40px;
    color: white;
}

@keyframes loadingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.loading-title {
    font-size: 28px;
    font-weight: 800;
    color: #dfc06a;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.loading-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, var(--accent-primary), var(--pink));
    border-radius: 3px;
    animation: loadingBar 1.5s ease-in-out infinite;
}

@keyframes loadingBar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ==========================================
   Header
   ========================================== */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.header-center {
    flex: 1;
    max-width: 500px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.icon-btn:active {
    transform: scale(0.92);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
    color: var(--accent-primary);
}

.logo-text {
    font-family: var(--font);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
}

.logo-accent {
    color: #dfc06a;
}

@media (max-width: 600px) {
    .logo-text { display: none; }
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    padding: 0 16px;
    height: 40px;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
    font-size: 20px;
    color: var(--text-muted);
    margin-right: 8px;
}

#search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    min-width: 0;
}

#search-input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.search-clear .material-icons-round {
    font-size: 18px;
}

/* ==========================================
   Filter Bar
   ========================================== */

.filter-bar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: var(--filter-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 999;
    display: flex;
    align-items: center;
}

.filter-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}

.filter-scroll::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.filter-chip:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: var(--accent-glow);
}

.filter-chip.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.filter-chip .material-icons-round {
    font-size: 16px;
}

.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filter-divider {
    width: 1px;
    height: 24px;
    background: var(--border-strong);
    flex-shrink: 0;
}

/* Collapsible Filter Groups */
.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.district-toggle {
    position: relative;
    padding-right: 28px;
}

.chip-arrow {
    font-size: 16px;
    transition: transform 0.3s ease;
    position: absolute;
    right: 8px;
    opacity: 0.6;
}

.filter-group.expanded .chip-arrow {
    transform: rotate(90deg);
}

.filter-group.expanded .district-toggle {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.ward-chip {
    display: none;
    padding: 6px 12px;
    font-size: 12px;
    border-color: transparent;
    background: var(--bg-primary);
    opacity: 0;
    transform: translateX(-8px);
}

.filter-group.expanded .ward-chip {
    display: flex;
    opacity: 1;
    transform: translateX(0);
    animation: wardSlideIn 0.25s ease forwards;
}

.ward-chip.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.ward-chip:hover:not(.active) {
    background: var(--bg-tertiary);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

@keyframes wardSlideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filter-group.expanded .ward-chip:nth-child(2) { animation-delay: 0s; }
.filter-group.expanded .ward-chip:nth-child(3) { animation-delay: 0.05s; }
.filter-group.expanded .ward-chip:nth-child(4) { animation-delay: 0.1s; }

.filter-select {
    padding: 7px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.filter-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Gold-styled selects (matching "Tất cả" button) */
.filter-select-gold {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

.filter-select-gold:focus {
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.3);
}

/* ==========================================
   Map Container
   ========================================== */

.map-container {
    position: fixed;
    top: calc(var(--header-height) + var(--filter-height));
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100vh - 112px);
    z-index: 1;
}

.map-container * {
    box-sizing: content-box;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.leaflet-popup-content {
    margin: 0;
    padding: 0;
    width: auto !important;
}

.leaflet-popup-tip {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.leaflet-container {
    font-family: var(--font);
}

/* Marker labels for Leaflet */
.marker-label-container {
    background: transparent;
    border: none;
    box-shadow: none;
}

.marker-price-label {
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    white-space: nowrap;
    border: 2px solid;
    pointer-events: none;
}

.marker-district-label {
    text-align: center;
    background: rgba(15, 25, 35, 0.88);
    backdrop-filter: blur(6px);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    line-height: 1.2;
    pointer-events: none;
    color: #f1f5f9;
    border: 1px solid rgba(255,255,255,0.12);
    letter-spacing: 0.3px;
}

.university-marker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 12px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.3);
    transform: translateY(-50%);
}

.university-marker-icon .uni-name {
    letter-spacing: 0.2px;
}

/* Hide Leaflet attribution in mobile if needed */
.leaflet-control-attribution {
    font-size: 8px !important;
}

/* ==========================================
   Custom Info Window
   ========================================== */

.info-window {
    padding: 16px;
    min-width: 260px;
    max-width: 320px;
    font-family: var(--font);
}

.info-window .iw-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.info-window .iw-type-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.info-window .iw-address {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.info-window .iw-price {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.info-window .iw-price-unit {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.info-window .iw-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.info-window .iw-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-window .iw-detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-window .iw-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.info-window .iw-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.iw-district {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.iw-status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.iw-status-badge.available {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.iw-status-badge.rented {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ==========================================
   Sidebar
   ========================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    z-index: 2000;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.sidebar.active {
    transform: translateX(320px);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #1a2a3a, #243447);
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-title .material-icons-round {
    font-size: 22px;
    color: var(--accent-primary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
    margin-bottom: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-primary);
    font-weight: 600;
}

.nav-item .material-icons-round {
    font-size: 20px;
}

.sidebar-section {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* Toggle */
.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.toggle-item input {
    display: none;
}

.toggle-slider {
    width: 40px;
    height: 22px;
    background: var(--bg-tertiary);
    border-radius: 11px;
    position: relative;
    transition: var(--transition);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-item input:checked + .toggle-slider {
    background: var(--accent-primary);
}

.toggle-item input:checked + .toggle-slider::after {
    transform: translateX(18px);
}

/* Map type grid */
.map-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.map-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.map-type-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.map-type-btn.active {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
    color: var(--accent-primary);
    font-weight: 600;
}

.map-type-btn .material-icons-round {
    font-size: 22px;
}

/* Data source */
.data-source-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.source-count {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-refresh:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-glow);
}

.btn-refresh .material-icons-round {
    font-size: 16px;
}

.sheets-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 12px;
    outline: none;
    margin-bottom: 8px;
    transition: var(--transition);
}

.sheets-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-save-url {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent-primary);
    color: white;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-save-url:hover {
    background: var(--accent-secondary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-save-url .material-icons-round {
    font-size: 16px;
}
/* ==========================================
   Export Data
   ========================================== */

.export-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.export-desc strong {
    color: var(--accent-primary);
    font-weight: 700;
}

.export-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.btn-export {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-export.csv {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-export.csv:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-export.clipboard {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-export.clipboard:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-export .material-icons-round {
    font-size: 16px;
}

.btn-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.export-tip {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
}

/* ==========================================
   Stats Panel
   ========================================== */

.stats-panel {
    position: fixed;
    top: var(--header-height);
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: calc(100% - var(--header-height));
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    z-index: 1500;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.stats-panel.active {
    transform: translateX(-420px);
}

@media (max-width: 420px) {
    .stats-panel.active {
        transform: translateX(-100vw);
    }
}

.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #eef2ff, #fce7f3);
}

.stats-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.stats-header .material-icons-round {
    color: #6366f1;
}

.stats-header .icon-btn {
    color: #475569;
}

.stats-header .icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

.stats-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-card-title {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.stat-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
}

.stat-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

/* ==========================================
   Detail Panel (Bottom Sheet)
   ========================================== */

.detail-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 1500;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
}

.detail-panel.active {
    bottom: 0;
}

.detail-header {
    display: flex;
    justify-content: center;
    padding: 12px;
    position: relative;
}

.detail-header::before {
    content: '';
    width: 40px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
}

.detail-header .icon-btn {
    position: absolute;
    right: 8px;
    top: 4px;
}

.detail-content {
    padding: 0 20px 20px;
    overflow-y: auto;
    max-height: calc(60vh - 50px);
}

.detail-price-big {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.detail-address {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.detail-district {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.detail-grid-item {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border);
}

.detail-grid-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-grid-value {
    font-size: 16px;
    font-weight: 700;
}

.detail-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ==========================================
   List Panel
   ========================================== */

.list-panel {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1400;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-panel.app-hidden {
    display: none !important;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #eef2ff, #fce7f3);
}

.list-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
}

.list-header .material-icons-round {
    color: var(--accent-primary);
}

.list-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.list-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.list-item-price {
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
    min-width: 90px;
}

.list-item-info {
    flex: 1;
    min-width: 0;
}

.list-item-address {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.list-item-type {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* List header improvements */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #eef2ff, #fce7f3);
}

.list-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-header-left h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.list-header-left .material-icons-round {
    color: #6366f1;
}

.list-count {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background: #6366f1;
    padding: 2px 10px;
    border-radius: 12px;
}

.list-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-header .icon-btn {
    color: #475569;
}

.list-header .icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

.btn-add-small {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    background: var(--accent-primary);
    color: white;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-add-small:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-add-small .material-icons-round {
    font-size: 16px;
}

/* Item actions */
.item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.item-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.item-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.item-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.item-action-btn .material-icons-round {
    font-size: 18px;
}

/* ==========================================
   Property Form Panel (Centered Modal)
   ========================================== */

.property-form-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: 680px;
    max-width: 94vw;
    max-height: 92vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    z-index: 2500;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.property-form-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 720px) {
    .property-form-panel {
        width: 96vw;
        max-height: 94vh;
    }
}

@media (max-width: 480px) {
    .property-form-panel {
        width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: translateY(30px);
    }
    .property-form-panel.active {
        transform: translateY(0);
    }
}

.form-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2499;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.form-overlay.active {
    opacity: 1;
    visibility: visible;
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}

.form-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
}

.form-header .material-icons-round {
    color: #6366f1;
    font-size: 22px;
}

.form-header .icon-btn {
    color: #475569;
}

.form-header .icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

.form-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Two-column form layout (fields + images) */
.form-two-col {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 24px;
}

@media (max-width: 600px) {
    .form-two-col {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Custom Ward Dropdown
   ========================================== */

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    position: relative;
}

.custom-select-trigger::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    transition: transform 0.2s ease;
}

.custom-select-wrapper.open .custom-select-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select-trigger:hover {
    border-color: var(--accent-primary);
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.custom-select-trigger .ward-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.custom-select-trigger .placeholder-text {
    color: var(--text-muted);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1e2d3d;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 3000;
    max-height: 320px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.custom-select-wrapper.open .custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    pointer-events: none;
    border-top: 1px solid var(--border);
}

.custom-select-group-label:first-child {
    border-top: none;
}

.custom-select-group-label .group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 28px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.custom-select-option:hover {
    background: rgba(201, 168, 76, 0.12);
}

.custom-select-option.selected {
    background: rgba(201, 168, 76, 0.18);
    color: var(--accent-primary);
    font-weight: 600;
}

.custom-select-option .option-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid currentColor;
    opacity: 0.5;
}

.custom-select-option.selected .option-dot {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    opacity: 1;
}

.custom-select-option:last-child {
    margin-bottom: 4px;
}

.form-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--accent-primary);
    line-height: 1.4;
}

.form-tip .material-icons-round {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.btn-form {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-form.cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-form.cancel:hover {
    background: #cbd5e1;
    color: var(--text-primary);
}

.btn-form.submit {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.btn-form.submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-form .material-icons-round {
    font-size: 18px;
}

/* No data state */
.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.no-data .material-icons-round {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}
/* ==========================================
   Image Upload & Gallery
   ========================================== */

.image-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.image-preview-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-strong);
    transition: var(--transition);
}

.image-preview-item:hover {
    border-color: var(--accent-primary);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.image-preview-item:hover .image-preview-remove {
    opacity: 1;
}

.image-preview-remove .material-icons-round {
    font-size: 14px;
}

.image-add-btn {
    width: 100px;
    height: 100px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 11px;
    font-weight: 500;
}

.image-add-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-glow);
}

.image-add-btn .material-icons-round {
    font-size: 28px;
}

/* Detail Gallery */
.detail-gallery {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.gallery-slider {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.gallery-slide {
    min-width: 100%;
    height: 220px;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: var(--transition);
    opacity: 0;
}

.detail-gallery:hover .gallery-arrow {
    opacity: 1;
}

.gallery-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.gallery-arrow.prev { left: 8px; }
.gallery-arrow.next { right: 8px; }

.gallery-arrow .material-icons-round {
    font-size: 20px;
}

.gallery-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.gallery-dot.active {
    background: white;
    transform: scale(1.2);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.gallery-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    z-index: 10;
}

/* No image placeholder */
.no-image-placeholder {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.no-image-placeholder .material-icons-round {
    font-size: 40px;
    opacity: 0.4;
}

.no-image-placeholder span:last-child {
    font-size: 12px;
}

/* List item thumbnail */
.list-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.list-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-item-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.list-item-thumb-placeholder .material-icons-round {
    font-size: 24px;
    opacity: 0.4;
}

/* Popup thumbnail */
.iw-gallery {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.iw-gallery img {
    flex: 1;
    height: 100px;
    object-fit: cover;
    min-width: 0;
}

.iw-gallery img:only-child {
    height: 140px;
}

/* ==========================================
   Toast Notifications
   ========================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.toast {
    background: var(--bg-glass-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    white-space: nowrap;
    color: var(--text-primary);
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

.toast .material-icons-round {
    font-size: 20px;
}

.toast.success .material-icons-round { color: var(--success); }
.toast.error .material-icons-round { color: var(--danger); }
.toast.info .material-icons-round { color: var(--accent-primary); }

@keyframes toastIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(20px); opacity: 0; }
}

/* ==========================================
   Map Legend
   ========================================== */

.map-legend {
    position: fixed;
    bottom: 24px;
    left: 12px;
    background: var(--bg-glass-light);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    z-index: 500;
    box-shadow: var(--shadow);
}

.legend-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ==========================================
   Marker Labels
   ========================================== */

.marker-label {
    background: var(--bg-glass-light);
    backdrop-filter: blur(8px);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--border);
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ==========================================
   Utilities
   ========================================== */

.app-hidden {
    display: none !important;
}

/* Color utilities for price */
.price-low { color: var(--success); }
.price-mid { color: var(--warning); }
.price-high { color: var(--orange); }
.price-premium { color: var(--danger); }

/* Rental property types */
.type-nha-nguyen-can { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.type-can-ho { background: rgba(16, 185, 129, 0.12); color: #059669; }
.type-mat-bang { background: rgba(249, 115, 22, 0.12); color: #ea580c; }
.type-kho-xuong { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.type-phong-tro { background: rgba(244, 63, 94, 0.12); color: #e11d48; }

/* Legacy types (backward compatibility) */
.type-dat-nen { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.type-nha-pho { background: rgba(16, 185, 129, 0.12); color: #059669; }
.type-chung-cu { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.type-biet-thu { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.type-mat-tien { background: rgba(249, 115, 22, 0.12); color: #ea580c; }

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        left: -280px;
    }
    .sidebar.active {
        transform: translateX(280px);
    }
    .stats-panel {
        right: -100vw;
        width: 100vw;
    }
    .stats-panel.active {
        transform: translateX(-100vw);
    }
    .map-legend {
        bottom: 16px;
        left: 8px;
        padding: 8px 12px;
    }
    .legend-title {
        font-size: 10px;
    }
    .legend-item {
        font-size: 11px;
    }
}

/* ==========================================
   Custom Scrollbar (Light)
   ========================================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Status Toggle */
.status-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 4px;
}

.status-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 4px;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

input[type="radio"]:checked + .status-btn {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

input[type="radio"]:checked + .status-btn.rented {
    background: var(--danger);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
