﻿/* =========================================================
   SchoolManagement
   Global CSS
   Font: Benyamin
   ========================================================= */

/* =========================================================
   VARIABLES
   ========================================================= */
:root {
    --nav-gradient: linear-gradient(90deg, #1e3c72 0%, #2a5298 100%);
    --primary-color: #1e3c72;
    --bg-body: #f8fafc;
    --border-color: #b8c4d1;
    --table-header-bg: #d9e2ec;
    --table-header-color: #102a43;
    --table-text-color: #172b4d;
    --table-row-even: #f7f9fc;
    --table-row-hover: #e3edf7;
}

/* =========================================================
   HTML / BODY
   ========================================================= */
html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: #172b4d;
    direction: rtl;
    text-align: right;
    font-size: 15px;
}

/* =========================================================
   FONT - BENYAMIN
   ========================================================= */
body,
p,
h1,
h2,
h3,
h4,
h5,
h6,
input,
button,
select,
textarea,
div,
span,
a,
td,
th,
label,
option {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
}

/* =========================================================
   FONT AWESOME
   جلوگیری از خراب شدن فونت آیکون‌ها
   ========================================================= */
.fa,
.fas,
.far,
.fal,
.fab,
.fa-solid,
.fa-regular,
.fa-light,
.fa-thin,
.fa-duotone,
.fa-brands {
    font-family: "Font Awesome 6 Free", "FontAwesome" !important;
    font-style: normal !important;
    display: inline-block !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
}

.fas,
.fa-solid {
    font-weight: 900 !important;
}

.far,
.fa-regular {
    font-weight: 400 !important;
}

/* =========================================================
   BOOTSTRAP ICONS
   ========================================================= */
.bi,
[class^="bi-"],
[class*=" bi-"] {
    font-family: "bootstrap-icons" !important;
    font-style: normal !important;
    font-weight: normal !important;
    display: inline-block !important;
}

/* =========================================================
   NAVBAR
   ========================================================= */
.app-navbar {
    width: 100%;
    padding: 10px 0;
    background: var(--nav-gradient);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    position: relative;
    z-index: 1000;
}

    .app-navbar i {
        font-size: 1.25rem !important;
        vertical-align: middle;
    }

/* =========================================================
   LOGO
   ========================================================= */
.navbar-brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}

.site-logo-img {
    display: block !important;
    width: auto !important;
    height: 42px !important;
    max-height: 42px !important;
    max-width: 180px !important;
    object-fit: contain !important;
    border-radius: 6px;
    background: #ffffff;
    padding: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

.site-title-text {
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

/* =========================================================
   HOME BUTTON
   ========================================================= */
.nav-home-btn {
    background: rgba(255, 255, 255, .15);
    color: #ffffff !important;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: .2s;
}

    .nav-home-btn:hover {
        background: rgba(255, 255, 255, .30);
        transform: translateY(-1px);
    }

/* =========================================================
   USER INFO
   ========================================================= */
.user-info-badge {
    background: rgba(0, 0, 0, .20);
    border-radius: 20px;
    padding: 6px 16px;
    color: #e2e8f0;
    font-size: 14px !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* =========================================================
   FORM CONTROLS
   ========================================================= */
.form-control,
.form-select {
    min-height: 40px !important;
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 16px !important;
    color: #172b4d !important;
    background-color: #ffffff !important;
}

    .form-control::placeholder {
        color: #64748b !important;
        opacity: 1 !important;
    }

label,
.form-label {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #243b53 !important;
}

/* =========================================================
   FILTERS
   ========================================================= */
.filter-box input,
.filter-box select,
.filter-box textarea,
.filters-box input,
.filters-box select,
.filters-box textarea,
.search-box input,
.search-box select,
.search-box textarea,
.filter-panel input,
.filter-panel select,
.filter-panel textarea {
    min-height: 40px !important;
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 16px !important;
    color: #172b4d !important;
    background: #ffffff !important;
    border: 1px solid #9fb3c8 !important;
}

/* =========================================================
   SELECT2
   ========================================================= */
.select2-container .select2-selection--single {
    height: 40px !important;
    min-height: 40px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 16px !important;
    color: #172b4d !important;
    line-height: 38px !important;
}

.select2-results__option {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 16px !important;
    padding: 7px 10px !important;
}

.select2-search__field {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 16px !important;
}

/* =========================================================
   GLOBAL TABLE
   ========================================================= */
table,
table.table,
table.dataTable,
table[id^="tbl"] {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    /* =========================================================
   TABLE HEADER
   هدر بدون تغییر
   ========================================================= */
    table thead th,
    table.table thead th,
    table.dataTable thead th,
    table[id^="tbl"] thead th,
    #tblHoghgh thead th,
    .dataTables_wrapper table thead th {
        background-color: var(--table-header-bg) !important;
        color: var(--table-header-color) !important;
        font-family: 'Benyamin', Tahoma, sans-serif !important;
        font-size: 17px !important;
        font-weight: 800 !important;
        text-align: center !important;
        vertical-align: middle !important;
        padding: 14px 12px !important;
        min-height: 48px !important;
        line-height: 1.4 !important;
        border-bottom: 2px solid #829ab1 !important;
        border-left: 1px solid #b8c4d1 !important;
        white-space: nowrap !important;
    }

        table thead th:first-child {
            border-top-right-radius: 6px;
        }

        table thead th:last-child {
            border-left: none !important;
            border-top-left-radius: 6px;
        }

    /* =========================================================
   TABLE BODY
   فقط این قسمت تغییر کرده:
   font-size = 17px
   font-weight = 400
   ========================================================= */
    table tbody td,
    table.table tbody td,
    table.dataTable tbody td,
    table[id^="tbl"] tbody td,
    #tblHoghgh tbody td,
    .dataTables_wrapper table tbody td {
        background-color: #ffffff !important;
        color: var(--table-text-color) !important;
        font-family: 'Benyamin', Tahoma, sans-serif !important;
        font-size: 17px !important;
        font-weight: 400 !important;
        text-align: center !important;
        vertical-align: middle !important;
        padding: 10px 10px !important;
        line-height: 1.4 !important;
        border-bottom: 1px solid #cbd5e1 !important;
        border-left: 1px solid #cbd5e1 !important;
    }

        table tbody td:last-child {
            border-left: none !important;
        }

    /* =========================================================
   EVEN ROW & HOVER
   ========================================================= */
    table tbody tr:nth-child(even) td,
    table.table tbody tr:nth-child(even) td,
    table.dataTable tbody tr:nth-child(even) td,
    table[id^="tbl"] tbody tr:nth-child(even) td,
    #tblHoghgh tbody tr:nth-child(even) td {
        background-color: #f5f8fb !important;
        color: #172b4d !important;
    }

    table tbody tr:hover td,
    table.table tbody tr:hover td,
    table.dataTable tbody tr:hover td,
    table[id^="tbl"] tbody tr:hover td,
    #tblHoghgh tbody tr:hover td {
        background-color: #e1ebf5 !important;
        color: #102a43 !important;
    }

    /* =========================================================
   تمام محتویات داخل سلول
   فقط متن معمولی جدول از Bold خارج شده
   ========================================================= */
    table tbody td span,
    table tbody td div,
    table tbody td a,
    table tbody td strong,
    table tbody td label,
    table tbody td p,
    table.table tbody td span,
    table.table tbody td div,
    table.table tbody td a,
    table.table tbody td strong,
    table.table tbody td label,
    table.dataTable tbody td span,
    table.dataTable tbody td div,
    table.dataTable tbody td a,
    table.dataTable tbody td strong,
    table.dataTable tbody td label {
        font-family: 'Benyamin', Tahoma, sans-serif !important;
        font-size: 17px !important;
        font-weight: 400 !important;
        color: inherit !important;
    }

    /* =========================================================
   لینک داخل جدول
   ========================================================= */
    table tbody td a {
        color: #1554a5 !important;
        font-weight: 400 !important;
        text-decoration: none !important;
    }

        table tbody td a:hover {
            color: #0b3d91 !important;
            text-decoration: underline !important;
        }

    /* =========================================================
   BADGE داخل جدول
   ========================================================= */
    table tbody td .badge {
        font-family: 'Benyamin', Tahoma, sans-serif !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        padding: 5px 10px !important;
    }

    /* =========================================================
   INPUT / SELECT داخل جدول
   ========================================================= */
    table tbody td input,
    table tbody td select,
    table tbody td textarea {
        font-family: 'Benyamin', Tahoma, sans-serif !important;
        font-size: 15px !important;
        color: #172b4d !important;
        background: #ffffff !important;
    }

/* =========================================================
   DATATABLE
   ========================================================= */
.dataTables_wrapper {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 16px !important;
    color: #172b4d !important;
}

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        font-family: 'Benyamin', Tahoma, sans-serif !important;
        font-size: 15px !important;
        color: #243b53 !important;
    }

        .dataTables_wrapper .dataTables_filter input,
        .dataTables_wrapper .dataTables_length select {
            font-family: 'Benyamin', Tahoma, sans-serif !important;
            font-size: 15px !important;
            min-height: 36px !important;
            color: #172b4d !important;
        }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    min-height: 38px;
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    border-radius: 7px !important;
    white-space: nowrap;
}

.btn-sm {
    min-height: 34px !important;
    font-size: 14px !important;
}

.btn i,
.btn .fa,
.btn .fas,
.btn .far,
.btn .bi {
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* =========================================================
   دکمه‌های عملیات جدول
   ========================================================= */
table td .btn-operation,
table td .operation-btn,
table td .action-btn,
table td .btn-action,
td.actions .btn,
td.operation .btn,
td.operations .btn,
td.actions-cell .btn,
td.operation-cell .btn {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    margin: 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

    td.actions .btn span,
    td.operation .btn span,
    td.operations .btn span,
    td.actions-cell .btn span,
    td.operation-cell .btn span {
        display: none !important;
    }

    table td .btn-operation i,
    table td .operation-btn i,
    table td .action-btn i,
    table td .btn-action i,
    td.actions .btn i,
    td.operation .btn i,
    td.operations .btn i,
    td.actions-cell .btn i,
    td.operation-cell .btn i {
        font-size: 15px !important;
        margin: 0 !important;
    }

/* =========================================================
   CARD
   ========================================================= */
.card {
    border-radius: 9px;
}

.card-header {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 17px;
    font-weight: 800;
}

.card-body {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 16px;
}

.card-header i,
.card-title i,
h1 i,
h2 i,
h3 i,
h4 i,
h5 i {
    margin-left: 6px;
    vertical-align: -2px;
}

.badge {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
}

.alert {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 15px;
}

.pagination .page-link {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 15px !important;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   MODAL HEADER & CLOSE BUTTON
   ========================================================= */
.modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 1rem 1.25rem !important;
}

.modal-title {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 18px;
    font-weight: 800;
    margin: 0 !important;
}

.modal-body {
    font-family: 'Benyamin', Tahoma, sans-serif !important;
    font-size: 16px;
}

.modal-header .btn-close,
.modal-header .close {
    margin: 0 !important;
    padding: 0.4rem 0.6rem !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    opacity: 0.9 !important;
    font-size: 1.2rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
}

.modal-header .btn-close {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 1 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 1rem !important;
    width: 32px !important;
    height: 32px !important;
}

    .modal-header .btn-close:hover,
    .modal-header .close:hover {
        background-color: rgba(239, 68, 68, 0.9) !important;
        color: #ffffff !important;
        opacity: 1 !important;
        transform: scale(1.05);
    }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {

    body {
        font-size: 14px;
    }

    .site-title-text {
        font-size: 15px !important;
    }

    .nav-home-btn {
        padding: 6px 10px;
        font-size: 13px !important;
    }

    .user-info-badge {
        padding: 5px 10px;
        font-size: 12px !important;
    }

    .site-logo-img {
        height: 38px !important;
        max-height: 38px !important;
    }

    table thead th,
    table.table thead th,
    table.dataTable thead th {
        font-size: 15px !important;
        padding: 10px 6px !important;
    }

    /* متن دیتاگرید در موبایل */
    table tbody td,
    table.table tbody td,
    table.dataTable tbody td {
        font-size: 16px !important;
        font-weight: 400 !important;
        padding: 8px 6px !important;
    }

        table tbody td span,
        table tbody td div,
        table tbody td a,
        table tbody td strong {
            font-size: 16px !important;
            font-weight: 400 !important;
        }
}

/* =========================================================
   PRINT
   ========================================================= */
@media print {

    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    body * {
        visibility: hidden;
    }

    .no-print,
    nav,
    .app-navbar,
    .btn {
        display: none !important;
    }

    .print-container,
    .print-container * {
        visibility: visible;
    }

    .print-container {
        display: block !important;
        position: absolute;
        right: 0;
        top: 0;
        width: 100% !important;
    }
}
