/**
 * آکادمی امن‌خرید — استایل‌های سفارشی
 * فونت Vazirmatn، RTL، کامپوننت‌های ناوبری و داشبورد
 */

/* ── Vazirmatn ─────────────────────────────────────────────────────────── */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ── Base / RTL ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: #f8fafc;
    color: #1e293b;
    margin: 0;
    line-height: 1.5;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

video {
    max-width: 100%;
    display: block;
}

.aspect-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* آیکون‌های SVG — جلوگیری از روی هم افتادن با متن */
.icon-svg,
svg.icon-svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    line-height: 0;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* دکمه‌های تیره — متن سفید حتی اگر text-white در tailwind نباشد */
button.bg-slate-900,
button.bg-slate-800,
button.bg-rose-600,
button.bg-rose-700,
button.bg-emerald-600,
button.bg-emerald-700,
a.bg-slate-900,
a.bg-slate-800,
a.bg-emerald-600,
a.bg-emerald-700,
a.bg-rose-600,
a.bg-rose-700 {
    color: #ffffff !important;
}

/* فقط دکمه‌های بدون کلاس utility */
button:not([class]) {
    border: none;
    background: transparent;
    padding: 0;
}

button[type="submit"],
button.btn-primary,
a.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.nav-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.nav-link.nav-active {
    background-color: rgba(236, 253, 245, 0.8);
    color: #047857;
    font-weight: 700;
}

/* ── Footer links ───────────────────────────────────────────────────────── */
.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #94a3b8;
    transition: color 0.15s ease;
}

.footer-link:hover {
    color: #34d399;
}

/* ── Dashboard tabs (sidebar) ───────────────────────────────────────────── */
.dash-tab-btn {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: right;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.dash-tab-btn .dash-tab-badge {
    margin-right: auto;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: ui-monospace, monospace;
    background-color: #f1f5f9;
    color: #475569;
    line-height: 1.2;
}

.dash-tab-active,
.tab-active {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border-color: #020617 !important;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.15), 0 2px 4px -2px rgba(15, 23, 42, 0.1);
}

.dash-tab-active .dash-tab-badge,
.tab-active .dash-tab-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.dash-tab-active-admin {
    background-color: #4c0519 !important;
    color: #ffffff !important;
    border-color: #881337 !important;
    box-shadow: 0 4px 6px -1px rgba(76, 5, 25, 0.2);
}

.dash-tab-active-admin .dash-tab-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.dash-tab-btn:not(.dash-tab-active):not(.dash-tab-active-admin):not(.tab-active) {
    background-color: transparent;
    color: #475569;
    border-color: transparent;
    box-shadow: none;
}

.dash-tab-btn:not(.dash-tab-active):not(.dash-tab-active-admin):not(.tab-active):hover {
    background-color: #f8fafc;
    color: #334155;
}

/* ── Modal overlay ──────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-overlay--nested {
    z-index: 60;
}

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-10%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.animate-fade-in {
    animation: fade-in 0.2s ease-out both;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ── Form elements (فقط داخل محتوای اصلی) ─────────────────────────────── */
main input[type="text"],
main input[type="email"],
main input[type="password"],
main input[type="number"],
main input[type="tel"],
main input[type="url"],
main input[type="search"],
main select,
main textarea {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    color: #334155;
    font-size: 0.75rem;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

/* فیلد با آیکون — RTL: آیکون سمت راست (ابتدای متن) */
.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .input-icon {
    position: absolute;
    top: 50%;
    right: 0.875rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: #94a3b8;
    line-height: 0;
    z-index: 1;
}

.input-icon-wrap input {
    padding-right: 2.5rem !important;
}

main input:focus,
main select:focus,
main textarea:focus {
    outline: none;
    border-color: #10b981;
    background-color: #ffffff;
}

main input::placeholder,
main textarea::placeholder {
    color: #94a3b8;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

label {
    display: block;
    cursor: pointer;
}

/* ── Toast notifications ────────────────────────────────────────────────── */
#amanbuy-toast-host {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    width: min(24rem, calc(100vw - 2rem));
}

.amanbuy-toast {
    pointer-events: auto;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
    animation: fade-in 0.25s ease-out both;
}

.amanbuy-toast--success {
    background-color: #059669;
    color: #ffffff;
}

.amanbuy-toast--error {
    background-color: #e11d48;
    color: #ffffff;
}

.amanbuy-toast--info {
    background-color: #0f172a;
    color: #ffffff;
}

/* ── Mobile nav (فقط موبایل) ───────────────────────────────────────────── */
@media (min-width: 768px) {
    #mobile-menu-toggle {
        display: none !important;
    }

    #mobile-nav {
        display: none !important;
    }
}

#mobile-nav:not(.hidden) {
    display: block;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mobile-nav-link:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.mobile-nav-link.nav-active {
    background-color: rgba(236, 253, 245, 0.9);
    color: #047857;
    font-weight: 800;
}

/* ── FAQ accordion ──────────────────────────────────────────────────────── */
.faq-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    text-align: right;
    background: transparent;
    border: none;
    cursor: pointer;
}

.faq-content {
    padding: 0 1rem 0.875rem;
}

/* ── Header helpers ─────────────────────────────────────────────────────── */
main input.header-search-input,
header input.header-search-input {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1rem !important;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-size: 0.75rem;
    color: #334155;
}

main input.header-search-input:focus,
header input.header-search-input:focus {
    outline: none;
    border-color: #10b981;
    background-color: #fff;
}

.header-search-btn {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    line-height: 0;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.header-search-btn:hover {
    color: #059669;
}

.header-wallet {
    display: none;
}

@media (min-width: 640px) {
    .header-wallet {
        display: flex;
    }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    color: #94a3b8;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.site-footer__top {
    padding: 3rem 0 2rem;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: right;
}

@media (min-width: 640px) {
    .site-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .site-footer__grid {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
        gap: 2.5rem;
    }
}

.site-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.site-footer__logo-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-footer__logo-icon,
.site-footer__logo-img {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    flex-shrink: 0;
}

.site-footer__logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #059669, #14b8a6);
    color: #fff;
}

.site-footer__logo-img {
    object-fit: cover;
}

.site-footer__name {
    display: block;
    font-size: 1rem;
    font-weight: 900;
    color: #f8fafc;
    line-height: 1.3;
}

.site-footer__tagline {
    display: block;
    font-size: 0.6875rem;
    color: #64748b;
    margin-top: 0.125rem;
}

.site-footer__about {
    font-size: 0.75rem;
    line-height: 1.75;
    color: #94a3b8;
    margin: 0;
    max-width: 22rem;
}

.site-footer__contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.site-footer__contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #cbd5e1;
    transition: color 0.15s ease;
}

.site-footer__contact-item:hover {
    color: #34d399;
}

.site-footer__heading {
    font-size: 0.8125rem;
    font-weight: 800;
    color: #f1f5f9;
    margin: 0 0 0.875rem;
}

.site-footer__links,
.site-footer__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.site-footer__features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
}

.site-footer__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.site-footer__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 0.6875rem;
    font-weight: 700;
    color: #cbd5e1;
}

.site-footer__enamad {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.site-footer__enamad img {
    display: block;
    max-height: 4.5rem;
    width: auto;
}

.site-footer__bottom {
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    padding: 1rem 0;
}

.site-footer__bottom-inner {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    text-align: center;
}

@media (min-width: 768px) {
    .site-footer__bottom-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: right;
    }
}

.site-footer__copy {
    font-size: 0.6875rem;
    color: #64748b;
}

.site-footer__made {
    font-size: 0.625rem;
    color: #475569;
}

/* ── Admin dashboard ─────────────────────────────────────────────────────── */
.admin-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 5rem;
    text-align: right;
}

@media (min-width: 640px) {
    .admin-dashboard {
        gap: 2rem;
    }
}

.admin-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #4c0519 0%, #881337 45%, #be123c 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px -12px rgba(76, 5, 25, 0.35);
}

@media (min-width: 640px) {
    .admin-hero {
        padding: 2rem 2.25rem;
    }
}

.admin-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -10%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.admin-hero__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .admin-hero__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 2rem;
    }
}

.admin-hero__title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.35;
}

@media (min-width: 640px) {
    .admin-hero__title {
        font-size: 1.625rem;
    }
}

.admin-hero__sub {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 228, 230, 0.85);
    line-height: 1.6;
    max-width: 36rem;
}

.admin-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.625rem;
    font-weight: 800;
    color: #fecdd3;
    margin-bottom: 0.75rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .admin-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .admin-stats {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.admin-stat {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.admin-stat:hover {
    box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.admin-stat__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    flex-shrink: 0;
}

.admin-stat__icon--slate { background: #f1f5f9; color: #475569; }
.admin-stat__icon--rose { background: #ffe4e6; color: #be123c; }
.admin-stat__icon--amber { background: #fef3c7; color: #b45309; }
.admin-stat__icon--emerald { background: #d1fae5; color: #047857; }
.admin-stat__icon--blue { background: #dbeafe; color: #1d4ed8; }
.admin-stat__icon--violet { background: #ede9fe; color: #6d28d9; }

.admin-stat__body {
    min-width: 0;
    flex: 1;
}

.admin-stat__label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    color: #94a3b8;
    line-height: 1.3;
}

.admin-stat__value {
    display: block;
    margin-top: 0.125rem;
    font-size: 1.25rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
}

.admin-stat__value--amber { color: #b45309; }
.admin-stat__value--emerald { color: #047857; }

.admin-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 768px) {
    .admin-layout {
        grid-template-columns: 240px 1fr;
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .admin-layout {
        grid-template-columns: 260px 1fr;
    }
}

.admin-sidebar {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 1.5rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

@media (min-width: 768px) {
    .admin-sidebar {
        position: sticky;
        top: 6rem;
    }
}

.admin-sidebar__title {
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.6875rem;
    font-weight: 800;
    color: #334155;
}

.admin-sidebar .dash-tab-btn svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.admin-main {
    min-width: 0;
}

.admin-panel {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.admin-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(to bottom, #fafafa, #ffffff);
}

.admin-panel__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 800;
    color: #334155;
}

.admin-panel__desc {
    margin: 0.25rem 0 0;
    font-size: 0.6875rem;
    color: #94a3b8;
    font-weight: 600;
}

.admin-panel__body {
    padding: 0;
}

.admin-panel__body--padded {
    padding: 1.25rem;
}

.admin-panel__body--stack {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.75rem;
    text-align: right;
}

.admin-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table th {
    padding: 0.875rem 1rem;
    font-weight: 800;
    color: #64748b;
    white-space: nowrap;
}

.admin-table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: #fafafa;
}

.admin-table tbody tr.is-blocked {
    background: rgba(254, 242, 242, 0.45);
}

.admin-table .col-actions {
    text-align: left;
    white-space: nowrap;
}

.admin-course-cell {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.admin-course-cell img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #f1f5f9;
}

.admin-course-cell__title {
    font-weight: 800;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 12rem;
}

.admin-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.375rem;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.625rem;
    font-weight: 800;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
}

.admin-btn--dark { background: #0f172a; color: #fff; }
.admin-btn--dark:hover { background: #1e293b; }

.admin-btn--muted { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.admin-btn--muted:hover { background: #e2e8f0; }

.admin-btn--success { background: #059669; color: #fff; }
.admin-btn--success:hover { background: #047857; }

.admin-btn--danger { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.admin-btn--danger:hover { background: #ffe4e6; }

.admin-btn--primary { background: #be123c; color: #fff; }
.admin-btn--primary:hover { background: #9f1239; }

.admin-btn--lg {
    padding: 0.625rem 1rem;
    font-size: 0.75rem;
    border-radius: 0.75rem;
    width: 100%;
}

.admin-btn--fit {
    width: auto;
    min-width: 12rem;
}

.admin-actions--stretch {
    display: flex;
    gap: 0.5rem;
}

.admin-actions--stretch .admin-btn {
    flex: 1;
}

.admin-select {
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    cursor: pointer;
}

.admin-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 800;
    line-height: 1.4;
}

.admin-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.admin-pill {
    padding: 0.4375rem 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.6875rem;
    font-weight: 800;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.admin-pill:hover {
    background: #e2e8f0;
    color: #334155;
}

.admin-pill.is-active {
    background: #0f172a;
    color: #ffffff;
    border-color: #020617;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.admin-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
}

.admin-review {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
    align-items: center;
}

@media (min-width: 768px) {
    .admin-review {
        grid-template-columns: 7rem 1fr auto;
    }
}

.admin-review + .admin-review {
    border-top: 1px solid #f1f5f9;
}

.admin-review__cover {
    width: 100%;
    height: 5.5rem;
    border-radius: 0.875rem;
    object-fit: cover;
    border: 1px solid #f1f5f9;
}

@media (min-width: 768px) {
    .admin-review__cover {
        width: 7rem;
        height: 5rem;
    }
}

.admin-review__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 800;
    color: #1e293b;
}

.admin-review__desc {
    margin: 0.375rem 0 0;
    font-size: 0.6875rem;
    color: #64748b;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.admin-review__meta {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.625rem;
    color: #94a3b8;
    font-weight: 600;
}

.admin-review__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 7rem;
}

.admin-card {
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
}

.admin-card--white {
    background: #ffffff;
}

.admin-instructor-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-instructor-card + .admin-instructor-card {
    border-top: 1px solid #f1f5f9;
}

.admin-ticket-item,
.admin-contact-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.admin-ticket-item:last-child,
.admin-contact-item:last-child {
    border-bottom: none;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.admin-form__section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-form__section-title {
    margin: 0;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8125rem;
    font-weight: 800;
    color: #334155;
}

.admin-form__section-desc {
    margin: -0.25rem 0 0;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #64748b;
}

.admin-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
}

.admin-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #059669;
    cursor: pointer;
}

.admin-enamad-preview {
    display: inline-flex;
    align-items: center;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
}

.admin-enamad-preview img {
    max-height: 4.5rem;
    width: auto;
}

.admin-form__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .admin-form__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-form__grid .span-2 {
        grid-column: span 2;
    }
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.admin-field label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #94a3b8;
}

.admin-input,
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="date"],
.admin-form input[type="email"],
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: #fda4af;
    box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.1);
    background: #ffffff;
}

.admin-input--mono {
    font-family: ui-monospace, monospace;
    direction: ltr;
    text-align: left;
}

.admin-form textarea {
    resize: vertical;
    min-height: 4.5rem;
    line-height: 1.55;
}

.admin-form input[type="file"] {
    font-size: 0.625rem;
    margin-top: 0.375rem;
}

.admin-discount-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
}

@media (min-width: 1024px) {
    .admin-discount-layout {
        grid-template-columns: 5fr 7fr;
    }
}

.admin-discount-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.admin-discount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 0.875rem;
}

.admin-modal {
    background: #ffffff;
    border-radius: 1.25rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: right;
}

.admin-modal--sm { max-width: 24rem; }
.admin-modal--md { max-width: 28rem; }
.admin-modal--lg { max-width: 42rem; }
.admin-modal--xl { max-width: 52rem; }

.admin-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.admin-modal__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 800;
    color: #1e293b;
}

.admin-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.admin-modal__close:hover {
    background: #e2e8f0;
    color: #334155;
}

.admin-modal__body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.admin-meta-box {
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 0.75rem;
    font-size: 0.6875rem;
    color: #64748b;
    line-height: 1.6;
}

.admin-cover-picker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-cover-picker__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

.admin-cover-picker__frame {
    position: relative;
    width: 9.5rem;
    height: 6rem;
    border-radius: 0.875rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.admin-cover-picker__preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-cover-picker__placeholder {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #94a3b8;
}

.admin-cover-picker__frame.is-empty .admin-cover-picker__placeholder {
    display: flex;
}

.admin-cover-picker__actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    min-width: 12rem;
    flex: 1;
}

.admin-cover-picker__actions .admin-btn {
    width: fit-content;
}

.admin-cover-picker__hint {
    margin: 0;
    font-size: 0.625rem;
    color: #94a3b8;
    line-height: 1.5;
}

.admin-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    max-height: 26rem;
    overflow-y: auto;
}

.admin-media-empty {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    padding: 2rem 0;
}

.admin-media-item {
    border: 2px solid transparent;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    background: #f8fafc;
    padding: 0;
    text-align: right;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-media-item:hover,
.admin-media-item.is-selected {
    border-color: #be123c;
    box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.12);
}

.admin-media-item img {
    width: 100%;
    height: 5.5rem;
    object-fit: cover;
    display: block;
    background: #e2e8f0;
}

.admin-media-item span {
    display: block;
    padding: 0.375rem 0.5rem;
    font-size: 0.5625rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Course wizard timelines ─────────────────────────────────────────────── */
.wizard-timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wizard-timeline__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.9rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    min-width: 0;
}

.wizard-timeline__index {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    background: #e2e8f0;
    color: #64748b;
    flex-shrink: 0;
}

.wizard-timeline__label {
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wizard-timeline__item.is-active {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.wizard-timeline__item.is-active .wizard-timeline__index {
    background: #059669;
    color: #fff;
}

.wizard-timeline__item.is-done {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.wizard-timeline__item.is-done .wizard-timeline__index {
    background: #16a34a;
    color: #fff;
}

.lesson-upload-timeline {
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 1.25rem;
    padding: 1rem 1.1rem;
    display: grid;
    gap: 0.85rem;
}

.lesson-upload-timeline__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
}

.lesson-upload-timeline__head strong {
    font-size: 0.8rem;
    color: #0f172a;
}

.lesson-upload-timeline__summary {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
}

.lesson-upload-timeline__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}

.lesson-upload-timeline__steps li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.6rem;
    border-radius: 0.85rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 0;
}

.lesson-upload-timeline__steps li span {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #64748b;
    flex-shrink: 0;
}

.lesson-upload-timeline__steps li.is-active {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #0369a1;
}

.lesson-upload-timeline__steps li.is-active span {
    background: #0284c7;
    color: #fff;
}

.lesson-upload-timeline__steps li.is-done {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.lesson-upload-timeline__steps li.is-done span {
    background: #16a34a;
    color: #fff;
}

.lesson-upload-timeline__steps li.is-error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #be123c;
}

.lesson-upload-timeline__steps li.is-error span {
    background: #e11d48;
    color: #fff;
}

.lesson-upload-timeline__bar {
    height: 0.5rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.lesson-upload-timeline__fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: #0ea5e9;
    transition: width 0.25s ease, background-color 0.2s ease;
}

.lesson-upload-timeline__fill.is-success {
    background: #10b981;
}

.lesson-upload-timeline__fill.is-error {
    background: #f43f5e;
}

.lesson-upload-timeline__message {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    line-height: 1.7;
}

@media (max-width: 767px) {
    .wizard-timeline,
    .lesson-upload-timeline__steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
