/* ========================================
   Islamic Center Finance - Main Stylesheet
   RTL Arabic Design
======================================== */

:root {
    --primary-color: #1a5f7a;
    --primary-dark: #134b5f;
    --secondary-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    --border-radius: 10px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    /*  font-family: 'Tajawal', sans-serif;*/
    background-color: var(--bg-light);
    color: var(--text-color);
    direction: rtl;
    line-height: 1.6;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    right: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

    .sidebar.collapsed {
        width: 70px;
    }

        .sidebar.collapsed .sidebar-header h3, .sidebar.collapsed .nav-item span {
            display: none;
        }

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

    .sidebar-header .logo {
        width: 60px;
        height: 60px;
        background: #ffffff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 15px;
        font-size: 28px;
    }

    .sidebar-header h3 {
        font-size: 16px;
        font-weight: 600;
    }

.sidebar-nav {
    padding: 15px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
}

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

    .nav-item i {
        font-size: 18px;
        width: 24px;
        text-align: center;
    }

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 260px;
    transition: var(--transition);
}

    .main-content.expanded {
        margin-right: 70px;
    }

/* Header */
.header {
    height: 60px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 500;
    color: var(--text-light);
}

/* Content Wrapper */
.content-wrapper {
    padding: 25px;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

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

.stat-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--box-shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

    .stat-icon.balance {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    }

    .stat-icon.revenue {
        background: linear-gradient(135deg, #27ae60, #1e8449);
    }

    .stat-icon.expense {
        background: linear-gradient(135deg, #e74c3c, #c0392b);
    }

    .stat-icon.custody {
        background: linear-gradient(135deg, #f39c12, #d68910);
    }

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
}

/* Forms */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

    .form-label.required::after {
        content: ' *';
        color: var(--danger-color);
    }

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
    }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

.btn-success {
    background: var(--secondary-color);
    color: white;
}

    .btn-success:hover {
        background: #1e8449;
    }

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.w-100 {
    width: 100%;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

    .table th, .table td {
        padding: 12px 15px;
        text-align: right;
        border-bottom: 1px solid var(--border-color);
    }

    .table th {
        background: var(--bg-light);
        font-weight: 600;
        color: var(--text-color);
    }

    .table tr:hover {
        background: rgba(26, 95, 122, 0.02);
    }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}

.badge-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.badge-warning {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
}

.badge-info {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

/* Alerts */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: block;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    color: #1e8449;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    color: #d68910;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

/* Filters Section */
.filters-section {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-color);
}

    .quick-action-btn:hover {
        border-color: var(--primary-color);
        transform: translateY(-3px);
        box-shadow: var(--box-shadow);
    }

    .quick-action-btn i {
        font-size: 24px;
    }

    .quick-action-btn span {
        font-weight: 600;
    }

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
}

    .welcome-card h2 {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .welcome-card p {
        opacity: 0.9;
        font-size: 14px;
    }

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a5f7a, #134b5f, #0d3d4d);
}

.login-container {
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: white;
    padding: 30px;
    text-align: center;
}

    .login-header .logo {
        width: 70px;
        height: 70px;
        background: #ffffff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 15px;
        font-size: 32px;
    }

    .login-header h2 {
        font-size: 22px;
        margin-bottom: 5px;
    }

    .login-header p {
        opacity: 0.9;
        font-size: 13px;
    }

.login-body {
    padding: 30px;
}

.login-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.login-footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-light);
}

.input-group {
    position: relative;
}

    .input-group i.icon {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-light);
    }

    .input-group .form-control {
        padding-right: 45px;
    }

/* Utility Classes */
.text-success {
    color: #27ae60 !important;
}

.text-danger {
    color: #e74c3c !important;
}

.text-warning {
    color: #f39c12 !important;
}

.text-info {
    color: #3498db !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: var(--text-light) !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.d-flex {
    display: flex !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }

        .sidebar .sidebar-header h3, .sidebar .nav-item span {
            display: none;
        }

    .main-content {
        margin-right: 70px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        width: 260px;
    }

        .sidebar.show {
            transform: translateX(0);
        }

            .sidebar.show .sidebar-header h3, .sidebar.show .nav-item span {
                display: block;
            }

    .main-content {
        margin-right: 0;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
    }
}
