﻿/*----------------------------------*/
/*  أساسيات عامة - Main Base Colors */
/*----------------------------------*/
body {
    background: #f4f7fa;
}

.text-rtl {
    text-align: right !important;
    direction: rtl !important;
}

/*------------------------------*/
/*      الهيدر - Header         */
/*------------------------------*/
.index-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 8px;
}
.index-header .search-input {
    border-radius: 12px;
    background: #e3f2fd;
    border: 1px solid #b6daf9;
    padding: 6px 18px;
    font-size: 15px;
    min-width: 180px;
    max-width: 270px;
}
.index-header .btn-primary {
    background: #1976d2;
    border: none;
    border-radius: 8px;
    font-weight: bold;
}

/*------------------------------*/
/*   الكروت - Cards             */
/*------------------------------*/
.card {
    border-radius: 18px;
    border: 1.5px solid #b6daf9;
    box-shadow: 0 2px 8px 0 #11518422;
    margin-bottom: 30px;
    background: #fff;
}

.dashboard-card {
    border-radius: 16px;
    background: #e3f2fd;
    box-shadow: 0 2px 8px 0 #11518418;
}

.icon-box {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #115184;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
}

/*------------------------------*/
/*    الجداول - Tables          */
/*------------------------------*/
.table-index th, .table-index td {
    vertical-align: middle !important;
    font-size: 15px;
}
.table-index th {
    background: #e3f2fd;
    color: #115184;
    font-weight: 700;
}
.table-index tbody tr {
    background: #fff;
    border-bottom: 2.5px solid #b6daf9 !important;
    transition: background 0.12s;
}
.table-index tbody tr:hover {
    background: #f0f6fb;
}

.table-index .actions-col {
    white-space: nowrap !important;
}
.table-index .badge {
    border-radius: 6px;
    font-size: 13px;
    padding: 2px 12px;
    font-weight: 500;
}
.table-action-btn {
    border-radius: 6px;
    font-size: 14px;
    margin: 0 2px;
    min-width: 33px;
}

/*------------------------------*/
/*     البادجات - Badges        */
/*------------------------------*/
.badge-paid {
    background: #e3faea;
    color: #1976d2;
}
.badge-unpaid {
    background: #f9eaea;
    color: #e55642;
}
.badge-partial {
    background: #fef7e3;
    color: #e6b342;
}

/*------------------------------*/
/*   الأعمدة القابلة للف - Wrap  */
/*------------------------------*/
.cell-wrap-mobile,
.cell-wrap-mobile-wide,
.cell-wrap-mobile-xl {
    background: #e3f2fd;
    border-radius: 8px;
    font-size: 14px;
    overflow-y: auto;
    direction: rtl !important;
}
.cell-wrap-mobile {
    min-width: 120px;
    max-width: 170px;
    padding: 8px 6px;
    max-height: 48px;
}
.cell-wrap-mobile-wide {
    min-width: 160px;
    max-width: 250px;
    padding: 10px 8px;
    max-height: 70px;
}
.cell-wrap-mobile-xl {
    min-width: 300px;
    max-width: 330px;
    padding: 11px 10px;
    max-height: 110px;
}

/*------------------------------*/
/* الباجيناشن - Pagination      */
/*------------------------------*/
.pagination {
    justify-content: center;
    margin-top: 20px;
}
.pagination .page-item .page-link {
    color: #1976d2;
    border-radius: 7px;
    border: none;
    margin: 0 2px;
    font-weight: 500;
}
.pagination .page-item.active .page-link,
.pagination .page-item .page-link:focus {
    background: #1976d2;
    color: #fff;
}

/*------------------------------*/
/*     الاستايل للموبايل        */
/*------------------------------*/
@media (max-width: 600px) {
    .cell-wrap-mobile { min-width: 120px; max-width: 170px; }
    .cell-wrap-mobile-wide { min-width: 160px; max-width: 250px; }
    .cell-wrap-mobile-xl { min-width: 210px; max-width: 350px; }
    .index-header { flex-direction: column; align-items: stretch; }
    .table-responsive { overflow-x: auto; }
    .table-index td, .table-index th { font-size: 13px; padding: 6px 2px !important; }
    .table-action-btn { min-width: 27px !important; font-size: 13px !important; padding: 3px 3px !important; margin: 0 1px !important; }
    .table-index .actions-col { white-space: nowrap !important; }
    .table-index tr { border-bottom: 2px solid #b6daf9 !important; }
}

/*------------------------------*/
/*    الاستايلات العامة         */
/*------------------------------*/
.page-title {
    font-weight: bold;
    font-size: 1.5rem;
    margin-bottom: 24px;
}
.form-label { font-weight: 500; }
.form-control, .form-select {
    border-radius: 12px;
    background: #f7f8fd;
    border-color: #b6daf9;
}
.form-check-input:checked {
    background-color: #1976d2;
    border-color: #1976d2;
}
.btn-primary {
    background: #1976d2;
    border: none;
    border-radius: 8px;
    font-weight: bold;
}
.btn-secondary {
    border-radius: 8px;
}
/*------------------------------*/
/*     القائمة الجانبية         */
/*------------------------------*/

/* خلفية القائمة الجانبية */
.sidebar-wrapper,
.sidebarMenuScroll,
#sidebar,
.main-container #sidebar,
.main-container .sidebar-wrapper {
    background: #115184 !important;
    border-right: none !important;
}

    /* لوجو أو البراند */
    .sidebar-wrapper .app-brand,
    .sidebar-wrapper .app-brand * {
        background: transparent !important;
    }

/* عناصر القائمة الرئيسية */
.sidebar-menu > li > a,
.sidebar-menu > li > a .menu-text,
.sidebar-menu > li > a i,
.sidebar-menu > li > a:visited,
.sidebar-menu > li > a:active {
    color: #fff !important;
    font-weight: 500 !important; /* ثقل للعنصر الرئيسي */
}

    /* العنصر النشط أو عند الهوفر */
    .sidebar-menu > li.active > a,
    .sidebar-menu > li > a:hover {
        background: #135d96 !important;
        color: #fff !important;
        font-weight: 500 !important;
    }

/* حاوية القوائم الفرعية */
.sidebar-wrapper .sidebar-menu .treeview-menu {
    background: #0f4977 !important;
    color: #fff !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

    /* الروابط داخل القوائم الفرعية */
    .sidebar-wrapper .sidebar-menu .treeview-menu li a,
    .sidebar-wrapper .sidebar-menu .treeview-menu li a:visited {
        color: #fff !important;
        font-weight: 400 !important; /* ثقل للعنصر الفرعي */
    }

        /* الهوفر والنشط في القوائم الفرعية */
        .sidebar-wrapper .sidebar-menu .treeview-menu li a:hover,
        .sidebar-wrapper .sidebar-menu .treeview-menu li.active > a {
            background: #1976d2 !important;
            color: #fff !important;
            border-radius: 8px !important;
            transition: background 0.15s, color 0.15s;
            font-weight: 400 !important;
        }

    /* حدود خفيفة بين العناصر الفرعية */
    .sidebar-wrapper .sidebar-menu .treeview-menu li {
        border-bottom: 1px solid #1976d226;
    }

        /* حذف الحد من آخر عنصر فرعي */
        .sidebar-wrapper .sidebar-menu .treeview-menu li:last-child {
            border-bottom: none;
        }
.form-control:focus, .form-select:focus {
    border-color: #2186d4 !important;
    box-shadow: 0 0 0 0.20rem #2186d440 !important; /* شادو أزرق فاتح */
}
/* تغيير خلفية الكنترولات في وضع الخمول */
.form-control,
.form-select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"] {
    background: #f4f9fd !important; /* لبني فاتح جدا */
    border-color: #c1e0fc !important; /* إطار أزرق هادي */
    box-shadow: none !important;
    transition: background 0.2s;
}

    /* في وضع الـ focus (لما يكون المستخدم عليه الكنترول) */
    .form-control:focus,
    .form-select:focus,
    textarea:focus,
    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="password"]:focus {
        background: #ffffff !important;
        border-color: #1976d2 !important; /* أزرق واضح */
        box-shadow: 0 0 0 2px #1976d228 !important; /* ظل أزرق خفيف */
    }
@media (max-width: 600px) {
    /* الكارت الرئيسي ياخد 100% من البودي بدون بادينج */
    .app-body,
    .app-body > .row,
    .app-body > .row > .col-xxl-12,
    .app-body > .row > .col-xxl-12 > .card,
    .app-body > .row > .col-xxl-12 > .card > .card-body {
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* الكارت الرئيسي يشيل البوردر/الشادو خالص */
    .card,
    .card-body {
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

        /* لو فيه كروت جوة كارت: خليها كلها شكل واحد */
        .card .card {
            box-shadow: none !important;
            border: none !important;
            border-radius: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
            background: transparent !important;
        }

    /* لو فيه بادينج في main أو app-container أو أي container تاني */
    .app-container,
    main,
    .main {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* لو فيه بادينج أو مارجن بين الكارت وبين حدود الصفحة */
    body,
    html {
        padding: 0 !important;
        margin: 0 !important;
    }
}
.dataTables_filter {
    display: none !important;
}
@media (max-width: 767px) {
    .dataTables_filter {
        display: none !important;
    }
}
/* لون هوفر مخصص لكل صف في جدول Bootstrap */
.table-hover > tbody > tr:hover {
    background-color: #e7f1fa !important; /* لبني فاتح */
    /* لو عايز لون أزرق تاني جرب مثلاً: #d0e7ff أو #f0f6ff */
}
/* تأكد أن الشريط الجانبي كله بياخد ارتفاع الشاشة */
.sidebar-wrapper,
#sidebar,
.main-container #sidebar {
    height: 100vh !important;
    min-height: 100vh !important;
    display: flex;
    flex-direction: column;
}

/* منطقة سكرول القائمة تكون مرنة وتملأ المساحة المتبقية */
.sidebarMenuScroll {
    flex: 1 1 0%;
    overflow-y: auto;
    min-height: 0;
    height: 100%;
}

/* قائمة القوائم الرئيسية */
.sidebar-menu {
    flex: 1 1 0%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* القوائم الفرعية تملأ مساحة العنصر الأب */
.sidebar-wrapper .sidebar-menu .treeview-menu {
    min-height: 100%;
    height: 100%;
    /* لو حبيت تظهرها بشكل كامل مع خلفية: */
    /* position: absolute;
    left: 0; right: 0;
    z-index: 100; */
}

/* ولو بتحتاج تدي الهيدر/اللوجو مساحة ثابتة، ممكن: */
.sidebar-wrapper .app-brand {
    flex-shrink: 0;
}

/* لو فيه مشكلة مع overflow في كل الشريط: */
.sidebar-wrapper {
    overflow: hidden;
}
.table-inner-details th, .table-inner-details td {
    font-size: 0.93rem;
    padding: 0.45rem 0.55rem !important;
}

.table-inner-details thead {
    background: #e6f0ff;
    font-weight: bold;
    color: #0d2578;
    border-bottom: 2px solid #457cf6 !important;
}

.table-inner-details {
    margin-bottom: 12px;
    border-radius: 0.75rem !important;
    border-width: 2px !important;
}

.table-inner-details {
    margin-bottom: 12px;
    border-radius: 0.75rem !important;
    border-width: 2px !important;
    box-shadow: 0 2px 8px 0 rgba(44, 104, 255, 0.07) !important;
}

    .table-inner-details thead th {
        background: #d6e6ff !important;
        color: #003c7c !important;
        border-bottom: 2.5px solid #457cf6 !important;

    }
@media (max-width: 700px) {
    .profitloss-table {
        font-size: 1rem;
        min-width: 320px !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

        .profitloss-table th, .profitloss-table td {
            padding: 0.5rem 0.4rem !important;
            white-space: normal !important;
        }
}

/*------------------------------*/
/*          END                 */
/*------------------------------*/
