
/* =========================================================
   مجلس مدينة حمص
   FINAL CSS
   نسخة منظمة ومتجاوبة للكمبيوتر والموبايل
========================================================= */


/* =========================================================
   1. RESET + GLOBAL
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'El Messiri', sans-serif;
    background: #f4f6f9;
    color: #333;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

main,
.container {
    width: 100%;
    flex: 1;
}

.container {
    padding: 10px;
}


/* =========================================================
   2. GENERAL HEADINGS
========================================================= */

h1,
h2,
h3 {
    font-family: 'El Messiri', sans-serif;
}

h2 {
    color: #236456;
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 26px;
    font-weight: 900;
}

h3 {
    color: #236456;
}


/* =========================================================
   3. HEADER
========================================================= */

header {
    display: flex;
    flex-direction: row !important;
    align-items: center;
}


/* =========================================================
   4. MAIN HEADER
========================================================= */

.main-header {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.container > .main-header {
    margin-top: 90px !important;
}


/* =========================================================
   5. BUTTONS
========================================================= */

button {
    background: linear-gradient(
        135deg,
        #236456,
        #2f7a63
    );

    color: #d4af37;

    border: 1px solid rgba(212, 175, 55, 0.5);

    padding: 12px 18px;

    border-radius: 12px;

    font-weight: 800;

    letter-spacing: 0.3px;

    cursor: pointer;

    transition: 0.25s;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

button:hover {
    background: linear-gradient(
        135deg,
        #2f7a63,
        #236456
    );

    color: #fff;

    transform: translateY(-2px);

    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}


/* الأزرار الرئيسية */

.buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.buttons button {
    padding: 12px 20px;
    min-width: 180px;
}


/* أزرار المنتصف */

.center-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 100%;
    text-align: center;
    margin: 20px auto 0 auto;
    flex-wrap: wrap;
}

.center-buttons button {
    min-width: 180px;
    padding: 12px 18px;
    font-size: 15px;
    border-radius: 12px;
}


/* زر سجل العمليات */

button.view-log {
    background: linear-gradient(
        135deg,
        #a38e5c,
        #d4af37
    );

    color: #236456;
    font-weight: 900;
}

button.view-log:hover {
    background: linear-gradient(
        135deg,
        #d4af37,
        #a38e5c
    );

    color: #fff;
}


/* أزرار الإدارة */

button[name="bulk_delete"] {
    background: #ef4444;
}

button[name="bulk_update"] {
    background: #f59e0b;
}


/* =========================================================
   6. NAVIGATION
========================================================= */

.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #236456;
}

.nav-menu {
    display: flex;
}


/* =========================================================
   7. GENERAL FORMS
========================================================= */

form {
    width: 100%;
}

form input,
form textarea,
form select {
    width: 100%;
    max-width: 100%;
}

input,
textarea,
select {
    width: 100%;
    max-width: 100%;

    padding: 12px 14px;

    border-radius: 12px;

    border: 1px solid #d9c27a;

    background: #fff;

    font-size: 15px;

    transition: 0.25s;

    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

input:focus,
textarea:focus,
select:focus {
    border-color: #236456;

    box-shadow:
        0 0 0 3px rgba(35, 100, 86, 0.15);

    outline: none;
}

textarea {
    min-height: 120px;
    resize: vertical;
}


/* =========================================================
   8. SECTIONS
========================================================= */

.section {
    background: #ffffff;

    border: 1px solid #e6d7a6;

    border-radius: 14px;

    padding: 22px;

    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.08);
}

.section-title {
    color: #d4af37;

    font-weight: bold;

    margin-bottom: 20px;

    text-shadow:
        0 0 10px rgba(212, 175, 55, 0.3);
}

.section input,
.section textarea,
.section select {
    background: #fff;

    border: 1px solid #d9c27a;

    border-radius: 12px;

    padding: 12px 14px;

    font-family: 'El Messiri', sans-serif;

    transition: 0.2s;
}

.section input:focus,
.section textarea:focus,
.section select:focus {
    border-color: #236456;

    box-shadow:
        0 0 0 3px rgba(35, 100, 86, 0.15);

    outline: none;

    transform: translateY(-1px);
}

.section button {
    background: linear-gradient(
        135deg,
        #236456,
        #2f7a63
    );

    color: #d4af37;

    border: 1px solid rgba(212, 175, 55, 0.4);

    padding: 10px 18px;

    border-radius: 10px;

    font-weight: bold;

    cursor: pointer;
}

.section button:hover {
    background: linear-gradient(
        135deg,
        #2f7a63,
        #236456
    );

    color: #fff;
}

.section button.secondary {
    background: transparent;

    border: 1px solid #d4af37;

    color: #d4af37;
}


/* =========================================================
   9. COMPLAINT / CHECK / SUGGESTION
========================================================= */

#complaint,
#check,
#suggestion {
    background: linear-gradient(
        135deg,
        #ffffff,
        #f7f3e8
    );

    border: 1px solid #e0d9b5;

    border-radius: 22px;

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.12);

    padding: 30px;

    transition: 0.3s;

    margin: 90px auto 40px auto;

    width: 90%;
    max-width: 650px;

    display: flex;

    flex-direction: column;

    align-items: center;
}

#complaint:hover,
#check:hover,
#suggestion:hover {
    transform: translateY(-3px);

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   10. COMPLAINT FORM
========================================================= */

#complaint {
    width: 95%;
    max-width: 1200px;
    padding: 40px;
}

#complaint form {
    width: 100%;
    max-width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px 20px;
}

#complaint input,
#complaint textarea,
#complaint select {
    width: 100%;

    min-width: 0;

    padding: 14px 16px;

    font-size: 17px;

    border-radius: 14px;

    border: 1px solid #d9c27a;

    background: #fff;
}

#complaint textarea {
    min-height: 220px;
    resize: vertical;
}

#complaint textarea,
#complaint input[type="file"] {
    grid-column: 1 / -1;
}

#complaint label {
    grid-column: 1 / -1;

    font-weight: 700;

    color: #236456;

    margin-top: 5px;
}

#complaint button {
    grid-column: 1 / -1;

    max-width: 300px;

    margin: 10px auto 0 auto;
}


/* =========================================================
   11. COMPLAINT SECTIONS
========================================================= */

.complaint-section {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 25px;

    background: #fffdf6;

    padding: 20px;

    border-radius: 12px;

    border: 1px solid #e0d9b5;

    box-shadow:
        0 6px 15px rgba(0, 0, 0, 0.1);
}

.complaint-section h3 {
    grid-column: 1 / -1;

    color: #236456;

    margin-bottom: 15px;

    border-bottom: 2px solid #a38e5c;

    padding-bottom: 5px;
}


/* =========================================================
   12. CHECK FORM
========================================================= */

#check form {
    width: 100%;

    max-width: 500px;

    margin: 0 auto;
}

#check .section-title {
    width: 100%;

    text-align: center;

    margin-bottom: 20px;
}

#check .search-row {
    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    width: 100%;
}

#check input {
    width: 100%;

    padding: 12px;

    border-radius: 10px;

    border: 1px solid #ccc;

    text-align: center;

    font-size: 16px;
}

#check button {
    align-self: center;

    width: 100%;

    max-width: 250px;

    margin-top: 12px;

    background: linear-gradient(
        135deg,
        #236456,
        #2f7a63
    );

    color: #d4af37;

    border-radius: 12px;

    font-weight: 700;
}


/* =========================================================
   13. SUGGESTION FORM
========================================================= */

#suggestion {
    max-width: 650px;
}

#suggestion.section {
    margin-top: 80px;
}

#suggestion form {
    width: 100%;

    max-width: 500px;

    margin: 0 auto;

    display: flex;

    flex-direction: column;

    gap: 12px;
}

#suggestion .section-title {
    text-align: center;

    width: 100%;

    margin-bottom: 20px;
}

#suggestion input,
#suggestion textarea {
    width: 100%;

    padding: 12px;

    border-radius: 12px;

    border: 1px solid #d9c27a;

    background: #fff;
}

#suggestion textarea {
    min-height: 160px;
}

#suggestion input:focus,
#suggestion textarea:focus {
    border-color: #236456;

    box-shadow:
        0 0 0 3px rgba(35, 100, 86, 0.15);

    outline: none;
}

#suggestion button {
    background: linear-gradient(
        135deg,
        #236456,
        #2f7a63
    );

    color: #d4af37;

    border-radius: 12px;

    width: 100%;

    max-width: 250px;

    margin: 10px auto 0;
}


/* =========================================================
   14. SUCCESS MESSAGE
========================================================= */

.success-msg {
    padding: 10px 12px;

    background: #d1e7dd;

    color: #0f5132;

    border-radius: 8px;

    margin-bottom: 15px;

    font-weight: 700;

    text-align: center;
}


/* =========================================================
   15. SUCCESS BOX
========================================================= */

.success-box {
    background:
        linear-gradient(
            135deg,
            #fffdf6,
            #f8f1d7
        ) !important;

    border: 1px solid #e0d4a0 !important;

    border-top: 6px solid #c9a227 !important;

    border-radius: 20px !important;

    padding: 35px !important;

    text-align: center !important;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.12) !important;

    animation:
        popIn 0.35s ease !important;
}

.success-icon {
    width: 85px;

    height: 85px;

    margin: 0 auto 18px;

    border-radius: 50%;

    background: #2e7d32;

    color: #fff;

    font-size: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    box-shadow:
        0 8px 20px rgba(46, 125, 50, 0.25);
}

.success-title {
    color: #2e7d32;

    font-size: 25px;

    font-weight: 800;

    margin-bottom: 12px;
}

.success-message {
    color: #444;

    font-size: 16px;

    line-height: 1.9;

    margin-bottom: 12px;
}

.success-note {
    background:
        rgba(201, 162, 39, 0.12);

    border-right:
        4px solid #c9a227;

    color: #6b5b18;

    padding: 12px;

    border-radius: 10px;

    margin: 15px 0;

    font-size: 14px;
}

.success-btn {
    background:
        linear-gradient(
            135deg,
            #c9a227,
            #e0bf4f
        );

    color: #fff;

    border: none;

    padding: 12px 28px;

    border-radius: 12px;

    font-weight: 700;

    cursor: pointer;

    transition: 0.3s;
}

.success-btn:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 20px rgba(201, 162, 39, 0.35);
}




/* =========================================================
   16. ADMIN AREAS - توسيع إدارة الشكاوى والمقترحات
========================================================= */

#admin,
#admin_suggestions {
    width: 92%;
    max-width: none;
    margin: 90px auto 40px;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
}

/* توسيع الجدول داخل إدارة الشكاوى */
#admin .table-wrapper,
#admin_suggestions .table-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* استغلال عرض الحاوية */
#admin #complaintsTable {
    width: 100%;
}

/* ضبط المساحة على الهاتف */
@media (max-width: 768px) {
    #admin,
    #admin_suggestions {
        padding: 0 8px;
        margin-top: 70px;
    }
}


/* =========================================================
   17. TABLE WRAPPER
========================================================= */

.table-wrapper {
    width: 100%;

    max-width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;

    display: block;

    border-radius: 12px;

    background: #fff;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.08);

    margin-bottom: 0;

    padding-bottom: 0;
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #236456;

    border-radius: 10px;
}


/* =========================================================
   18. TABLE
========================================================= */

table {
    width: 100%;

    min-width: 900px;

    border-collapse: collapse;

    background: #fff;

    border-radius: 14px;

    overflow: hidden;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.08);

    font-family:
        'Tajawal',
        'El Messiri',
        sans-serif;

    table-layout: auto;
}

table thead th {
    background:
        linear-gradient(
            135deg,
            #236456,
            #2f7a63
        );

    color: #d4af37;

    padding: 14px;

    font-weight: 800;

    text-align: center;

    border-bottom:
        2px solid #d4af37;
}

table th,
table td {
    padding: 12px 10px;

    text-align: center;

    border-bottom:
        1px solid #ddd;

    font-size: 14px;

    white-space: normal;

    overflow-wrap: anywhere;

    word-break: break-word;

    color: #333;
}

table tr:hover {
    background: #f7f3e8;

    transition: 0.2s;
}

table td:last-child {
    white-space: nowrap;
}

table td:last-child button {
    padding: 6px 10px;

    font-size: 12px;
}


/* أعمدة عامة */

table th:nth-child(1),
table td:nth-child(1) {
    width: 40px;
}

table th:nth-child(2),
table td:nth-child(2) {
    width: 60px;
}

table th:nth-child(3),
table td:nth-child(3) {
    width: 120px;
}

table th:nth-child(5),
table td:nth-child(5) {
    width: 250px;
}

table th:nth-child(6),
table td:nth-child(6) {
    width: 120px;
}

table th:last-child,
table td:last-child {
    width: 90px;
}


/* =========================================================
   19. SUGGESTIONS TABLE
========================================================= */

#admin_suggestions .table-wrapper {
    width: 100%;

    max-width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
}

#suggestionsTable {
    width: 100%;

    min-width: 900px;

    margin: auto;

    background: #fff;

    border-radius: 12px;

    overflow: hidden;

    border-collapse: collapse;

    table-layout: fixed;
}

#suggestionsTable th,
#suggestionsTable td {
    white-space: normal;

    word-break: break-word;

    overflow-wrap: anywhere;

    font-size: 13px;

    padding: 8px;
}

#suggestionsTable thead th {
    position: sticky;

    top: 0;

    background: #236456;

    color: #fff;

    z-index: 10;
}

#suggestionsTable th:nth-child(2),
#suggestionsTable td:nth-child(2) {
    width: 60px;
}

#suggestionsTable th:nth-child(3),
#suggestionsTable td:nth-child(3) {
    width: 120px;
}

#suggestionsTable th:nth-child(4),
#suggestionsTable td:nth-child(4) {
    width: 120px;
}

#suggestionsTable th:nth-child(5),
#suggestionsTable td:nth-child(5) {
    width: 300px;

    max-width: 300px;
}


/* =========================================================
   20. TABLE SEARCH
========================================================= */

input.table-search {
    padding: 8px;

    border-radius: 6px;

    border: 1px solid #ccc;

    margin-bottom: 10px;

    width: 100%;

    max-width: 300px;
}


/* =========================================================
   21. BULK ACTIONS
========================================================= */

.bulk-actions {
    width: 100%;

    max-width: 100%;

    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    justify-content: center;

    margin-top: 15px;

    padding: 10px;

    box-sizing: border-box;
}

.bulk-actions select,
.bulk-actions button {
    max-width: 100%;

    padding: 10px 14px;

    border-radius: 10px;

    font-weight: 700;

    cursor: pointer;
}

.bulk-actions select {
    border: 1px solid #ccc;

    background: #fff;
}

.bulk-actions button {
    background: #236456;

    color: #fff;

    white-space: nowrap;
}

.bulk-actions button[name="bulk_delete"] {
    background: #ef4444;
}


/* =========================================================
   22. EXPORT / FILTER
========================================================= */

.export-filter-box {
    background: #f8f6ef;

    border: 1px solid #d8cda8;

    padding: 15px;

    border-radius: 12px;

    margin-bottom: 20px;
}

.filter-row {
    display: flex;

    align-items: end;

    gap: 15px;

    flex-wrap: wrap;
}

.filter-item {
    display: flex;

    flex-direction: column;

    gap: 6px;

    min-width: 160px;
}

.filter-item label {
    font-weight: 700;

    color: #236456;
}

.filter-item input,
.filter-item select {
    height: 40px;

    padding: 5px 10px;

    border-radius: 8px;

    border: 1px solid #ccc;

    min-width: 180px;
}

.export-button a {
    display: inline-block;

    background: #236456;

    color: white;

    padding: 11px 25px;

    border-radius: 10px;

    text-decoration: none;

    font-weight: bold;
}

.export-button a:hover {
    background: #a38e5c;
}


/* =========================================================
   23. COMPLAINTS TOOLBAR
========================================================= */

.export-bar {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 15px;

    flex-wrap: wrap;

    margin-bottom: 15px;
}

.date-item {
    display: flex;

    align-items: center;

    gap: 8px;
}

.date-item label {
    font-weight: bold;

    color: #236456;

    white-space: nowrap;
}

.export-bar input,
.export-bar select {
    height: 40px;

    padding: 0 10px;

    border: 1px solid #ccc;

    border-radius: 6px;
}

.export-bar button {
    height: 40px;

    padding: 0 18px;

    border: none;

    border-radius: 6px;

    background: #236456;

    color: #fff;

    cursor: pointer;
}

.complaints-toolbar {
    display: flex;

    align-items: flex-end;

    gap: 15px;

    flex-wrap: wrap;

    background: #f8f8f8;

    padding: 15px;

    border-radius: 12px;

    margin-bottom: 20px;

    direction: rtl;
}

.complaints-toolbar .filter-item {
    display: flex;

    flex-direction: column;

    gap: 6px;

    min-width: 160px;
}

.complaints-toolbar .filter-item label {
    font-weight: 700;

    color: #236456;
}

.complaints-toolbar .filter-item select,
.complaints-toolbar .filter-item input {
    height: 40px;

    padding: 8px 12px;

    border-radius: 8px;

    border: 1px solid #ccc;

    font-family: 'El Messiri', sans-serif;
}

.search-box input {
    width: 250px;
}

.export-button-box button {
    height: 40px;

    padding: 0 20px;

    background:
        linear-gradient(
            135deg,
            #0f4c75,
            #236456
        );

    color: white;

    border: none;

    border-radius: 10px;

    font-weight: 700;

    cursor: pointer;
}

.export-button-box button:hover {
    opacity: 0.9;
}


/* =========================================================
   24. LIMIT BOX
========================================================= */

.limit-box {
    display: flex;

    justify-content: center;

    align-items: center;

    gap: 10px;

    margin: 15px auto;

    width: 100%;

    max-width: 400px;

    padding: 10px;

    background:
        rgba(255, 255, 255, 0.7);

    border-radius: 12px;

    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.08);
}

.limit-box select {
    padding: 8px 12px;

    border-radius: 10px;

    border: 1px solid #ccc;

    background: #fff;

    font-weight: bold;

    cursor: pointer;
}

.limit-box span {
    font-weight: 700;

    color: #236456;
}


/* =========================================================
   25. STATISTICS
========================================================= */

/* ===== بطاقات إحصائيات الشكاوى ===== */

#complaintsStats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    margin: 20px 0;
    direction: rtl;
    align-items: stretch;
    box-sizing: border-box;
}

#complaintsStats .stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-width: 0;
    min-height: 145px;
    padding: 22px 14px;
    box-sizing: border-box;

    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(35, 100, 86, 0.08);

    text-align: center;
    overflow: hidden;

    transition: transform .25s ease, box-shadow .25s ease;
}

#complaintsStats .stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: #236456;
}

#complaintsStats .stat-card h3 {
    margin: 4px 0 0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.7;
    color: #374151;
}

#complaintsStats .stat-card strong {
    display: block;
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    color: #236456;
}

/* إجمالي الشكاوى */
#complaintsStats .stat-total {
    background: #236456;
    border-color: #236456;
}

#complaintsStats .stat-total::before {
    background: #c7b996;
}

#complaintsStats .stat-total h3,
#complaintsStats .stat-total strong {
    color: #fff;
}

/* الشكاوى غير المحوّلة */
#complaintsStats .stat-untransferred::before {
    background: #236456;
}

#complaintsStats .stat-untransferred strong {
    color: #236456;
}

/* إجمالي الإحالات */
#complaintsStats .stat-total-assignments::before {
    background: #a38e5c;
}

#complaintsStats .stat-total-assignments strong {
    color: #92763c;
}

/* الإحالات المنجزة */
#complaintsStats .stat-done::before {
    background: #16a34a;
}

#complaintsStats .stat-done strong {
    color: #15803d;
}

/* الإحالات المرفوضة */
#complaintsStats .stat-rejected::before {
    background: #dc2626;
}

#complaintsStats .stat-rejected strong {
    color: #dc2626;
}

/* الإحالات قيد الإنجاز */
#complaintsStats .stat-pending::before {
    background: #d97706;
}

#complaintsStats .stat-pending strong {
    color: #c2410c;
}

/* الإحالات المعادة */
#complaintsStats .stat-returned::before {
    background: #7c3aed;
}

#complaintsStats .stat-returned strong {
    color: #7c3aed;
}

@media (hover: hover) {
    #complaintsStats .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 9px 22px rgba(35, 100, 86, 0.14);
    }
}

/* الكمبيوتر اللوحي */
@media (max-width: 992px) {
    #complaintsStats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    #complaintsStats .stat-card {
        min-height: 130px;
        padding: 18px 10px;
    }
}

/* الموبايل */
@media (max-width: 600px) {
    #complaintsStats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin: 15px 0;
    }

    #complaintsStats .stat-card {
        min-height: 112px;
        padding: 16px 8px;
        gap: 8px;
        border-radius: 12px;
    }

    #complaintsStats .stat-card h3 {
        font-size: 13px;
        line-height: 1.6;
    }

    #complaintsStats .stat-card strong {
        font-size: 27px;
    }
}

@media (max-width: 360px) {
    #complaintsStats {
        gap: 8px;
    }

    #complaintsStats .stat-card {
        min-height: 100px;
        padding: 13px 6px;
    }

    #complaintsStats .stat-card h3 {
        font-size: 12px;
    }

    #complaintsStats .stat-card strong {
        font-size: 24px;
    }
}


/* =========================================================
   26. STATUS
========================================================= */

.status,
.status-badge,
.status-pill {
    display: inline-block;

    padding: 6px 12px;

    border-radius: 20px;

    font-weight: bold;

    font-size: 13px;
}

.status {
    color: #fff;
}

.status-badge {
    color: #fff;
}

.status-pill {
    color: #fff;
}


/* الحالات */

.status.pending {
    background: #f59e0b;
}

.status.done {
    background: #28a745;
}

.status.rejected {
    background: #dc3545;
}

.status-progress {
    background: #fff3cd;

    color: #856404;

    border: 1px solid #ffeeba;
}

.status-done {
    background: #d4edda;

    color: #155724;

    border: 1px solid #c3e6cb;
}

.status-rejected {
    background: #f8d7da;

    color: #721c24;

    border: 1px solid #f5c6cb;
}

.status-returned {
    background: #ede9fe;

    color: #6d28d9;

    border: 1px solid #8b5cf6;
}


/* =========================================================
   27. DIRECTORATE BADGES
========================================================= */

.dept-badge {
    padding: 4px 10px;

    border-radius: 8px;

    font-size: 13px;

    font-weight: bold;

    display: inline-block;

    color: #fff;
}

.dept-النظافة {
    background: #2ecc71;
}

.dept-الحدائق {
    background: #27ae60;
}

.dept-الأشغال {
    background: #3498db;
}

.dept-النقل,
.dept-النقل-والمرور {
    background: #9b59b6;
}

.dept-جمالية-المدينة {
    background: #e67e22;
}

.dept-الأملاك {
    background: #e74c3c;
}

.dept-غير-ذلك,
.dept-default {
    background: #7f8c8d;
}


/* =========================================================
   28. CHECK RESULT
========================================================= */

.result-box {
    margin-bottom: 15px;

    padding: 10px;

    border-radius: 10px;

    background: #fff;
}

.result-box p {
    margin: 10px 0;

    font-size: 15px;
}

.check-card {
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f7f3e8
        );

    border: 1px solid #e0d9b5;

    border-right: 5px solid #c9a227;

    padding: 20px;

    border-radius: 18px;

    text-align: right;

    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.12);

    line-height: 1.8;

    margin-bottom: 15px;
}

.check-card p {
    margin: 6px 0;

    font-size: 15px;

    color: #333;
}

.check-simple p {
    margin: 8px 0;

    font-size: 15px;
}

.check-row {
    display: flex;

    justify-content: space-between;

    padding: 8px 0;

    border-bottom: 1px solid #eee;
}

.check-row .label {
    font-weight: 800;

    color: #236456;
}

.check-row .value {
    color: #333;
}

#checkModalBody {
    max-height: 70vh;

    overflow-y: auto;
}


/* =========================================================
   29. REJECTION
========================================================= */

.rejection-box {
    background:
        linear-gradient(
            135deg,
            #f8d7da,
            #f1b0b7
        );

    border-right:
        5px solid #8b1e1e;

    padding: 12px;

    margin-top: 10px;

    border-radius: 10px;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   30. MODALS / POPUPS
========================================================= */

.welcome-popup,
.modal {
    position: fixed;

    inset: 0;

    width: 100%;

    height: 100%;

    background:
        rgba(0, 0, 0, 0.60);

    display: none;

    justify-content: center;

    align-items: center;

    z-index: 99999;

    opacity: 0;

    visibility: hidden;

    padding: 15px;

    backdrop-filter: blur(6px);

    transition: 0.25s ease;
}

.welcome-popup.active,
.modal.active {
    display: flex !important;

    opacity: 1;

    visibility: visible;
}

.welcome-box,
.modal-content {
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f7f3e8
        );

    border: 1px solid #e0d9b5;

    border-radius: 20px;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.25);

    width: 90%;

    max-width: 650px;

    padding: 30px;

    position: relative;

    animation:
        popupScale 0.25s ease;

    text-align: center;
}

.welcome-box h2,
.modal-content h2 {
    color: #236456;

    font-weight: 900;

    font-size: 22px;

    margin-bottom: 10px;
}

.welcome-box p,
.modal-content p {
    color: #4a4a4a;

    font-size: 15px;

    line-height: 1.7;
}

.welcome-box .highlight {
    color: #a38e5c;

    font-weight: 800;
}


/* =========================================================
   31. WELCOME POPUP
========================================================= */

.welcome-box {
    max-height: 90vh;

    overflow-y: auto;
}

.welcome-box::-webkit-scrollbar {
    width: 8px;
}

.welcome-box::-webkit-scrollbar-thumb {
    background: #236456;

    border-radius: 10px;
}

.welcome-box .popup-buttons {
    display: flex;

    gap: 10px;

    flex-wrap: wrap;

    justify-content: center;

    margin-top: 15px;
}

.welcome-box .popup-buttons button {
    padding: 12px 18px;

    border: none;

    border-radius: 10px;

    font-weight: 700;

    cursor: pointer;

    background: #236456;

    color: #fff;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    transition: 0.3s;
}

.welcome-box .popup-buttons button.secondary {
    background: #a38e5c;
}

.welcome-box .popup-buttons button.third {
    background: #f59e0b;
}

.welcome-box .popup-buttons button:hover {
    opacity: 0.9;
}

.welcome-box .close-popup {
    position: absolute;

    top: 10px;

    right: 15px;

    font-size: 24px;

    font-weight: 700;

    cursor: pointer;

    color: #236456;

    transition: 0.3s;
}

.welcome-box .close-popup:hover {
    color: #a38e5c;
}


/* =========================================================
   32. CHECK RESULT POPUP
========================================================= */

#checkResultPopup .welcome-box {
    width: 95%;

    max-width: 850px;

    max-height: 80vh;

    overflow-y: auto;

    overflow-x: hidden;

    padding: 25px;

    scroll-behavior: smooth;
}

#checkResultPopup .welcome-box::-webkit-scrollbar {
    width: 12px;
}

#checkResultPopup .welcome-box::-webkit-scrollbar-track {
    background: #f1f1f1;

    border-radius: 10px;
}

#checkResultPopup .welcome-box::-webkit-scrollbar-thumb {
    background: #236456;

    border-radius: 10px;

    border: 2px solid #f1f1f1;
}

#checkResultPopup .welcome-box::-webkit-scrollbar-thumb:hover {
    background: #1a4b41;
}


/* =========================================================
   33. IMAGE VIEWER
========================================================= */

#imageViewer {
    display: none;

    position: fixed;

    inset: 0;

    background:
        rgba(0, 0, 0, 0.9);

    z-index: 999999;

    justify-content: center;

    align-items: center;

    flex-direction: column;
}

#imageViewer.active {
    display: flex;
}

#imageViewer span {
    position: absolute;

    top: 20px;

    right: 25px;

    font-size: 35px;

    color: #fff;

    cursor: pointer;

    z-index: 2;
}

#viewerImage {
    max-width: 90%;

    max-height: 80vh;

    transition: 0.2s;

    box-shadow:
        0 0 20px #000;
}

.zoom-controls {
    margin-top: 15px;

    display: flex;

    gap: 10px;
}

.zoom-btn {
    width: 45px;

    height: 45px;

    border: none;

    border-radius: 50%;

    background: #fff;

    color: #000;

    font-size: 22px;

    cursor: pointer;
}


/* =========================================================
   34. FILE UPLOAD
========================================================= */

input[type="file"] {
    width: 100% !important;

    max-width: 100% !important;

    min-width: 0 !important;

    display: block;

    font-size: 12px;

    line-height: 1.4;

    direction: rtl;

    color: #000 !important;

    background: #fff;

    white-space: nowrap;

    overflow: visible;
}

input[type="file"]::file-selector-button {
    padding: 8px 12px;

    border: none;

    background: #236456;

    color: #fff;

    border-radius: 10px;

    font-weight: 700;

    font-size: 12px;

    cursor: pointer;
}

.file-upload {
    display: flex;

    flex-direction: column;

    gap: 8px;

    width: 100%;

    font-weight: 700;
}

.file-upload input[type="file"] {
    width: 100%;

    padding: 12px;

    border: 1px solid #ccc;

    border-radius: 12px;

    background: #fff;
}

.file-text {
    font-size: 12px;

    color: #000;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    max-width: 200px;
}

.image-error {
    display: block;

    color: red;

    font-size: 14px;

    margin-top: 5px;
}


/* =========================================================
   35. BACKGROUND OVERLAY / WATERMARK
========================================================= */



/* العلامة المائية */
.bg-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 99999;
    pointer-events: none;
    margin: 0;
}

.bg-overlay img {
    display: block;
    width: min(400px, 80vw);
    height: auto;
    opacity: 0.12;
}

/* تكبير بسيط على الموبايل */
@media (max-width: 768px) {
    .bg-overlay img {
        width: 60vw;
        max-width: 400px;
        height: auto;
    }
}




/* =========================================================
   37. HIDDEN
========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   38. ANIMATIONS
========================================================= */

@keyframes pop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes popupScale {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* =========================================================
   39. MOBILE - 768px
========================================================= */

@media (max-width: 768px) {

    html,
    body {
        width: 100%;

        overflow-x: hidden;
    }

    body {
        min-height: 100vh;
    }

    .container {
        width: 100%;

        padding: 10px;
    }


    /* العناوين */

    h1,
    h2,
    h3 {
        text-align: center;
    }

    h2 {
        font-size: 18px;
    }


    /* القائمة */

    .nav-menu {
        position: fixed;

        top: 60px;

        right: -100%;

        width: 260px;

        height: 100vh;

        background: #fdf6e3;

        flex-direction: column;

        padding: 20px;

        transition: 0.3s ease;

        z-index: 99999;

        box-shadow:
            -5px 0 20px rgba(0, 0, 0, 0.2);
    }

    .nav-menu.active {
        right: 0;
    }

    .menu-toggle {
        display: block !important;

        font-size: 26px;

        cursor: pointer;

        color: #236456;
    }


    /* الأزرار */

    button {
        width: auto;

        max-width: 100%;

        padding: 12px;
    }

    .buttons {
        flex-direction: column;

        gap: 10px;
    }

    .buttons button {
        width: 100%;

        margin-bottom: 10px;

        min-width: 0;
    }

    .center-buttons {
        flex-direction: column;

        width: 100%;
    }

    .center-buttons button {
        width: 100%;

        max-width: 100%;

        min-width: 0;
    }


    /* الأقسام */

    .section {
        padding: 10px;
    }


    /* الشكوى */

    #complaint {
        width: 100% !important;

        max-width: 100% !important;

        padding: 18px !important;

        border-radius: 16px;
    }

    #complaint form {
        grid-template-columns: 1fr !important;

        gap: 12px !important;
    }

    #complaint input,
    #complaint textarea,
    #complaint select {
        width: 100% !important;

        min-width: 0 !important;

        font-size: 16px !important;

        padding: 14px !important;
    }

    #complaint textarea {
        min-height: 160px !important;
    }

    #complaint button {
        width: 100% !important;

        max-width: 100% !important;
    }

    .complaint-section {
        grid-template-columns: 1fr;

        gap: 10px;

        padding: 10px;
    }


    /* check / suggestion */

    #check,
    #suggestion {
        width: 100%;

        max-width: 100%;

        margin-top: 70px;

        padding: 18px;
    }

    #check form,
    #suggestion form {
        width: 100%;

        max-width: 100%;
    }

    #check button,
    #suggestion button {
        width: 100%;

        max-width: 100%;
    }


    /* الجداول */

    .table-wrapper {
        width: 100%;

        overflow-x: auto;

        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 700px;

        font-size: 13px;
    }

    table th,
    table td {
        font-size: 13px;

        padding: 9px 7px;
    }

    #suggestionsTable {
        min-width: 700px;
    }


    /* الفلاتر */

    .complaints-toolbar {
        flex-direction: column;

        align-items: stretch;
    }

    .complaints-toolbar .filter-item,
    .search-box input {
        width: 100%;

        min-width: 0;
    }

    .export-bar {
        flex-direction: column;

        align-items: stretch;
    }

    .date-item {
        width: 100%;
    }

    .export-bar input,
    .export-bar select,
    .export-bar button {
        width: 100%;
    }


    /* الإحصائيات */

    .complaints-stats,
    .stats,
    .stats-container,
    .stats-box {
        flex-direction: row;

        flex-wrap: wrap;

        gap: 10px;
    }

    .stat-card {
        flex: 1 1 45%;

        min-width: 0;

        max-width: 100%;
    }


    /* المودال */

    .welcome-box,
    .modal-content {
        width: 95%;

        max-width: 600px;

        max-height: 90vh;

        padding: 15px;

        border-radius: 15px;

        overflow-y: auto;
    }

    .welcome-box .popup-buttons {
        flex-direction: column;

        gap: 10px;
    }

    .welcome-box .popup-buttons button {
        width: 100%;
    }


    /* نتيجة الاستعلام */

    #checkResultPopup .welcome-box {
        width: 95%;

        max-width: 95%;

        max-height: 90vh;

        padding: 15px;
    }


    /* الصور */

    #viewerImage,
    #imageViewer img {
        max-width: 95%;

        max-height: 80vh;
    }


    /* الخلفية */

    .bg-overlay img {
        width: 250px;

        opacity: 0.20;
    }


    /* رسالة إغلاق الشكاوى */

    #complaint .complaint-closed-message {
        width:
            calc(100% - 20px) !important;

        max-width: 680px !important;

        margin: 15px auto !important;

        padding: 28px 15px !important;

        border-radius: 16px !important;
    }

    #complaint .complaint-closed-message .closed-status {
        gap: 9px !important;

        margin-bottom: 20px !important;
    }

    #complaint .complaint-closed-message .closed-icon {
        width: 44px !important;

        height: 44px !important;

        min-width: 44px !important;

        font-size: 20px !important;
    }

    #complaint .complaint-closed-message .closed-text {
        font-size: 20px !important;
    }

    #complaint .complaint-closed-message .closed-title {
        font-size: 19px !important;
    }

    #complaint .complaint-closed-message .closed-subtitle {
        font-size: 15px !important;

        line-height: 1.8 !important;

        margin-bottom: 20px !important;
    }

    #complaint .complaint-closed-message .working-days {
        max-width: 100% !important;

        flex-direction: column !important;

        gap: 5px !important;

        padding: 13px 10px !important;
    }

    #complaint .complaint-closed-message .working-days-label {
        font-size: 14px !important;
    }

    #complaint .complaint-closed-message .working-days-value {
        font-size: 17px !important;
    }
}


/* =========================================================
   40. VERY SMALL PHONES - 480px
========================================================= */

@media (max-width: 480px) {

    h2 {
        font-size: 18px;
    }

    td,
    th {
        font-size: 12px;
    }

    input,
    textarea,
    select {
        font-size: 14px;
    }

    .success-box {
        padding: 20px !important;
    }

  
/* بطاقات الإحصائيات على الهواتف */
#complaintsStats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

#complaintsStats .stat-card {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 108px;
    padding: 14px 12px;
    flex: initial;
    border-radius: 12px;
}

#complaintsStats .stat-card h3 {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 10px;
}

#complaintsStats .stat-card strong {
    font-size: 27px;
    line-height: 1.3;
}

@media (max-width: 360px) {
    #complaintsStats {
        gap: 8px;
    }

    #complaintsStats .stat-card {
        padding: 11px 9px;
        min-height: 100px;
    }

    #complaintsStats .stat-card h3 {
        font-size: 12px;
    }

    #complaintsStats .stat-card strong {
        font-size: 24px;
    }
}


    .welcome-box,
    .modal-content {
        width: 96%;

        padding: 14px;
    }

    #complaint {
        padding: 14px !important;
    }

    #complaint input,
    #complaint textarea,
    #complaint select {
        font-size: 15px !important;

        padding: 12px !important;
    }
}


/* =========================================================
   41. FOOTER
========================================================= */

footer,
.site-footer {
    width: 100%;

    background: #236456;

    color: #fff;

    margin-top: auto;

    flex-shrink: 0;
}

.footer-container {
    width: 100%;

    max-width: 1200px;

    margin: 0 auto;

    padding: 40px 30px;

    display: grid;

    grid-template-columns:
        1.5fr 1fr 1fr;

    gap: 40px;

    direction: rtl;
}


/* الشعار */

.footer-logo {
    text-align: right;
}

.footer-logo img {
    width: 90px;

    height: auto;
}

.footer-logo h3 {
    font-size: 24px;

    margin: 10px 0;
}

.footer-logo p {
    line-height: 2;

    font-size: 15px;

    text-align: justify;
}


/* الروابط */

.footer-links,
.footer-contact {
    text-align: right;
}

.footer-links a {
    display: block;

    color: #fff;

    margin-bottom: 12px;

    text-decoration: none;
}

.footer-contact p {
    line-height: 2;
}


/* الحقوق */

.footer-bottom {
    width: 100%;

    text-align: center;

    padding: 15px;

    background: #1b5044;
}


/* =========================================================
   42. FOOTER MOBILE
========================================================= */

@media (max-width: 900px) {

    .footer-container {
        grid-template-columns: 1fr;

        text-align: center;
    }

    .footer-logo,
    .footer-links,
    .footer-contact {
        text-align: center;
    }

    .footer-logo p {
        text-align: center;
    }
}


/* =========================================================
   نافذة إغلاق الشكاوى والمقترحات
   تصميم مستقل بالكامل
========================================================= */

/* الخلفية الخارجية */

#complaintsClosedPopup.closed-popup {

    position: fixed !important;

    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;

    display: none;

    justify-content: center !important;
    align-items: center !important;

    padding: 20px !important;

    background: rgba(15, 48, 42, 0.72) !important;

    backdrop-filter: blur(7px) !important;

    -webkit-backdrop-filter: blur(7px) !important;

    z-index: 999999 !important;

    direction: rtl;
}


/* =========================================================
   الصندوق الرئيسي
========================================================= */

#complaintsClosedPopup .closed-box {

    width: 92% !important;

    max-width: 480px !important;

    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #f8f4e8 100%
        ) !important;

    border-radius: 24px !important;

    border: 1px solid #d8c99b !important;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.30) !important;

    padding: 32px 28px 28px !important;

    text-align: center !important;

    position: relative !important;

    animation: closedPopupIn .35s ease-out !important;

    overflow: hidden !important;
}


/* خط علوي */

#complaintsClosedPopup .closed-box::before {

    content: "";

    position: absolute;

    top: 0;

    right: 0;

    width: 100%;

    height: 6px;

    background:
        linear-gradient(
            90deg,
            #236456,
            #c9a227,
            #236456
        );
}


/* =========================================================
   أيقونة القفل
========================================================= */

#complaintsClosedPopup .closed-icon-box {

    width: 82px !important;

    height: 82px !important;

    margin: 4px auto 18px !important;

    border-radius: 50% !important;

    background:
        linear-gradient(
            145deg,
            #236456,
            #2f7a63
        ) !important;

    display: flex !important;

    align-items: center !important;

    justify-content: center !important;

    box-shadow:
        0 10px 25px rgba(35, 100, 86, 0.25) !important;

    border: 4px solid #eee5c9 !important;
}


#complaintsClosedPopup .closed-icon-box span {

    font-size: 38px !important;

    line-height: 1 !important;

    display: block !important;
}


/* =========================================================
   العنوان
========================================================= */

#complaintsClosedPopup .closed-title {

    margin: 0 !important;

    padding: 0 !important;

    color: #236456 !important;

    font-family: 'El Messiri', sans-serif !important;

    font-size: 25px !important;

    font-weight: 900 !important;

    line-height: 1.5 !important;
}


/* =========================================================
   الخط الذهبي
========================================================= */

#complaintsClosedPopup .closed-line {

    width: 70px !important;

    height: 3px !important;

    margin: 12px auto 18px !important;

    background: #c9a227 !important;

    border-radius: 10px !important;
}


/* =========================================================
   النصوص
========================================================= */

#complaintsClosedPopup .closed-message {

    margin: 0 auto 10px !important;

    color: #444 !important;

    font-family: 'El Messiri', sans-serif !important;

    font-size: 15px !important;

    font-weight: 600 !important;

    line-height: 1.9 !important;

    max-width: 400px !important;
}


#complaintsClosedPopup .secondary-text {

    color: #777 !important;

    font-size: 14px !important;

    margin-bottom: 20px !important;
}


/* =========================================================
   صندوق الدوام الرسمي
========================================================= */

#complaintsClosedPopup .closed-working-days {

    width: 100% !important;

    display: flex !important;

    align-items: center !important;

    justify-content: center !important;

    gap: 14px !important;

    padding: 15px 18px !important;

    margin: 18px auto 24px !important;

    background:
        linear-gradient(
            135deg,
            #f3ead2,
            #fffaf0
        ) !important;

    border: 1px solid #d9c99c !important;

    border-right: 5px solid #c9a227 !important;

    border-radius: 14px !important;

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.06) !important;
}


/* أيقونة التقويم */

#complaintsClosedPopup .closed-working-icon {

    width: 45px !important;

    height: 45px !important;

    min-width: 45px !important;

    border-radius: 12px !important;

    background: #236456 !important;

    display: flex !important;

    align-items: center !important;

    justify-content: center !important;

    font-size: 22px !important;
}


/* محتوى الدوام */

#complaintsClosedPopup .closed-working-content {

    display: flex !important;

    flex-direction: column !important;

    align-items: flex-start !important;

    text-align: right !important;

    gap: 3px !important;
}


#complaintsClosedPopup .closed-working-label {

    color: #777 !important;

    font-size: 13px !important;

    font-weight: 600 !important;
}


#complaintsClosedPopup .closed-working-value {

    color: #236456 !important;

    font-size: 17px !important;

    font-weight: 900 !important;
}


/* =========================================================
   منطقة الزر
========================================================= */

#complaintsClosedPopup .closed-button-container {

    width: 100% !important;

    display: flex !important;

    justify-content: center !important;

    align-items: center !important;

    margin-top: 5px !important;
}


/* =========================================================
   زر الإغلاق
========================================================= */

#complaintsClosedPopup .closed-close-btn {

    width: 110px !important;

    min-width: 110px !important;

    max-width: 110px !important;

    height: 42px !important;

    min-height: 42px !important;

    max-height: 42px !important;

    padding: 0 !important;

    margin: 0 !important;

    border: 1px solid #a38e5c !important;

    border-radius: 9px !important;

    background:
        linear-gradient(
            135deg,
            #236456,
            #2f7a63
        ) !important;

    color: #fff !important;

    font-family: 'El Messiri', sans-serif !important;

    font-size: 14px !important;

    font-weight: 800 !important;

    cursor: pointer !important;

    display: flex !important;

    align-items: center !important;

    justify-content: center !important;

    flex: 0 0 110px !important;

    box-shadow:
        0 5px 12px rgba(35, 100, 86, 0.20) !important;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease !important;
}


/* Hover */

#complaintsClosedPopup .closed-close-btn:hover {

    background:
        linear-gradient(
            135deg,
            #2f7a63,
            #236456
        ) !important;

    color: #fff !important;

    transform: translateY(-2px) !important;

    box-shadow:
        0 8px 18px rgba(35, 100, 86, 0.30) !important;
}


/* الضغط */

#complaintsClosedPopup .closed-close-btn:active {

    transform: scale(.97) !important;
}


/* =========================================================
   Animation
========================================================= */

@keyframes closedPopupIn {

    from {

        opacity: 0;

        transform:
            translateY(20px)
            scale(.92);
    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    #complaintsClosedPopup.closed-popup {

        padding: 15px !important;
    }


    #complaintsClosedPopup .closed-box {

        width: 94% !important;

        max-width: 430px !important;

        padding: 27px 20px 23px !important;

        border-radius: 20px !important;
    }


    #complaintsClosedPopup .closed-icon-box {

        width: 68px !important;

        height: 68px !important;

        margin-bottom: 14px !important;
    }


    #complaintsClosedPopup .closed-icon-box span {

        font-size: 31px !important;
    }


    #complaintsClosedPopup .closed-title {

        font-size: 21px !important;

        line-height: 1.5 !important;
    }


    #complaintsClosedPopup .closed-message {

        font-size: 14px !important;

        line-height: 1.8 !important;
    }


    #complaintsClosedPopup .secondary-text {

        font-size: 13px !important;

        margin-bottom: 15px !important;
    }


    #complaintsClosedPopup .closed-working-days {

        padding: 12px !important;

        gap: 10px !important;

        margin: 15px auto 20px !important;
    }


    #complaintsClosedPopup .closed-working-icon {

        width: 40px !important;

        height: 40px !important;

        min-width: 40px !important;

        font-size: 19px !important;
    }


    #complaintsClosedPopup .closed-working-value {

        font-size: 15px !important;
    }


    #complaintsClosedPopup .closed-close-btn {

        width: 105px !important;

        min-width: 105px !important;

        max-width: 105px !important;

        flex-basis: 105px !important;

        height: 40px !important;

        min-height: 40px !important;

        max-height: 40px !important;

        font-size: 13px !important;
    }
}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    #complaintsClosedPopup .closed-box {

        width: 96% !important;

        padding: 24px 16px 20px !important;
    }


    #complaintsClosedPopup .closed-icon-box {

        width: 62px !important;

        height: 62px !important;
    }


    #complaintsClosedPopup .closed-icon-box span {

        font-size: 28px !important;
    }


    #complaintsClosedPopup .closed-title {

        font-size: 19px !important;
    }


    #complaintsClosedPopup .closed-message {

        font-size: 13px !important;

        line-height: 1.75 !important;
    }


    #complaintsClosedPopup .closed-working-content {

        align-items: center !important;

        text-align: center !important;
    }


    #complaintsClosedPopup .closed-working-value {

        font-size: 14px !important;
    }
}
/* =========================================================
   أخطاء نموذج المقترح
   يعمل على الكمبيوتر والموبايل
========================================================= */

#suggestionForm .suggestion-error {
    display: block !important;
    width: 100% !important;

    color: #d60000 !important;

    font-family: 'El Messiri', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;

    line-height: 1.7 !important;
    text-align: right !important;

    margin: -6px 0 8px 0 !important;
    padding: 0 !important;

    background: transparent !important;
    border: none !important;

    min-height: 0 !important;
}

#suggestionForm .suggestion-error:empty {
    display: none !important;
}

/* الحقل الذي يحتوي على خطأ */
#suggestionForm input.field-invalid,
#suggestionForm textarea.field-invalid,
#suggestionForm select.field-invalid {
    border: 2px solid #d60000 !important;
    border-color: #d60000 !important;

    outline: none !important;

    background-color: #fff !important;
}

/* الحقل الأحمر حتى أثناء التركيز */
#suggestionForm input.field-invalid:focus,
#suggestionForm textarea.field-invalid:focus,
#suggestionForm select.field-invalid:focus {
    border: 2px solid #d60000 !important;
    border-color: #d60000 !important;

    outline: none !important;

    box-shadow: 0 0 0 2px rgba(214, 0, 0, 0.12) !important;
}


/* =========================================================
   الموبايل
========================================================= */

@media (max-width: 768px) {

    #suggestionForm .suggestion-error {
        display: block !important;

        color: #d60000 !important;

        font-size: 13px !important;
        font-weight: 700 !important;

        line-height: 1.8 !important;

        text-align: right !important;

        margin-top: -5px !important;
        margin-bottom: 8px !important;

        width: 100% !important;
    }

    #suggestionForm .suggestion-error:empty {
        display: none !important;
    }

    #suggestionForm input.field-invalid,
    #suggestionForm textarea.field-invalid,
    #suggestionForm select.field-invalid {
        border: 2px solid #d60000 !important;
        border-color: #d60000 !important;

        outline: none !important;

        box-shadow: none !important;

        background: #fff !important;
    }

    #suggestionForm input.field-invalid:focus,
    #suggestionForm textarea.field-invalid:focus,
    #suggestionForm select.field-invalid:focus {
        border: 2px solid #d60000 !important;
        border-color: #d60000 !important;

        box-shadow:
            0 0 0 2px rgba(214, 0, 0, 0.12) !important;
    }
}
/* =========================================================
   نافذة نتيجة استعلام الشكوى
========================================================= */

#checkModal {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(12, 27, 23, 0.78);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}


/* =========================================================
   محتوى النافذة
========================================================= */

#checkModal .modal-content {

    position: relative;

    width: 100%;
    max-width: 620px;

    max-height: 90vh;

    overflow-y: auto;

    padding: 0;

    background: #ffffff;

    border-radius: 18px;

    border: 1px solid rgba(128, 107, 63, 0.55);

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.38),
        0 5px 20px rgba(23, 79, 67, 0.20);

    direction: rtl;

    font-family:
        'El Messiri',
        'Tajawal',
        Arial,
        sans-serif;

    animation: checkModalShow 0.25s ease-out;
}


/* =========================================================
   عنوان النافذة
========================================================= */

#checkModal .modal-content > h2 {

    margin: 0 !important;

    padding: 20px 25px 18px;

    text-align: center;

    color: #174f43;

    font-size: 22px;

    font-weight: 800;

    line-height: 1.6;

    background:
        linear-gradient(
            135deg,
            #eeece3 0%,
            #f8f8f5 100%
        );

    border-bottom:
        2px solid #a89562;

    border-radius:
        18px 18px 0 0;

    position: relative;
}


/* =========================================================
   خط زخرفي تحت العنوان
========================================================= */

#checkModal .modal-content > h2::after {

    content: "";

    display: block;

    width: 65px;
    height: 3px;

    margin: 8px auto 0;

    background: #806b3f;

    border-radius: 10px;
}


/* =========================================================
   جسم النتيجة
========================================================= */

#checkModalBody {

    padding: 24px 25px 28px;

    color: #292929;

    font-size: 15px;

    line-height: 2;

    text-align: right;
}


/* =========================================================
   أي حاوية داخل نتيجة الاستعلام
========================================================= */

#checkModalBody > div {

    margin-bottom: 12px;
}


/* =========================================================
   بطاقات معلومات الشكوى
========================================================= */

#checkModalBody .result-item,
#checkModalBody .complaint-result,
#checkModalBody .check-result {

    background: #eeeeE8;

    border: 1px solid #cfc6ad;

    border-right:
        4px solid #806b3f;

    border-radius: 10px;

    padding: 11px 14px;

    margin-bottom: 10px;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


#checkModalBody .result-item:hover,
#checkModalBody .complaint-result:hover,
#checkModalBody .check-result:hover {

    background: #e5e3d9;

    transform: translateY(-1px);
}


/* =========================================================
   النصوص والعناوين داخل النتيجة
========================================================= */

#checkModalBody strong {

    color: #174f43;

    font-weight: 800;
}


#checkModalBody b {

    color: #174f43;

    font-weight: 800;
}


/* =========================================================
   حالة الشكوى
========================================================= */

#checkModalBody .status {

    display: inline-block;

    padding: 5px 14px;

    margin-top: 4px;

    border-radius: 20px;

    font-size: 13px;

    font-weight: 800;

    line-height: 1.6;

    border: 1px solid transparent;
}


/* =========================================================
   قيد الإنجاز
========================================================= */

#checkModalBody .status.pending,
#checkModalBody .status.in-progress {

    color: #674900;

    background: #f7edbd;

    border-color: #c9ad4d;
}


/* =========================================================
   منجزة
========================================================= */

#checkModalBody .status.completed,
#checkModalBody .status.done {

    color: #0f5138;

    background: #dcefe5;

    border-color: #69a88b;
}


/* =========================================================
   مرفوضة
========================================================= */

#checkModalBody .status.rejected {

    color: #8d1717;

    background: #f8dddd;

    border-color: #c97878;
}


/* =========================================================
   إذا كانت الحالة مجرد نص عربي
========================================================= */

#checkModalBody .status-badge {

    display: inline-block;

    padding: 5px 14px;

    border-radius: 20px;

    font-size: 13px;

    font-weight: 800;
}


/* =========================================================
   الجداول داخل النتيجة
========================================================= */

#checkModalBody table {

    width: 100%;

    border-collapse: separate;

    border-spacing: 0;

    overflow: hidden;

    border:
        1px solid #cfc6ad;

    border-radius: 10px;

    background: #ffffff;

    margin-top: 5px;
}


/* =========================================================
   رأس الجدول
========================================================= */

#checkModalBody th {

    padding: 11px 12px;

    background: #174f43;

    color: #ffffff;

    font-weight: 700;

    text-align: right;

    border-bottom:
        1px solid #123f36;
}


/* =========================================================
   خلايا الجدول
========================================================= */

#checkModalBody td {

    padding: 11px 12px;

    color: #292929;

    background: #ffffff;

    border-bottom:
        1px solid #ddd8c9;

    text-align: right;

    vertical-align: top;
}


#checkModalBody tr:last-child td {

    border-bottom: none;
}


#checkModalBody tr:nth-child(even) td {

    background: #f1f0e9;
}


/* =========================================================
   الرسائل داخل النتيجة
========================================================= */

#checkModalBody .success,
#checkModalBody .success-message {

    padding: 14px 16px;

    color: #0f5138;

    background: #e0f1e8;

    border:
        1px solid #82b99c;

    border-right:
        4px solid #287452;

    border-radius: 10px;

    font-weight: 700;
}


#checkModalBody .error,
#checkModalBody .error-message {

    padding: 14px 16px;

    color: #8d1717;

    background: #f9e2e2;

    border:
        1px solid #d18a8a;

    border-right:
        4px solid #a91f1f;

    border-radius: 10px;

    font-weight: 700;
}


/* =========================================================
   الأزرار داخل نافذة النتيجة
========================================================= */

#checkModalBody button {

    font-family:
        'El Messiri',
        'Tajawal',
        Arial,
        sans-serif;

    cursor: pointer;

    border: none;

    border-radius: 9px;

    padding: 10px 18px;

    font-size: 14px;

    font-weight: 700;

    transition:
        0.2s ease;
}


#checkModalBody button:hover {

    transform: translateY(-1px);

    box-shadow:
        0 5px 12px rgba(0, 0, 0, 0.16);
}


/* =========================================================
   زر الإغلاق - في منتصف النافذة
========================================================= */

#checkModal .close,
#checkModal .modal-close,
#checkModal .close-btn {

    position: absolute;

    top: 12px;

    left: 50%;

    transform: translateX(-50%);

    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;

    border-radius: 50%;

    background: #174f43;

    color: #ffffff;

    font-size: 20px;

    font-weight: bold;

    cursor: pointer;

    z-index: 5;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


#checkModal .close:hover,
#checkModal .modal-close:hover,
#checkModal .close-btn:hover {

    background: #806b3f;

    transform:
        translateX(-50%)
        rotate(90deg);
}

/* =========================================================
   شريط التمرير
========================================================= */

#checkModal .modal-content::-webkit-scrollbar {

    width: 7px;
}


#checkModal .modal-content::-webkit-scrollbar-track {

    background: #e6e4da;

    border-radius: 10px;
}


#checkModal .modal-content::-webkit-scrollbar-thumb {

    background: #a89562;

    border-radius: 10px;
}


#checkModal .modal-content::-webkit-scrollbar-thumb:hover {

    background: #806b3f;
}


/* =========================================================
   الحركة
========================================================= */

@keyframes checkModalShow {

    from {

        opacity: 0;

        transform:
            translateY(15px)
            scale(0.97);
    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* =========================================================
   الموبايل
========================================================= */

@media (max-width: 768px) {

    #checkModal {

        padding: 12px;
    }


    #checkModal .modal-content {

        width: 100%;

        max-width: 100%;

        max-height: 92vh;

        border-radius: 15px;
    }


    #checkModal .modal-content > h2 {

        padding:
            16px
            42px
            14px;

        font-size: 18px;

        border-radius:
            15px 15px 0 0;
    }


    #checkModalBody {

        padding:
            18px
            15px
            22px;

        font-size: 14px;

        line-height: 1.9;
    }


    #checkModalBody .result-item,
    #checkModalBody .complaint-result,
    #checkModalBody .check-result {

        padding: 10px 12px;

        margin-bottom: 8px;
    }


    #checkModalBody table {

        font-size: 13px;
    }


    #checkModalBody th,
    #checkModalBody td {

        padding: 9px 8px;
    }


 #checkModal .close,
#checkModal .modal-close,
#checkModal .close-btn {

    top: 9px;

    left: 50%;

    width: 31px;

    height: 31px;

    font-size: 18px;

    transform: translateX(-50%);
}
}


/* =========================================================
   شاشات الموبايل الصغيرة جدًا
========================================================= */

@media (max-width: 400px) {

    #checkModal {

        padding: 8px;
    }


    #checkModal .modal-content {

        border-radius: 13px;
    }


    #checkModal .modal-content > h2 {

        font-size: 17px;

        padding:
            14px
            38px
            12px;
    }


    #checkModalBody {

        padding:
            15px
            11px
            18px;

        font-size: 13px;
    }


    #checkModalBody th,
    #checkModalBody td {

        padding: 8px 6px;
    }
}
/* =========================================================
   زر إغلاق نتيجة الاستعلام - توسيط كامل
========================================================= */

#checkModalBody button {
    display: block !important;

    margin-left: auto !important;
    margin-right: auto !important;

    text-align: center !important;

    background: #174f43;

    color: #ffffff;

    min-width: 120px;

    border: none;

    border-radius: 9px;

    padding: 10px 22px;

    font-family:
        'El Messiri',
        'Tajawal',
        Arial,
        sans-serif;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;
}


#checkModalBody button:hover {

    background: #806b3f;

    transform: translateY(-1px);

    box-shadow:
        0 5px 12px rgba(0, 0, 0, 0.16);
}
/* توسيط زر تصدير Excel */
.export-button-box {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.export-button-box button {
    margin: 10px auto;
}
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    margin-right: 6px;
}

.status-progress {
    background: #fff3cd;
    color: #856404;
}

.status-done {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-returned {
    background: #e2e3e5;
    color: #383d41;
}
/* =========================================================
   إصلاح ألوان الحالة داخل تفاصيل الشكوى
   يجب أن يكون في آخر ملف CSS
========================================================= */

#detailsPopup .status-badge.status-progress,
#checkResultPopup .status-badge.status-progress,
#checkModalBody .status-badge.status-progress {
    background: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeeba !important;
}

#detailsPopup .status-badge.status-done,
#checkResultPopup .status-badge.status-done,
#checkModalBody .status-badge.status-done {
    background: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

#detailsPopup .status-badge.status-rejected,
#checkResultPopup .status-badge.status-rejected,
#checkModalBody .status-badge.status-rejected {
    background: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
}

#detailsPopup .status-badge.status-returned,
#checkResultPopup .status-badge.status-returned,
#checkModalBody .status-badge.status-returned {
    background: #ede9fe !important;
    color: #6d28d9 !important;
    border: 1px solid #8b5cf6 !important;
}
/* =========================================================
   إصلاح نهائي لألوان حالات الشكاوى
   يجب أن يكون في آخر ملف CSS
========================================================= */

/* قيد الإنجاز */
#detailsPopup .status-badge.status-progress,
#checkResultPopup .status-badge.status-progress,
#checkModalBody .status-badge.status-progress {
    background: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeeba !important;
}

/* منجزة */
#detailsPopup .status-badge.status-done,
#checkResultPopup .status-badge.status-done,
#checkModalBody .status-badge.status-done {
    background: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

/* مرفوضة */
#detailsPopup .status-badge.status-rejected,
#checkResultPopup .status-badge.status-rejected,
#checkModalBody .status-badge.status-rejected {
    background: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
}

/* معادة */
#detailsPopup .status-badge.status-returned,
#checkResultPopup .status-badge.status-returned,
#checkModalBody .status-badge.status-returned {
    background: #ede9fe !important;
    color: #6d28a8 !important;
    border: 1px solid #8b5cf6 !important;
}
/* =====================================================
   زر تصدير المقترحات - Excel
===================================================== */

.export-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 15px 0;
    direction: rtl;
}

.export-excel-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-width: 145px;
    height: 42px;

    padding: 0 18px;

    background: #236456 !important;
    color: #fff !important;

    border: 1px solid #236456;
    border-radius: 9px;

    font-family: "Tajawal", "Cairo", sans-serif;
    font-size: 14px;
    font-weight: 700;

    text-decoration: none !important;

    cursor: pointer;

    box-shadow: 0 3px 8px rgba(35, 100, 86, 0.18);

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.export-excel-btn:hover {
    background: #1b5145 !important;
    color: #fff !important;

    transform: translateY(-1px);

    box-shadow: 0 5px 12px rgba(35, 100, 86, 0.25);
}

.export-excel-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(35, 100, 86, 0.18);
}




/* =========================================
   تنسيق بطاقات الإحصائيات فقط
   الحفاظ على التوزيع الحالي
   ========================================= */

#complaintsStats .stat-card {
    box-sizing: border-box !important;
    min-width: 0 !important;
    min-height: 120px !important;
    padding: 18px 14px !important;

    background: #ffffff !important;
    border: 1px solid #e0e8e3 !important;
    border-bottom: 3px solid #236456 !important;
    border-radius: 10px !important;

    box-shadow: 0 2px 7px rgba(35, 100, 86, 0.07) !important;

    text-align: center !important;
    transition: box-shadow 0.2s ease !important;
}

#complaintsStats .stat-card:hover {
    box-shadow: 0 4px 12px rgba(35, 100, 86, 0.13) !important;
}

/* العناوين */
#complaintsStats .stat-card h3 {
    margin: 0 0 10px !important;
    color: #45574f !important;

    font-family: "Tajawal", "El Messiri", sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.7 !important;
    text-align: center !important;
}

/* الأرقام */
#complaintsStats .stat-card strong {
    display: block !important;
    margin: 0 !important;

    color: #236456 !important;
    font-family: "Tajawal", "El Messiri", sans-serif !important;
    font-size: 32px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    font-variant-numeric: tabular-nums;
}

/* تمييز هادئ لكل نوع */
#complaintsStats .stat-total,
#complaintsStats .stat-total-assignments,
#complaintsStats .stat-total-referrals {
    border-bottom-color: #236456 !important;
}

#complaintsStats .stat-untransferred {
    border-bottom-color: #a38e5c !important;
}

#complaintsStats .stat-done {
    border-bottom-color: #398064 !important;
}

#complaintsStats .stat-rejected {
    border-bottom-color: #b66b68 !important;
}

#complaintsStats .stat-pending {
    border-bottom-color: #b18a42 !important;
}

#complaintsStats .stat-returned {
    border-bottom-color: #8273a5 !important;
}

/* الهاتف: تحسين الحجم فقط، دون تغيير التوزيع */
@media (max-width: 600px) {
    #complaintsStats .stat-card {
        min-height: 100px !important;
        padding: 13px 8px !important;
        border-radius: 8px !important;
    }

    #complaintsStats .stat-card h3 {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }

    #complaintsStats .stat-card strong {
        font-size: 27px !important;
    }
}

/* ألوان بطاقات الإحصائيات */

#complaintsStats .stat-card {
    background: #f5f8f6 !important;
    border: 1px solid #dfe8e2 !important;
    border-bottom: 4px solid #236456 !important;
    border-radius: 10px !important;
}

/* إجمالي الشكاوى: أخضر المجلس */
#complaintsStats .stat-total {
    background: #eaf4ef !important;
    border-color: #cfe3d8 !important;
    border-bottom-color: #236456 !important;
}

/* الشكاوى غير المحولة: ذهبي هادئ */
#complaintsStats .stat-untransferred {
    background: #fbf4e5 !important;
    border-color: #eadcba !important;
    border-bottom-color: #a38e5c !important;
}

/* إجمالي الإحالات: أزرق هادئ */
#complaintsStats .stat-total-assignments,
#complaintsStats .stat-total-referrals {
    background: #edf3f9 !important;
    border-color: #d4e1ef !important;
    border-bottom-color: #527b9b !important;
}

/* الإحالات المنجزة: أخضر */
#complaintsStats .stat-done {
    background: #eaf6ed !important;
    border-color: #cee6d4 !important;
    border-bottom-color: #39804f !important;
}

/* الإحالات المرفوضة: أحمر هادئ */
#complaintsStats .stat-rejected {
    background: #fbefee !important;
    border-color: #efd6d3 !important;
    border-bottom-color: #b65e59 !important;
}

/* الإحالات قيد الإنجاز: كهرماني */
#complaintsStats .stat-pending {
    background: #fff5e7 !important;
    border-color: #f0dfc3 !important;
    border-bottom-color: #b78335 !important;
}

/* الإحالات المعادة: بنفسجي هادئ */
#complaintsStats .stat-returned {
    background: #f2eef9 !important;
    border-color: #e0d7ef !important;
    border-bottom-color: #8270a5 !important;
}

/* لون الأرقام والعناوين */
#complaintsStats .stat-card h3 {
    color: #374a41 !important;
}

#complaintsStats .stat-total strong,
#complaintsStats .stat-total-assignments strong,
#complaintsStats .stat-total-referrals strong {
    color: #236456 !important;
}

#complaintsStats .stat-untransferred strong {
    color: #8b713b !important;
}

#complaintsStats .stat-done strong {
    color: #287344 !important;
}

#complaintsStats .stat-rejected strong {
    color: #a34440 !important;
}

#complaintsStats .stat-pending strong {
    color: #95651e !important;
}

#complaintsStats .stat-returned strong {
    color: #6e5b94 !important;
}

/* تحسين وضوح حالة الشكوى غير المحوّلة */
#complaintsStats .stat-card,
.status-badge,
.status-label,
.badge {
    /* لا تغيّر ألوان العناصر الأخرى */
}

/* نص الحالة غير المحوّلة داخل جدول الشكاوى */
td .status-untransferred,
td .status-not-transferred,
td .status-badge.untransferred {
    color: #8b713b !important;
    background-color: #fbf4e5 !important;
    border: 1px solid #eadcba !important;
    font-weight: 700 !important;
}
/* =========================================================
   التصحيح النهائي لنافذة نتيجة الاستعلام
   مجلس مدينة حمص - الأخضر والذهبي
   الكمبيوتر والموبايل
========================================================= */

/* النافذة الرئيسية */
#checkModal {
    box-sizing: border-box !important;
    padding: 16px !important;
    direction: rtl !important;
    align-items: center !important;
    justify-content: center !important;
}

/* الصندوق الرئيسي للنتيجة */
#checkModal .modal-content {
    display: flex !important;
    flex-direction: column !important;

    width: 100% !important;
    max-width: 760px !important;

    max-height: 88vh !important;
    max-height: 88dvh !important;

    min-height: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;

    background: #fff !important;
    border: 1px solid #c7b996 !important;
    border-radius: 18px !important;

    box-shadow: 0 18px 50px rgba(23, 63, 53, 0.22) !important;

    text-align: right !important;
}

/* عنوان النافذة */
#checkModal .modal-content > h2 {
    flex: 0 0 auto !important;

    margin: 0 !important;
    padding: 18px 48px !important;

    color: #236456 !important;
    background: #f5f3eb !important;

    border-bottom: 2px solid #a38e5c !important;
    border-radius: 18px 18px 0 0 !important;

    font-family: 'El Messiri', 'Tajawal', sans-serif !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    line-height: 1.7 !important;
    text-align: center !important;
}

/* جسم نتيجة الاستعلام */
#checkModal #checkModalBody {
    flex: 1 1 auto !important;

    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;

    max-height: none !important;

    padding: 22px !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;

    background: #fff !important;
    color: #333 !important;

    font-family: 'El Messiri', 'Tajawal', sans-serif !important;
    font-size: 15px !important;
    line-height: 1.9 !important;
    text-align: right !important;

    -webkit-overflow-scrolling: touch;
}

/* المسافات بين أقسام النتيجة */
#checkModalBody > div {
    min-width: 0 !important;
    max-width: 100% !important;
    margin-bottom: 12px;
}

/* بطاقات معلومات الشكوى */
#checkModalBody .result-box,
#checkModalBody .check-card,
#checkModalBody .result-item,
#checkModalBody .complaint-result,
#checkModalBody .check-result {
    box-sizing: border-box !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    padding: 14px 16px !important;
    margin: 0 0 12px !important;

    background: #f8f8f4 !important;
    border: 1px solid #e1ddcf !important;
    border-right: 4px solid #a38e5c !important;
    border-radius: 12px !important;

    color: #37413c !important;
    line-height: 1.9 !important;

    overflow-wrap: anywhere;
}

/* عناوين البيانات */
#checkModalBody strong,
#checkModalBody b,
#checkModalBody .label {
    color: #236456 !important;
    font-weight: 900 !important;
}

/* قيم البيانات */
#checkModalBody .value {
    color: #333 !important;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* صفوف البيانات */
#checkModalBody .check-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 5px 14px !important;

    width: 100% !important;
    min-width: 0 !important;

    padding: 10px 0 !important;
    border-bottom: 1px solid #e7e4da !important;
}

#checkModalBody .check-row:last-child {
    border-bottom: none !important;
}

#checkModalBody .check-row .label,
#checkModalBody .check-row .value {
    min-width: 0 !important;
    overflow-wrap: anywhere;
}

/* الجداول داخل نتيجة الاستعلام
   مهم: إلغاء الحد الأدنى العام البالغ 900px */
#checkModalBody table {
    display: table !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;

    margin: 10px 0 14px !important;

    background: #fff !important;
    border: 1px solid #ded9ca !important;
    border-radius: 10px !important;

    box-shadow: none !important;
}

#checkModalBody table th,
#checkModalBody table td {
    box-sizing: border-box !important;

    min-width: 0 !important;
    max-width: 100% !important;

    padding: 10px 8px !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;

    font-size: 14px !important;
    line-height: 1.8 !important;
    vertical-align: top !important;
}

#checkModalBody table th {
    background: #236456 !important;
    color: #fff !important;
    border-color: #1b5044 !important;
}

#checkModalBody table td {
    background: #fff !important;
    color: #333 !important;
    border-bottom: 1px solid #e5e1d5 !important;
}

#checkModalBody table tbody tr:nth-child(even) td {
    background: #f5f6f2 !important;
}

/* الحالات */
#checkModalBody .status-badge,
#checkModalBody .status {
    display: inline-block !important;

    max-width: 100% !important;
    padding: 5px 12px !important;

    border-radius: 20px !important;

    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.7 !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* قيد الإنجاز */
#checkModalBody .status-badge.status-progress,
#checkModalBody .status.status-progress,
#checkModalBody .status.pending,
#checkModalBody .status.in-progress {
    color: #856404 !important;
    background: #fff3cd !important;
    border: 1px solid #ffe3a0 !important;
}

/* منجزة */
#checkModalBody .status-badge.status-done,
#checkModalBody .status-badge.status-completed,
#checkModalBody .status.done,
#checkModalBody .status.completed {
    color: #155724 !important;
    background: #d4edda !important;
    border: 1px solid #b8dbc2 !important;
}

/* مرفوضة */
#checkModalBody .status-badge.status-rejected,
#checkModalBody .status.status-rejected {
    color: #721c24 !important;
    background: #f8d7da !important;
    border: 1px solid #edb9be !important;
}

/* معادة */
#checkModalBody .status-badge.status-returned,
#checkModalBody .status.status-returned {
    color: #6d28a8 !important;
    background: #ede9fe !important;
    border: 1px solid #c4b5fd !important;
}

/* رسائل النجاح والخطأ */
#checkModalBody .success,
#checkModalBody .success-message {
    padding: 12px 14px !important;
    background: #eaf5ee !important;
    color: #155724 !important;
    border: 1px solid #c8e3d0 !important;
    border-right: 4px solid #39804f !important;
    border-radius: 10px !important;
}

#checkModalBody .error,
#checkModalBody .error-message {
    padding: 12px 14px !important;
    background: #fbefee !important;
    color: #8d1717 !important;
    border: 1px solid #efd0ce !important;
    border-right: 4px solid #b65e59 !important;
    border-radius: 10px !important;
}

/* الأزرار داخل النتيجة */
#checkModalBody button {
    display: block !important;

    width: auto !important;
    max-width: 100% !important;
    min-width: 120px !important;

    margin: 16px auto 0 !important;
    padding: 10px 22px !important;

    background: #236456 !important;
    color: #fff !important;

    border: 1px solid #a38e5c !important;
    border-radius: 10px !important;

    font-family: 'El Messiri', 'Tajawal', sans-serif !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

/* نافذة تفاصيل نتيجة الاستعلام إذا كانت تستخدم هذا المعرّف */
#checkResultPopup .welcome-box {
    width: 95% !important;
    max-width: 760px !important;

    max-height: 88vh !important;
    max-height: 88dvh !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    border: 1px solid #c7b996 !important;
    border-radius: 18px !important;

    background: linear-gradient(145deg, #fff, #f8f6ef) !important;
    box-shadow: 0 18px 50px rgba(23, 63, 53, 0.22) !important;

    -webkit-overflow-scrolling: touch;
}

/* تحسين الموبايل */
@media (max-width: 768px) {
    #checkModal {
        padding: 10px !important;
    }

    #checkModal .modal-content {
        width: 100% !important;
        max-width: 100% !important;

        max-height: 92vh !important;
        max-height: 92dvh !important;

        border-radius: 14px !important;
    }

    #checkModal .modal-content > h2 {
        padding: 15px 40px !important;
        font-size: 18px !important;
        line-height: 1.7 !important;
    }

    #checkModal #checkModalBody {
        padding: 15px 12px 20px !important;
        font-size: 14px !important;
        line-height: 1.85 !important;
    }

    #checkModalBody .result-box,
    #checkModalBody .check-card,
    #checkModalBody .result-item,
    #checkModalBody .complaint-result,
    #checkModalBody .check-result {
        padding: 11px 10px !important;
        margin-bottom: 9px !important;
        border-radius: 10px !important;
    }

    #checkModalBody .check-row {
        gap: 4px !important;
        padding: 9px 0 !important;
    }

    #checkModalBody table th,
    #checkModalBody table td {
        padding: 8px 5px !important;
        font-size: 12px !important;
        line-height: 1.7 !important;
    }

    #checkModalBody .status-badge,
    #checkModalBody .status {
        font-size: 12px !important;
        padding: 4px 9px !important;
    }

    #checkResultPopup .welcome-box {
        width: 96% !important;
        max-width: 96% !important;

        max-height: 92vh !important;
        max-height: 92dvh !important;

        padding: 16px !important;
        border-radius: 14px !important;
    }
}

@media (max-width: 380px) {
    #checkModal {
        padding: 6px !important;
    }

    #checkModal .modal-content > h2 {
        font-size: 16px !important;
        padding: 13px 36px !important;
    }

    #checkModal #checkModalBody {
        padding: 12px 9px 16px !important;
        font-size: 13px !important;
    }

    #checkModalBody table th,
    #checkModalBody table td {
        padding: 7px 4px !important;
        font-size: 11px !important;
    }
}
/* =========================================================
   الألوان النهائية لنافذة نتيجة الاستعلام
   هوية مجلس مدينة حمص: أخضر + ذهبي + عاجي
========================================================= */

/* خلفية النافذة الخارجية */
#checkModal {
    background: rgba(20, 49, 42, 0.82) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* الصندوق الرئيسي */
#checkModal .modal-content {
    background: #fffdf8 !important;
    border: 1px solid #c7b996 !important;
    box-shadow: 0 18px 50px rgba(23, 63, 53, 0.28) !important;
}

/* عنوان النافذة */
#checkModal .modal-content > h2 {
    background: linear-gradient(135deg, #236456, #17483d) !important;
    color: #ffffff !important;
    border-bottom: 4px solid #a38e5c !important;
}

/* الخط الزخرفي */
#checkModal .modal-content > h2::after {
    background: #d5bd7a !important;
}

/* خلفية بيانات النتيجة */
#checkModal #checkModalBody {
    background: #fffdf8 !important;
    color: #343b37 !important;
}

/* بطاقات معلومات الشكوى */
#checkModalBody .result-box,
#checkModalBody .check-card,
#checkModalBody .result-item,
#checkModalBody .complaint-result,
#checkModalBody .check-result {
    background: #f5f4ed !important;
    border: 1px solid #e2ddcc !important;
    border-right: 4px solid #a38e5c !important;
    color: #343b37 !important;
}

/* عناوين الحقول */
#checkModalBody strong,
#checkModalBody b,
#checkModalBody .label,
#checkModalBody .check-row .label {
    color: #236456 !important;
}

/* قيم الحقول */
#checkModalBody .value,
#checkModalBody .check-row .value {
    color: #383d39 !important;
}

/* الفواصل بين البيانات */
#checkModalBody .check-row {
    border-bottom-color: #ddd6c2 !important;
}

/* جدول الإحالات أو سجل المعالجة */
#checkModalBody table {
    background: #ffffff !important;
    border-color: #d8ceb1 !important;
}

/* رأس الجدول */
#checkModalBody table thead th,
#checkModalBody table th {
    background: #236456 !important;
    color: #ffffff !important;
    border-color: #17483d !important;
}

/* خلايا الجدول */
#checkModalBody table td {
    background: #ffffff !important;
    color: #343b37 !important;
    border-bottom-color: #e5dfcf !important;
}

/* الصفوف المتناوبة */
#checkModalBody table tbody tr:nth-child(even) td {
    background: #f4f1e7 !important;
}

/* حالة: قيد الإنجاز */
#checkModalBody .status-progress,
#checkModalBody .status.pending,
#checkModalBody .status.in-progress {
    background: #fff1c9 !important;
    color: #795713 !important;
    border: 1px solid #dec078 !important;
}

/* حالة: منجزة */
#checkModalBody .status-done,
#checkModalBody .status.completed,
#checkModalBody .status.done {
    background: #e1f1e6 !important;
    color: #1d6540 !important;
    border: 1px solid #9bc9aa !important;
}

/* حالة: مرفوضة */
#checkModalBody .status-rejected,
#checkModalBody .status.rejected {
    background: #fae5e3 !important;
    color: #982f2b !important;
    border: 1px solid #e3aaa6 !important;
}

/* حالة: معادة */
#checkModalBody .status-returned,
#checkModalBody .status-badge.status-returned {
    background: #eee8fa !important;
    color: #67459a !important;
    border: 1px solid #c2b0e2 !important;
}

/* رسائل النجاح */
#checkModalBody .success,
#checkModalBody .success-message {
    background: #e8f4eb !important;
    color: #205e3a !important;
    border: 1px solid #b8d8c1 !important;
    border-right: 4px solid #39804f !important;
}

/* رسائل الخطأ */
#checkModalBody .error,
#checkModalBody .error-message {
    background: #fae9e7 !important;
    color: #912e29 !important;
    border: 1px solid #e7bcb8 !important;
    border-right: 4px solid #b65e59 !important;
}

/* الأزرار داخل النتيجة */
#checkModalBody button {
    background: linear-gradient(135deg, #236456, #17483d) !important;
    color: #ffffff !important;
    border: 1px solid #a38e5c !important;
    box-shadow: 0 3px 9px rgba(35, 100, 86, 0.16) !important;
}

/* عند تمرير المؤشر على الأزرار */
#checkModalBody button:hover {
    background: linear-gradient(135deg, #a38e5c, #897344) !important;
    color: #ffffff !important;
}

/* شريط التمرير */
#checkModal .modal-content::-webkit-scrollbar-track {
    background: #f1eee4 !important;
}

#checkModal .modal-content::-webkit-scrollbar-thumb {
    background: #a38e5c !important;
    border: 1px solid #f1eee4 !important;
}

#checkModal .modal-content::-webkit-scrollbar-thumb:hover {
    background: #236456 !important;
}

/* =========================================
   نافذة النتيجة البديلة إن كانت مستخدمة
   #checkResultPopup
========================================= */

#checkResultPopup .welcome-box {
    background: #fffdf8 !important;
    border: 1px solid #c7b996 !important;
    border-top: 5px solid #236456 !important;
    box-shadow: 0 18px 50px rgba(23, 63, 53, 0.28) !important;
}

#checkResultPopup .welcome-box h2 {
    color: #236456 !important;
}

#checkResultPopup .welcome-box strong,
#checkResultPopup .welcome-box b {
    color: #236456 !important;
}


/* رسالة إلزامية موضوع الشكوى */
#complaintSubjectWrapper .error-message,
#complaintSubjectWrapper .error-text,
#complaintSubjectWrapper .validation-error,
#complaintSubjectWrapper .field-error,
#complaintSubjectWrapper [role="alert"] {
    color: #dc2626 !important;
    -webkit-text-fill-color: #dc2626 !important;
}

/* ضمان ظهور اللون الأحمر على الموبايل */
@media (max-width: 768px) {
    #complaintSubjectWrapper .error-message,
    #complaintSubjectWrapper .error-text,
    #complaintSubjectWrapper .validation-error,
    #complaintSubjectWrapper .field-error,
    #complaintSubjectWrapper [role="alert"] {
        color: #dc2626 !important;
        -webkit-text-fill-color: #dc2626 !important;
    }
}
