/* =========================================================
   لایه‌ی پایه (جایگزین بوت‌استرپ) — بدون وابستگی به CDN
   گرید، ابزارک‌ها و اجزای ساده‌ی فرم/جدول/تب/آکاردئون
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; line-height: 1.5; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; }
img, svg { vertical-align: middle; }
button, input, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; margin: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---- گرید ---- */
.container { width: 100%; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }
.row { --gx: 1.5rem; --gy: 0rem; display: flex; flex-wrap: wrap; margin-inline: calc(var(--gx) * -.5); margin-top: calc(var(--gy) * -1); }
.row > * { flex: 0 0 auto; width: 100%; max-width: 100%; padding-inline: calc(var(--gx) * .5); margin-top: var(--gy); }
.g-2 { --gx: .5rem; --gy: .5rem; } .g-3 { --gx: 1rem; --gy: 1rem; } .g-4 { --gx: 1.5rem; --gy: 1.5rem; }
.col-6 { width: 50%; } .col-12 { width: 100%; }
@media (min-width: 768px) {
    .col-md-3 { width: 25%; } .col-md-4 { width: 33.3333%; } .col-md-5 { width: 41.6667%; } .col-md-6 { width: 50%; }
}
@media (min-width: 992px) {
    .col-lg-3 { width: 25%; } .col-lg-4 { width: 33.3333%; } .col-lg-5 { width: 41.6667%; }
    .col-lg-6 { width: 50%; } .col-lg-7 { width: 58.3333%; }
}

/* ---- ابزارک‌ها ---- */
.d-flex { display: flex !important; } .d-none { display: none !important; }
@media (min-width: 576px) { .d-sm-inline-flex { display: inline-flex !important; } .flex-sm-nowrap { flex-wrap: nowrap !important; } }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center !important; } .align-middle { vertical-align: middle !important; }
.justify-content-between { justify-content: space-between !important; } .justify-content-center { justify-content: center !important; }
.gap-2 { gap: .5rem; } .gap-3 { gap: 1rem; }
.w-100 { width: 100% !important; } .h-100 { height: 100% !important; }
.text-center { text-align: center !important; } .text-nowrap { white-space: nowrap !important; }
.text-muted { color: var(--ink-mute) !important; } .text-primary { color: var(--brand) !important; }
.text-success { color: var(--green) !important; } .text-danger { color: var(--rose) !important; } .text-warning { color: #a16207 !important; }
.fw-bold { font-weight: 700 !important; } .small { font-size: .875em; }
.border { border: 1px solid var(--line) !important; } .border-0 { border: 0 !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .25rem !important; } .mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; } .mb-4 { margin-bottom: 1.5rem !important; } .mt-4 { margin-top: 1.5rem !important; }
.me-1 { margin-inline-end: .25rem !important; } .me-2 { margin-inline-end: .5rem !important; } .ms-1 { margin-inline-start: .25rem !important; } .ms-2 { margin-inline-start: .5rem !important; }
.p-0 { padding: 0 !important; } .pb-5 { padding-bottom: 3rem !important; } .pe-3 { padding-inline-end: 1rem !important; }
.px-4 { padding-inline: 1.5rem !important; } .px-5 { padding-inline: 3rem !important; } .py-4 { padding-block: 1.5rem !important; }

/* ---- کارت ---- */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card-body { flex: 1 1 auto; }

/* ---- دکمه ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    border: 1.5px solid transparent; background: transparent; text-align: center; text-decoration: none;
    font-size: 1rem; line-height: 1.5; user-select: none; vertical-align: middle;
}
.btn-lg { padding: .85rem 1.8rem; font-size: 1.1rem; border-radius: 14px; }
.btn-close {
    width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; opacity: .6; position: relative;
    transition: opacity .2s, background .2s;
}
.btn-close::before, .btn-close::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 2px; background: currentColor; border-radius: 2px; }
.btn-close::before { transform: translate(-50%, -50%) rotate(45deg); } .btn-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.btn-close:hover { opacity: 1; background: rgba(0, 0, 0, .07); }

/* ---- فرم ---- */
.form-label { display: inline-block; }
.form-control, .form-select { display: block; width: 100%; font-size: 1rem; line-height: 1.6; outline: 0; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%238b91ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-size: 14px;
}
.form-select-sm, .form-select.form-select-sm { padding-block: .45rem; font-size: .9rem; }
.form-check { display: block; }
.form-check-input { appearance: none; -webkit-appearance: none; width: 1.1em; height: 1.1em; border: 1.5px solid #c3c8e0; background: #fff; border-radius: 50%; vertical-align: middle; }
.form-check-input:checked { box-shadow: inset 0 0 0 3px #fff; }

/* ---- جدول ---- */
.table { width: 100%; border-collapse: collapse; text-align: start; }
.table th, .table td { text-align: start; border-bottom: 1px solid #f0f2f9; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- نشان و هشدار ---- */
.badge { display: inline-block; line-height: 1.4; white-space: nowrap; text-align: center; vertical-align: baseline; }
.alert { position: relative; }
.alert-dismissible { padding-inline-end: 3.2rem; }
.alert-dismissible .btn-close { position: absolute; top: 50%; margin-top: -14px; inset-inline-end: 12px; }
.alert.fade:not(.show) { opacity: 0; }

/* ---- ناوبری / تب ---- */
.nav { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.nav-link { display: block; background: none; border: 0; text-decoration: none; }
.nav-item { list-style: none; }
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; animation: fadeUp .45s var(--ease); }
.fade:not(.show) { opacity: 0; }

/* ---- آکاردئون / collapse ---- */
.accordion-item { margin: 0; }
.accordion-header { margin: 0; }
.accordion-button { position: relative; display: flex; align-items: center; width: 100%; border: 0; text-align: start; }
.accordion-button::after {
    content: ""; flex: none; width: 1.1rem; height: 1.1rem; margin-inline-start: auto; transition: transform .3s var(--ease);
    background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%235b6285' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
}
.accordion-button:not(.collapsed)::after { transform: rotate(180deg); }
.collapse:not(.show) { display: none; }
.collapse.show { animation: fadeIn .35s ease; }
.accordion-header { font-size: 1rem; font-weight: 400; }
.accordion-button { font-size: 1rem; }
