:root {
    /* Color Palette - Stunning Dark Glassmorphic */
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --secondary: #94a3b8;
    
    --bg-main: #020617;
    --bg-sidebar: rgba(15, 23, 42, 0.75);
    --bg-card: rgba(30, 41, 59, 0.6);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #ffffff;
    --text-dark: #0f172a;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --border: rgba(255, 255, 255, 0.1);
    --border-focus: #3b82f6;
    
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.2);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 10px 10px -5px rgb(0 0 0 / 0.3);
    
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass: blur(16px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(ellipse at 10% 20%, rgba(59, 130, 246, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 90% 10%, rgba(139, 92, 246, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 90%, rgba(245, 158, 11, 0.08) 0%, transparent 60%);
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border-right: 1px solid var(--border);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    z-index: 10;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.logo i {
    color: var(--primary);
    width: 28px;
    height: 28px;
}

.logo span {
    font-size: 1.25rem;
    font-weight: 800;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: #94a3b8;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    width: 380px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.875rem;
    background: transparent;
    color: var(--text-main);
}
.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar input {
    caret-color: #f8fafc;
}

.top-actions {
    display: flex;
    gap: 1rem;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--secondary);
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.primary-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.5rem;
    height: 42px;
    border-radius: var(--radius-md);
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

/* Common Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    transition: var(--transition);
}
.glass-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.2);
}

.dashboard-charts-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.chart-container {
    flex: 2;
    height: 350px;
    padding: 1.5rem;
    position: relative;
    background: white;
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chart-container.small {
    flex: 1;
}

/* Property Grid */
.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    border-radius: 6px;
    transition: all 0.2s;
}
.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}
.dropdown-item i {
    width: 16px;
    margin-right: 0.5rem;
}

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.property-card {
    padding: 0;
    min-height: 400px;
    cursor: pointer;
}

.property-image-wrapper {
    height: 200px;
    position: relative;
}

.property-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.property-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
}

.property-tag.occupied { background: var(--success); }
.property-tag.maintenance { background: var(--warning); }
.property-tag.vacant { background: var(--danger); }

.property-info {
    padding: 1.5rem;
}

.property-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.property-metrics {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.metric label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.metric p {
    font-weight: 700;
}

/* Tab System */
.tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn i {
    width: 18px;
    height: 18px;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: white;
}

/* Summary Dashboard Tile System */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.dashboard-tile {
    background: var(--bg-card);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.dashboard-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tile-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-icon i {
    width: 24px;
    height: 24px;
}

.tile-info label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.tile-info p {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Financial Analysis Styles */
.analysis-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.analysis-card.main {
    background: linear-gradient(135deg, var(--bg-sidebar) 0%, #1e293b 100%);
    color: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.analysis-card.main h2 {
    font-size: 3rem;
    margin: 0.5rem 0;
}

.analysis-card.main label {
    font-size: 1rem;
    opacity: 0.8;
}

.mini-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mini-stat {
    background: var(--bg-card);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-stat span {
    color: var(--text-muted);
    font-weight: 500;
}

.mini-stat strong {
    font-size: 1.125rem;
    color: var(--primary);
}

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

.financial-table th, .financial-table td {
    padding: 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.financial-table th {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Lease View Styles */
.tenant-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 1rem;
}

.tenant-avatar {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.meta-row {
    margin-bottom: 1.25rem;
}

.meta-row label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.meta-row p {
    font-weight: 600;
    font-size: 1.1rem;
}

/* UI Utility */
.secondary-btn {
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0 1.25rem;
    height: 40px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.secondary-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f8fafc;
}

.btn-sm {
    height: 32px;
    font-size: 0.8rem;
    padding: 0 0.75rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge.rental-type {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Modal */
.modal-container {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
}

.modal-content {
    position: relative;
    background: white;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    z-index: 10000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    color: var(--text-dark);
}

/* Financial Analysis & Income Statement */
.income-statement-container {
    padding: 2rem;
    background: white;
    color: var(--text-dark);
}

.statement-header h4 {
    font-size: 1.25rem;
    color: var(--text-dark);
}

.financial-table.statement {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.financial-table.statement th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
}

.statement-row {
    transition: all 0.2s ease;
    cursor: help;
}

.statement-row:hover {
    background: #f8fafc;
}

.statement-row td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.statement-row.expense td:last-child {
    font-family: inherit;
}

.subtotal td {
    background: #f8fafc;
    padding: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.total-row td {
    background: #f1f5f9;
    padding: 1.25rem 1rem;
    font-weight: 700;
    color: var(--primary);
}

.final-row td {
    border-top: 3px double var(--border);
    padding: 2rem 1rem;
    font-weight: 800;
    font-size: 1.1rem;
}

.icon-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

.text-right {
    text-align: right;
}

/* Modal form specifics */
.field select, .field input {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: white;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
}


/* Transaction Filtering Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
    background: #f8fafc;
    color: var(--text-dark);
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1;
    min-width: 300px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group select, .filter-group input {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-dark);
    background: white;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
    background: #fdfdfd;
}

.transaction-ledger .activity-table td {
    padding: 0.75rem 1rem;
}

.activity-table { width: 100%; border-collapse: collapse; }
.activity-table th { padding: 0.75rem 1rem; text-align: left; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.activity-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.25rem; margin: 0; }
.section-header a { color: var(--primary); font-weight: 600; font-size: 0.9rem; }

/* Custom scrollbar */
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }

/* Address autocomplete verify highlight */
@keyframes verify-pulse {
    0%, 100% { border-color: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { border-color: #f59e0b; box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
.highlight-verify {
    animation: verify-pulse 1s ease-in-out 3;
    border-color: #f59e0b !important;
    background: #fffbeb !important;
}

/* Mobile hamburger - hidden on desktop */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile overlay to close sidebar */
.sidebar-overlay {
    display: none;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    body { overflow: auto; height: auto; }

    .app-container { flex-direction: column; height: auto; min-height: 100vh; }

    /* Sidebar: hidden off-screen, slides in */
    .sidebar {
        position: fixed;
        top: 0; left: -280px;
        width: 260px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        padding: 1.5rem 1.25rem;
    }
    .sidebar.sidebar-open { left: 0; }

    /* Overlay when sidebar is open */
    .sidebar.sidebar-open ~ .main-content::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    /* Show hamburger */
    .mobile-menu-btn { display: flex; align-items: center; }

    /* Main content takes full width */
    .main-content {
        width: 100%;
        height: auto;
    }

    .content-scroll {
        padding: 1rem 1rem;
        overflow-y: auto;
    }

    .top-bar { margin-bottom: 1.5rem; }

    /* Property grid: single column */
    .property-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .property-card { min-height: auto; }

    /* Dashboard tiles: 2 columns */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .dashboard-tile { padding: 0.75rem; gap: 0.75rem; }
    .dashboard-tile .tile-icon { width: 36px; height: 36px; min-width: 36px; }
    .dashboard-tile .tile-info label { font-size: 0.65rem; }
    .dashboard-tile .tile-info p { font-size: 0.95rem; }

    /* Tabs: scrollable */
    .tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .tab-btn { padding: 0.75rem 1rem; font-size: 0.85rem; white-space: nowrap; }

    /* Modals: full screen */
    .modal-content, .property-modal, .lease-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        padding: 1.25rem !important;
    }

    .modal-backdrop { padding: 0; align-items: stretch; }

    /* Input grids: stack */
    .input-grid { grid-template-columns: 1fr !important; }

    /* Form sections */
    .form-section { padding: 1rem !important; }

    /* Financial table */
    .financial-table, .activity-table { font-size: 0.8rem; }

    /* View header */
    .view-header h1 { font-size: 1.4rem; }

    /* Glass cards */
    .glass-card { padding: 1rem; }

    /* Auth page */
    .auth-card { margin: 1rem; padding: 2rem; }

    /* Settings dual columns to single */
    .settings-view .glass-card .input-grid { grid-template-columns: 1fr !important; }

    /* Property details flex layout */
    .property-details-view .view-header { flex-direction: column; gap: 1rem; }

    /* Metrics row in financial tab */
    .metrics-row { grid-template-columns: 1fr !important; }

    /* Logo text smaller */
    .logo span { font-size: 1rem; }
    .logo { margin-bottom: 2rem; }

    /* User profile in sidebar */
    .user-profile { padding: 0.75rem 0; }

    /* Search bar */
    .search-bar { width: auto; flex: 1; }

    /* Hide header button text on very small screens */
    #header-btn-text { display: none; }
}

@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .main-content { padding: 0.75rem; }
    .auth-card { padding: 1.5rem; margin: 0.5rem; }
    .auth-card h1 { font-size: 1.4rem; }
}

