/* ═══════════════════════════════════════════════════
    panel_style.css - Glassmorphism واقعی (iOS 17)
   ═══════════════════════════════════════════════════ */

:root {
    --primary-gradient-start: #6366f1;
    --primary-gradient-end: #8b5cf6;
    --primary-color: #6366f1;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --glass-bg: rgba(255, 255, 255, 0.18);
    --glass-border: rgba(255, 255, 255, 0.35);
}

/* ══════════════════════════════════════════════════
   شفاف‌سازی کامل کانتینرها
   ══════════════════════════════════════════════════ */


.dashboard-container {
    min-height: 100vh;
    padding: 1rem 1.5rem;
}

/* ══════════════════════════════════════════════════
   کارت شیشه‌ای iOS 17 (فقط کارت اصلی blur داره)
   ══════════════════════════════════════════════════ */
.card {
    /* position: relative; */
    background: rgba(255, 255, 255, 0.2) !important;
    /* backdrop-filter: blur(24px) saturate(180%) !important; */
    /* -webkit-backdrop-filter: blur(24px) saturate(180%) !important; */
    border-radius: 28px !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    /* overflow: visible; */
    /* transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); */
    /* position: relative; */
    z-index: 1;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 28px 28px 0 0;
    pointer-events: none;
    z-index: 0;
}

.card:hover {
    /* transform: translateY(-8px) scale(1.01); */
    background: rgba(255, 255, 255, 0.2) !important;
    /* border-color: rgba(255, 255, 255, 0.5) !important; */
    box-shadow: 
        0 20px 48px rgba(31, 38, 135, 0.18),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

/* ══════════════════════════════════════════════════
   بدنه و فوتر کارت - کاملاً شفاف
   ══════════════════════════════════════════════════ */
.card-body,
.card-body.shadow,
.card-footer,
.card-header {
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
    position: relative;
    z-index: 2;
}

.card-body {
    background: rgba(255, 255, 255, 0.2) !important;
    padding: 1.75rem !important;
    
}

.card-footer {
    background: rgba(255, 255, 255, 0.2) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 1.25rem 1.75rem !important;
}

/* ══════════════════════════════════════════════════
   متن‌ها - تیره و خوانا با سایه نرم
   ══════════════════════════════════════════════════ */
.card,
.card *,
.card-title,
.card-text,
.card-body,
.card-body *,
.card-footer,
.card-footer * {
    
    color: var(--text-primary) !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.12);
    /* background: none !important; */
    -webkit-text-fill-color: var(--text-primary) !important;
}

/* ══════════════════════════════════════════════════
   دکمه‌های داخل کارت
   ══════════════════════════════════════════════════ */
.card-footer .btn-outline-primary {
    background: rgba(255, 255, 255, 0.25) !important;
    /* backdrop-filter: blur(8px); */
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    color: var(--text-primary) !important;
    border-radius: 40px !important;
    padding: 0.625rem 1.5rem !important;
    font-weight: 600;
    /* transition: all 0.25s; */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15)
}

.card-footer .btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end)) !important;
    /* border-color: transparent !important; */
    color: white !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    color: var(--text-primary) !important;
    border-radius: 40px !important;
    font-weight: 600;
    /* transition: all 0.25s; */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15)
}

/* ══════════════════════════════════════════════════
   دکمه تنظیمات بالای صفحه
   ══════════════════════════════════════════════════ */
.btn-outline-secondary {
    background: rgba(255, 255, 255, 0.2) !important;
    /* backdrop-filter: blur(5px); */
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    color: var(--text-primary) !important;
    border-radius: 40px !important;
    padding: 0.625rem 1.5rem !important;
    font-weight: 600;
    /* transition: all 0.25s; */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15)
}

.btn-outline-secondary:hover {
    /* background: rgba(255, 255, 255, 0.35) !important; */
    /* transform: scale(1.04); */
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15)
}

.btn-outline-primary {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    color: var(--text-primary) !important;
    border-radius: 40px !important;
    padding: 0.625rem 1.5rem !important;
    font-weight: 600;
    /* transition: all 0.25s; */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15)
}

.btn-outline-primary:hover {
    /* transform: scale(1.04); */
    border-color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15)
    /* یا گرادیان دلخواه */
}

/* ══════════════════════════════════════════════════
   پیام خالی
   ══════════════════════════════════════════════════ */
.text-muted.text-center {
    /* background: rgba(255, 255, 255, 0.2) !important; */
    /* backdrop-filter: blur(20px); */
    border-radius: 28px;
    padding: 2.5rem;
    color: var(--text-secondary) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ══════════════════════════════════════════════════
   مودال تنظیمات
   ══════════════════════════════════════════════════ */
.modal-content {
    background: rgba(255, 255, 255, 0.85) !important;
    /* backdrop-filter: blur(24px) saturate(180%); */
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end)) !important;
    border-bottom: none;
    border-radius: 28px 28px 0 0;
    padding: 1.5rem 2rem;
}

.modal-title {
    color: white !important;
    font-weight: 600;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.modal-body {
    /* background: transparent !important; */
    padding: 2rem;
}

.modal-body .text-muted {
    background: rgba(99, 102, 241, 0.08);
    border-right: 3px solid var(--primary-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: var(--text-secondary) !important;
}

.list-group {
    /* background: transparent !important; */
    border-radius: 16px;
}

.list-group-item {
    background: rgba(255, 255, 255, 0.4) !important;
    /* backdrop-filter: blur(8px); */
    border: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    padding: 1.25rem 1.5rem !important;
    color: var(--text-primary) !important;
    /* transition: all 0.2s; */
}

.list-group-item:first-child {
    border-radius: 16px 16px 0 0;
}

.list-group-item:last-child {
    border-radius: 0 0 16px 16px;
    border-bottom: none !important;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.6) !important;
    /* transform: translateX(-6px); */
}

.cursor-grab {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.form-switch .form-check-input {
    width: 48px !important;
    height: 26px !important;
    background-color: rgba(0, 0, 0, 0.15) !important;
    border: 1.5px solid rgba(0, 0, 0, 0.2) !important;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.modal-footer {
    background: rgba(0, 0, 0, 0.02) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.25rem 2rem;
}

.modal-footer .btn-secondary {
    background: rgba(0, 0, 0, 0.08) !important;
    border: none;
    color: var(--text-primary) !important;
    border-radius: 40px;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end)) !important;
    border: none;
    border-radius: 40px;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ══════════════════════════════════════════════════
   انیمیشن ورود کارت‌ها
   ══════════════════════════════════════════════════ */
/* @keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
} */

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }

/* ══════════════════════════════════════════════════
   Sortable
   ══════════════════════════════════════════════════ */
.sortable-ghost {
    opacity: 0.3;
    background: rgba(99, 102, 241, 0.15) !important;
}

.sortable-drag {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    /* transform: rotate(2deg); */
}

/* ══════════════════════════════════════════════════
   ریسپانسیو
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 0.875rem;
    }
    .card-body {
        padding: 1.25rem !important;
    }
    .card-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 576px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 24px !important;
    }
    .modal-dialog {
        margin: 1rem;
    }
}

/* ══════════════════════════════════════════════════
   استایل کشویی (Select) به سبک شیشه‌ای
   ══════════════════════════════════════════════════ */
select.form-select,
select.glass-select {
    background: rgba(255, 255, 255, 0.2) !important;
    /* backdrop-filter: blur(4px); */
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 20px !important; /* گردی کمتر از دکمه‌ها برای زیبایی */
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.625rem 1.5rem !important;
    /* transition: all 0.25s ease; */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

/* افکت hover روی سلکت */
select.form-select:hover,
select.glass-select:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    /* transform: translateY(-1px); */
}

/* افکت focus (وقتی کلیک می‌شود) */
select.form-select:focus,
select.glass-select:focus {
    background: rgba(255, 255, 255, 0.592) !important;
    border-color: var(--primary-gradient-end, #a855f7) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* استایل آپشن‌ها (گزینه‌های داخل کشویی) */
select.form-select option,
select.glass-select option {
    background: #55559c; /* پس‌زمینه تیره برای آپشن‌ها - متناسب با تم شما */
    color: #f0f0f0 !important;
    padding: 12px;
}

/* ══════════════════════════════════════════════════
   استایل تکست‌اریا (Textarea) به سبک شیشه‌ای
   ══════════════════════════════════════════════════ */
textarea.form-control,
textarea.glass-textarea {
    background: rgba(255, 255, 255, 0.2) !important;
    /* backdrop-filter: blur(4px); */
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 20px !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.75rem 1.5rem !important;
    /* transition: all 0.25s ease; */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    resize: vertical; /* کاربر می‌تواند ارتفاع را تغییر دهد */
    min-height: 100px;
}

/* افکت hover روی تکست‌اریا */
textarea.form-control:hover,
textarea.glass-textarea:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* افکت focus روی تکست‌اریا */
textarea.form-control:focus,
textarea.glass-textarea:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: var(--primary-gradient-end, #a855f7) !important;
    outline: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* استایل placeholder (متن راهنما) */
textarea.form-control::placeholder,
select.form-select::placeholder {
    color: rgba(var(--text-primary-rgb, 255, 255, 255), 0.6);
    font-weight: 400;
}

/* ══════════════════════════════════════════════════
   استایل سراسری برای تمام ورودی‌های متنی
   ══════════════════════════════════════════════════ */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
textarea.form-control,
select.form-select {
    background: rgba(255, 255, 255, 0.2) !important;
    /* backdrop-filter: blur(4px); */
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 20px !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.625rem 1.5rem !important;
    /* transition: all 0.25s ease; */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    width: 100%;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):hover,
textarea.form-control:hover,
select.form-select:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    /* transform: translateY(-1px); */
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):focus,
textarea.form-control:focus,
select.form-select:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: var(--primary-gradient-end, #a855f7) !important;
    outline: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* اضافه کردن سایه داخلی به ورودی‌ها */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
textarea.form-control,
select.form-select {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    /* سایه داخلی ملایم + سایه بیرونی قبل */
}

/* ویجت پولی (SmartMoneyWidget) - نمایش در کنار هم */
.smart-money-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.smart-money-widget input.smart-money-input {
    flex: 1;
    width: auto !important; /* override width:100% از قانون سراسری */
}

.smart-money-widget .currency-unit {
    background: rgba(255, 255, 255, 0.2);
    /* backdrop-filter: blur(4px); */
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 40px;
    padding: 0.625rem 1.2rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.95rem;
}

/* ===== استایل پایه تمام اینپوت‌ها با سایه داخلی ===== */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
textarea.form-control,
select.form-select {
    background: rgba(255, 255, 255, 0.2) !important;
    /* backdrop-filter: blur(4px); */
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 20px !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.625rem 1.5rem !important;
    /* transition: all 0.25s ease; */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    width: 100%;
}

/* ===== رفع مشکل input-group (ویجت پولی و هر جای دیگه) ===== */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group input {
    width: auto !important;
    flex: 1;
    border-top-left-radius: 20px !important;
    border-bottom-left-radius: 20px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.2) !important;
    /* backdrop-filter: blur(4px); */
    border: 1.5px solid rgb(255, 0, 0) !important;
    border-radius: 40px !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.625rem 1.2rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 40px !important;
    border-bottom-right-radius: 40px !important;
    white-space: nowrap;
}

/* ===== هاور و فوکوس اینپوت‌ها (همون قبلی) ===== */
input:not([type="checkbox"]):not([type="radio"]):hover,
textarea.form-control:hover,
select.form-select:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    /* transform: translateY(-1px); */
}

input:not([type="checkbox"]):focus,
textarea.form-control:focus,
select.form-select:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: var(--primary-gradient-end, #a855f7) !important;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* بازگرداندن استایل شیشه‌ای به واحد پول (لغو bg-light بوت‌استرپ) */
.input-group-text.bg-light,
.input-group-text {
    background: rgba(255, 255, 255, 0.2) !important;
    /* backdrop-filter: blur(4px) !important; */
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 40px !important;
    color: var(--text-primary) !important;
    font-weight: 500 !important;
    padding: 0.625rem 1.2rem !important;
    /* حذف border-radius سمت چپ برای چسبیدن به اینپوت */
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 40px !important;
    border-bottom-right-radius: 40px !important;
    /* حذف سایه داخلی (نیازی نیست) */
    box-shadow: none !important;
}

/* همچنین متن واحد پول باید خوانا باشد */
.input-group-text.bg-light.text-secondary {
    color: var(--text-primary) !important; /* لغو text-secondary */
}

.text-danger {
    color: maroon !important;
}

/* ══════════════════════════════════════════════════
   استایل Select2 به سبک شیشه‌ای (هماهنگ با glass-select)
   ══════════════════════════════════════════════════ */

/* کانتینر اصلی Select2 */
.select2-container--default .select2-selection--single {
    background: rgba(255, 255, 255, 0.2) !important;
    /* backdrop-filter: blur(4px); */
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 20px !important;
    height: auto !important;
    padding: 0.625rem 1.5rem !important;
    /* transition: all 0.25s ease; */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

/* متن انتخاب‌شده */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary, #f0f0f0) !important;
    font-weight: 500;
    line-height: normal !important;
    padding: 0 !important;
}

/* جای خالی placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* فلش پیش‌فرض را مخفی می‌کنیم و فلش خودمان را می‌سازیم (اختیاری) */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    right: 12px !important;
}

/* .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: rgba(255, 255, 255, 0.8) transparent transparent transparent !important;
} */

/* حالت Hover */
.select2-container--default .select2-selection--single:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    /* transform: translateY(-1px); */
}

/* حالت Focus (وقتی باز است) */
.select2-container--default.select2-container--open .select2-selection--single {
    background: rgba(255, 255, 255, 0.592) !important;
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* لیست کشویی (dropdown) */
.select2-dropdown {
    background: rgba(30, 30, 60, 0.95) !important;
    /* backdrop-filter: blur(8px); */
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
    /* overflow: hidden; */
}

/* آیتم‌های داخل لیست */
.select2-results__option {
    color: #f0f0f0 !important;
    padding: 10px 16px !important;
    /* background: transparent !important; */
    /* transition: all 0.15s; */
}

/* hover روی آیتم */
.select2-results__option--highlighted {
    background: rgba(168, 85, 247, 0.4) !important;
    color: white !important;
}

/* آیتم انتخاب‌شده */
.select2-results__option[aria-selected="true"] {
    background: rgba(168, 85, 247, 0.6) !important;
    color: white !important;
}

/* نوار جستجو (اگر از جستجو استفاده می‌کنید) */
.select2-search--dropdown .select2-search__field {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 40px !important;
    color: #f0f0f0 !important;
    padding: 8px 12px !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #a855f7 !important;
    outline: none;
}


/* ══════════════════════════════════════════════════
   iOS Glass Table Style
   ══════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════
   iOS Glass Table Style - اصلاح شده نهایی (بدون باگ ریسپانسیو)
   ══════════════════════════════════════════════════ */

/* کانتینر جدول – درست مثل بوت‌استرپ، اسکرول فقط داخل */
.table-responsive {
    overflow-x: auto !important;
    border-radius: 24px;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* خود جدول – دیگر بیرون نمی‌زند */
table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.4) !important;
    border-radius: 24px !important;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 32px rgba(31,38,135,0.15), inset 0 1px 0 rgba(255,255,255,0.6) !important;
}

/* هدر جدول (فقط در دسکتاپ دیده می‌شود) */
table thead th {
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    padding: 0.9rem 1.2rem !important;
    border-bottom: 1px solid rgba(30,41,59,0.15) !important;
    text-align: right !important;
    background: rgba(255,255,255,0.15) !important;
}
table thead th:first-child { border-top-right-radius: 24px !important; }
table thead th:last-child { border-top-left-radius: 24px !important; }

/* سلول‌های بدنه */
table tbody tr {
    background: rgba(255, 255, 255, 0.2) !important;
    transition: all 0.2s ease;
}
table tbody tr:hover {
    background: rgba(255,255,255,0.35) !important;
}
table td {
    padding: 0.85rem 1.2rem !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid rgba(30,41,59,0.1) !important;
    font-weight: 500;
}
table tbody tr:last-child td {
    border-bottom: none !important;
}

/* ══════════════════════════════════════════════════
   ★ موبایل: هر ردیف به کارت تبدیل می‌شود (چیدمان افقی) ★
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* هدر اصلی جدول مخفی شود */
    .table-responsive table thead {
        display: none !important;
    }

    /* تبدیل همه المان‌های جدول به بلوک */
    .table-responsive table tbody,
    .table-responsive table tr,
    .table-responsive table td {
        display: block !important;
        width: 100% !important;
    }

    /* هر ردیف = یک کارت شیشه‌ای فشرده */
    .table-responsive table tr {
        margin-bottom: 0.75rem !important;
        background: rgba(255, 255, 255, 0.25) !important;
        border: 1px solid var(--glass-border) !important;
        border-radius: 20px !important;
        padding: 0.25rem 0 !important;
        box-shadow: 0 4px 16px rgba(31, 38, 135, 0.1) !important;
    }

    /* هر سلول = یک ردیف افقی (عنوان در کنار مقدار) */
    .table-responsive table td {
        display: flex !important;
        flex-direction: row !important;        /* افقی چیدن عنوان و مقدار */
        align-items: center !important;        /* عمودی وسط چین */
        justify-content: space-between !important; /* عنوان سمت راست، مقدار سمت چپ */
        gap: 8px;
        padding: 6px 12px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        text-align: right !important;
        flex-wrap: wrap; /* اگر فضا کم بود، آیتم‌ها به خط بعد بروند اما تلاش می‌کنیم در یک خط بمانند */
    }

    .table-responsive table td:last-child {
        border-bottom: none !important;
    }

    /* لیبل (عنوان ستون) که توسط JS ساخته شده */
    .table-responsive table td::before {
        content: attr(data-label) !important;
        display: inline-block !important;
        font-weight: 700 !important;
        color: #6366f1 !important;
        background: rgba(99, 102, 241, 0.12) !important;
        padding: 4px 10px !important;
        border-radius: 20px !important;
        font-size: 0.7rem !important;
        white-space: nowrap;    /* جلوگیری از شکستن عنوان به خط بعد */
        text-align: center !important;
    }

    /* مقدار (متن داخل سلول) - به طور طبیعی چپ‌چین می‌شود */
    .table-responsive table td {
        font-size: 0.85rem !important;
        font-weight: 500;
        color: var(--text-primary);
    }

    /* بج‌ها (badge) داخل سلول را کوچک‌تر و همراستا کن */
    .table-responsive table td .badge,
    .table-responsive table td span.badge {
        font-size: 0.7rem !important;
        padding: 2px 8px !important;
        white-space: nowrap;
    }

    /* اگر داخل سلول چند عنصر inline مانند آیکون + متن داریم، آن‌ها را کنار هم نگه دار */
    .table-responsive table td .d-flex,
    .table-responsive table td .btn-group {
        justify-content: flex-end;
    }

    /* دکمه‌های عملیات را کمی فشرده‌تر کن */
    .table-responsive table td .btn-group-sm .btn {
        padding: 0.4rem 1.3rem !important;
        font-size: 0.9rem;
    }
}

/* ══════════════════════════════════════════════════
   Base iOS Glass Button (اصلاح شده)
   ══════════════════════════════════════════════════ */

.btn {
    border-radius: 40px !important;
    padding: 0.6rem 1.6rem !important;
    font-weight: 600 !important;
    letter-spacing: -0.2px;
    border: 1.5px solid rgba(255,255,255,0.35) !important;

    background: rgba(255,255,255,0.22) !important;
    /* backdrop-filter: blur(8px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(160%) !important; */

    color: var(--text-primary) !important;

    /* transition: 
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease,
        border .18s ease !important; */

    box-shadow:
        0 6px 18px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.55) !important;
}

/* ===== hover برای دکمه معمولی (فقط کمی شفاف‌تر، نه سفید) ===== */
.btn:hover {
    background: rgba(255,255,255,0.32) !important;  /* از 0.22 به 0.32 - نه سفید */
    border-color: rgba(255,255,255,0.55) !important;
    /* transform: translateY(-2px); */
    box-shadow:
        0 10px 24px rgba(0,0,0,0.18),
        inset 0 1px 0 rgba(255,255,255,0.7) !important;
}

/* ===== active ===== */
.btn:active {
    transform: scale(.96);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.2) !important;
}

/* ===== disabled ===== */
.btn:disabled,
.btn.disabled {
    opacity: .55 !important;
    /* transform: none !important; */
    box-shadow: none !important;
}

/* ══════════════════════════════════════════════════
   Primary (iOS accent) - گرادیان بنفش
   ══════════════════════════════════════════════════ */
.btn-primary {
    background: linear-gradient(135deg,
        var(--primary-gradient-start),
        var(--primary-gradient-end)) !important;
    border: none !important;
    color: white !important;
    box-shadow:
        0 8px 22px rgba(99,102,241,0.35),
        inset 0 1px 0 rgba(255,255,255,0.35) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg,
        #7c3aed,
        #6d28d9) !important;  /* کمی تیره‌تر از گرادیان اصلی */
    /* transform: translateY(-2px); */
    filter: brightness(1.02);
    box-shadow: 0 12px 26px rgba(99,102,241,0.45) !important;
    border: none !important;
    color: white !important;
}

/* ══════════════════════════════════════════════════
   Secondary (خاکستری شیشه‌ای)
   ══════════════════════════════════════════════════ */
.btn-secondary {
    background: rgba(100, 116, 139, 0.25) !important;
    border: 1.5px solid rgba(255,255,255,0.35) !important;
    color: var(--text-primary) !important;
}

.btn-secondary:hover {
    background: rgba(100, 116, 139, 0.4) !important;
    border-color: rgba(255,255,255,0.55) !important;
}

/* ══════════════════════════════════════════════════
   Success (سبز)
   ══════════════════════════════════════════════════ */
.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 8px 22px rgba(34,197,94,0.35) !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    /* transform: translateY(-2px); */
    box-shadow: 0 12px 26px rgba(34,197,94,0.45) !important;
}

/* ══════════════════════════════════════════════════
   Danger (قرمز)
   ══════════════════════════════════════════════════ */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 8px 22px rgba(239,68,68,0.35) !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    /* transform: translateY(-2px); */
    box-shadow: 0 12px 26px rgba(239,68,68,0.45) !important;
}

/* ══════════════════════════════════════════════════
   Warning (نارنجی)
   ══════════════════════════════════════════════════ */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 8px 22px rgba(245,158,11,0.35) !important;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    /* transform: translateY(-2px); */
    box-shadow: 0 12px 26px rgba(245,158,11,0.45) !important;
}

/* ══════════════════════════════════════════════════
   Info (آبی روشن)
   ══════════════════════════════════════════════════ */
.btn-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 8px 22px rgba(6,182,212,0.35) !important;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490) !important;
    /* transform: translateY(-2px); */
    box-shadow: 0 12px 26px rgba(6,182,212,0.45) !important;
}

/* ══════════════════════════════════════════════════
   Outline Buttons (Glass style) - اصلاح شده
   ══════════════════════════════════════════════════ */
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-light,
.btn-outline-dark {
    background: rgba(255,255,255,0.18) !important;
    border: 1.5px solid rgba(255,255,255,0.45) !important;
    color: var(--text-primary) !important;
    /* backdrop-filter: blur(8px) saturate(160%) !important; */
}

/* هاور مخصوص هر outline با رنگ متناسب */
.btn-outline-primary:hover {
    background: rgba(99, 102, 241, 0.3) !important;
    border-color: #6366f1 !important;
    color: #fff !important;
}

.btn-outline-secondary:hover {
    background: rgba(100, 116, 139, 0.3) !important;
    border-color: #94a3b8 !important;
}

.btn-outline-success:hover {
    background: rgba(34, 197, 94, 0.3) !important;
    border-color: #22c55e !important;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 12px 26px rgba(255, 98, 0, 0.832) !important;
}

.btn-outline-danger {
    /* background: rgba(239, 68, 68, 0.3) !important; */
    border-color: #ef4444 !important;

}

.btn-outline-warning:hover {
    background: rgba(245, 158, 11, 0.3) !important;
    border-color: #f59e0b !important;
    box-shadow: 0 12px 26px rgba(255, 98, 0, 0.832) !important;
}

.btn-outline-info:hover {
    background: rgba(6, 182, 212, 0.3) !important;
    border-color: #06b6d4 !important;
}

/* برای اطمینان از اینکه outlineها از transform مشترک استفاده کنند */
[class*="btn-outline-"]:hover {
    /* transform: translateY(-2px); */
    box-shadow: 0 10px 24px rgba(0,0,0,0.15) !important;
}

/* ══════════════════════════════════════════════════
   Small & Large Buttons
   ══════════════════════════════════════════════════ */
.btn-sm {
    padding: 0.35rem 1rem !important;
    font-size: .85rem !important;
}

.btn-lg {
    padding: 0.8rem 2rem !important;
    font-size: 1.05rem !important;
}

/* ══════════════════════════════════════════════════
   Button Groups
   ══════════════════════════════════════════════════ */
.btn-group .btn {
    border-radius: 0 !important;
    direction: rtl;
}

.btn-group .btn:last-child {
    border-radius: 40px 0 0 40px !important;
}

.btn-group .btn:first-child {
    border-radius: 0 40px 40px 0 !important;
}
/* ══════════════════════════════════════════════════
   Base iOS Glass Badge
   ══════════════════════════════════════════════════ */

.badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    padding: 0.35rem 0.7rem !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;

    border-radius: 40px !important;

    /* backdrop-filter: blur(6px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(6px) saturate(160%) !important; */

    background: rgba(255,255,255,0.22) !important;
    border: 1.2px solid rgba(255,255,255,0.4) !important;

    color: var(--text-primary) !important;

    box-shadow:
        0 2px 6px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.55) !important;

    letter-spacing: -0.1px;
}

/* hover خیلی subtle */

.badge:hover {
    background: rgba(255,255,255,0.35) !important;
    border-color: rgba(255,255,255,0.55) !important;
}



/* ══════════════════════════════════════════════════
   Primary
   ══════════════════════════════════════════════════ */

.badge.bg-primary,
.badge-primary {
    background: linear-gradient(
        135deg,
        var(--primary-gradient-start),
        var(--primary-gradient-end)
    ) !important;

    color: white !important;

    border: none !important;

    box-shadow:
        0 4px 10px rgba(99,102,241,0.35) !important;
}



/* ══════════════════════════════════════════════════
   Secondary
   ══════════════════════════════════════════════════ */

.badge.bg-secondary,
.badge-secondary {
    background: rgba(245, 222, 222, 0.393) !important;
}



/* ══════════════════════════════════════════════════
   Success
   ══════════════════════════════════════════════════ */

.badge.bg-success,
.badge-success {
    background: linear-gradient(135deg,#22c55e,#16a34a) !important;
    color: white !important;
    border: none !important;

    box-shadow:
        0 4px 10px rgba(34,197,94,0.35) !important;
}



/* ══════════════════════════════════════════════════
   Danger
   ══════════════════════════════════════════════════ */

.badge.bg-danger,
.badge-danger {
    background: linear-gradient(135deg,#ef4444,#dc2626) !important;
    color: white !important;
    border: none !important;

    box-shadow:
        0 4px 10px rgba(239,68,68,0.35) !important;
}



/* ══════════════════════════════════════════════════
   Warning
   ══════════════════════════════════════════════════ */

.badge.bg-warning,
.badge-warning {
    background: linear-gradient(135deg,#f59e0b,#d97706) !important;
    color: white !important;
    border: none !important;

    box-shadow:
        0 4px 10px rgba(245,158,11,0.35) !important;
}



/* ══════════════════════════════════════════════════
   Info
   ══════════════════════════════════════════════════ */

.badge.bg-info,
.badge-info {
    background: linear-gradient(135deg,#06b6d4,#0891b2) !important;
    color: white !important;
    border: none !important;

    box-shadow:
        0 4px 10px rgba(6,182,212,0.35) !important;
}



/* ══════════════════════════════════════════════════
   Light
   ══════════════════════════════════════════════════ */

.badge.bg-light,
.badge-light {
    background: rgba(255,255,255,0.5) !important;
    color: var(--text-primary) !important;
}



/* ══════════════════════════════════════════════════
   Dark
   ══════════════════════════════════════════════════ */

.badge.bg-dark,
.badge-dark {
    background: rgba(30,41,59,0.9) !important;
    color: white !important;
}



/* ══════════════════════════════════════════════════
   Outline Badges
   ══════════════════════════════════════════════════ */

[class*="badge-outline"] {
    background: rgba(255,255,255,0.15) !important;
    border: 1.2px solid rgba(255,255,255,0.5) !important;
    color: var(--text-primary) !important;
}



/* ══════════════════════════════════════════════════
   Notification Badge (small circle)
   ══════════════════════════════════════════════════ */

.badge-notification {
    width: 20px !important;
    height: 20px !important;

    padding: 0 !important;

    border-radius: 50% !important;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    font-size: 0.7rem !important;

    background: linear-gradient(135deg,#ef4444,#dc2626) !important;

    color: white !important;

    box-shadow:
        0 4px 10px rgba(239,68,68,0.4) !important;
}

/* ══════════════════════════════════════════════════
   Bootstrap Subtle Backgrounds (bg-*-subtle) - Glass Style
   ══════════════════════════════════════════════════ */

[class*="bg-"]:where(.bg-primary-subtle, .bg-secondary-subtle, .bg-success-subtle, .bg-danger-subtle, .bg-warning-subtle, .bg-info-subtle, .bg-light-subtle, .bg-dark-subtle) {
    /* backdrop-filter: blur(8px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(160%) !important; */
    border-radius: 16px !important;
    padding: 0.25rem 0.75rem !important;  /* برای readability در صورت استفاده روی متن */
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: var(--text-primary) !important;
}

/* رنگ‌های اختصاصی برای هر subtle */
.bg-primary-subtle {
    background: rgba(99, 102, 241, 0.18) !important;
}
.bg-secondary-subtle {
    background: rgba(100, 116, 139, 0.18) !important;
}
.bg-success-subtle {
    background: rgba(34, 197, 94, 0.18) !important;
}
.bg-danger-subtle {
    background: rgba(239, 68, 68, 0.18) !important;
}
.bg-warning-subtle {
    background: rgba(245, 158, 11, 0.18) !important;
}
.bg-info-subtle {
    background: rgba(6, 182, 212, 0.18) !important;
}
.bg-light-subtle {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}
.bg-dark-subtle {
    background: rgba(30, 41, 59, 0.5) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* ══════════════════════════════════════════════════
   Bootstrap Text Colors - Override for consistency
   ══════════════════════════════════════════════════ */
.text-primary {
    color: #0d6efd !important;
}
.text-secondary {
    color: #6c757d !important;
}
.text-success {
    color: #198754 !important;
}
.text-danger {
    color: #dc3545 !important;
}
.text-warning {
    color: #ffc107 !important;
}
.text-info {
    color: #0dcaf0 !important;
}
.text-light {
    color: #f8f9fa !important;
}
.text-dark {
    color: #212529 !important;
}
.text-body {
    color: #212529 !important;
}
.text-muted {
    color: #6c757d !important;
}
.text-white {
    color: #fff !important;
}
.text-black {
    color: #000 !important;
}

.card {
    z-index: auto !important;
}

.card:focus-within {
    position: relative;
    z-index: 100000 !important;
}

.filter-card {
    z-index: auto !important;
}

body {
    position: static !important;
    z-index: auto !important;
}

.bd-main,
.bd-calendar,
.kamadatepicker,
.kama-datepicker {
    z-index: 2147483647 !important;
}

/* ══════════════════════════════════════════════════
   Override کلاس‌های bg-* بوت‌استرپ (مطابق با استایل badge)
   ══════════════════════════════════════════════════ */

/* Primary */
.bg-primary,
.btn-primary,
.alert-primary,
.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end)) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35) !important;
}

/* Secondary */
.bg-secondary,
.btn-secondary,
.alert-secondary,
.badge.bg-secondary {
    background: rgba(100, 116, 139, 0.85) !important;
    backdrop-filter: blur(4px) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Success */
.bg-success,
.btn-success,
.alert-success,
.badge.bg-success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.35) !important;
}

/* Danger */
.bg-danger,
.btn-danger,
.alert-danger,
.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35) !important;
}

/* Warning */
.bg-warning,
.btn-warning,
.alert-warning,
.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35) !important;
}

/* Info */
.bg-info,
.btn-info,
.alert-info,
.badge.bg-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.35) !important;
}

/* Light & Dark (اختیاری) */
.bg-light {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(4px) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.bg-dark {
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(4px) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* اطمینان از اینکه text-white روی این کلاس‌ها اعمال شود */
.bg-primary,
.bg-secondary,
.bg-success,
.bg-danger,
.bg-warning,
.bg-info,
.bg-dark {
    --bs-bg-opacity: 1;
    color: white !important;
}

