/* Reset and Global Styles */
:root {
    /* Light Theme Variables */
    --bg-gradient: radial-gradient(circle at 10% 20%, rgb(242, 245, 243) 0%, rgb(228, 235, 231) 90%);
    --bg-color: #f1f5f3;
    --sidebar-bg: #122d21;
    --sidebar-text: #e8ece9;
    --sidebar-active: #d4af37;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(18, 45, 33, 0.08);
    --text-main: #1e2925;
    --text-muted: #5c6f68;
    --border-color: rgba(0, 0, 0, 0.08);
    
    /* Primary / Secondary colors */
    --primary-color: #1b4332;
    --primary-light: #2d6a4f;
    --secondary-color: #d4af37;
    --secondary-hover: #b8952b;
    --accent-color: #40916c;
    
    /* Status Colors */
    --status-paid: #2ec4b6;
    --status-paid-bg: rgba(46, 196, 182, 0.15);
    --status-pending: #ff9f1c;
    --status-pending-bg: rgba(255, 159, 28, 0.15);
    --status-overdue: #e71d36;
    --status-overdue-bg: rgba(231, 29, 54, 0.15);
    
    /* UI Utilities */
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --font-primary: 'Cairo', 'Tajawal', sans-serif;
    --transition-speed: 0.3s;
}

body.dark-theme {
    /* Dark Theme Variables */
    --bg-gradient: radial-gradient(circle at 10% 20%, rgb(15, 23, 20) 0%, rgb(7, 12, 10) 90%);
    --bg-color: #0b100e;
    --sidebar-bg: #09130e;
    --sidebar-text: #d5ddd9;
    --sidebar-active: #f3c63f;
    --card-bg: rgba(20, 31, 26, 0.7);
    --card-border: rgba(255, 255, 255, 0.06);
    --text-main: #f0f5f2;
    --text-muted: #95ab9f;
    --border-color: rgba(255, 255, 255, 0.08);
    
    --primary-color: #40916c;
    --primary-light: #52b788;
    --secondary-color: #f3c63f;
    --secondary-hover: #d4af37;
    --accent-color: #74c69d;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

body {
    background: var(--bg-gradient);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* App Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 10;
    transition: width var(--transition-speed);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    background-color: #fff;
    padding: 4px;
}

.sidebar-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    background: none;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    color: var(--sidebar-text);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: right;
    transition: all 0.25s ease;
    width: 100%;
}

.menu-item i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    transition: transform 0.25s ease;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.menu-item:hover i {
    transform: scale(1.1);
}

.menu-item.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(27, 67, 50, 0.4);
}

.menu-item.active i {
    color: var(--sidebar-active);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.version-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

/* Header Styling */
.main-header {
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--card-border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 5;
}

.time-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.data-actions {
    display: flex;
    gap: 10px;
}

.btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 18px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(27, 67, 50, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(27, 67, 50, 0.3);
}

.btn-secondary {
    background-color: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.btn-icon span {
    display: inline;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none !important;
    transform: none !important;
}

/* Theme & Notifications Widgets */
.theme-toggle, .notification-bell {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    transition: all 0.25s ease;
}

.theme-toggle:hover, .notification-bell:hover {
    background-color: var(--border-color);
    transform: scale(1.05);
}

.notification-bell .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--status-overdue);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-bg);
    animation: pulse 2s infinite;
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    width: 320px;
    background-color: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.notification-bell:hover .notification-dropdown,
.notification-dropdown.active {
    display: flex;
}

.dropdown-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.02);
}

.dropdown-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.btn-clear-all {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-clear-all:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.dropdown-list {
    max-height: 280px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: right;
}

.notification-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.notification-item.overdue {
    border-right: 4px solid var(--status-overdue);
}

.notification-item.upcoming {
    border-right: 4px solid var(--status-pending);
}

.notification-item .time {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.empty-notifications {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Views Section */
.view-panel {
    padding: 32px;
    flex-grow: 1;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

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

.view-header {
    margin-bottom: 32px;
}

.view-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.view-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background-color: rgba(27, 67, 50, 0.08);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.total-properties .stat-icon {
    color: #4361ee;
    background-color: rgba(67, 97, 238, 0.1);
}

.active-leases .stat-icon {
    color: #7209b7;
    background-color: rgba(114, 9, 183, 0.1);
}

.collected-rent .stat-icon {
    color: var(--status-paid);
    background-color: var(--status-paid-bg);
}

.pending-rent .stat-icon {
    color: var(--status-pending);
    background-color: var(--status-pending-bg);
}

.overdue-rent .stat-icon {
    color: var(--status-overdue);
    background-color: var(--status-overdue-bg);
}

.stat-info h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
}

/* Dashboard Bottom Layout */
.dashboard-details-grid {
    display: grid;
    grid-template-columns: 350px 300px 1fr;
    gap: 24px;
}

.dashboard-card {
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.dashboard-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Progress Circle Layout */
.collection-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.progress-circle-wrap {
    position: relative;
    width: 160px;
    height: 160px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bar {
    transition: stroke-dashoffset 0.5s ease-in-out;
}

.progress-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary-color);
}

.progress-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.progress-detail-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.progress-detail-item .dot.paid {
    background-color: var(--status-paid);
}

.progress-detail-item .dot.remaining {
    background-color: #e6e6e6;
}

/* Water Fee Tracker Card */
.water-fee-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-top: 10px;
}

.water-icon-large {
    font-size: 3rem;
    color: #4cc9f0;
    animation: float 3s ease-in-out infinite;
}

.water-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.water-stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

/* Urgent Alerts List */
.urgent-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.empty-alerts {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-muted);
}

.empty-alerts i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.empty-alerts p {
    font-size: 0.85rem;
}

.alert-item-box {
    background-color: rgba(0,0,0,0.02);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    border-right: 4px solid var(--border-color);
}

.alert-item-box.overdue {
    border-right-color: var(--status-overdue);
    background-color: var(--status-overdue-bg);
}

.alert-item-box.upcoming {
    border-right-color: var(--status-pending);
    background-color: var(--status-pending-bg);
}

.alert-item-details strong {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 2px;
}

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

/* Two Column Layouts */
.grid-two-columns {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
}

/* Forms styling */
.styled-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.required {
    color: var(--status-overdue);
}

input, select, textarea {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
    text-align: right;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.15);
}

.phone-input-wrapper {
    position: relative;
}

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.3;
}

/* Items lists (Properties/Leases cards) */
.items-list-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    max-height: 520px;
    overflow-y: auto;
    padding-left: 5px;
}

.empty-list {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Custom list items cards */
.list-item-card {
    background-color: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s ease;
    animation: slideUp 0.3s ease-out;
}

.list-item-card:hover {
    background-color: var(--card-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.item-main-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-details-icon {
    width: 44px;
    height: 44px;
    background-color: rgba(27, 67, 50, 0.05);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.item-details-text h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.item-details-text p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.item-badge-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.badge-ui {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 50px;
}

.badge-ui.primary {
    background-color: rgba(27, 67, 50, 0.1);
    color: var(--primary-color);
}

.btn-danger-link {
    background: none;
    border: none;
    color: var(--status-overdue);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
}

.btn-danger-link:hover {
    text-decoration: underline;
}

/* Payments View & Table Styles */
.payments-filter-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

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

.btn-filter {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-filter:hover, .btn-filter.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding-right: 36px;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

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

.payments-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.85rem;
}

.payments-table th, .payments-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.payments-table th {
    font-weight: 700;
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--text-main);
    font-size: 0.8rem;
}

.payments-table tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
}

.badge-status.paid {
    background-color: var(--status-paid-bg);
    color: var(--status-paid);
}

.badge-status.pending {
    background-color: var(--status-pending-bg);
    color: var(--status-pending);
}

.badge-status.overdue {
    background-color: var(--status-overdue-bg);
    color: var(--status-overdue);
}

.overdue-days-label {
    font-size: 0.72rem;
    color: var(--status-overdue);
    margin-top: 5px;
    font-weight: 700;
}

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

.btn-table-action {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-table-action:hover {
    background-color: var(--border-color);
}

.btn-table-action.pay-action:hover {
    background-color: var(--status-paid-bg);
    color: var(--status-paid);
    border-color: var(--status-paid);
}

.btn-table-action.whatsapp-action {
    color: #25d366;
    border-color: rgba(37, 211, 102, 0.3);
}

.btn-table-action.whatsapp-action:hover {
    background-color: rgba(37, 211, 102, 0.1);
    border-color: #25d366;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 999;
    animation: slideUp 0.3s ease-out;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.toast-message {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Utilities classes & Colors override */
.text-success { color: var(--status-paid) !important; }
.text-warning { color: var(--status-pending) !important; }
.text-danger { color: var(--status-overdue) !important; }
.text-center { text-align: center; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

/* Scrollbars styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(27, 67, 50, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 29, 54, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(231, 29, 54, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 29, 54, 0); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

/* Responsive Rules */
@media (max-width: 1200px) {
    .dashboard-details-grid {
        grid-template-columns: 1fr;
    }
    .grid-two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 16px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    .sidebar-logo {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    .menu-item {
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    .main-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .header-right {
        justify-content: space-between;
    }
    .view-panel {
        padding: 16px;
    }
    .payments-filter-panel {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        width: 100%;
    }
    .btn-icon span {
        display: none;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background-color: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 750px;
    max-height: 85vh;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateY(-30px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--status-overdue);
}

.modal-body {
    overflow-y: auto;
    flex-grow: 1;
    padding-left: 5px;
}

/* Google Drive Auto-Sync UI Styling */
#btnGDriveSync {
    position: relative;
    transition: all 0.3s ease;
}

#btnGDriveSync.sync-unlinked {
    border-color: var(--border-color);
    color: var(--text-main);
}

#btnGDriveSync.sync-needs-permission {
    border-color: rgba(255, 159, 28, 0.5);
    color: var(--status-pending);
    background-color: rgba(255, 159, 28, 0.05);
    animation: pulse-sync-pending 2s infinite;
}

#btnGDriveSync.sync-active {
    border-color: rgba(46, 196, 182, 0.5);
    color: var(--status-paid);
    background-color: rgba(46, 196, 182, 0.05);
}

#btnGDriveSync.sync-active:hover {
    background-color: rgba(46, 196, 182, 0.15);
}

.sync-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

#btnGDriveSync.sync-unlinked .sync-indicator {
    background-color: var(--text-muted);
}

#btnGDriveSync.sync-needs-permission .sync-indicator {
    background-color: var(--status-pending);
}

#btnGDriveSync.sync-active .sync-indicator {
    background-color: var(--status-paid);
}

@keyframes pulse-sync-pending {
    0% { box-shadow: 0 0 0 0 rgba(255, 159, 28, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 159, 28, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 159, 28, 0); }
}

.rent-excl-tax .stat-icon {
    color: #4cc9f0;
    background-color: rgba(76, 201, 240, 0.1);
}

.total-tax .stat-icon {
    color: #f72585;
    background-color: rgba(247, 37, 133, 0.1);
}

.portfolio-grand-total .stat-icon {
    color: var(--secondary-color);
    background-color: rgba(212, 175, 55, 0.1);
}



/* iPhone/Safari friendly hidden file input */
.visually-hidden-file {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.portfolio-filter { display:flex; flex-wrap:wrap; gap:16px; align-items:center; margin-bottom:24px; padding:20px; }
.portfolio-filter .form-group { flex:1 1 220px; margin:0; }
.portfolio-filter small { width:100%; color:var(--text-muted); }

.payment-building-control { display:flex; flex-direction:column; gap:5px; flex:1 1 160px; }
.payment-building-control label { font-size:.75rem; color:var(--text-muted); }
.payment-building-control input,.payment-building-control select { width:100%; padding:8px 12px; border:1px solid var(--border-color); border-radius:var(--radius-md); background:var(--card-bg); color:var(--text-main); font:inherit; font-size:.8rem; }

.sayed-mark { background:linear-gradient(140deg,#1b4332,#40916c); color:#fff; border:1px solid #c9aa60; display:grid; place-items:center; font-size:35px; font-weight:800; border-radius:20px; width:64px; height:64px; margin:0 auto 12px; box-shadow:0 6px 20px #1b433222; }
.sidebar-logo .sayed-mark {margin-bottom:10px;}
