/* Real Estate Management System - Main Stylesheet */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6366f1;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-color: #374151;
    --text-muted: #6b7280;
    --sidebar-width: 260px;
    --header-height: 70px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f3f4f6;
    color: var(--text-color);
    line-height: 1.6;
}

/* Auth Pages - Landlord Studio Style */
.auth-page {
    min-height: 100vh;
    overflow: hidden;
}

.login-container {
    display: flex;
    min-height: 100vh;
}

/* Left Panel - Promotional */
.login-left-panel {
    flex: 1;
    background: linear-gradient(180deg, #1e3a5f 0%, #2d4a6b 50%, #ff6b35 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px 80px;
    position: relative;
    overflow: hidden;
}

.login-left-panel::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -100px;
    width: 300px;
    height: 300px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 50%;
    filter: blur(80px);
}

.login-branding {
    z-index: 1;
}

.logo-large {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.tagline {
    font-size: 42px;
    font-weight: 600;
    line-height: 1.2;
    color: white;
    max-width: 500px;
}

.tagline .highlight {
    color: #ff6b35;
}

.dashboard-preview {
    z-index: 1;
    margin-top: auto;
}

.preview-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
}

.preview-header p {
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 16px;
    font-size: 16px;
}

.preview-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.preview-stat {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e3a5f;
}

/* Right Panel - Login Form */
.login-right-panel {
    flex: 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.tenant-link {
    display: block;
    text-align: right;
    margin-bottom: 40px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
}

.tenant-link span {
    color: #4f46e5;
    text-decoration: underline;
}

.login-header {
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Social Login Buttons */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.social-btn svg {
    flex-shrink: 0;
}

/* Separator */
.login-separator {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.login-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.login-separator span {
    position: relative;
    background: white;
    padding: 0 16px;
    color: #6b7280;
    font-size: 14px;
}

/* Login Form */
.login-form {
    margin-top: 24px;
}

.login-form .form-group {
    margin-bottom: 24px;
    position: relative;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
}

.login-form input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.forgot-password-link {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 14px;
    color: #4f46e5;
    text-decoration: none;
    margin-top: 8px;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-login:hover {
    background: #4338ca;
}

.btn-login:active {
    transform: translateY(1px);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.login-footer p {
    color: #6b7280;
    font-size: 14px;
}

.login-footer a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Expense Chart Styles */
.expenses-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.expense-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.expense-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expense-category {
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.expense-amount {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.expense-bar {
    width: 100%;
    height: 8px;
    background: var(--light-color);
    border-radius: 4px;
    overflow: hidden;
}

.expense-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stat-danger {
    border-left: 4px solid var(--danger-color);
}

.cashflow-chart {
    position: relative;
    height: 300px;
    width: 100%;
}

/* RTL Support for Arabic currencies */
body[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.rtl-text {
    direction: rtl;
    text-align: right;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification-bell {
    position: relative;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notification-bell:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.bell-icon {
    font-size: 24px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 380px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    max-height: 500px;
    overflow: hidden;
}

.notification-dropdown.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light-color);
}

.notification-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.notification-count-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: background 0.2s;
    position: relative;
}

.notification-item:hover {
    background: var(--light-color);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    font-size: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--dark-color);
}

.notification-message {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.notification-count {
    background: var(--light-color);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-color);
    margin-left: 12px;
    flex-shrink: 0;
}

.notification-danger {
    border-left: 4px solid var(--danger-color);
}

.notification-warning {
    border-left: 4px solid var(--warning-color);
}

.notification-info {
    border-left: 4px solid var(--info-color);
}

.notification-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: var(--light-color);
}

.notification-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.notification-footer a:hover {
    text-decoration: underline;
}

/* Click outside to close */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: none;
}

.notification-overlay.show {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .notification-dropdown {
        width: calc(100vw - 40px);
        right: -20px;
    }
    
    .notification-container {
        right: 15px;
        top: 15px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-left-panel {
        padding: 40px;
        min-height: 300px;
    }
    
    .tagline {
        font-size: 28px;
    }
    
    .dashboard-preview {
        display: none;
    }
}

/* Mobile Login - More Compact */
@media (max-width: 768px) {
    .login-left-panel {
        padding: 30px 20px;
        min-height: 200px;
    }
    
    .logo-large {
        margin-bottom: 20px;
    }
    
    .logo-icon {
        font-size: 24px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .tagline {
        font-size: 22px;
    }
    
    .login-right-panel {
        padding: 30px 20px;
    }
    
    .login-wrapper {
        max-width: 100%;
    }
    
    .login-header h1 {
        font-size: 26px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .btn-login {
        padding: 12px;
        font-size: 15px;
    }
    
    .tenant-link {
        margin-bottom: 24px;
        font-size: 13px;
    }
    
    .login-footer {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .login-left-panel {
        padding: 20px 15px;
        min-height: 150px;
    }
    
    .logo-icon {
        font-size: 20px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .tagline {
        font-size: 18px;
    }
    
    .login-right-panel {
        padding: 20px 15px;
    }
    
    .login-header h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .form-group input {
        padding: 9px 11px;
        font-size: 13px;
    }
    
    .btn-login {
        padding: 11px;
        font-size: 14px;
    }
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 22px;
    color: var(--dark-color);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.nav-item.active {
    background-color: #eef2ff;
    color: var(--primary-color);
    font-weight: 500;
}

.nav-icon {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--light-color);
    border-radius: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 12px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.page-header p {
    color: var(--text-muted);
    font-size: 16px;
}

/* Dashboard */
.dashboard {
    max-width: 1400px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 36px;
    margin-right: 16px;
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark-color);
}

.stat-content p {
    font-size: 14px;
    color: var(--text-muted);
}

.stat-income {
    border-left: 4px solid var(--success-color);
}

.stat-expense {
    border-left: 4px solid var(--danger-color);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Cards */
.dashboard-card,
.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
}

.card-body {
    padding: 24px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background-color: var(--light-color);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background-color: var(--light-color);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
