:root {
    --glass: rgba(255, 255, 255, 0.15);
    --border: rgba(255, 255, 255, 0.2);
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
                url('https://images.unsplash.com/photo-1564182842519-8a3b2af3e228?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    height: 100vh;
    color: white;
    overflow: hidden;
}

.glass-container {
    display: flex;
    height: 100vh;
    backdrop-filter: blur(10px);
}

.sidebar {
    width: 200px;
    background: rgba(0,0,0,0.3);
    border-left: 1px solid var(--border);
    padding: 20px;
}

.sidebar li {
    padding: 15px;
    cursor: pointer;
    list-style: none;
    border-radius: 8px;
    margin-bottom: 5px;
}

.sidebar li:hover { background: var(--glass); }

.content { flex: 1; padding: 20px; overflow-y: auto; }

.page { display: none; }
.page.active { display: block; }

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.assoc-card {
    background: var(--glass);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: 0.3s;
}

.assoc-card:hover { transform: translateY(-5px); background: rgba(255,255,255,0.25); }

.glass-card {
    background: var(--glass);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
}

input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
    color: white;
    box-sizing: border-box;
}

button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.table-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: fixed; /* هذا السطر يضمن ثبات عرض الأعمدة */
}

/* صندوق مبلغ القبض */
.payout-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

/* شريط التقدم الصغير */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #2ecc71;
    transition: width 0.5s ease;
}

/* تمييز الصف الحالي */
.current-payout {
    background: rgba(46, 204, 113, 0.15) !important;
}

.op-btn {
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 2px;
    transition: 0.3s;
}

.op-btn.edit:hover { background: #3498db; }
.op-btn.delete:hover { background: #e74c3c; }

/* زر حذف الجمعية في الكرت الرئيسي */
.delete-assoc-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(231, 76, 60, 0.7);
    border: none;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
}

th, td {
    padding: 15px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    word-wrap: break-word; /* لمنع تداخل الكلام الطويل */
}

thead th {
    background: rgba(255, 255, 255, 0.1);
    color: #f1c40f; /* لون مميز للعناوين */
    font-size: 0.9rem;
}

/* لجعل الجدول يعمل بشكل جيد على الموبايل */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto; /* السماح بالتمرير الجانبي في الموبايل */
    }
    table {
        min-width: 800px; /* ضمان عدم انضغاط الجدول في الشاشات الصغيرة */
    }
}
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* تمييز الصف النشط (من عليه الدور) */
.current-payout {
    background: rgba(46, 204, 113, 0.3) !important;
    border: 2px solid #2ecc71 !important;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
    font-weight: bold;
}

/* أزرار الترتيب */
.reorder-btn {
    background: none;
    border: 1px solid var(--border);
    color: white;
    padding: 2px 8px;
    margin: 0 2px;
    cursor: pointer;
    border-radius: 4px;
}

.reorder-btn:hover { background: rgba(255,255,255,0.2); }

/* زر القرعة */
.shuffle-btn {
    background: #f1c40f !important;
    color: #000 !important;
    font-weight: bold;
    margin-left: 10px;
}