:root {
    --font-sans-fa: "Vazirmatn", "Shabnam", "Tahoma", "Segoe UI", sans-serif;
    --font-display-fa: "Sahel", "Vazirmatn", "Shabnam", "Tahoma", "Segoe UI", sans-serif;
    --font-ui-fa: "Shabnam", "Vazirmatn", "Tahoma", "Segoe UI", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

body {
    background-color: #f8f9fa;
    font-family: var(--font-sans-fa);
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand {
    font-family: var(--font-display-fa);
    letter-spacing: -0.02em;
}

.font-sans-fa { font-family: var(--font-sans-fa) !important; }
.font-display-fa { font-family: var(--font-display-fa) !important; }
.font-ui-fa { font-family: var(--font-ui-fa) !important; }
.lh-fa { line-height: 1.9; }
.pre-wrap { white-space: pre-wrap; }

.ai-insight-note { font-family: var(--font-ui-fa) !important; }
.ai-insight-text {
    white-space: pre-wrap;
    font-family: var(--font-sans-fa) !important;
    line-height: 2;
}

.form-control, .form-select, .form-label, .btn {
    font-family: inherit;
}

.bg-teal {
    background-color: #20c997 !important;
}

#sidebar {
    transition: all 0.3s ease;
}

/* 🔹 حالت دسکتاپ: سایدبار ثابت در کنار محتوا */
@media (min-width: 768px) {
    #sidebar {
        width: 270px;
    }
}

.nav-link:hover {
    background-color: #e6f7f1;
    border-radius: 8px;
}

.footer {
    background-color: #f1fdfb;
    color: #555;
}

/* 🔹 زیباسازی کلی کارت و فرم */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-radius: 1rem 1rem 0 0 !important;
}

.form-label {
    color: #0d6efd;
    font-weight: 600;
}

/* 🔹 فاصله بین فیلدها */
.form-group {
    margin-bottom: 1.5rem;
}

/* 🔹 ظاهر nicer برای دکمه‌ها */
.btn {
    border-radius: 0.5rem;
    font-weight: 600;
}

/* 🔹 جهت‌نمایی تقویم */
.password-toggle-btn {
    min-width: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn .bi {
    font-size: 1.1rem;
    line-height: 1;
}

.pwt-datepicker-container {
    z-index: 1055 !important;
}

/* 🔹 فیلد آپلود فایل زیبا */
.custom-file-input {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 45px;
    cursor: pointer;
}

.custom-file-input input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.custom-file-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    transition: 0.3s;
}

.custom-file-label:hover {
    background-color: #eef3ff;
    border-color: #0d6efd;
}

.custom-file-label .file-name {
    color: #6c757d;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-file-label .upload-btn {
    background-color: #0d6efd;
    color: #fff;
    border-radius: 0.4rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    transition: 0.3s;
}

.custom-file-label .upload-btn:hover {
    background-color: #0b5ed7;
}

.file-picker .custom-file-input {
    height: auto;
    min-height: 45px;
}

.file-picker .custom-file-label {
    min-height: 45px;
    flex-wrap: wrap;
    gap: .5rem;
}

.file-picker .file-summary {
    flex: 1 1 100%;
    order: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-picker .hover-card {
    border: 1px dashed #cfd8dc;
    border-radius: 10px;
    transition: all .2s ease;
}

.file-picker .hover-card:hover {
    border-color: #0d6efd;
    background: #f8faff;
    box-shadow: 0 6px 18px -12px rgba(13, 110, 253, 0.45);
}

.selected-files-panel {
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    background: #f8faff;
    padding: .75rem;
}

.selected-file-item {
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    background: #fff;
    padding: .6rem .75rem;
}

.selected-file-name {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-thumb {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    flex: 0 0 auto;
}

@media (min-width: 768px) {
    .file-picker .custom-file-label {
        flex-wrap: nowrap;
    }

    .file-picker .file-summary {
        flex: 0 1 auto;
        order: initial;
    }
}


.medical-edit .form-control-lg {
    min-height: 48px;
}

.medical-edit .hover-card {
    border: 1px dashed #cfd8dc;
    border-radius: 10px;
    transition: all .2s ease;
}

.medical-edit .hover-card:hover {
    border-color: #0d6efd;
    background: #f8faff;
    box-shadow: 0 6px 18px -12px rgba(13, 110, 253, 0.45);
}

#filesContainer .file-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    transition: all .15s ease;
    background: #fff;
    cursor: pointer;
}

#filesContainer .file-card:hover {
    border-color: #0d6efd33;
    box-shadow: 0 4px 14px -10px rgba(0, 0, 0, .35);
}

#filesContainer .file-name {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .medical-edit .btn {
        width: 100%;
    }
}

