/* --- Global Variables & Reset --- */
:root {
    --color-primary: #1e88e5;
    /* A vibrant blue for main actions/branding */
    --color-secondary: #ffb300;
    /* A warm yellow for secondary actions/alerts */
    --color-background: #f4f6f9;
    /* Light, soft background */
    --color-surface: #ffffff;
    /* White for cards and forms */
    --color-text-dark: #333333;
    --color-text-light: #777777;
    --color-success: #43a047;
    --color-danger: #e53935;
    --font-primary: 'Inter', sans-serif;
    /* Use a modern, readable font */
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-background);
    color: var(--color-text-dark);
    line-height: 1.6;
}

/* --- Layout: Header & Sidebar --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-layout2 {
    display: flex;
    min-height: 100vh;
    width: 80vw;
    margin: 0 auto;
}

.sidebar {
    width: 250px;
    background-color: var(--color-surface);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    position: fixed;
    height: 100%;
    overflow-y: auto;
}

.logo img {
    max-width: 230px;
    padding: 10px;
    height: auto;
}

.main-content {
    flex-grow: 1;
    margin-left: 250px;
    /* Offset for fixed sidebar */
    padding: 20px;

    /* Background image */
    /*background-image:
        linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.8)),
        url("../images/image.png");*/
    background-repeat: no-repeat;
    background-size: contain;
    /* or use 'cover' depending on effect */
    background-position: center center;
    background-color: #f5f5f5;
    /* fallback color */
}

.main-content2 {
    margin-left: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.header {
    background-color: var(--color-surface);
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header2 {
    height: 100px;
    background-color: var(--color-primary);
    width: 100%;
    display: flex;
    justify-content: space-around;
    font-size: 25px;
    border-radius: 10px;
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--color-primary);
}

/* --- Navigation --- */
.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--color-text-dark);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--color-primary);
    color: var(--color-surface);
}

.nav-link i {
    margin-right: 10px;
}

/* --- Widget (Card) Styling --- */
.widget-card {
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
    min-height: 120px;
}

.widget-card:hover {
    transform: translateY(-3px);
}

.widget-title {
    color: var(--color-text-light);
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 5px;
}

.widget-value {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--color-primary);
}

.widget-info {
    font-size: 1em;
    color: var(--color-text-light);
}

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    grid-column: span 1;
    /* Default for smaller screens */
    min-height: 350px;
}

/* Adjustments for charts on larger screens */
@media (min-width: 1024px) {
    .chart-container.full-width {
        grid-column: span 2;
    }
}




/* --- Properties List & General List Styling --- */

.list-container {
    padding: 20px;
}

.list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Primary Action Button (Add Property) */
.btn {
    padding: 10px 15px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-surface);
}

.btn-primary:hover {
    background-color: #1565c0;
    /* Darker shade of primary blue */
}

/* Search Input */
.search-input {
    padding: 10px 15px;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1em;
}

/* --- Data Table Styling (Uniform Look) --- */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background-color: var(--color-background);
    color: var(--color-text-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* --- Action Buttons (Table Row) --- */
.action-btn {
    color: var(--color-text-light);
    margin-right: 10px;
    transition: color 0.2s;
    font-size: 1.1em;
}

.action-btn:hover {
    color: var(--color-primary);
}

/* --- Status Badges --- */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background-color: rgba(67, 160, 71, 0.1);
    /* Green background */
    color: var(--color-success);
}

.status-inactive,
.status-maintenance {
    background-color: rgba(255, 179, 0, 0.1);
    /* Yellow background */
    color: var(--color-secondary);
}

/* --- Pagination --- */
.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    margin-top: 15px;
}

.page-btn {
    background: var(--color-surface);
    border: 1px solid #ddd;
    padding: 8px 12px;
    margin: 0 4px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.page-btn:hover:not(.active) {
    background-color: #f0f0f0;
}

.page-btn.active {
    background-color: var(--color-primary);
    color: var(--color-surface);
    border-color: var(--color-primary);
}



/* --- Units List Specific Styles --- */

/* Filter group container for search and selects */
.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Style for select dropdowns in the toolbar */
.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1em;
    background-color: var(--color-surface);
}

/* Ensure toolbar wraps nicely on smaller screens */
.list-toolbar.flex-wrap {
    flex-wrap: wrap;
    gap: 15px;
    /* Add gap for wrapping elements */
}

/* Status Badges refinement */

.status-badge.status-occupied {
    background-color: rgba(67, 160, 71, 0.1);
    /* Green for Occupied */
    color: var(--color-success);
}

.status-badge.status-vacant {
    background-color: rgba(244, 67, 54, 0.1);
    /* Light red/orange for Vacant */
    color: var(--color-danger);
}

.status-badge.status-maintenance {
    background-color: rgba(255, 179, 0, 0.1);
    /* Yellow/Alert for Maintenance */
    color: var(--color-secondary);
}

/* STK Push Button Style */
.action-btn.btn-stk {
    color: #9c27b0;
    /* A distinct purple/mauve color for financial/mobile action */
}

.action-btn.btn-stk:hover {
    color: #4a148c;
    /* Darker hover */
}

.action-btn[disabled] {
    color: #ccc;
    cursor: not-allowed;
}


/* --- Owners List Specific Styles --- */

/* Style for the statement generation action button */
.action-btn.btn-statement {
    color: #4CAF50;
    /* A distinct green color, perhaps slightly different from success, for documentation/finance actions */
}

.action-btn.btn-statement:hover {
    color: #388E3C;
}


/* --- Tenants List Specific Statuses & Actions --- */

/* Status Badge for Current Tenant (Green) */
.status-badge.status-current {
    background-color: rgba(67, 160, 71, 0.1);
    color: var(--color-success);
}

/* Status Badge for Tenant In Arrears (Red/Danger) */
.status-badge.status-arrears {
    background-color: rgba(229, 57, 53, 0.1);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
    /* Added border for emphasis */
}

/* Status Badge for Tenant with Notice (Secondary/Alert) */
.status-badge.status-notice {
    background-color: rgba(255, 179, 0, 0.1);
    color: var(--color-secondary);
}

/* Move-out/Danger Action Button */
.action-btn.btn-danger-action {
    color: var(--color-danger);
    /* Use the primary danger color */
    margin-left: 5px;
    /* Separate visually from finance actions */
}

.action-btn.btn-danger-action:hover {
    color: #a0201d;
    /* Darker red on hover */
}



/* --- Deposits List Specific Styles --- */

/* Text alignment for financial columns */
.data-table .text-right {
    text-align: right;
    font-weight: 600;
}

/* Deposit Type Badges */
.type-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    display: inline-block;
}

/* Rent Deposit Type */
.type-badge.type-rent {
    background-color: rgba(30, 136, 229, 0.1);
    /* Light Blue */
    color: var(--color-primary);
}

/* Utility Deposit Type (Water/Electricity) */
.type-badge.type-utility {
    background-color: rgba(0, 150, 136, 0.1);
    /* Teal/Cyan */
    color: #009688;
}

/* Collected Deposit Status */
.status-badge.status-collected {
    background-color: rgba(67, 160, 71, 0.1);
    /* Green */
    color: var(--color-success);
}


/* --- Billing Module Specific Styles --- */

/* Style for descriptive text below headers */
.section-description {
    color: var(--color-text-light);
    font-size: 0.95em;
    margin-bottom: 20px;
}

/* Enhancing the form field grouping (used within .filter-group here) */
.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-weight: 500;
    font-size: 0.9em;
    color: var(--color-text-dark);
    margin-bottom: 5px;
}

/* Adjusting the main form layout for horizontal alignment */
.billing-form .filter-group {
    /* Override filter-group to use a standard gap */
    gap: 20px;
    align-items: flex-end;
    /* Align inputs/selects and button at the bottom */
}

.billing-form .filter-select {
    width: 150px;
    /* Standardize width for selects */
}

/* Adjusting the generate button for better alignment */
.billing-form .generate-btn {
    padding: 11px 20px;
    height: 44px;
    /* Match height of select inputs */
}

/* Status Badges for Billing Cycles */

/* Billed/Sent Status */
.status-badge.status-billed {
    background-color: rgba(30, 136, 229, 0.1);
    color: var(--color-primary);
}

/* Complete/Fully Paid Status */
.status-badge.status-paid {
    background-color: rgba(67, 160, 71, 0.1);
    color: var(--color-success);
}

/* Action Button Style for Primary/Secondary actions in the table */
.action-btn.btn-primary-action {
    color: var(--color-primary);
}


/* --- Invoices List Specific Statuses & Actions --- */

/* Status Badge for Fully Paid Invoice (Success) */
.status-badge.status-paid {
    background-color: rgba(67, 160, 71, 0.1);
    color: var(--color-success);
}

/* Status Badge for Pending Payment (Primary/Default) */
.status-badge.status-partial {
    background-color: rgba(30, 136, 229, 0.1);
    color: var(--color-primary);
}

/* Status Badge for Overdue Invoice (Danger/Alert) */
.status-badge.status-pending {
    background-color: rgba(229, 57, 53, 0.1);
    color: var(--color-danger);
    font-weight: 700;
}

/* Action Button for PDF/Export */
.action-btn.btn-export {
    color: #FF5722;
    /* A strong orange/red for PDF download */
}

.action-btn.btn-export:hover {
    color: #E64A19;
}

/* Action Button for minor edits (less emphasized than primary actions) */
.action-btn.btn-edit-minor {
    color: #8D6E63;
    /* Subtle brown/grey for minor edits */
}




/* --- Payments List Specific Styles --- */

/* Payment Method Badges */
.method-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    min-width: 65px;
    text-align: center;
}

/* MPESA Method */
.method-badge.method-mpesa_paybill {
    background-color: rgba(69, 158, 71, 0.15);
    /* MPESA Green */
    color: #4CAF50;
}

/* Bank Transfer Method */
.method-badge.method-stk_push {
    background-color: rgba(33, 150, 243, 0.1);
    /* Bank Blue */
    color: #2196F3;
}

/* Cash Method */
.method-badge.method-cash {
    background-color: rgba(255, 152, 0, 0.1);
    /* Cash Orange */
    color: #FF9800;
}

/* Action Button to View Applied Invoice */
.action-btn.btn-view-invoice {
    color: #00BCD4;
    /* Cyan/Teal for financial linking */
}

.action-btn.btn-view-invoice:hover {
    color: #0097A7;
}



/* --- Communication Module Specific Styles --- */

/* Badge for SMS Channel */
.type-badge.type-sms {
    background-color: rgba(69, 158, 71, 0.15);
    /* MPESA Green */
    color: #4CAF50;
}

/* Badge for Email Channel */
.type-badge.type-email {
    background-color: rgba(255, 152, 0, 0.1);
    /* Orange/Alert */
    color: #FF9800;
}

/* Status Badge for Sent Message */
.status-badge.status-sent {
    background-color: rgba(67, 160, 71, 0.1);
    color: var(--color-success);
}

/* Status Badge for Failed Message */
.status-badge.status-failed {
    background-color: rgba(229, 57, 53, 0.1);
    color: var(--color-danger);
}



/* --- Reports Module Specific Styles --- */

/* Grid container for report cards */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Responsive grid */
    gap: 20px;
    margin-top: 20px;
}

/* Individual Report Card styling */
.report-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Push button to the bottom */
    padding: 30px;
    min-height: 220px;
    text-align: center;
    transition: transform 0.2s;
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

/* Icon style for the card top */
.report-card .card-icon {
    font-size: 3em;
    color: var(--color-primary);
    margin-bottom: 15px;
}

.report-card h3 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: var(--color-text-dark);
}

.report-card p {
    font-size: 0.9em;
    color: var(--color-text-light);
    margin-bottom: 20px;
    /* Space above the button */
    flex-grow: 1;
    /* Allows the paragraph to take up available space */
}


/* --- Settings Module Specific Styles --- */

.settings-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    /* Keep panels aligned at the top */
}

.settings-nav {
    flex-shrink: 0;
    /* Prevents sidebar from shrinking */
    width: 250px;
    padding: 0;
    /* Remove default card padding, content has its own padding */
}

.settings-nav nav {
    display: flex;
    flex-direction: column;
}

.settings-nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--color-text-dark);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.settings-nav-link i {
    margin-right: 10px;
}

.settings-nav-link:hover {
    background-color: var(--color-background);
    color: var(--color-primary);
}

.settings-nav-link.active {
    background-color: var(--color-primary);
    color: var(--color-surface);
}

.settings-content {
    flex-grow: 1;
    min-width: 500px;
    /* Ensures forms have space */
}

.settings-view {
    /* Styles for the individual content panel */
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    display: none;
    /* Hide all views by default */
}

.settings-view.active {
    display: block;
    /* Show the active view */
}

/* Form Styling within Settings */
.settings-form .form-group {
    margin-bottom: 20px;
}

.settings-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-dark);
}

.settings-form input[type="text"],
.settings-form input[type="number"],
.settings-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1em;
}

/* Integration Status Indicators */
.integration-status {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    font-weight: 600;
}

.integration-status i {
    margin-right: 10px;
}

.integration-status.status-active {
    background-color: rgba(67, 160, 71, 0.1);
    color: var(--color-success);
    border-left: 5px solid var(--color-success);
}

.integration-status.status-inactive {
    background-color: rgba(255, 179, 0, 0.1);
    color: var(--color-secondary);
    border-left: 5px solid var(--color-secondary);
    cursor: pointer;
}

/* Responsive adjustment for small screens */
@media (max-width: 900px) {
    .settings-container {
        flex-direction: column;
    }

    .settings-nav {
        width: 100%;
    }

    .settings-nav nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }
}


/* --- Companies List Specific Styles (New Badges) --- */

/* Corporate Tenant (reusing existing rent deposit blue/primary theme) */
.type-badge.type-tenant {
    background-color: rgba(30, 136, 229, 0.1);
    color: var(--color-primary);
}

/* Maintenance Vendor Type (using a utility/secondary color) */
.type-badge.type-vendor {
    background-color: rgba(0, 150, 136, 0.1);
    /* Teal/Cyan */
    color: #009688;
}

/* Agency/Partner Type (using a slightly different color) */
.type-badge.type-agency {
    background-color: rgba(156, 39, 176, 0.1);
    /* Purple */
    color: #9C27B0;
}

/* Action button for Financial/Receipt viewing (for Vendors) */
.action-btn.btn-financial {
    color: #FF9800;
    /* Orange/Alert for non-tenant finance actions */
}

.action-btn.btn-financial:hover {
    color: #F57C00;
}


/* --- Login Page Specific Styles (for uniformity) --- */

/* 1. Main Layout: Center the login card */
.login-layout {
    background-color: var(--color-background);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

/* 2. Login Card: Reuse widget-card styles */
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 30px;
    text-align: center;
}

.login-logo img {
    max-width: 100%;
}

.login-card .card-title {
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 1.5em;
    color: var(--color-primary);
}

/* 3. Form Input Styling (Unified Input Look) */
.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-dark);
}

.login-form .form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1em;
    box-sizing: border-box;
    /* Crucial for padding/border inside width */
    transition: border-color 0.2s;
}

.login-form .form-input:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* 4. Button & Links */
.btn-login {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 10px;
}

.forgot-password {
    margin-top: 20px;
    font-size: 0.9em;
}

.forgot-password a {
    color: var(--color-primary);
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}


/* --- Login Page Input Group Enhancement --- */

/* Wrapper for the input and icon */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Ensure the input fills the space within the group */
.input-group .form-input {
    width: 100%;
    padding-right: 40px;
    /* Space for the icon */
}

/* Style and position the icon button */
.password-toggle {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: var(--color-text-light);
    /* Faded color for the icon */
    font-size: 1.1em;
    transition: color 0.2s;
    /* Ensure the toggle is visually interactive */
}

.password-toggle:hover {
    color: var(--color-primary);
}


/* --- Forgot Password Specific Styles --- */

.reset-instruction {
    color: var(--color-text-light);
    font-size: 0.95em;
    margin-bottom: 25px;
    padding: 0 10px;
    /* Slight padding inside the card */
}

/* Style for the "Back to Login" link */
.return-to-login {
    margin-top: 30px;
    font-size: 0.95em;
}

.return-to-login a {
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.return-to-login a:hover {
    color: var(--color-primary);
}

.return-to-login i {
    margin-right: 5px;
    font-size: 0.8em;
}



/* --- Registration Form Layout Additions (REVERTED TO FLEXBOX) --- */
.register-form .form-row {
    display: flex;
    gap: 20px;
}

/* Makes the form groups take up half the width */
.register-form .half-width {
    width: 50%;
    flex: 1 1 50%;
}

/* Header to visually segment the form */
.form-section-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.form-section-header h3 {
    font-size: 1.2em;
    color: var(--color-primary);
    margin: 0;
}

.form-section-header i {
    margin-right: 8px;
}

/* Ensure form groups still have margin when inside form-row */
.register-form .form-group {
    margin-bottom: 20px;
    /* This margin will apply to form groups that take up the full width, 
       as well as those inside .half-width containers. */
}


/* Modern Input Styling */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    /* soft gray */
    border-radius: 8px;
    background: #f9fafb;
    /* subtle off-white */
    font-size: 15px;
    color: #111827;
    /* dark text */
    transition: all 0.25s ease-in-out;
}

/* Focus effect */
.form-input:focus,
input:focus {
    border-color: #4f46e5;
    /* main brand color */
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    /* glow highlight */
    outline: none;
}

/* Input labels */
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #111827;
}

/* Password toggle icon */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6b7280;
    transition: 0.2s;
}

.password-toggle:hover {
    color: #4f46e5;
}

/* File input improvement */
input[type="file"] {
    padding: 10px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
}

input[type="file"]:hover {
    border-color: #4f46e5;
}


.error-message {
    color: white;
    background-color: red;
    font-size: 24px;
    margin-top: 5px;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
}

.success-message {
    color: white;
    background-color: rgb(113, 213, 113);
    font-size: 24px;
    margin-top: 5px;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
}




.fee-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.fee-row input {
    flex: 1;
}

.remove-fee {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
}

.add-fee-btn {
    margin-top: 10px;
}



.chart-container {
    position: relative;
    height: 350px;
}

.user-info {
    cursor: pointer;
    display: inline-block;
    position: relative;
}

.user-info:hover i.fa-user-circle {
    display: none;
}

.user-info:hover .logout {
    display: block;
}


.logout {
    padding: 5px 10px;
    background-color: var(--color-primary);
    color: #fff;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    display: none;
}

.logout:hover {
    background-color: var(--color-danger);
}




/* --- Mobile Responsive Sidebar --- */

/*Hide the toggle button on desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-primary);
    cursor: pointer;
    padding: 10px;
}

@media (max-width: 768px) {
    .sidebar {
        left: -250px;
        transition: all 0.3s ease;
        z-index: 1000;
    }

    /*This class will be toggled via JavaScript */
    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    /* Show the hamburger button in the header */
    .menu-toggle {
        display: block;
    }






    /* Stack the Search Bar and Add Button */
    .list-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    /* Make the search group take full width */
    .filter-group {
        min-width: 100% !important;
        /* Overrides your inline style */
    }

    .search-input {
        width: 100%;
    }

    /* Adjust the Add Button for mobile */
    .btn-primary {
        justify-content: center;
        padding: 12px;
    }

    /* Table Font Adjustments */
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.85em;
    }

    /* Stack Pagination Info */
    .pagination-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }


    /* Make dropdowns full width */
    .filter-select {
        width: 100%;
        display: none;
    }

    /* Make "Add Unit" button full width and centered */
    .btn-primary {
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 12px;
        /* Slightly larger for easier tapping */
    }


    .user-info i.fa-user-circle {
        display: none;
    }

    .user-info .logout {
        display: block;
        background-color: red;
        font-size: 10px;
    }
}


/* Specific fix for the 'Company' column badge on mobile */
@media (max-width: 480px) {
    /* Hide non-essential columns on very small screens to avoid excessive scrolling */
    .data-table th:nth-child(4),
    .data-table td:nth-child(4),
    /* Owner */
    .data-table th:nth-child(5),
    .data-table td:nth-child(5)

    /* Company */
        {
        display: none;
    }
}





/* ===== MODAL OVERLAY ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}

/* ===== MODAL BOX ===== */
.modal {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .2);
    animation: modalFade 0.25s ease;
}

/* ===== HEADER ===== */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    cursor: pointer;
    font-size: 1.2rem;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

/* ===== BODY ===== */
.modal-body label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #555;
}

.modal-body select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
}

/* ===== FOOTER ===== */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.modal-footer .btn {
    padding: 8px 14px;
}

/* ===== ANIMATION ===== */
@keyframes modalFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* Billing & Status Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-block;
}

.badge-blue {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.badge-green {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.badge-gray {
    background-color: #f5f5f5;
    color: #616161;
    border: 1px solid #e0e0e0;
}

/* Status specific colors */
.status-occupied {
    color: #2e7d32;
    font-weight: bold;
    text-transform: capitalize;
}

.status-vacant {
    color: #d32f2f;
    font-weight: bold;
    text-transform: capitalize;
}