﻿/* ========== نظام ضريبة الملاهي - الملف الرئيسي ========== */
:root {
    --primary-dark: #0a2b4e;
    --primary-gold: #c9a03d;
    --primary-light: #eef2f7;
    --white: #ffffff;
    --danger: #e53e3e;
    --success: #27ae60;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tahoma', 'Arial', sans-serif;
    background: var(--primary-light);
}

/* ========== الهيدر العلوي ========== */
.main-header {
    background: var(--primary-dark);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-area img {
    height: 50px;
    width: auto;
    max-width: 60px;
    object-fit: contain;
}

.logo-area h2 {
    font-size: 18px;
    margin: 0;
    color: var(--primary-gold);
}

/* ========== منطقة الأزرار ========== */
.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* القاعدة العامة لكل زر في user-area */
.user-area .btn,
.user-area a:not(.logo-area a) {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    transition: 0.2s;
    color: white !important;
    background-color: #2c3e50 !important;
}

/* ========== ألوان خاصة بكل زر (حسب الرابط) ========== */
.user-area a[href*="change_password"] { background-color: #2c3e50 !important; }
.user-area a[href*="import_excel"] { background-color: #27ae60 !important; }
.user-area a[href*="manage_users"] { background-color: #f39c12 !important; color: #0a2b4e !important; }
.user-area a[href*="manage_tax_types"] { background-color: #16a085 !important; }
.user-area a[href*="manage_employees"] { background-color: #1abc9c !important; }
.user-area a[href*="employee_reports"] { background-color: #1abc9c !important; }
.user-area a[href*="audit_logs"] { background-color: #e67e22 !important; }
.user-area a[href*="manage_targets"] { background-color: #8e44ad !important; }
.user-area a[href*="performance"] { background-color: #3498db !important; }
.user-area a[href*="comparison_reports"] { background-color: #2980b9 !important; }
.user-area a[href*="advanced_reports"] { background-color: #9b59b6 !important; }
.user-area a[href*="summary_report"] { background-color: #2c3e50 !important; }
.user-area a[href*="logout"] { background-color: #c0392b !important; }
.user-area a[href*="back"] { background-color: #34495e !important; border: 1px solid var(--primary-gold); }

/* تأثير التمرير */
.user-area a:hover {
    filter: brightness(0.9);
}

/* ========== الحاويات ========== */
.container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== البطاقات ========== */
.card, .form-card, .table-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    padding: 20px;
}

/* ========== الجداول ========== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}
th {
    background: var(--primary-dark);
    color: white;
    padding: 8px;
    text-align: center;
}
td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: center;
}

/* ========== شريط الفلترة ========== */
.filter-bar {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.filter-group label {
    font-weight: bold;
}
.filter-group select, .filter-group input {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* ========== بطاقات الإحصائيات ========== */
.cards, .stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.card-stat {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.card-stat .value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-dark);
}

/* ========== أزرار التصدير ========== */
.export-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}
.export-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: white;
}
.excel-btn { background: var(--success); }
.pdf-btn { background: var(--danger); }
.print-btn { background: var(--primary-dark); }

/* ========== أزرار الحذف والتعديل داخل الجداول ========== */
.btn-delete {
    background: #e74c3c;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
}
.btn-delete:hover { background: #c0392b; }

.btn-edit {
    background: #3498db;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
}
.btn-edit:hover { background: #2980b9; }
.btn-backup { background-color: #2980b9; color: white; }

.disabled-delete {
    background: #95a5a6;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: not-allowed;
}

/* ========== رسائل النجاح والخطأ ========== */
.success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}
.warning {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* ========== الأزرار العامة خارج user-area ========== */
button, .btn-submit, input[type="submit"] {
    background: var(--primary-gold);
    color: var(--primary-dark);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}
button:hover {
    background: #b88a2c;
}

/* ========== التوافق مع الجوال ========== */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        text-align: center;
    }
    .user-area {
        justify-content: center;
    }
    .filter-bar {
        flex-direction: column;
    }
    th, td {
        font-size: 11px;
        padding: 4px;
    }
}

/* ========== الطباعة ========== */
@media print {
    .main-header, .filter-bar, .export-buttons, .user-area a {
        display: none !important;
    }
    body {
        background: white;
        padding: 15px;
    }
    .container {
        padding: 0;
    }
}
/* ========== إصلاح نهائي لألوان الأزرار (قابل للإزالة) ========== */
.user-area a,
.user-area .btn,
.user-area a.btn {
    display: inline-block !important;
    padding: 6px 12px !important;
    margin: 0 3px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    font-size: 13px !important;
    transition: 0.2s !important;
    color: white !important;
    background-color: #2c3e50 !important;
}

/* ألوان خاصة لكل رابط (حسب النص في href أو الكلاس) */
.user-area a[href*="change_password"] { background-color: #2c3e50 !important; }
.user-area a[href*="import_excel"] { background-color: #27ae60 !important; }
.user-area a[href*="manage_users"] { background-color: #f39c12 !important; color: #0a2b4e !important; }
.user-area a[href*="manage_tax_types"] { background-color: #16a085 !important; }
.user-area a[href*="manage_employees"] { background-color: #1abc9c !important; }
.user-area a[href*="employee_reports"] { background-color: #1abc9c !important; }
.user-area a[href*="audit_logs"] { background-color: #e67e22 !important; }
.user-area a[href*="manage_targets"] { background-color: #8e44ad !important; }
.user-area a[href*="performance"] { background-color: #3498db !important; }
.user-area a[href*="comparison_reports"] { background-color: #2980b9 !important; }
.user-area a[href*="advanced_reports"] { background-color: #9b59b6 !important; }
.user-area a[href*="summary_report"] { background-color: #2c3e50 !important; }
.user-area a[href*="advanced_comparison"] { background-color: #9b59b6 !important; }
.user-area a[href*="logout"] { background-color: #c0392b !important; }
.user-area a[href*="back"] { background-color: #34495e !important; border: 1px solid #c9a03d !important; }

/* تأثير التمرير */
.user-area a:hover {
    filter: brightness(0.9) !important;
}

/* إخفاء أي خلفية قديمة */
.user-area a {
    background-image: none !important;
}
/* تنسيق عام لفلتر الموبايل لجميع الصفحات */
@media (max-width: 768px) {
    .filter-bar {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }
    .filter-group {
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }
    .filter-group label {
        display: block;
        text-align: center;
    }
    .filter-group select, .filter-group button {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
        text-align: center;
    }
}
/* ========== أزرار موحدة ========== */
.btn {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    font-size: 13px;
}

.btn-primary {
    background: #0a2b4e;
    color: white;
}
.btn-primary:hover {
    background: #1e3a5f;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}
.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 3px 10px;
    font-size: 12px;
}

.btn-icon {
    margin-right: 5px;
}
/* تنسيق أزرار PDF و Excel داخل شريط الفلاتر - تجاوز القواعد القديمة */
.filter-group .btn-danger {
    background: #e74c3c !important;
    color: white !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 30px !important;
    font-weight: bold !important;
}

.filter-group .btn-secondary {
    background: #27ae60 !important;
    color: white !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 30px !important;
    font-weight: bold !important;
}