* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

/* Default overlay state - hidden on all devices */
.sidebar-overlay {
    display: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, lch(40.79% 40.67 289.81) 0%, #764ba2 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile-first base styles */
html {
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
    touch-action: manipulation; /* Remove 300ms delay on mobile */
}

/* Login Screen Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    margin: 20px;
    position: relative;
}

.back-to-home {
    display: block;
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-to-home:hover {
    color: #5568d3;
    transform: translateX(-3px);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-header p {
    color: #666;
    margin-bottom: 0;
    font-weight: 300;
}

.login-form {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    height: auto;
    line-height: 1.4;
    overflow: visible;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    border-width: 2px; /* Ensure consistent border width on focus */
}

.credentials-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #666;
    font-size: 13px;
    text-align: left;
}

.credentials-info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    text-align: center;
}

.credentials-info p {
    margin: 5px 0;
    font-family: monospace;
    background: #e9ecef;
    padding: 5px 8px;
    border-radius: 3px;
    border-left: 3px solid #667eea;
}

/* Mobile adjustments for login */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .login-header h1 {
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .vacancy-overview, .rent-overview {
        grid-template-columns: 1fr;
    }
}

/* Main Application Layout */
.main-app {
    display: flex;
    min-height: 100vh;
    background: #f8f9fa;
}

/* Left Navigation Panel */
.left-panel {
    width: 280px;
    background: #2c3e50;
    color: white;
    transition: all 0.3s ease;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
}

.left-panel.collapsed {
    transform: translateX(-280px);
}

.left-panel.minimized {
    width: 70px !important;
}

.left-panel.minimized .panel-header h3 {
    display: none;
}

.left-panel.minimized .nav-text {
    display: none;
}

.left-panel.minimized .nav-icon {
    margin-right: 0;
    text-align: center;
}

.left-panel.minimized .nav-item {
    justify-content: center;
    padding: 15px 10px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #34495e;
    border-bottom: 1px solid #3a546b;
}

.panel-header h3 {
    margin: 0;
    color: #ecf0f1;
    font-size: 18px;
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s;
    z-index: 1002;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .left-panel {
        transform: translateX(-280px);
    }
    
    .left-panel.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
        padding-top: 80px; /* Space for fixed toggle button */
    }
    
        /* Keep toggle button always visible on mobile */
        .toggle-btn {
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 1100;
            background: #2c3e50;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }
    
    .vacancy-overview, .rent-overview {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card span {
        font-size: 24px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu {
    padding: 0;
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    border-bottom: 1px solid #3a546b;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-item:hover {
    background: #34495e;
    color: #ecf0f1;
}

.nav-item.active {
    background: #3498db;
    color: white;
}

.nav-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 20px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    min-height: 100vh;
}

.main-content.expanded {
    margin-left: 70px !important;
}

.content-section {
    display: none;
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

/* Statistics Cards */
.vacancy-overview, .rent-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
    align-items: stretch;
    justify-items: stretch;
}

.rent-overview-metrics {
    grid-auto-rows: 1fr;
    grid-template-columns: repeat(3, 1fr);
}

.rent-overview-metrics .stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card.compact {
    padding: 16px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
}

.stat-card.compact h3 {
    font-size: 14px;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.stat-card span {
    font-size: 28px;
    font-weight: bold;
    display: block;
}

.stat-card.compact span {
    font-size: 28px;
    font-weight: 800;
}

.stat-card small {
    font-size: 11px;
    opacity: 0.95;
    display: block;
    margin-top: 6px;
    font-weight: 600;
}

.stat-card h3 {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.stat-card.method-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-card.method-card h3,
.stat-card.method-card span,
.stat-card.method-card small {
    font-weight: 700;
    color: rgba(255, 255, 255, 1);
}

/* Monthly Analysis Specific Cards */
.stat-card.revenue-card {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card.expense-card {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card.profit-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card.revenue-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.stat-card.expense-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.stat-card.profit-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

/* Room Status Grid */
.room-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.room-status-card {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid;
    transition: transform 0.2s;
}

.room-status-card:hover {
    transform: translateY(-2px);
}

.room-status-card.vacant {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.room-status-card.occupied {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.setting-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.setting-card h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.setting-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-form .form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
    font-size: 14px;
}

.setting-form input, .setting-form button {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.setting-form button {
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
}

.license-display {
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

/* Amenities Section Styles */
.amenities-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.amenities-section h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.amenities-section > p {
    margin: 0 0 20px 0;
}

.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.amenity-group {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.amenity-group h4 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
}

.amenity-group .form-group {
    margin-bottom: 15px;
}

.amenity-group .form-group:last-child {
    margin-bottom: 0;
}

.amenity-group label {
    display: block;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
    font-size: 14px;
}

.checkbox-group {
    margin-bottom: 12px !important;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.checkbox-group label:hover {
    background-color: #f8f9fa;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-group span {
    font-weight: normal;
    color: #333;
}

.amenity-group .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.amenity-group .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.amenity-group input[type="time"],
.amenity-group input[type="number"],
.amenity-group input[type="url"],
.amenity-group select {
    width: 100%;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.btn-secondary {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-primary {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #5568d3;
}

/* Deleted Records Section Styles */
.deleted-records-card {
    grid-column: 1 / -1; /* Span full width */
    max-width: 100%;
}

.deleted-records-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.records-info {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.stat-badge {
    background: #f0f2f5;
    color: #555;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.deleted-records-search {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Tenant Statistics Styling */
.tenant-stats {
    margin: 20px 0;
    display: flex;
    gap: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.deleted-records-table {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

#deletedTenantsTable {
    width: 100%;
    border-collapse: collapse;
}

#deletedTenantsTable th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eee;
}

#deletedTenantsTable td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

#deletedTenantsTable tbody tr:hover {
    background: #f8f9fa;
}

#deletedTenantsTable tbody tr:last-child td {
    border-bottom: none;
}

.no-deleted-records {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-deleted-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .deleted-records-card {
        margin-top: 20px;
    }
    
    .records-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .deleted-tenant-details {
        grid-template-columns: 1fr;
    }
    
    .deleted-tenant-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .left-panel {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(280px, 85vw);
        max-width: 85vw;
        transform: translateX(-100%);
        z-index: 1000;
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .left-panel.show {
        transform: translateX(0);
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 10px;
        padding-top: 70px; /* Make room for mobile toggle button */
    }
    
    /* Mobile toggle button */
    .toggle-btn {
        position: fixed !important;
        top: 15px !important;
        left: 15px !important;
        z-index: 1100 !important;
        background: #667eea !important;
        color: white !important;
        border: none !important;
        border-radius: 8px !important;
        width: 45px !important;
        height: 45px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
        font-size: 18px !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .toggle-btn:hover {
        background: #5a67d8 !important;
        transform: scale(1.05) !important;
    }
    
    /* Ensure toggle button is always visible on mobile */
    .panel-header .toggle-btn {
        display: none !important;
    }
    
    /* Override any desktop styles that might hide the toggle button */
    @media (max-width: 768px) {
        .toggle-btn {
            display: flex !important;
        }
    }
}

/* Mobile Toggle Button - Always Visible */
.mobile-toggle-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1200;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.mobile-toggle-btn:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.mobile-toggle-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .mobile-toggle-btn {
        display: flex !important;
    }
    
    /* Hide the original toggle button on mobile */
    .panel-header .toggle-btn {
        display: none !important;
    }
    
    /* Mobile sidebar overlay */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        pointer-events: none;
    }
    
    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    /* Ensure left panel is above overlay on mobile */
    .left-panel {
        z-index: 1001 !important;
    }
    
    /* Mobile header adjustments */
    .header {
        padding: 10px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header h1 {
        font-size: 20px;
        margin: 0;
    }
    
    /* Mobile stat cards */
    .vacancy-overview, .rent-overview, .analysis-overview {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
        margin: 15px 0;
    }
    
    .stat-card {
        padding: 12px;
        min-height: auto;
    }
    
    .stat-card h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .stat-card span {
        font-size: 20px;
    }
    
    .stat-card small {
        font-size: 10px;
    }
    
    /* Mobile tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tenants-table {
        min-width: 600px;
    }
    
    /* Mobile rent tracking table */
    .rent-tracking-table {
        min-width: 800px; /* Ensure table is scrollable on mobile */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Add horizontal scroll to rent tracking grid */
    .rent-tracking-grid {
        margin: 0 -15px;
        padding: 0 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Convert rent tracking table to cards on mobile */
    @media (max-width: 640px) {
        .rent-tracking-table {
            display: none; /* Hide the table on small mobile screens */
        }
        
        .rent-tracking-cards {
            display: block !important; /* Show cards instead */
        }
    }
    
    .rent-tracking-cards {
        display: none; /* Hidden by default, shown only on mobile */
    }
    
    .rent-card {
        background: white;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        border: 1px solid #e1e1e1;
    }
    
    .rent-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .rent-card-name {
        font-weight: 600;
        font-size: 16px;
        color: #333;
    }
    
    .rent-card-room {
        font-size: 14px;
        color: #666;
        background: #f8f9fa;
        padding: 4px 8px;
        border-radius: 4px;
    }
    
    .rent-card-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .rent-card-detail {
        display: flex;
        flex-direction: column;
    }
    
    .rent-card-label {
        font-size: 12px;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
    }
    
    .rent-card-value {
        font-size: 14px;
        color: #333;
        font-weight: 500;
    }
    
    .rent-card-footer {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-top: 12px;
        padding-top: 10px;
        border-top: 1px solid #f0f0f0;
    }
    
    .rent-card-status {
        flex: 1;
    }
    
    .rent-card-action {
        margin-left: 0;
    }
    
    .rent-card-action .status-toggle-btn {
        width: 100%;
        padding: 9px 12px;
        font-size: 13px;
        min-width: 0;
        border-radius: 6px;
    }
    
    .tenants-table th,
    .tenants-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* Mobile forms */
    .form-modal {
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
        width: calc(100vw - 20px);
        max-width: none;
    }
    
    .form-row.four-columns {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Mobile search bars */
    .search-input,
    .rent-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
    }
    
    .rent-controls {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .filter-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Mobile room grid */
    .room-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .room-card {
        padding: 15px;
    }
    
    /* Mobile settings */
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .setting-card {
        padding: 15px;
    }
    
    /* Mobile expense forms */
    .expense-form {
        grid-template-columns: 1fr;
    }
    
    .analytics-filters,
    .expense-filters {
        margin-top: 10px;
    }
    
    /* Mobile section headers */
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .add-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Hide desktop-only elements on mobile */
    .nav-text {
        display: block;
    }
    
    .nav-icon {
        margin-right: 10px;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    .left-panel {
        width: min(260px, 90vw) !important;
        max-width: 90vw !important;
    }
    
    .panel-header {
        padding: 15px;
    }
    
    .panel-header h3 {
        font-size: 16px;
    }
    
    .nav-item {
        padding: 12px 15px;
    }
    
    .nav-icon {
        margin-right: 8px;
        font-size: 16px;
    }
    
    .nav-text {
        font-size: 14px;
    }
    
    .mobile-toggle-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .main-content {
        padding: 8px;
        padding-top: 60px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-card h3 {
        font-size: 11px;
    }
    
    .stat-card span {
        font-size: 18px;
    }
    
    .form-modal {
        margin: 5px;
        width: calc(100vw - 10px);
    }
    
    .tenants-table th,
    .tenants-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    .search-input,
    .rent-search-input {
        padding: 10px 12px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .room-card {
        padding: 12px;
    }
}

/* Very thin mobile screens (320px and below) */
@media (max-width: 320px) {
    .left-panel {
        width: 95vw !important;
        max-width: 95vw !important;
    }
    
    .panel-header {
        padding: 12px;
    }
    
    .panel-header h3 {
        font-size: 14px;
    }
    
    .nav-item {
        padding: 10px 12px;
    }
    
    .nav-text {
        font-size: 13px;
    }
    
    .nav-icon {
        font-size: 14px;
        margin-right: 6px;
    }
    
    .mobile-toggle-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        top: 10px;
        left: 10px;
    }
    
    .main-content {
        padding: 6px;
        padding-top: 55px;
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e1e1;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    margin: 0;
    color: #333;
    flex: 1;
    min-width: 200px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.logout-btn:hover {
    background: #c0392b;
}

h1 {
    text-align: center;
    color: #333;
}

.form-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.booking-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Mobile adjustments for forms */
@media (max-width: 768px) {
    .form-section {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 12px;
    }
    
    .booking-form {
        grid-template-columns: 1fr;
    }
}

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select {
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    line-height: 1.4;
    overflow: visible;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    border-width: 2px; /* Ensure consistent border width on focus */
}

button[type="submit"] {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
    grid-column: span 2;
    width: 100%;
    box-sizing: border-box;
}

button[type="submit"]:hover {
    background: #5a67d8;
}

/* Specific styling for Add Room button */
#roomForm button[type="submit"] {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    min-height: 40px;
    border-radius: 6px;
    background: #28a745;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.2);
    transition: all 0.3s ease;
}

#roomForm button[type="submit"]:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.3);
}

/* Mobile adjustments for inputs and buttons */
@media (max-width: 768px) {
    input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select {
        padding: 14px;
        font-size: 16px; /* Prevents zoom on iOS */
        box-sizing: border-box;
        height: auto;
        line-height: 1.4;
        overflow: visible;
        border: 2px solid #e1e1e1; /* Ensure consistent border */
    }
    
    input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, input[type="date"]:focus, input[type="number"]:focus, select:focus {
        outline: none;
        border-color: #667eea;
        border-width: 2px; /* Keep border width consistent */
    }
    
    button[type="submit"] {
        padding: 14px 20px;
        grid-column: span 1;
        font-size: 16px;
    }
    
    /* Mobile styling for Add Room button */
    #roomForm button[type="submit"] {
        padding: 12px 18px;
        font-size: 14px;
        min-height: 44px;
        margin-top: 5px;
    }
}

/* Grid layouts for items */
.room-grid, .guest-grid, .booking-grid, .tenant-grid, .expense-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.rent-tracking-grid {
    display: block;
    width: 100%;
}

.room-card, .guest-card, .booking-card, .tenant-card, .expense-card, .rent-card {
    background: #fff;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    word-wrap: break-word;
}

.room-card:hover, .guest-card:hover, .booking-card:hover, .tenant-card:hover, .expense-card:hover, .rent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.room-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Tenant details in room cards */
.tenants-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e1e1;
}

.tenant-info {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
}

.tenant-name {
    font-weight: 600;
    color: #333;
}

.tenant-details {
    color: #666;
    font-size: 12px;
    margin-left: 8px;
}

/* Clickable room number */
.clickable-room {
    cursor: pointer;
    transition: color 0.3s ease;
}

.clickable-room:hover {
    color: #667eea;
    text-decoration: underline;
}

/* View Details button */
.view-details-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.view-details-btn:hover {
    background: #218838;
}

/* Room details modal */
.room-details-modal {
    max-width: 600px;
}

.room-details-info {
    padding: 20px 0;
}

.room-basic-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e1e1e1;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #333;
    min-width: 100px;
}

.detail-value {
    color: #666;
    text-align: right;
}

.detail-value.status-full {
    color: #dc3545;
    font-weight: 600;
}

.detail-value.status-vacant {
    color: #28a745;
    font-weight: 600;
}

.detail-value.status-partially-occupied {
    color: #ffc107;
    font-weight: 600;
}

.tenants-details-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.tenants-grid {
    display: grid;
    gap: 15px;
}

.tenant-detail-card {
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tenant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.tenant-header .tenant-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.bed-number {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tenant-details {
    display: grid;
    gap: 8px;
}

.tenant-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tenant-detail .label {
    color: #666;
    font-size: 14px;
}

.tenant-detail .value {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.no-tenants-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-room-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-tenants-message p {
    font-size: 16px;
    margin: 0;
}

/* Room edit modal styles */
.room-edit-info {
    padding: 10px 0;
}

.room-details {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.room-details p {
    margin: 8px 0;
}

.tenants-list {
    margin-top: 10px;
}

.tenant-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    flex-wrap: wrap;
    gap: 10px;
}

.tenant-detail-row .tenant-name {
    font-weight: 600;
    color: #333;
    flex: 1;
    min-width: 120px;
}

.tenant-detail-row .tenant-info {
    color: #666;
    font-size: 14px;
    flex: 2;
    min-width: 200px;
}

.tenant-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.tenant-status.paid,
.tenant-status:contains("Paid") {
    background: #d4edda;
    color: #155724;
}

.tenant-status.pending,
.tenant-status:contains("Pending") {
    background: #fff3cd;
    color: #856404;
}

.no-tenants {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

.edit-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.edit-btn:hover {
    background: #5a67d8;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    word-break: break-word;
}

.delete-btn, .rent-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.rent-btn {
    background: #28a745;
    margin-top: 10px;
    width: 100%;
    padding: 8px 12px;
}

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

.rent-btn:hover {
    background: #218838;
}

.card-info {
    color: #666;
    line-height: 1.6;
    word-wrap: break-word;
}

.card-info strong {
    color: #333;
}

.rent-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.rent-status.paid {
    background: #d4edda;
    color: #155724;
}

.rent-status.pending {
    background: #f8d7da;
    color: #721c24;
}

/* Rent Tracking Table Styles */
.rent-tracking-table {
    width: 100%;
    background: white;
    border-radius: 0;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: none;
    border: 1px solid #e1e1e1;
    margin: 0;
    position: relative;
}

/* Custom scrollbar for table */
.rent-tracking-table::-webkit-scrollbar {
    height: 8px;
}

.rent-tracking-table::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.rent-tracking-table::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.rent-tracking-table::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

.table-header {
    display: grid;
    grid-template-columns: 200px 120px 150px 140px 120px 140px 330px 140px 170px;
    background: #667eea;
    color: white;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #5a67d8;
    min-width: fit-content;
}

.header-cell {
    padding: 18px 15px;
    text-align: left;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.header-cell:last-child {
    border-right: none;
}

.table-row {
    display: grid;
    grid-template-columns: 200px 120px 150px 140px 120px 140px 330px 140px 170px;
    border-bottom: 1px solid #e1e1e1;
    transition: background-color 0.2s ease;
    min-width: fit-content;
}

.table-row:hover {
    background: #f8f9fa;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:nth-child(even) {
    background: #fafbfc;
}

.table-row:nth-child(even):hover {
    background: #f1f3f4;
}

.table-cell {
    padding: 18px 15px;
    display: flex;
    align-items: center;
    border-right: 1px solid #e1e1e1;
    font-size: 14px;
}

.table-cell:last-child {
    border-right: none;
}

.tenant-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.room-number {
    font-weight: 500;
    color: #667eea;
    font-size: 15px;
}

.rent-amount {
    font-weight: 600;
    color: #28a745;
    font-size: 15px;
}

.move-date {
    color: #666;
}

.status-cell {
    justify-content: center;
}

.action-cell {
    justify-content: center;
}

/* Last Payment Info Styling */
.last-payment-scroll {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px 0;
    font-size: 13px;
    line-height: 1.6;
    max-width: 100%;
    word-break: break-word;
}

.last-payment-type {
    font-weight: 600;
    color: #667eea;
    font-size: 12px;
}

.last-payment-date {
    color: #666;
    font-size: 12px;
}

.last-payment-amount {
    font-weight: 600;
    color: #28a745;
    font-size: 13px;
}

.last-payment-notes {
    color: #999;
    font-size: 11px;
    font-style: italic;
    flex-basis: 100%;
    margin-top: 2px;
}

.last-payment-separator {
    color: #ddd;
    font-size: 10px;
}

.last-payment-cell {
    align-items: flex-start;
    padding: 12px 15px;
    overflow: hidden;
}

/* WhatsApp Remind Button */
.remind-cell {
    justify-content: center;
    align-items: center;
}

/* Contact Buttons Group */
.contact-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    width: 100%;
}

.contact-buttons-group.mobile {
    flex-direction: row;
    margin-top: 6px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.contact-btn svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.contact-btn span {
    white-space: nowrap;
    font-size: 11px;
}

/* WhatsApp Button */
.contact-btn.whatsapp-btn {
    background: #25D366;
    color: white;
}

.contact-btn.whatsapp-btn:hover {
    background: #1eb352;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

/* Call Button */
.contact-btn.call-btn {
    background: #007bff;
    color: white;
}

.contact-btn.call-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Mobile Styling */
.contact-buttons-group.mobile .contact-btn {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
}

.contact-buttons-group.mobile .contact-btn span {
    font-size: 13px;
}

.contact-buttons-group.mobile .contact-btn svg {
    width: 18px;
    height: 18px;
}

/* Disabled State */
.contact-btn.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.contact-btn.whatsapp-btn.disabled {
    background: #bcdcc8;
    color: #2e5c3e;
}

.contact-btn.call-btn.disabled {
    background: #b3d7ff;
    color: #004085;
}

.status-toggle-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    min-width: 100px;
}

.status-toggle-btn:hover {
    background: #218838;
}

.status-toggle-btn.pending {
    background: #dc3545;
}

.status-toggle-btn.pending:hover {
    background: #c82333;
}

.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 60px 20px;
    background: white;
    border: 1px solid #e1e1e1;
    margin: 0;
    font-size: 16px;
}

/* Mobile adjustments for rent tracking table */
@media (max-width: 768px) {
    .rent-tracking-table {
        overflow-x: visible;
        border: none;
    }
    
    .table-header {
        display: none; /* Hide header on mobile */
    }
    
    .table-row {
        grid-template-columns: 1fr;
        background: white;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: 1px solid #e1e1e1;
        overflow: visible;
    }
    
    .table-row:nth-child(even) {
        background: white;
    }
    
    .table-cell {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 12px 15px;
        justify-content: space-between;
        display: flex;
        align-items: flex-start;
        flex-wrap: wrap;
        min-height: auto;
    }
    
    .table-cell:last-child {
        border-bottom: none;
    }
    
    .table-cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: #333;
        margin-right: 10px;
        min-width: 120px;
        text-align: left;
        flex-shrink: 0;
    }
    
    .tenant-name::before {
        content: "Tenant: ";
    }
    
    .room-number::before {
        content: "Room: ";
    }
    
    .rent-amount::before {
        content: "Monthly Rent: ";
    }
    
    .move-date::before {
        content: "Move-in Date: ";
    }
    
    .status-cell::before {
        content: "Status: ";
    }
    
    .action-cell::before {
        content: "Action: ";
    }
    
    .days-left-cell::before {
        content: "Days Left: ";
    }
    
    .last-payment-cell::before {
        content: "Last Payment: ";
    }
    
    .remind-cell::before {
        content: "Remind: ";
    }
    
    /* Mobile-specific cell styling */
    .last-payment-cell {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }
    
    .last-payment-cell::before {
        margin-bottom: 8px;
        font-size: 14px;
        color: #667eea;
    }
    
    .last-payment-scroll {
        width: 100%;
        background: #f8f9fa;
        padding: 12px;
        border-radius: 6px;
        font-size: 13px;
    }
    
    .last-payment-scroll .payment-type,
    .last-payment-scroll .payment-date,
    .last-payment-scroll .payment-amount {
        margin-bottom: 6px;
        display: block;
    }
    
    .last-payment-scroll .payment-notes {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #e1e1e1;
        color: #666;
        font-size: 12px;
    }
    
    /* Mobile Contact Buttons styling */
    .remind-cell {
        justify-content: flex-start;
        align-items: center;
        padding: 12px 15px;
    }
    
    .contact-buttons-group.desktop {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }
    
    .contact-buttons-group.desktop .contact-btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .contact-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .status-toggle-btn {
        padding: 10px 18px;
        font-size: 14px;
        min-width: 120px;
        width: 100%;
        max-width: 200px;
    }
    
    /* Mobile rent controls */
    .rent-controls {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }
    
    .rent-search-container {
        width: 100%;
    }
    
    .rent-search-input {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
    }
    
    .filter-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 80px;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .rent-tracking-grid {
        margin: 0 -15px;
        padding: 0 15px;
    }
}

/* Mobile adjustments for cards */
@media (max-width: 768px) {
    .room-grid, .guest-grid, .booking-grid, .tenant-grid, .expense-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .room-card, .guest-card, .booking-card, .tenant-card, .expense-card, .rent-card {
        padding: 15px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .card-actions {
        align-self: flex-end;
        gap: 10px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .delete-btn, .edit-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .room-grid, .guest-grid, .booking-grid, .tenant-grid, .expense-grid {
        gap: 10px;
    }
    
    .room-card, .guest-card, .booking-card, .tenant-card, .expense-card, .rent-card {
        padding: 12px;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    .card-info {
        font-size: 14px;
        line-height: 1.5;
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    /* All interactive elements should be touch-friendly */
    .nav-item, 
    .delete-btn, 
    .edit-btn,
    .rent-btn, 
    .logout-btn, 
    .history-btn,
    .filter-btn,
    button[type="submit"],
    button[type="button"],
    .btn-primary,
    .add-btn,
    .submit-btn,
    .cancel-btn,
    .status-toggle-btn,
    .whatsapp-remind-btn {
        min-height: 44px; /* iOS recommended touch target size */
        min-width: 44px;
        touch-action: manipulation; /* Prevents double-tap zoom */
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Navigation items extra padding */
    .nav-item {
        padding: 15px 20px;
    }
    
    /* Card action buttons */
    .card-actions button,
    .action-buttons button,
    .action-buttons a {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* Search inputs touch-friendly */
    .search-input,
    .rent-search-input,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="date"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        box-sizing: border-box;
        height: auto;
        line-height: 1.4;
        overflow: visible;
        border: 2px solid #e1e1e1; /* Ensure consistent border */
    }
    
    .search-input:focus,
    .rent-search-input:focus,
    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="tel"]:focus,
    input[type="number"]:focus,
    input[type="password"]:focus,
    input[type="date"]:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: #667eea;
        border-width: 2px; /* Keep border width consistent */
    }
    
    /* Stat cards more tappable if they have actions */
    .stat-card {
        padding: 20px;
        min-height: 100px;
    }
    
    /* Table action buttons in mobile card view */
    .tenants-table .action-buttons button,
    .table-cell button {
        min-height: 40px;
        padding: 10px 14px;
    }
    
    /* Better spacing for mobile cards */
    .room-card,
    .tenant-card,
    .expense-card,
    .rent-card {
        margin-bottom: 12px;
    }
    
    /* Header buttons */
    .header button {
        min-height: 44px;
        padding: 10px 20px;
    }
    
    /* Mobile toggle button */
    .mobile-toggle-btn,
    .toggle-btn {
        min-height: 50px;
        min-width: 50px;
    }
}

/* Landscape phone adjustments */
@media (max-width: 896px) and (orientation: landscape) {
    .main-content {
        padding: 15px;
    }
    
    .header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
}

/* Modal Styles */
.form-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.form-modal {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.form-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.close-btn:hover {
    background: #e1e1e1;
    color: #333;
}

/* Tenant Mode Toggle Styles */
.tenant-mode-toggle {
    display: flex;
    background: #f8f9fa;
    padding: 15px 25px 0;
    gap: 20px;
    border-bottom: 1px solid #e1e1e1;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #666;
}

.toggle-label:hover {
    background: #e9ecef;
}

.toggle-label input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.toggle-label input[type="radio"]:checked + span {
    color: #007bff;
    font-weight: 600;
}

.mode-description {
    background: #f8f9fa;
    padding: 10px 25px 15px;
    color: #666;
    font-size: 14px;
    font-style: italic;
    border-bottom: 1px solid #e1e1e1;
}

.modal-form {
    padding: 25px;
}

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

.form-row.four-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
    align-items: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.form-row.four-columns > div:empty {
    display: none;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    text-transform: none;
}

.form-row:last-of-type {
    margin-bottom: 25px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
}

.add-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.add-btn:hover {
    background: #218838;
}

.submit-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background: #5a67d8;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.cancel-btn:hover {
    background: #5a6268;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

/* Rent tracking controls */
.rent-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: #e9ecef;
    color: #495057;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #dee2e6;
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.filter-btn.active:hover {
    background: #5a67d8;
}

/* Mobile adjustments for modal */
@media (max-width: 768px) {
    .form-overlay {
        padding: 10px;
    }
    
    .form-modal {
        margin: 10px;
        max-width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    .modal {
        padding: 10px;
        align-items: flex-start;
    }
    
    .modal-content {
        max-width: 95%;
        width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .form-row.four-columns {
        grid-template-columns: 1fr;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        min-height: 44px; /* Touch-friendly height */
        height: auto; /* Allow natural height */
        line-height: 1.4; /* Better vertical alignment */
        display: block;
        box-sizing: border-box; /* Ensure border is included in height */
        overflow: visible; /* Prevent content clipping */
        border: 2px solid #e1e1e1; /* Ensure consistent border */
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: none;
        border-color: #667eea;
        border-width: 2px; /* Keep border width consistent */
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
        position: sticky;
        bottom: 0;
        background: white;
        padding-top: 15px;
        margin-top: 20px;
    }
    
    .submit-btn, .cancel-btn, .add-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px; /* Touch-friendly */
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .section-header h3 {
        font-size: 18px;
    }
    
    .add-btn {
        align-self: stretch;
        justify-content: center;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    /* Close button more touch-friendly */
    .close {
        font-size: 28px;
        padding: 10px;
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Payment History Modal Styles */
.modal-content {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.tenant-summary-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.tenant-summary-card h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.tenant-summary-card p {
    margin: 5px 0;
    color: #666;
}

.tenant-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.detail-item {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.detail-item strong {
    color: #333;
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item {
    font-size: 16px;
    color: #555;
    font-weight: 500;
}

.payment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-record {
    display: grid;
    grid-template-columns: 120px 1fr 80px;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid;
    align-items: center;
}

.payment-record.paid {
    background: #d4edda;
    border-color: #28a745;
}

.payment-record.pending {
    background: #f8d7da;
    border-color: #dc3545;
}

.payment-date {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.payment-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.payment-amount {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.payment-method {
    font-size: 14px;
    color: #666;
}

.payment-type {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.payment-notes {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    font-style: italic;
    border-left: 2px solid #e1e1e1;
    padding-left: 8px;
}

.payment-status {
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
}

.payment-status.paid {
    background: #28a745;
    color: white;
}

.payment-status.pending {
    background: #dc3545;
    color: white;
}

.no-history {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

.payment-history h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    border-bottom: 2px solid #e1e1e1;
    padding-bottom: 10px;
}

/* Clickable tenant cards */
.tenant-card.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tenant-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.click-hint {
    text-align: center;
    font-size: 12px;
    color: #667eea;
    font-style: italic;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e1e1e1;
}

/* Search field styles */
.search-container {
    margin: 20px 0;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Monthly Rent Tracking search and sort container */
.search-sort-container {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 20px 0;
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.rent-search-input {
    flex: 1 1 auto;
    min-width: 260px;
    max-width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.rent-search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Sort button and menu */
.sort-button-container {
    position: relative;
    flex-shrink: 0;
}

.sort-btn {
    padding: 12px 24px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.sort-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sort-btn:active {
    transform: translateY(0);
}

.sort-icon {
    font-size: 18px;
    font-weight: bold;
}

.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: white;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 230px;
    display: none;
}

.sort-menu.open {
    display: block;
}

.sort-section {
    padding: 8px 0;
    border-bottom: 1px solid #e1e1e1;
}

.sort-section:last-child {
    border-bottom: none;
}

.sort-section-title {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.sort-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    gap: 10px;
}

.sort-option:hover {
    background-color: #f5f5f5;
}

.check-icon {
    color: #667eea;
    font-weight: bold;
    font-size: 16px;
    visibility: hidden;
    width: 16px;
}

.sort-option.active .check-icon {
    visibility: visible;
}

.sort-option.active {
    background-color: #f0f2ff;
    color: #667eea;
    font-weight: 500;
}

/* Mobile responsive for search and sort */
@media (max-width: 768px) {
    .search-sort-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .rent-search-input {
        min-width: 100%;
    }
    
    .sort-btn {
        width: 100%;
        justify-content: center;
    }
    
    .sort-menu {
        right: auto;
        left: 0;
        width: calc(100% - 4px);
    }
    
    .sort-section-title {
        font-size: 11px;
    }
    
    .sort-option {
        padding: 12px 16px;
    }
}

/* Table styles */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tenants-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 800px;
}

.tenants-table th,
.tenants-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.tenants-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

.tenants-table tbody tr {
    transition: background-color 0.2s;
}

.tenants-table tbody tr:hover {
    background: #f8f9fa;
}

.tenants-table .action-buttons {
    display: flex;
    gap: 8px;
}

.tenants-table .edit-btn,
.tenants-table .delete-btn,
.tenants-table .history-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.tenants-table .history-btn {
    background: #38a169;
    color: white;
}

.tenants-table .history-btn:hover {
    background: #2f855a;
}

.tenants-table .edit-btn {
    background: #667eea;
    color: white;
}

.tenants-table .edit-btn:hover {
    background: #5a67d8;
}

.tenants-table .delete-btn {
    background: #e53e3e;
    color: white;
}

.tenants-table .delete-btn:hover {
    background: #c53030;
}

/* Status badge styles */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-paid {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-overdue {
    background: #f8d7da;
    color: #721c24;
}

/* Table hint styling */
.table-hint {
    text-align: center;
    padding: 15px;
    font-size: 14px;
    color: #667eea;
    font-style: italic;
    background: #f8f9fa;
    border-top: 1px solid #e1e1e1;
    border-radius: 0 0 8px 8px;
}

/* Sharing Vacancy Overview Styles */
.sharing-vacancy-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    margin-top: 25px;
}

.sharing-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.sharing-stat-card:hover {
    transform: translateY(-5px);
}

.sharing-stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.vacancy-details {
    font-size: 14px;
    opacity: 0.9;
}

.available-beds {
    font-size: 24px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

/* Room Details Section */
.room-details-section {
    margin-top: 30px;
}

.room-details-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

/* Enhanced Room Status Card Styles */
.room-status-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.room-status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.room-status-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.room-status-card.vacant {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f7ea 100%);
}

.room-status-card.vacant::before {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.room-status-card.partial {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fffcf0 0%, #fff3cd 100%);
}

.room-status-card.partial::before {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.room-status-card.full {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #f8d7da 100%);
}

.room-status-card.full::before {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

/* New layout styles */
.room-status-card {
    cursor: pointer;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    padding: 20px;
}

.room-type-header {
    margin-bottom: 16px;
}

.room-type {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.room-number {
    margin: 16px 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-number h4 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 700;
}

.room-vacancy {
    margin-top: 16px;
}

.room-vacancy .available {
    color: #28a745;
    font-weight: 600;
    font-size: 16px;
    background: rgba(40, 167, 69, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
    display: inline-block;
}

.room-vacancy .full {
    color: #dc3545;
    font-weight: 600;
    font-size: 16px;
    background: rgba(220, 53, 69, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
    display: inline-block;
}

/* No rooms available messages */
.no-available-rooms,
.no-sharing-available {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
    grid-column: 1 / -1; /* Span full width */
}

.no-rooms-icon,
.no-sharing-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-available-rooms h3,
.no-sharing-available h3 {
    margin: 0 0 12px 0;
    color: #6c757d;
    font-size: 24px;
}

.no-available-rooms p,
.no-sharing-available p {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
}

/* Remove cursor pointer since cards are no longer clickable */
.room-status-card {
    cursor: default;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.room-header h4 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 700;
}

.room-type {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.room-occupancy {
    margin-bottom: 0;
    text-align: center;
}

.availability-status {
    text-align: center;
    margin-top: 16px;
}

.availability-status .available {
    color: #28a745;
    font-weight: 600;
    font-size: 16px;
    background: rgba(40, 167, 69, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
    display: inline-block;
}

.availability-status .full {
    color: #dc3545;
    font-weight: 600;
    font-size: 16px;
    background: rgba(220, 53, 69, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
    display: inline-block;
}

.current-tenants {
    border-top: 1px solid #e9ecef;
    padding-top: 16px;
}

.tenants-header {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.tenants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tenant-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.no-tenants {
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 14px;
    padding: 20px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 16px;
}

/* Click hint styles */
.click-hint {
    text-align: center;
    padding: 12px 0 8px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 16px;
}

.tenant-count {
    color: #667eea;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.no-tenant-hint {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

.room-status-card {
    cursor: pointer;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Room Details Modal Styles */
.room-details-content {
    padding: 0;
}

.room-info-card {
    background: white;
    border-radius: 12px;
}

.room-basic-info {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.room-basic-info h4 {
    margin: 0 0 16px 0;
    font-size: 24px;
    color: #333;
    font-weight: 700;
}

.room-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.spec-label {
    font-weight: 600;
    color: #666;
}

.spec-value {
    color: #333;
    font-weight: 500;
}

.tenants-section {
    padding: 20px;
}

.tenants-section h5 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.tenants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.tenant-detail-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #667eea;
}

.tenant-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.tenant-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #666;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.no-tenants-section {
    padding: 40px 20px;
    text-align: center;
}

.empty-room-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-tenants-section p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Mobile adjustments for payment history */
@media (max-width: 768px) {
    .payment-record {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .payment-date {
        font-size: 16px;
        font-weight: 600;
    }
    
    .payment-details {
        align-items: center;
    }
    
    .modal-content {
        padding: 20px;
        max-width: 95%;
        width: calc(100vw - 40px);
    }
    
    .tenant-summary-card {
        padding: 12px;
    }
    
    /* Mobile table styles - Convert to cards */
    .table-container {
        overflow-x: visible;
        box-shadow: none;
        border-radius: 0;
    }
    
    .tenants-table {
        font-size: 14px;
        min-width: auto;
        border: none;
    }
    
    .tenants-table thead {
        display: none;
    }
    
    .tenants-table tbody {
        display: block;
    }
    
    .tenants-table tbody tr {
        display: block;
        background: white;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: 1px solid #e1e1e1;
        padding: 15px;
    }
    
    .tenants-table tbody tr:hover {
        background: white;
        transform: none;
    }
    
    .tenants-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
        text-align: right;
    }
    
    .tenants-table td:last-child {
        border-bottom: none;
    }
    
    .tenants-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #333;
        text-align: left;
        flex-shrink: 0;
        margin-right: 10px;
    }
    
    .tenants-table .action-buttons {
        flex-direction: row;
        gap: 8px;
        justify-content: flex-end;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .tenants-table .edit-btn,
    .tenants-table .delete-btn,
    .tenants-table .history-btn {
        font-size: 12px;
        padding: 8px 12px;
        flex: 1;
        min-width: 70px;
        text-align: center;
    }
    
    /* Mobile room card adjustments */
    .room-status-card {
        padding: 16px;
        min-height: 120px;
    }
    
    .room-number h4 {
        font-size: 20px;
    }
    
    .room-vacancy .available,
    .room-vacancy .full {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .room-type {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .sharing-stat-card {
        padding: 16px;
    }
    
    .sharing-stat-card h3 {
        font-size: 16px;
    }
    
    .available-beds {
        font-size: 20px;
    }
    
    /* Mobile room details modal */
    .room-specs {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .tenants-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tenant-info {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .room-basic-info h4 {
        font-size: 20px;
    }
    
    .empty-room-icon {
        font-size: 36px;
    }
}

/* Custom Alert Modal */
.alert-modal {
    max-width: 400px;
    width: 90%;
}

.alert-header {
    background: #667eea;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
}

.alert-header h3 {
    margin: 0;
    font-size: 18px;
}

.alert-content {
    padding: 25px 20px;
    text-align: center;
}

.alert-content p {
    margin: 0;
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}

.alert-modal .form-actions {
    padding: 15px 20px;
    justify-content: center;
}

.alert-modal .submit-btn {
    min-width: 80px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.alert-modal .submit-btn:hover {
    background: #5a67d8;
}

/* Payment Mode Modal */
.payment-modal {
    max-width: 450px;
    width: 90%;
}

.tenant-payment-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.tenant-payment-info h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
}

.tenant-payment-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.payment-method-selection h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.payment-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
}

.payment-method-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.method-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.method-text {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

@media (max-width: 480px) {
    .payment-methods {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .payment-method-btn {
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px;
    }
    
    .method-icon {
        font-size: 24px;
        margin-bottom: 0;
        margin-right: 12px;
    }
}

/* Responsive styles for tenant details grid */
@media (max-width: 768px) {
    .tenant-details-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .detail-item {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .tenant-details-grid {
        gap: 8px;
    }
    
    .detail-item {
        padding: 8px 10px;
        border-left-width: 2px;
    }
    
    .detail-item strong {
        font-size: 11px;
    }
}

/* Initial Payment Modal Styles */
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
    flex: 1;
}

.btn-primary:hover {
    background: #5a6fd8;
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-secondary,
    .btn-primary {
        width: 100%;
    }
}

/* Enhanced Payment Modal Styles */
.payment-method-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.date-group {
    max-width: 250px;
}

.date-input-small {
    max-width: 180px;
    font-size: 14px;
}

.form-help {
    color: #6c757d;
    font-style: italic;
    margin-top: 4px;
    display: block;
}

.confirm-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    flex: 1;
}

.confirm-btn:hover {
    background: #218838;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.cancel-btn:hover {
    background: #5a6268;
}

/* Monthly Analysis Styles */
.analysis-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.analysis-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.analysis-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.analysis-card.revenue {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.analysis-card.revenue:hover {
    box-shadow: 0 12px 35px rgba(40, 167, 69, 0.4);
}

.analysis-card.profit {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.3);
}

.analysis-card.profit:hover {
    box-shadow: 0 12px 35px rgba(23, 162, 184, 0.4);
}

.analysis-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.analysis-subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin: 0;
}

/* Expense Form Styles */
.expense-form-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.expense-form-container h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #e1e1e1;
    padding-bottom: 10px;
}

.expense-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.expense-form .form-group {
    display: flex;
    flex-direction: column;
}

.expense-form label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.expense-form input,
.expense-form select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.expense-form input:focus,
.expense-form select:focus {
    outline: none;
    border-color: #667eea;
}

.add-expense-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
    margin-top: 20px;
}

.add-expense-btn:hover {
    background: #218838;
}

/* Category Breakdown Styles */
.category-breakdown {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.category-breakdown h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #e1e1e1;
    padding-bottom: 10px;
}

.category-list {
    display: grid;
    gap: 12px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: background-color 0.2s ease;
    margin-bottom: 10px;
}

.category-item:hover {
    background: #e9ecef;
}

.category-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-right: 15px;
}

.category-name {
    font-weight: 500;
    color: #333;
    text-transform: capitalize;
    font-size: 14px;
    margin-bottom: 4px;
}

.category-amount {
    font-weight: 600;
    color: #667eea;
    font-size: 16px;
}

.category-bar {
    flex: 2;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 15px;
}

.category-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.category-percentage {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    min-width: 40px;
    text-align: right;
}

/* Yearly Trends Section Styles */
.yearly-trends-section {
    margin-top: 30px;
}

.yearly-trends-section h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 25px;
    font-weight: 600;
    text-align: left;
}

.trend-chart-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e1e1;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.year-selector select {
    padding: 8px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.year-selector select:hover {
    border-color: #667eea;
}

.year-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    height: 400px;
    padding: 20px;
    background: linear-gradient(to top, #f8f9fa 0%, transparent 100%);
    border-radius: 8px;
    position: relative;
    margin-bottom: 30px;
}

.bar-chart::before {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    height: 1px;
    background: #dee2e6;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    min-width: 0;
    height: 100%;
    gap: 8px;
}

.bar-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: calc(100% - 40px);
    justify-content: flex-end;
    flex: 1;
}

.bar {
    width: 70%;
    max-width: 45px;
    min-height: 2px;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 6px 6px 0 0;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 -2px 10px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.bar.revenue-bar {
    background: linear-gradient(to top, #28a745, #20c997);
    box-shadow: 0 -2px 10px rgba(40, 167, 69, 0.3);
}

.bar.expense-bar {
    background: linear-gradient(to top, #dc3545, #fd7e14);
    box-shadow: 0 -2px 10px rgba(220, 53, 69, 0.3);
}

.bar.increase {
    background: linear-gradient(to top, #28a745, #20c997);
    box-shadow: 0 -2px 10px rgba(40, 167, 69, 0.3);
}

.bar.decrease {
    background: linear-gradient(to top, #dc3545, #e74c3c);
    box-shadow: 0 -2px 10px rgba(220, 53, 69, 0.3);
}

.bar:hover {
    transform: scaleY(1.02);
    filter: brightness(1.1);
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.bar-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-align: center;
}

.bar-change {
    font-size: 10px;
    font-weight: 600;
    color: #28a745;
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.bar-change.negative {
    color: #dc3545;
}

.chart-summary {
    margin-top: 0;
    margin-bottom: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    text-align: center;
    padding: 10px;
}

.summary-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.summary-value.positive {
    color: #28a745;
}

.summary-value.negative {
    color: #dc3545;
}

.summary-icon {
    font-size: 16px;
    margin-left: 5px;
}

.no-data {
    text-align: center;
    color: #666;
    padding: 40px;
    font-style: italic;
}


.no-expenses {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 30px 20px;
}

/* Recent Expenses Styles */
.recent-expenses {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.expenses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e1e1;
    flex-wrap: wrap;
    gap: 15px;
}

.expenses-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.expense-filters select {
    padding: 8px 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.expense-filters select:focus {
    outline: none;
    border-color: #667eea;
}

.expense-table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.expenses-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
}

.expenses-table th {
    background: #667eea;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #5a67d8;
}

.expenses-table th:nth-child(1) { /* Date */
    width: 100px;
}

.expenses-table th:nth-child(2) { /* Description */
    width: auto;
    min-width: 200px;
}

.expenses-table th:nth-child(3) { /* Amount */
    width: 100px;
    text-align: right;
}

.expenses-table th:nth-child(4) { /* Category */
    width: 120px;
    text-align: center;
}

.expenses-table th:nth-child(5) { /* Actions */
    width: 80px;
    text-align: center;
}

.expenses-table th:first-child {
    border-radius: 8px 0 0 0;
}

.expenses-table th:last-child {
    border-radius: 0 8px 0 0;
}

.expense-row {
    border-bottom: 1px solid #e1e1e1;
    transition: background-color 0.2s ease;
}

.expense-row:hover {
    background: #f8f9fa;
}

.expense-row:last-child {
    border-bottom: none;
}

.expenses-table td {
    padding: 12px 15px;
    font-size: 14px;
    vertical-align: middle;
}

.expense-date {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    width: 100px;
}

.expense-description {
    color: #333;
    font-weight: 600;
    max-width: 250px;
    word-wrap: break-word;
    padding-right: 20px;
}

.expense-category-cell {
    text-align: center;
    width: 120px;
}

.expense-category-tag {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    white-space: nowrap;
    display: inline-block;
}

.expense-amount-cell {
    color: #dc3545;
    font-weight: 700;
    font-size: 15px;
    text-align: right;
    white-space: nowrap;
    width: 100px;
    font-family: 'Courier New', monospace;
    padding-right: 20px;
}

.expense-actions {
    text-align: center;
    width: 80px;
}

.expenses-table .delete-expense-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.expenses-table .delete-expense-btn:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
    transform: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.no-expenses-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    font-size: 16px;
}

/* Expense Pagination */
.expense-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    margin-top: 20px;
    border-top: 1px solid #e9ecef;
}

.pagination-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.pagination-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.pagination-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    min-width: 200px;
    text-align: center;
}

.expense-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.2s ease;
}

.expense-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.expense-details h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.expense-meta {
    color: #666;
    font-size: 14px;
}

.expense-date {
    color: #666;
    font-size: 13px;
}

.expense-category {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    white-space: nowrap;
}

.expense-amount-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.expense-amount {
    font-weight: 700;
    color: #dc3545;
    font-size: 18px;
    white-space: nowrap;
}

.delete-expense-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.delete-expense-btn:hover {
    background: #c82333;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.delete-expense-btn span {
    font-size: 12px;
}

.more-expenses {
    text-align: center;
    padding: 20px;
    margin-top: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.more-text {
    color: #6c757d;
    font-style: italic;
    margin: 0;
}

/* Mobile Responsive Styles for Monthly Analysis */
@media (max-width: 768px) {
    .analysis-overview {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .analysis-card {
        padding: 20px;
    }
    
    .analysis-value {
        font-size: 28px;
    }
    
    .expense-form-container,
    .category-breakdown,
    .recent-expenses {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .expense-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .expense-form .form-group {
        margin-bottom: 0;
    }
    
    .add-expense-btn {
        margin-top: 10px;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .expenses-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .expenses-header h3 {
        text-align: center;
        font-size: 18px;
    }
    
    .expense-filters {
        text-align: center;
    }
    
    .expense-filters select {
        width: 100%;
        max-width: 200px;
        padding: 12px;
        font-size: 16px;
    }
    
    /* Mobile table styles - Horizontal thin rows */
    .expenses-table thead {
        display: none;
    }
    
    .expense-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: white;
        margin-bottom: 8px;
        border-radius: 6px;
        border: 1px solid #e1e1e1;
        padding: 10px 12px;
        gap: 8px;
        min-height: 50px;
    }
    
    .expense-row:hover {
        background: #f8f9fa;
    }
    
    .expenses-table td {
        display: inline-block;
        padding: 0;
        border: none;
        position: relative;
    }
    
    .expenses-table td::before {
        display: none;
    }
    
    .expense-date {
        font-size: 11px;
        color: #666;
        white-space: nowrap;
        min-width: 60px;
    }
    
    .expense-description {
        flex: 1;
        font-size: 13px;
        font-weight: 600;
        color: #333;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 0 8px;
    }
    
    .expense-amount-cell {
        font-size: 14px;
        font-weight: 700;
        color: #dc3545;
        white-space: nowrap;
        min-width: 70px;
        text-align: right;
    }
    
    .expense-category-cell {
        display: none;
    }
    
    .expense-actions {
        min-width: auto;
        text-align: right;
    }
    
    .expenses-table .delete-expense-btn {
        padding: 6px 12px;
        font-size: 11px;
        border-radius: 5px;
        background: #dc3545;
        color: white;
        border: none;
        white-space: nowrap;
        font-weight: 500;
    }
    
    .expenses-table .delete-expense-btn:hover {
        background: #c82333;
    }
    
    /* Expense pagination mobile styles */
    .expense-pagination {
        flex-direction: row;
        gap: 10px;
        padding: 15px;
        margin-top: 15px;
    }
    
    .pagination-btn {
        padding: 10px 16px;
        font-size: 13px;
        flex: 0 0 auto;
    }
    
    .pagination-info {
        font-size: 12px;
        min-width: auto;
        white-space: nowrap;
    }
    
    /* Trend Charts Responsive Styles */
    .yearly-trends-section h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .trend-chart-container {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .chart-header h4 {
        font-size: 16px;
        text-align: center;
    }
    
    .year-selector {
        text-align: center;
    }
    
    .year-selector select {
        width: 100%;
        max-width: 200px;
        padding: 10px 15px;
        font-size: 16px;
    }
    
    .bar-chart {
        height: 250px;
        gap: 4px;
        padding: 15px;
    }
    
    .bar-chart::before {
        left: 15px;
        right: 15px;
        bottom: 15px;
    }
    
    .bar {
        max-width: 35px;
    }
    
    .bar-value {
        font-size: 9px;
        top: -20px;
        padding: 1px 4px;
    }
    
    .bar-label {
        font-size: 10px;
        margin-top: 6px;
    }
    
    .bar-change {
        font-size: 8px;
        margin-top: 1px;
    }
    
    .chart-summary {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 15px;
    }
    
    .summary-item {
        padding: 8px;
    }
    
    .summary-label {
        font-size: 11px;
    }
    
    .summary-value {
        font-size: 16px;
    }
    
    .summary-icon {
        font-size: 14px;
    }
}


@media (max-width: 480px) {
    .analysis-card {
        padding: 16px;
    }
    
    .analysis-card h3 {
        font-size: 14px;
    }
    
    .analysis-value {
        font-size: 24px;
    }
    
    .expense-form-container h3,
    .category-breakdown h3,
    .recent-expenses h3 {
        font-size: 18px;
    }
    
    .expense-form-container,
    .category-breakdown,
    .recent-expenses {
        padding: 15px;
    }
}

/* Remove Tenant Modal Styles */
.removal-type-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.removal-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.removal-option:hover {
    border-color: #2196F3;
    background-color: #f5f9ff;
}

.removal-option input[type="radio"] {
    margin-top: 3px;
}

.removal-option input[type="radio"]:checked + .option-text {
    color: #2196F3;
    font-weight: 600;
}

.removal-option:has(input[type="radio"]:checked) {
    border-color: #2196F3;
    background-color: #f5f9ff;
}

.option-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.removal-option small {
    color: #666;
    font-size: 13px;
    display: block;
}

.scheduled-removal-details {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.removal-date-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.days-countdown {
    margin-top: 15px;
}

.days-info {
    color: #2196F3;
    font-weight: 500;
    margin: 0;
}

.days-warning {
    color: #f44336;
    font-weight: 500;
    margin: 0;
}

/* Scheduled Removals Section */
.scheduled-removals-section {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scheduled-removals-section h3 {
    color: #333;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.scheduled-removals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.scheduled-removal-card {
    background: linear-gradient(135deg, #fff3e0 0%, #ffecb3 100%);
    border: 1px solid #ffcc02;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.scheduled-removal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.removal-info h4 {
    margin: 0 0 10px 0;
    color: #e65100;
    font-size: 18px;
}

.removal-info p {
    margin: 5px 0;
    color: #333;
    font-size: 14px;
}

.days-countdown {
    color: #f57f17;
    font-weight: bold;
    font-size: 16px;
}

.removal-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.removal-actions button {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.btn-secondary {
    background-color: #9e9e9e;
    color: white;
}

.btn-secondary:hover {
    background-color: #757575;
}

.btn-primary {
    background-color: #f44336;
    color: white;
}

.btn-primary:hover {
    background-color: #d32f2f;
}

.no-scheduled-removals {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

/* Scheduled Removal Indicator in Tenant Table */
.scheduled-removal-indicator {
    color: #ff9800;
    font-weight: 500;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

/* Responsive Design for Remove Modal */
@media (max-width: 768px) {
    .removal-type-selection {
        gap: 10px;
    }
    
    .removal-option {
        padding: 12px;
    }
    
    .scheduled-removals-grid {
        grid-template-columns: 1fr;
    }
    
    .removal-actions {
        flex-direction: column;
    }
}

/* Removal reason fields styling */
.removal-reason-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.other-reason-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Logout section styles */
.logout-actions {
    display: flex;
    gap: 10px;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.reset-btn {
    background: #FF9800;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.reset-btn:hover {
    background: #F57C00;
}

/* Responsive utility classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* On mobile devices */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
}

/* New Login Selection Styles */
.login-selection-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-selection-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.login-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
}

.login-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.login-option:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.option-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.login-option h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
}

.login-option p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.4;
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background: #5a6268;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    border: 1px solid #f5c6cb;
}

/* Dashboard Styles */
.dashboard {
    min-height: 100vh;
    background: #f5f5f5;
}

.dashboard-nav {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.dashboard-content {
    padding: 30px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.card h3 {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

.card-value {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
}

.dashboard-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    border-bottom-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.tab-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th,
table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.form-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.form-actions button:not(.btn-primary) {
    background: #6c757d;
    color: white;
}

.form-actions button:not(.btn-primary):hover {
    background: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .dashboard-nav {
        padding: 15px 20px;
    }
    
    .dashboard-content {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Enhanced Alert Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
}

/* Alert message styling */
#alertMessage {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    padding: 10px 0;
}

/* Alert title with icon */
#alertTitle {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Read-only Settings Information */
.readonly-info {
    padding: 15px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .form-label {
    font-weight: 600;
    color: #495057;
    margin: 0;
    font-size: 14px;
}

.info-value {
    font-size: 15px;
    color: #212529;
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-wrap: break-word;
}

.license-display {
    color: #28a745;
    font-weight: 600;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-value {
        max-width: 100%;
        text-align: left;
    }
}

/* Additional small screen optimizations (phones under 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .main-content {
        padding: 8px;
        padding-top: 65px;
    }
    
    .content-section {
        padding: 15px;
        border-radius: 6px;
    }
    
    /* Smaller headers on tiny screens */
    h1, .header h1 {
        font-size: 20px;
    }
    
    h2, .header h2 {
        font-size: 18px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    /* Stat cards more compact */
    .vacancy-overview, .rent-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .sharing-vacancy-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 20px;
    }
    
    .sharing-stat-card {
        padding: 15px;
    }
    
    .sharing-stat-card h3 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .vacancy-details {
        font-size: 12px;
    }
    
    .rent-overview-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 15px;
        min-height: 100px;
    }
    
    .stat-card h3 {
        font-size: 12px;
    }
    
    .stat-card span {
        font-size: 22px;
    }
    
    /* Smaller buttons on tiny screens */
    .filter-btn {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    /* Table cards more compact */
    .table-row {
        margin-bottom: 12px;
        padding: 12px;
    }
    
    .table-cell {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .table-cell::before {
        font-size: 13px;
        min-width: 100px;
    }
    
    /* Room cards single column */
    .room-status-grid {
        grid-template-columns: 1fr;
    }
    
    /* Settings cards single column */
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    /* Smaller modal padding */
    .modal-content {
        padding: 15px;
    }
    
    /* Form inputs more compact */
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    /* Navigation items */
    .nav-text {
        font-size: 13px;
    }
    
    .panel-header h3 {
        font-size: 16px;
    }
}

/* Landscape mode optimizations for phones */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        padding: 10px;
        padding-top: 60px;
    }
    
    .modal-content {
        max-height: 90vh;
        padding: 15px;
    }
    
    .content-section {
        padding: 15px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .table-row {
        margin-bottom: 10px;
    }
}

/* Extra wide mobile devices (tablets in portrait) */
@media (min-width: 481px) and (max-width: 768px) {
    .vacancy-overview, .rent-overview {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .rent-overview-metrics {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .room-status-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tenants-table tbody tr {
        padding: 18px;
    }
}

/* Print styles */
@media print {
    .left-panel,
    .toggle-btn,
    .mobile-toggle-btn,
    .add-btn,
    .delete-btn,
    .edit-btn,
    .action-buttons,
    .form-actions,
    .filter-buttons {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .table-row,
    .tenants-table tbody tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
