/* ==========================================================================
   پنل تحصیلداران — استایل مشترک
   استفاده در صفحات /Collector/*
   ========================================================================== */

.collector-page {
    padding: 1.5rem 1rem;
    min-height: 100%;
}

.collector-card {
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #ede3d7;
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(120, 53, 15, .05);
}

.collector-title {
    color: #431407;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: .65rem;
    border-bottom: 2px solid #fef3c7;
}

/* ---------- نوار جستجو ---------- */
.collector-search {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding: .75rem;
    background: #fffbf5;
    border: 1px solid #f3e8dc;
    border-radius: 14px;
}

.collector-search .field {
    flex: 1 1 210px;
    min-width: 160px;
}

.collector-search .actions {
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
}

.collector-btn {
    border: none;
    border-radius: 10px;
    padding: .52rem 1rem;
    font-weight: 700;
    font-size: .86rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    transition: background .15s ease, transform .15s ease;
}

.collector-btn:active { transform: scale(.97); }

.collector-btn.primary { background: #d97706; color: #fff; }
.collector-btn.primary:hover { background: #b45309; }

.collector-btn.ghost {
    background: #fff;
    color: #92400e;
    border: 1px solid #f3d9b7;
}
.collector-btn.ghost:hover { background: #fff7ed; }

.collector-btn.soft {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

/* ---------- جدول ---------- */
.collector-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #ede3d7;
    border-radius: 14px;
    margin-top: .5rem;
}

.collector-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: .86rem;
}

.collector-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fef3c7;
    color: #78350f;
    font-weight: 800;
    padding: .7rem .6rem;
    border-bottom: 2px solid #f1e2cf;
    white-space: nowrap;
}

.collector-table tbody td {
    padding: .65rem .6rem;
    color: #431407;
    border-bottom: 1px solid #f4ece4;
    vertical-align: middle;
}

.collector-table tbody tr:nth-child(even) { background: #fffdfa; }
.collector-table tbody tr:hover { background: #fffbeb; cursor: pointer; }

.collector-table .money { font-weight: 800; color: #15803d; white-space: nowrap; }
.collector-table .muted { color: #9a7b63; font-size: .8rem; }
.collector-table .ltr { direction: ltr; text-align: right; }

.collector-row-actions { display: flex; gap: .3rem; justify-content: center; }

.collector-icon-btn {
    border: 1px solid #f3d9b7;
    background: #fff;
    color: #b45309;
    border-radius: 9px;
    padding: .25rem .5rem;
    line-height: 1;
    cursor: pointer;
    transition: all .15s ease;
}
.collector-icon-btn:hover { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.collector-icon-btn.call:hover { background: #0dcaf0; border-color: #0dcaf0; }

/* ---------- حالت‌های خالی/بارگذاری ---------- */
.collector-empty {
    text-align: center;
    padding: 1.25rem;
    margin-top: 1rem;
    border: 1px dashed #f59e0b;
    border-radius: 14px;
    background: #fffbeb;
    color: #92400e;
    font-weight: 600;
}

.collector-loading {
    text-align: center;
    padding: 1rem;
    color: #92400e;
    font-weight: 600;
}

/* اسکلتون */
.collector-skeleton-row {
    height: 44px;
    border-radius: 10px;
    margin: .45rem 0;
    background: linear-gradient(90deg, #f6efe8 25%, #fdf7f1 37%, #f6efe8 63%);
    background-size: 400% 100%;
    animation: collector-sk 1.2s ease-in-out infinite;
}
@keyframes collector-sk {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------- دکمهٔ «بیشتر» ---------- */
.collector-loadmore {
    display: flex;
    justify-content: center;
    margin-top: .9rem;
}

/* ---------- موبایل: تبدیل جدول به کارت ---------- */
@media (max-width: 720px) {
    .collector-card { padding: .9rem; border-radius: 16px; }
    .collector-search { padding: .6rem; }
    .collector-search .field { flex: 1 1 100%; }

    .collector-table.responsive thead { display: none; }

    .collector-table.responsive tbody tr {
        display: block;
        border: 1px solid #f1e2cf;
        border-radius: 14px;
        margin-bottom: .7rem;
        padding: .5rem .65rem;
        background: #fffdfa;
    }

    .collector-table.responsive tbody td {
        display: flex;
        justify-content: space-between;
        gap: .75rem;
        border: none;
        padding: .32rem 0;
        text-align: left;
    }

    .collector-table.responsive tbody td::before {
        content: attr(data-label);
        color: #9a7b63;
        font-weight: 700;
        font-size: .78rem;
        text-align: right;
    }

    .collector-table.responsive tbody td:empty { display: none; }

    .collector-table.responsive .collector-row-actions { justify-content: flex-start; }
}

/* ---------- اعلان کوچک (Toast) ---------- */
.collector-toast {
    position: fixed;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: .6rem 1rem;
    border-radius: 999px;
    font-size: .82rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    z-index: 2000;
}

/* هم‌ترازی دکمه‌های جستجو با فیلدهای کنارشان */
.collector-search .actions-field {
    flex: 0 0 auto;
    min-width: auto;
}
.collector-search .actions-field .component-label {
    visibility: hidden;
}
.collector-search .actions-field .actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    height: 40px;
}
.collector-search input.form-control,
.collector-search .component-input {
    min-height: 40px;
}

/* تراز دقیق فیلدها و دکمه‌ها */
.collector-search .field .component-label {
    display: block;
    font-size: .8rem;
    line-height: 20px;
    min-height: 20px;
    margin-bottom: .2rem;
    color: #9a7b63;
    font-weight: 700;
}
.collector-search .field input.form-control {
    height: 40px;
}
.collector-search .actions-field .collector-btn {
    height: 40px;
    padding-top: 0;
    padding-bottom: 0;
}

/* ==========================================================================
   اصلاح لیبل‌ها (لیبل پیش‌فرض سراسری absolute است) و نمای کارتی بر اساس عرض ظرف
   ========================================================================== */
.collector-search .field {
    display: flex;
    flex-direction: column;
    position: relative;
}
.collector-search .field .component-label {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    background: transparent !important;
    padding: 0 !important;
    transform: none !important;
}

.collector-table-wrap {
    container-type: inline-size;
}

@container (max-width: 760px) {
    .collector-table.responsive thead { display: none; }

    .collector-table.responsive tbody tr {
        display: block;
        border: 1px solid #f1e2cf;
        border-radius: 14px;
        margin-bottom: .7rem;
        padding: .5rem .65rem;
        background: #fffdfa;
    }

    .collector-table.responsive tbody td {
        display: flex;
        justify-content: space-between;
        gap: .75rem;
        border: none;
        padding: .32rem 0;
        text-align: left;
    }

    .collector-table.responsive tbody td::before {
        content: attr(data-label);
        color: #9a7b63;
        font-weight: 700;
        font-size: .78rem;
        text-align: right;
    }

    .collector-table.responsive tbody td:empty { display: none; }
    .collector-table.responsive .collector-row-actions { justify-content: flex-start; }
}

html[data-theme="dark"] .collector-table-wrap { container-type: inline-size; }
@container (max-width: 760px) {
    html[data-theme="dark"] .collector-table.responsive tbody tr {
        background: #16223a !important;
        border-color: #25324a !important;
    }
    html[data-theme="dark"] .collector-table.responsive tbody td::before {
        color: #9aa9c0 !important;
    }
}
