body,
.wrapper,
.btn,
input,
textarea,
select,
.form-control,
.sidebar-menu,
.box,
h1, h2, h3, h4, h5, h6,
.login-box-msg,
table {
    font-family: 'Vazir', Tahoma, Arial, sans-serif;
}

body {
    background-color: #eef1f5;
}

.sidebar-unread-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 21px;
    height: 21px;
    margin-right: auto;
    padding: 0 6px;
    border-radius: 10px;
    color: #fff;
    background: #dd4b39;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}
.sidebar-unread-count[hidden] { display: none !important; }

html {
    scroll-behavior: smooth;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #3e5266 #2c3e50;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #2c3e50;
}

::-webkit-scrollbar-thumb {
    background-color: #3e5266;
    background-clip: padding-box;
    border-radius: 20px;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #3c8dbc;
    background-clip: padding-box;
}

.box,
.small-box,
.login-box-body {
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border-top: none;
}

.box-header.with-border {
    border-bottom: 1px solid #eef1f5;
}

.box-header .box-title {
    font-weight: 600;
}

.small-box {
    overflow: hidden;
}

.small-box > .inner {
    padding: 20px;
    min-height: 90px;
}

.small-box h3 {
    font-weight: 700;
}

.small-box .icon {
    color: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.small-box.bg-aqua { background-color: #3c8dbc !important; }
.small-box.bg-green { background-color: #00a65a !important; }
.small-box.bg-yellow { background-color: #f39c12 !important; }
.small-box.bg-red { background-color: #d9534f !important; }

.btn,
.btn-flat,
.form-control,
.input-group-addon {
    border-radius: 5px !important;
}

.btn-primary {
    background-color: #3c8dbc;
    border-color: #367fa9;
}

.main-sidebar {
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.08);
}

.main-sidebar .sidebar {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    padding-bottom: 14px;
}

.sidebar-user-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 17px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #dce7eb;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    font-size: 14px;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-name {
    display: block;
    color: #fff;
    font-weight: 600;
}

.sidebar-user-role {
    display: block;
    color: #8aa4af;
    font-size: 12px;
    margin-top: 4px;
}

.sidebar-logout-form {
    margin-top: auto;
    padding: 12px 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    margin: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e6e6e6;
    font-size: 12px;
    padding: 9px 11px;
    border-radius: 4px;
    cursor: pointer;
}

.sidebar-logout-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.sidebar-navigation {
    padding-top: 12px;
}

.sidebar-section-title {
    display: block;
    padding: 10px 16px 6px;
    color: #7f969f;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2px;
}

.sidebar-menu {
    margin: 0 !important;
}

.sidebar-menu > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1px 8px;
    padding: 11px 12px;
    border-radius: 4px;
    color: #c5d2d7;
    transition: background .15s ease, color .15s ease;
}

.sidebar-menu > li > a > .fa {
    width: 16px;
    color: #9bb0b9;
    font-size: 14px;
    text-align: center;
}

.sidebar-menu > li > a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-menu > li.active > a {
    color: #fff;
    background: rgba(60, 141, 188, 0.2);
    border-right: 3px solid #3c8dbc;
}

.sidebar-menu > li.active > a > .fa {
    color: #77b8dd;
}

.sidebar-menu > li > a.sidebar-analysis-trigger { position:relative; padding-left:34px; }
.sidebar-menu > li > a > .sidebar-analysis-arrow {
    position:absolute;
    top:50%;
    left:12px;
    margin:0;
    transform:translateY(-50%);
}
.sidebar-analysis-popover {
    position:fixed;
    inset:auto;
    margin:0;
    width:136px;
    padding:5px;
    border:1px solid #dfe8ec;
    border-radius:6px;
    background:#fff;
    box-shadow:0 6px 18px rgba(30,55,70,.2);
    direction:rtl;
}
.sidebar-analysis-popover a { display:flex; align-items:center; gap:8px; padding:8px 10px; color:#465863; font-size:12px; border-radius:4px; }
.sidebar-analysis-popover a:is(:hover, :focus-visible, .active) { background:#edf6fb; color:#25729e; }


.main-header .navbar-utilities {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    direction: ltr;
    margin: 0;
}

.main-header .navbar-utilities > li { direction:rtl; }

.main-header .navbar-utilities > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    min-width: 36px;
    padding: 0 10px;
    font-size: 13px;
}

.navbar-custom-menu .notifications-menu > .dropdown-toggle .fa-bell-o {
    font-size: 13px;
}

@media (min-width: 768px) {
    .sidebar-toggle {
        display: none;
    }

    .sidebar-collapse .main-sidebar {
        -webkit-transform: translate(0, 0) !important;
        -ms-transform: translate(0, 0) !important;
        transform: translate(0, 0) !important;
    }

    .sidebar-collapse .content-wrapper,
    .sidebar-collapse .main-footer {
        margin-right: 230px !important;
    }

    .main-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        overflow-y: auto;
    }

    .main-header {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 1030;
    }

    .content-wrapper {
        padding-top: 50px;
        min-height: calc(100vh - 50px) !important;
    }

    .wrapper {
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: visible !important;
    }
}

.skin-blue .main-header .logo,
.skin-blue .main-header .navbar {
    background-color: #2c3e50;
}

.skin-blue .main-header .logo:hover {
    background-color: #263544;
}

.main-header .logo .logo-lg b { font-size: 16px; font-weight: 600; }

.table > thead > tr > th {
    border-bottom: 2px solid #eef1f5;
    font-weight: 600;
}

.box .table {
    margin-bottom: 0;
}

.dataTables_wrapper {
    padding-top: 10px;
    color: #718088;
    font-size: 11px;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
    margin-bottom: 10px;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
    color: #718088;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    height: 31px;
    margin-right: 6px;
    padding: 5px 9px;
    color: #4f5e67;
    background: #fff;
    border: 1px solid #dbe5e9;
    border-radius: 4px;
    outline: 0;
    box-shadow: none;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: #8bc1dc;
    box-shadow: 0 0 0 2px rgba(60, 141, 188, .08);
}

.dataTables_wrapper .pagination > li > a {
    margin: 0 2px;
    color: #5c6a72;
    border: 1px solid #e0e8eb;
    border-radius: 3px;
}

.dataTables_wrapper .pagination > .active > a,
.dataTables_wrapper .pagination > .active > a:hover {
    color: #fff;
    background: #3c8dbc;
    border-color: #3c8dbc;
}

body.login-page {
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.login-page {
    background-color: #2c3e50;
}

.login-page .login-box {
    margin: 8vh 0 0;
}

.login-box-body {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.login-logo img {
    max-width: 170px;
    width: 100%;
}

.form-group span.text-danger,
.form-group .field-validation-error {
    font-size: 12px;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
    margin-bottom: 10px;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_paginate {
    text-align: left;
}

.alert-dismissible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 18px;
}

.alert-message {
    flex: 1;
}

.alert-dismissible .close {
    float: none;
    position: static;
    flex-shrink: 0;
    margin: 0;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 18px;
    line-height: 1;
    text-shadow: none;
    opacity: 0.6;
}

.alert-dismissible .close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.15);
}

.main-header .navbar-utilities > .navbar-datetime {
    display: flex;
    align-items: center;
    height: 50px;
    padding: 0 8px 0 12px;
}

.navbar-clock {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    white-space: nowrap;
    line-height: 1;
    direction: ltr;
}

.navbar-calendar-icon { position:relative; display:inline-flex; align-items:center; }
.main-header .navbar-utilities .calendar-due-badge {
    position:absolute;
    top:-6px;
    right:-7px;
    width:12px;
    height:12px;
    border-radius:50%;
    background:#ffc66a;
    color:#2c3e50;
    font-size:9px;
    font-weight:700;
    line-height:12px;
    text-align:center;
}
.main-header .navbar-utilities .calendar-due-badge[hidden] { display:none; }
.navbar-clock time { padding-left:6px; border-left:1px solid rgba(255,255,255,.2); font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; }
.navbar-clock #navbarDate { color:#d6e1e8; font-size:12px; }

.employee-role-select {
    height: 38px !important;
    padding: 8px 12px !important;
    line-height: 20px !important;
    direction: rtl;
    background-color: #fff !important;
}

.gantt-chart {
    overflow: hidden;
}

.gantt-row {
    display: flex;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f4f4f4;
}

.gantt-row:last-child {
    border-bottom: none;
}

.gantt-label {
    width: 32%;
    flex-shrink: 0;
    font-size: 12px;
    padding-left: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-track {
    flex: 1;
    min-width: 0;
    position: relative;
}

.gantt-track {
    height: 18px;
    background: #f4f4f4;
    border-radius: 3px;
}

.gantt-bar {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 3px;
    overflow: hidden;
}

.gantt-bar.gantt-success { background-color: #00a65a; }
.gantt-bar.gantt-danger { background-color: #dd4b39; }
.gantt-bar.gantt-info { background-color: #3c8dbc; }

.gantt-progress {
    height: 100%;
    background: rgba(255, 255, 255, 0.45);
}

.kpi-row {
    display: flex;
    flex-wrap: wrap;
}

.kpi-row > [class*="col-"] {
    display: flex;
    margin-bottom: 15px;
}

.kpi-row > [class*="col-"] > .small-box {
    width: 100%;
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .gantt-row {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 0;
    }

    .gantt-label {
        width: 100%;
        flex-shrink: initial;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
        padding-left: 0;
        padding-bottom: 6px;
        font-weight: 600;
    }

    .gantt-track {
        flex: none;
        min-width: 0;
        width: 100%;
        height: 18px;
    }
}

.pc-upload-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pc-upload-form input[type="file"] {
    flex: 1;
    min-width: 220px;
}

.pc-fixed-table {
    width: 100% !important;
    min-width: 720px;
    table-layout: fixed;
}

.pc-fixed-table td,
.pc-fixed-table th {
    word-wrap: break-word;
    vertical-align: middle;
}

.pc-meta-info p {
    line-height: 1.9;
    margin-bottom: 12px;
}

.pc-meta-info strong {
    margin-left: 6px;
}

.pc-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 32px;
}

.callout > strong:first-child {
    display: block;
    margin-bottom: 8px;
}

.callout p {
    line-height: 1.9;
    margin: 0;
}

.announcement-card {
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    align-items: flex-start;
}

.announcement-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    background: #3c8dbc;
}

.announcement-card.is-new .announcement-icon {
    background: #00c0ef;
}

.announcement-body {
    flex: 1;
    min-width: 0;
}

.announcement-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
}

.announcement-meta {
    color: #999;
    font-size: 12px;
    margin-bottom: 14px;
}

.announcement-meta i {
    margin-left: 4px;
}

.announcement-meta i:not(:first-child) {
    margin-right: 16px;
}

.announcement-content {
    white-space: pre-wrap;
    line-height: 1.9;
    margin: 0;
}

.ai-chat-messages {
    height: 320px;
    overflow-y: auto;
    padding: 5px;
    scrollbar-width: none;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.ai-chat-msg {
    max-width: 85%;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    line-height: 1.7;
    font-size: 13px;
    white-space: pre-wrap;
}

.ai-chat-msg-user {
    margin-right: auto;
    margin-left: 0;
    background: #3c8dbc;
    color: #fff;
}

.ai-chat-msg-assistant {
    margin-left: auto;
    margin-right: 0;
    background: #f4f4f4;
    color: #333;
}

.ai-chat-msg-error {
    background: #f2dede;
    color: #a94442;
}

.ai-chat-use-btn {
    margin-top: 6px;
}

.ai-chat-input-row {
    display: flex;
    gap: 8px;
}

.ai-chat-input-row input {
    flex: 1;
}

.ai-chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
}

.ai-chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    animation: ai-chat-typing-bounce 1.2s infinite ease-in-out;
}

.ai-chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ai-chat-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.ai-chat-mic-active {
    background-color: #dd4b39;
    border-color: #d73925;
    color: #fff;
    animation: ai-chat-mic-pulse 1.2s infinite;
}

@keyframes ai-chat-mic-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(221, 75, 57, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(221, 75, 57, 0);
    }
}
.modal,
.modal .modal-dialog *,
.modal .modal-dialog .modal-body {
    scrollbar-width: thin;
    scrollbar-color: #b8cbd3 transparent;
}

.modal::-webkit-scrollbar,
.modal .modal-dialog ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.modal::-webkit-scrollbar-track,
.modal .modal-dialog ::-webkit-scrollbar-track {
    background: transparent;
}

.modal::-webkit-scrollbar-thumb,
.modal .modal-dialog ::-webkit-scrollbar-thumb {
    background: #bfced4;
    border: 0;
    border-radius: 10px;
}

.modal::-webkit-scrollbar-thumb:hover,
.modal .modal-dialog ::-webkit-scrollbar-thumb:hover {
    background: #90b6c6;
}

form .field-validation-error {
    display: block;
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.7;
}
