@font-face {
    font-family: AriabunSans;
    src: url("../fonts/Yekan-Bakh-FaNum-04-Regular.ttf") format("truetype"),
         url("../fonts/iran_yekan.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: AriabunSans;
    src: url("../fonts/Yekan-Bakh-FaNum-08-Fat.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --ink: #202231;
    --muted: #667085;
    --line: #d9deea;
    --primary: #2364d2;
    --primary-dark: #17499f;
    --accent: #1f9d7a;
    --danger: #c24141;
    --success: #16794f;
    --shadow: 0 18px 50px rgba(34, 43, 69, .10);
}

* {
    box-sizing: border-box;
}

html,
body,
button,
input,
select,
textarea,
table {
    font-family: AriabunSans, Tahoma, Arial, sans-serif;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.8;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-shell {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0;
}

.site-header {
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.brand {
    color: var(--ink);
    font-weight: 900;
    font-size: 24px;
}

.top-nav,
.top-menu {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 14px;
    padding: 10px;
    border-radius: 10px;
}

.top-menu li {
    background: #f8f9fa;
    border-radius: 10px;
    white-space: nowrap;
}

.top-nav a,
.top-menu a,
.link-button {
    border: 0;
    background: transparent;
    color: #333;
    display: block;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all .3s;
    font-weight: 500;
    font-size: 14px;
}

.inline-form {
    display: inline;
}

.hero {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 36px;
    margin: 12px 0 28px;
    background: linear-gradient(135deg, #ffffff 0%, #eaf1ff 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.hero h1 {
    margin: 4px 0 10px;
    font-size: 40px;
    line-height: 1.35;
}

.hero p {
    margin: 0;
    color: var(--muted);
    max-width: 620px;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-weight: 800;
    font-size: 14px;
}

.cart-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    font-weight: 800;
}

.cart-pill img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.cart-link {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .2);
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
    z-index: 1000;
}

.cart-link:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, .3);
}

.cart-link img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.product-card,
.auth-card,
.profile-panel,
.detail-grid > div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.product-card {
    overflow: hidden;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .1);
    transition: transform .3s, box-shadow .3s;
    border: 1px solid #f0f0f0;
}

.product-card-disabled {
    opacity: .82;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    display: block;
}

.product-body,
.product-content {
    padding: 20px;
}

.product-body h2 {
    margin: 0 0 8px;
    font-size: 21px;
}

.product-body p {
    color: var(--muted);
    min-height: 86px;
    margin: 0 0 16px;
}

.product-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 10px;
    color: #333;
    text-align: center;
}

.product-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.9;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 5.7em;
    text-overflow: ellipsis;
}

.read-more-btn {
    display: block;
    margin-top: 8px;
    margin-right: auto;
    margin-left: auto;
    background: none;
    border: none;
    color: #6c5ce7;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    font-weight: 700;
    line-height: 1.8;
}

.read-more-btn[hidden] {
    display: none;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #28a745;
    margin: 15px 0;
    text-align: center;
}

.price-original {
    display: block;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: line-through;
}

.price-current {
    display: inline-block;
    color: #28a745;
    font-weight: 900;
}

.product-price.coming-soon {
    color: #ffc107;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.product-actions form {
    flex: 1;
}

.btn-add-cart {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity .3s;
    font-size: 14px;
}

.btn-add-cart:hover {
    opacity: .9;
}

.btn-add-cart:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: .6;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.coming-soon {
    color: #d18800;
}

.primary-button {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 800;
}

.primary-button:hover {
    background: var(--primary-dark);
}

.wide {
    width: 100%;
}

.text-center {
    text-align: center;
}

.auth-wrap {
    min-height: calc(100vh - 180px);
    display: grid;
    place-items: center;
    padding: 28px 0;
}

.auth-card {
    width: min(100%, 480px);
    padding: 28px;
}

.auth-card-wide {
    width: min(100%, 680px);
}

.auth-heading {
    text-align: center;
    margin-bottom: 22px;
}

.auth-heading h1 {
    margin: 4px 0 6px;
}

.auth-heading p:last-child {
    color: var(--muted);
    margin: 0;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

label span {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
}

.form-help {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
}

select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    font: inherit;
}

textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    resize: vertical;
    min-height: 120px;
    font: inherit;
}

input:focus {
    outline: 3px solid rgba(35, 100, 210, .16);
    border-color: var(--primary);
}

/* Ariabun legacy visual alignment */
:root {
    --bg: #ffe6f0;
    --primary: #667eea;
    --primary-dark: #764ba2;
    --accent: #11c57a;
}

body {
    background: linear-gradient(#ffe6f0, #ff66a3);
}

.site-header {
    justify-content: center;
    min-height: 70px;
}

.brand {
    display: none;
}

.top-nav {
    justify-content: center;
    gap: 5px;
}

.top-nav a,
.top-menu a,
.top-nav .link-button,
.top-menu .link-button {
    border: 0;
    background: transparent;
    color: #333;
    padding: 12px 15px;
    font-weight: 500;
    font-size: 14px;
}

.top-nav a:hover,
.top-nav a.active,
.top-menu a:hover,
.top-menu a.active,
.top-nav .link-button:hover,
.top-menu .link-button:hover {
    background: #fff;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.top-nav a.home-link.active,
.top-menu a.home-link.active,
.top-nav a.active,
.top-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: bold;
}

.products-header {
    text-align: center;
    padding: 6px 0 16px;
}

.products-header h1 {
    color: #333;
    margin: 0 0 10px;
    font-size: 28px;
}

.products-title-with-logos {
    direction: ltr;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.products-title-with-logos span {
    direction: rtl;
}

.products-title-logo {
    width: clamp(24px, 4vw, 38px);
    height: clamp(24px, 4vw, 38px);
    object-fit: contain;
    flex: 0 0 auto;
}

img.products-title-logo.products-title-logo-right-big {
    height: 180px;
    width: 180px;
    margin-right: 50px;
}

img.products-title-logo.products-title-logo-left-big {
    height: 180px;
    width: 180px;
    margin-left: 50px;
}

.products-header p {
    margin: 0;
    color: #666;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.hero {
    background: rgba(255, 255, 255, .92);
}

.secondary-button {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    background: #6c757d;
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 800;
}

.form-divider {
    margin: 22px 0;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.otp-form {
    margin-top: 16px;
}

.readonly-field {
    background: #f8f9fa;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 800;
}

.login-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 20px 0 10px;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #333;
    margin: 0 0 10px;
}

.login-header p {
    color: #667085;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    border: 2px solid #ddd;
    font-size: 16px;
    transition: border-color .3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.password-container {
    position: relative;
}

.password-container input {
    padding-left: 48px;
}

.toggle-password {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 16px;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: opacity .3s;
}

.btn-primary {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 16px;
    margin-bottom: 15px;
}

.btn-secondary {
    padding: 12px;
    background: #6c757d;
    font-size: 14px;
}

.btn-primary:hover,
.btn-secondary:hover {
    opacity: .9;
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-options {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-options p {
    margin: 8px 0;
}

.login-options a {
    color: #667eea;
}

.login-options p:last-child a {
    color: #666;
    font-size: 14px;
}

.tab-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all .3s;
    color: #333;
    font: inherit;
}

.tab.active {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
    font-weight: bold;
    color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.code-section {
    margin-top: 20px;
}

.login-otp-sent {
    display: none;
}

.content-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 40px 0;
}

.cart-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.cart-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .1);
}

.cart-header,
.empty-cart {
    text-align: center;
}

.cart-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.cart-header h1 {
    color: #333;
    margin-bottom: 10px;
}

.cart-table {
    margin-top: 20px;
}

.cart-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
    padding: 15px;
    text-align: center;
    border-bottom: 2px solid #ddd;
}

.cart-table td {
    padding: 20px 15px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cart-product .cart-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .1);
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.quantity-control form {
    margin: 0;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 0;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #e9ecef;
}

.item-remove {
    border: 0;
    background: transparent;
    color: #dc3545;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background .3s;
}

.item-remove:hover {
    background: #f8d7da;
}

.cart-total-box {
    text-align: left;
    margin-top: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.cart-total-box strong {
    display: block;
    font-size: 26px;
}

.cart-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.cart-actions form {
    flex: 1;
    min-width: 200px;
}

.cart-btn {
    flex: 1;
    border: 0;
    display: inline-block;
    min-width: 200px;
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: opacity .3s, transform .3s;
}

.cart-btn:hover {
    color: #fff;
    opacity: .9;
    transform: translateY(-2px);
}

.btn-green {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-blue {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
}

.btn-red {
    background: linear-gradient(135deg, #dc3545 0%, #d63384 100%);
    width: 100%;
}

.checkout-container {
    max-width: 1000px;
    margin: 40px auto;
}

.checkout-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .1);
}

.checkout-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.order-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 25px;
}

.final-price {
    font-size: 22px;
    font-weight: bold;
    margin-top: 10px;
}

.coupon-box {
    margin-top: 25px;
    display: flex;
    gap: 10px;
}

.active-coupon-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(40, 167, 69, .25);
    border-radius: 12px;
    background: #f0fff6;
}

.active-coupon-box span {
    display: block;
    color: #198754;
    font-size: 13px;
}

.active-coupon-box strong {
    color: #155724;
}

.active-coupon-box form {
    margin: 0;
}

.active-coupon-box button {
    border: 0;
    border-radius: 8px;
    background: #dc3545;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    padding: 10px 14px;
    white-space: nowrap;
}

.coupon-box input {
    flex: 1;
}

.coupon-box button,
.checkout-btn {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: bold;
    padding: 12px 20px;
}

.checkout-btn {
    width: 100%;
    margin-top: 28px;
    padding: 16px;
    background: linear-gradient(135deg, #28a745, #20c997);
}

.payment-result-grid {
    margin-top: 20px;
}

.content-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, .08);
    padding: 32px;
    text-align: right;
}

.content-card h1 {
    text-align: center;
    margin: 0 0 18px;
}

.info-box {
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 18px;
    padding: 16px 18px;
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
}

.rules-content {
    line-height: 2.1;
    white-space: normal;
}

.rules-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    direction: rtl;
    text-align: right;
    line-height: 2;
}

.rules-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, .08);
    padding: 32px;
    border: 1px solid #f0f0f0;
}

.rules-card h2 {
    font-size: 24px;
    margin: 30px 0 10px;
    color: #333;
}

.affiliate-info-card > h2:first-child {
    text-align: center;
}

.section-heading-with-audio {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.section-heading-with-audio .section-heading-audio {
    display: inline-flex;
}

.section-heading-with-audio .rich-audio-speaker {
    margin: 0;
}

.rules-card h2:first-child {
    margin-top: 0;
}

.rules-card p {
    font-size: 16px;
    color: #555;
    margin-bottom: 15px;
}

.rules-card a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.rules-card a:hover {
    text-decoration: underline;
}

.lock-message {
    color: #c24141;
    font-size: 18px;
    font-weight: 800;
}

.download-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.download-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e6e9f2;
    border-radius: 10px;
    background: #fff;
}

.download-card p {
    margin: 4px 0 0;
    color: var(--muted);
}

.affiliate-asset-preview {
    flex: 0 0 180px;
    width: 180px;
    max-height: 110px;
    border: 1px solid #e6e9f2;
    border-radius: 8px;
    background: #f8f9fa;
    object-fit: cover;
}

.affiliate-asset-audio {
    flex: 0 0 220px;
    width: 220px;
}

.download-card-locked {
    background: #fbfbfd;
}

.download-button {
    display: block;
    padding: 12px 16px;
    background: #2e7dff;
    color: #fff;
    border-radius: 8px;
    text-align: center;
    font-weight: 800;
}

.download-locked-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f1f3f5;
    color: #667085;
    padding: 8px 12px;
    font-weight: 800;
}

.homework-page {
    max-width: 1000px;
    margin: 40px auto;
}

.homework-card {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    text-align: center;
}

.homework-table {
    direction: ltr;
    text-align: center;
}

.homework-table th {
    background: #6a56c9;
    color: #fff;
}

.homework-btn {
    background: none;
    border: none;
    color: #0c7a57;
    font-weight: 900;
    cursor: pointer;
    font-size: 17px;
}

.stars {
    letter-spacing: 3px;
    font-weight: bold;
}

.pin {
    color: #d10000;
    font-weight: bold;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-box {
    background: #fff;
    padding: 24px;
    border-radius: 15px;
    width: min(92vw, 380px);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.desc-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .7);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.desc-modal-content {
    background: #fff;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-gutter: stable;
    background-clip: padding-box;
    border-radius: 18px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    animation: modalFade .2s ease;
}

.desc-modal-content::-webkit-scrollbar {
    width: 10px;
}

.desc-modal-content::-webkit-scrollbar-track {
    margin: 18px 0;
    background: transparent;
}

.desc-modal-content::-webkit-scrollbar-thumb {
    border: 3px solid #fff;
    border-radius: 999px;
    background: rgba(102, 112, 133, .45);
}

.close-desc-modal {
    position: absolute;
    top: 15px;
    right: 18px;
    border: 0;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.modal-description {
    line-height: 2;
    color: #333;
    margin-top: 20px;
    white-space: pre-line;
}

.product-gallery-template {
    display: none;
}

.product-media-carousel {
    margin-top: 22px;
}

.carousel-stage {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
}

.carousel-viewport {
    min-height: 260px;
    display: grid;
    place-items: center;
    border: 1px solid #e6e9f2;
    border-radius: 14px;
    background: #f8f9fa;
    overflow: hidden;
}

.product-modal-image,
.product-modal-video {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    background: #f8f9fa;
}

.carousel-arrow {
    width: 44px;
    height: 44px;
    border: 1px solid #d9deea;
    border-radius: 50%;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
}

.carousel-arrow:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.carousel-meta {
    margin: 10px 0;
    text-align: center;
    color: #667085;
    font-weight: 800;
}

.carousel-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 8px;
}

.carousel-thumb {
    flex: 0 0 74px;
    width: 74px;
    height: 58px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #eef2ff;
    color: #4f46e5;
    cursor: pointer;
    overflow: hidden;
    font-weight: 900;
}

.carousel-thumb.active {
    border-color: #667eea;
}

.carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-body {
    background: #f5f5f5;
}

.admin-login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-login-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .1);
    width: min(100%, 400px);
    padding: 40px;
}

.admin-login-card h1 {
    text-align: center;
    font-size: 22px;
}

.login-hint {
    text-align: center;
    background: #f0f8ff;
    border-radius: 8px;
    padding: 10px;
    color: #666;
}

.floating-notice {
    position: fixed;
    top: 12px;
    inset-inline: 12px;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 25px 20px;
    text-align: center;
}

.admin-header h1,
.admin-header p {
    margin: 0;
}

.admin-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0 0;
    flex-wrap: wrap;
}

.stat-box {
    background: rgba(255, 255, 255, .2);
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 120px;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 14px;
    opacity: .9;
}

.admin-nav {
    background: #fff;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
    text-align: center;
}

.nav-menu {
    list-style: none;
    display: inline-flex;
    gap: 5px;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 10px;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-menu a,
.nav-menu .link-button {
    text-decoration: none;
    color: #333;
    padding: 10px 15px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    transition: all .3s;
    font-weight: 500;
    cursor: pointer;
}

.nav-menu a:hover,
.nav-menu .link-button:hover {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
}

.nav-menu a.active {
    background: #667eea;
    color: #fff;
}

.nav-menu .logout {
    color: #dc3545;
}

.danger-link {
    color: #dc3545 !important;
}

.admin-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-stat-grid,
.admin-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.welcome-box {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .1);
    text-align: center;
}

.welcome-box h2 {
    color: #333;
    margin-bottom: 15px;
}

.welcome-box p {
    color: #666;
    line-height: 1.6;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.quick-link {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    color: #333;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .1);
    transition: transform .3s;
    border: 2px solid transparent;
}

.quick-link:hover {
    transform: translateY(-5px);
    color: #333;
    border-color: #667eea;
}

.quick-link h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.admin-stat-grid > div,
.admin-panel,
.admin-quick-grid a {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .1);
    padding: 24px;
}

.admin-stat-grid strong {
    display: block;
    font-size: 30px;
}

.admin-panel {
    margin-top: 28px;
}

.admin-body {
    background: #f4f6fb;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px;
    background: #172033;
    color: #fff;
    overflow-y: auto;
    z-index: 1100;
}

.admin-sidebar-brand {
    padding: 10px 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.admin-sidebar-brand strong,
.admin-sidebar-brand span {
    display: block;
}

.admin-sidebar-brand strong {
    font-size: 24px;
    line-height: 1.2;
}

.admin-sidebar-brand span {
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    margin-top: 5px;
}

.admin-sidebar .admin-nav {
    background: transparent;
    box-shadow: none;
    padding: 0;
    text-align: initial;
    display: grid;
    gap: 6px;
}

.admin-sidebar .admin-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    color: rgba(255, 255, 255, .82);
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 700;
}

.admin-sidebar .admin-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .10);
}

.admin-sidebar .admin-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 10px 25px rgba(102, 126, 234, .28);
}

.admin-logout-form {
    margin-top: auto;
}

.admin-logout-button {
    width: 100%;
    border: 1px solid rgba(220, 53, 69, .38);
    border-radius: 8px;
    background: rgba(220, 53, 69, .12);
    color: #ffb8c0;
    padding: 11px 12px;
    cursor: pointer;
    font-weight: 800;
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid #e6e9f2;
    backdrop-filter: blur(10px);
}

.admin-title-block h1,
.admin-title-block p {
    margin: 0;
}

.admin-title-block h1 {
    font-size: 22px;
    line-height: 1.35;
    color: #172033;
}

.admin-title-block p {
    color: #667085;
    font-size: 13px;
}

.admin-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid #d9deea;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    place-items: center;
    padding: 10px;
}

.admin-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #172033;
    border-radius: 999px;
    margin: 3px auto;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 24px 28px 0;
}

.admin-stat-card {
    background: #fff;
    border: 1px solid #e6e9f2;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(23, 32, 51, .06);
    padding: 18px;
}

.admin-stat-card .stat-number {
    color: #172033;
    font-size: 28px;
    line-height: 1.2;
}

.admin-stat-card .stat-label {
    color: #667085;
    opacity: 1;
}

.admin-shell .admin-content {
    max-width: none;
    padding: 28px;
}

.admin-shell .admin-panel,
.admin-shell .welcome-box,
.admin-shell .quick-link,
.admin-shell .admin-stat-grid > div,
.admin-shell .admin-quick-grid a {
    border: 1px solid #e6e9f2;
    box-shadow: 0 8px 24px rgba(23, 32, 51, .06);
}

.admin-drawer-backdrop {
    display: none;
}

@media (max-width: 1100px) {
    .admin-shell {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: min(82vw, 300px);
        height: 100vh;
        transform: translateX(105%);
        transition: transform .24s ease;
    }

    .admin-menu-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-drawer-backdrop {
        position: fixed;
        inset: 0;
        display: block;
        background: rgba(15, 23, 42, .45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .24s ease;
        z-index: 1000;
    }

    .admin-menu-open .admin-drawer-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .admin-topbar {
        padding: 12px 16px;
    }

    .admin-menu-toggle {
        display: block;
        flex: 0 0 auto;
    }

    .admin-title-block h1 {
        font-size: 18px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
        padding: 16px 16px 0;
    }

    .admin-shell .admin-content {
        padding: 16px;
    }

    .admin-panel,
    .welcome-box {
        padding: 18px;
    }
}

.table-wrap {
    overflow-x: auto;
}

.admin-users-table-wrap {
    width: 100%;
}

.admin-users-table {
    min-width: 1040px;
    table-layout: fixed;
}

.admin-users-table th,
.admin-users-table td {
    white-space: nowrap;
}

.admin-users-table .admin-user-username,
.admin-users-table .admin-user-name,
.admin-users-table .admin-user-phone,
.admin-users-table .admin-user-email {
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-users-table .admin-user-username {
    max-width: 130px;
}

.admin-users-table .admin-user-name {
    max-width: 170px;
}

.admin-users-table .admin-user-phone {
    max-width: 140px;
}

.admin-users-table .admin-user-email {
    max-width: 230px;
}

.admin-users-table .inline-password-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.admin-users-table .inline-password-form input[type="password"] {
    width: 150px;
    min-width: 150px;
}

.admin-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: right;
    vertical-align: middle;
}

th {
    background: #f8f9fa;
}

.homework-table {
    direction: ltr;
}

.homework-table th,
.homework-table td {
    text-align: center;
    vertical-align: middle;
}

.homework-table th {
    background: #6a56c9;
    color: #fff;
}

.homework-table .homework-btn {
    text-align: center;
}

.admin-thumb {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: 8px;
}

.upload-field {
    display: grid;
    gap: 10px;
}

.upload-field > span {
    font-weight: 800;
}

.current-cover-preview {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #e6e9f2;
    border-radius: 10px;
    background: #fff;
}

.current-cover-preview img {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    background: #f8f9fa;
}

.current-cover-preview span {
    direction: ltr;
    text-align: left;
    color: #475467;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.upload-dropzone {
    display: grid;
    place-items: center;
    min-height: 132px;
    gap: 8px;
    padding: 22px;
    border: 2px dashed #b8c2d8;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    color: #475467;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s;
}

.upload-dropzone-large {
    min-height: 160px;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
    border-color: #667eea;
    background: #eef2ff;
    transform: translateY(-1px);
}

.upload-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-dropzone strong {
    color: #172033;
    font-size: 16px;
}

.upload-dropzone small,
.form-help {
    color: #667085;
    font-size: 13px;
    line-height: 1.8;
}

.price-word-preview {
    display: block;
    min-height: 24px;
    color: #1f6f5b;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.8;
}

.upload-preview-list {
    display: grid;
    gap: 10px;
}

.upload-preview-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.upload-preview-item {
    display: grid;
    gap: 8px;
    border: 1px solid #e6e9f2;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}

.upload-preview-item img,
.upload-preview-item video {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    background: #f8f9fa;
}

.upload-preview-item span {
    direction: ltr;
    text-align: left;
    color: #475467;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.upload-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    align-items: center;
    gap: 10px;
}

.upload-progress[hidden] {
    display: none;
}

.upload-progress-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6e9f2;
}

.upload-progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #1f6f5b;
    transition: width .2s ease;
}

.upload-progress > span {
    direction: ltr;
    color: #475467;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}

.asset-admin-preview {
    display: grid;
    max-width: 360px;
    gap: 8px;
}

.asset-admin-preview img,
.asset-admin-preview video {
    width: 180px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid #e6e9f2;
    border-radius: 8px;
    background: #f8f9fa;
    object-fit: cover;
}

.asset-admin-preview audio {
    width: min(320px, 100%);
}

.asset-admin-preview a,
.asset-admin-preview small {
    overflow-wrap: anywhere;
    color: #475467;
}

.admin-gallery-editor {
    display: grid;
    gap: 12px;
}

.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.admin-gallery-item {
    display: grid;
    gap: 8px;
    align-content: start;
    border: 1px solid #e6e9f2;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}

.admin-gallery-item img,
.admin-gallery-item video {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    background: #f8f9fa;
}

.row-actions,
.inline-password-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-action-link {
    display: inline-block;
    border-radius: 8px;
    background: #eef2ff;
    color: #4f46e5;
    padding: 7px 10px;
    font-weight: 800;
    white-space: nowrap;
}

.audit-payload,
.audit-payload-grid pre {
    direction: ltr;
    text-align: left;
    max-width: 100%;
    overflow: auto;
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    white-space: pre-wrap;
}

.audit-payload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.danger-button {
    border: 0;
    border-radius: 8px;
    background: #dc3545;
    color: #fff;
    padding: 8px 12px;
    cursor: pointer;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-row input {
    width: auto;
}

.auth-links {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.affiliate-actions,
.copy-row,
.checkbox-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.affiliate-actions {
    margin-top: 24px;
}

.copy-row input {
    min-width: min(100%, 320px);
    flex: 1;
}

.embedded-panel {
    border: 1px solid #e6e9f2;
    border-radius: 10px;
    background: #f8f9fa;
    padding: 16px;
}

.embedded-panel h2,
.embedded-panel h3 {
    margin-top: 0;
}

.dynamic-list {
    display: grid;
    gap: 10px;
}

.field-title {
    display: block;
    font-weight: 800;
}

.exam-option-builder {
    display: grid;
    gap: 10px;
}

.exam-option-rows {
    display: grid;
    gap: 10px;
}

.exam-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid #e6e9f2;
    border-radius: 8px;
    background: #fff;
}

.exam-option-row-text {
    margin: 0;
}

.exam-option-row-correct {
    min-height: 44px;
    margin: 0;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .exam-option-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

.checkbox-grid {
    align-items: stretch;
}

.checkbox-grid .check-row {
    min-width: 180px;
    border: 1px solid #e6e9f2;
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.exam-question {
    border: 1px solid #e6e9f2;
    border-radius: 10px;
    margin: 12px 0;
    padding: 12px;
    background: #fff;
}

.exam-question legend {
    font-weight: 900;
    padding: 0 8px;
}

.affiliate-entry-panel {
    margin-top: 28px;
    padding: 18px;
    border: 1px solid #e6e9f2;
    border-radius: 12px;
    background: #f8fafc;
}

.affiliate-entry-copy {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    color: #334155;
}

.affiliate-entry-copy strong {
    color: #0f172a;
    font-size: 1.1rem;
}

.affiliate-read-confirm {
    align-items: flex-start;
    line-height: 1.9;
}

.affiliate-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    color: #475569;
}

.affiliate-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 8px;
    background: #0f172a;
    color: #fff !important;
    font-weight: 900;
    text-decoration: none;
}

.affiliate-login-button:hover {
    background: #1e293b;
    color: #fff !important;
}

.affiliate-study-card .auth-heading {
    margin-bottom: 20px;
}

.affiliate-study-action {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 22px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.settings-tab {
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
}

.settings-tab.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.active {
    display: grid;
    gap: 14px;
}

.qr-modal[hidden] {
    display: none !important;
}

.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.48);
}

.qr-modal-card {
    position: relative;
    width: min(100%, 420px);
    padding: 24px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    text-align: center;
}

.qr-modal-close {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 22px;
    cursor: pointer;
}

.qr-modal-code {
    display: grid;
    place-items: center;
    margin: 16px 0;
}

.qr-modal-code svg {
    width: min(100%, 260px);
    height: auto;
}

.qr-modal-card p {
    overflow-wrap: anywhere;
    color: #475569;
    font-size: 0.88rem;
}

.settings-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 18px;
    padding: 14px 0 0;
    background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
}

.section-audio-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
    border: 1px dashed #dbe3ef;
    border-radius: 8px;
    background: #fff;
}

.section-audio-field span {
    color: #667085;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.is-hidden {
    display: none !important;
}

.affiliate-exam-card .auth-heading {
    margin-bottom: 20px;
}

.affiliate-exam-question {
    border-width: 2px;
}

.affiliate-exam-question.is-incorrect {
    border-color: #fecaca;
    background: #fff7f7;
}

.affiliate-exam-question legend {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exam-help {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 900;
    cursor: pointer;
}

.exam-options {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.exam-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e6e9f2;
    border-radius: 10px;
    background: #fff;
}

.exam-option input {
    width: auto;
}

.exam-option.is-wrong {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.exam-option.is-correct {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #166534;
}

.homework-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0;
}

.homework-tab {
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    padding: 10px 18px;
    font-weight: 800;
    cursor: pointer;
}

.homework-tab.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.homework-product-panel {
    display: none;
}

.homework-product-panel.active {
    display: block;
}

.homework-category {
    margin-top: 22px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.86rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill.status-done {
    background: #dcfce7;
    color: #166534;
}

.local-swal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.42);
}

.local-swal {
    width: min(100%, 420px);
    padding: 28px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.24);
    text-align: center;
}

.local-swal-icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 32px;
    font-weight: 900;
}

.local-swal h2 {
    margin: 0 0 10px;
    font-size: 1.35rem;
}

.local-swal p {
    margin: 0;
    color: #475569;
    line-height: 1.9;
}

.local-swal-actions {
    margin-top: 20px;
}

.confetti-layer {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    overflow: hidden;
}

.confetti-layer span {
    position: absolute;
    top: -20px;
    left: var(--x);
    width: 9px;
    height: 15px;
    border-radius: 2px;
    animation: confetti-fall var(--duration) linear var(--delay) forwards;
}

@keyframes confetti-fall {
    to {
        transform: translate3d(-24px, 110vh, 0) rotate(760deg);
        opacity: 0.2;
    }
}

.ticket-thread {
    margin-top: 16px;
    border: 1px solid #e6e9f2;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.ticket-thread summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 900;
    background: #f8f9fa;
}

.ticket-reply {
    margin: 12px 16px;
    padding: 12px;
    border-radius: 10px;
    background: #f8f9fa;
}

.ticket-reply-admin {
    background: #eef2ff;
}

.selected-row {
    background: #eff6ff;
}

.ticket-status-form {
    margin: 18px 0;
    align-items: end;
}

.ticket-status-form label {
    min-width: 220px;
}

.ticket-detail-thread {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.profile-tab {
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    padding: 10px 16px;
    font-weight: 800;
    cursor: pointer;
}

.profile-tab.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.profile-tab-panel {
    display: none;
}

.profile-tab-panel.active {
    display: block;
}

.ticket-reply p {
    margin: 6px 0;
}

.notice {
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid;
    background: var(--surface);
}

.notice-success,
.notice-info {
    border-color: rgba(22, 121, 79, .25);
    color: var(--success);
}

.notice-error {
    border-color: rgba(194, 65, 65, .25);
    color: var(--danger);
}

.profile-layout {
    padding: 28px 0;
}

.profile-panel {
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-panel h1 {
    margin: 0;
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-size: 30px;
    font-weight: 900;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.detail-grid > div {
    padding: 18px;
}

.detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.detail-grid strong {
    display: block;
    margin-top: 4px;
}

.profile-orders {
    margin-top: 28px;
}

.profile-section-heading {
    margin-bottom: 16px;
}

.profile-section-heading h2,
.profile-section-heading p {
    margin: 0;
}

.profile-section-heading p,
.muted-line {
    color: var(--muted);
}

.profile-empty,
.profile-order-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, .08);
}

.profile-empty {
    padding: 22px;
    text-align: center;
}

.profile-order-card {
    margin-bottom: 18px;
    overflow: hidden;
}

.profile-order-card summary {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
    background: #fff;
    border-bottom: 1px solid #eef1f7;
}

.profile-order-card summary::-webkit-details-marker {
    display: none;
}

.profile-order-card summary span,
.profile-order-card summary strong {
    font-weight: 900;
}

.profile-order-card summary em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    padding: 6px 10px;
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.profile-order-meta,
.profile-coupon-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    padding: 18px 20px 0;
}

.profile-order-meta > div,
.profile-coupon-detail > div {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
}

.profile-order-meta span,
.profile-coupon-detail span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.profile-order-meta strong,
.profile-coupon-detail strong {
    display: block;
    margin-top: 4px;
}

.profile-subsection {
    padding: 18px 20px 20px;
}

.profile-subsection h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

.site-footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px 0;
    border-top: 1px solid #eee;
    color: #666;
}

.enamad-wrap {
    margin-top: 12px;
}

.enamad-wrap img {
    display: block;
    margin: 10px auto 0;
    cursor: pointer;
    height: 64px;
}

@media (max-width: 680px) {
    .site-header,
    .hero,
    .product-meta,
    .profile-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .hero {
        padding: 24px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 25px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .top-menu {
        flex-wrap: wrap;
        margin-bottom: 10px;
    }

    .top-menu li {
        margin-bottom: 5px;
    }

    .top-menu a,
    .top-menu .link-button {
        padding: 10px 12px;
        font-size: 13px;
    }

    .rules-container {
        padding: 30px 15px;
    }

    .rules-card {
        padding: 26px;
    }

    .rules-card h2 {
        font-size: 22px;
    }

    .rules-card p {
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .page-shell {
        width: calc(100% - 24px);
        padding: 8px 0 12px;
    }

    body {
        font-size: 14px;
    }

    .top-menu {
        gap: 8px;
        margin-bottom: 8px;
    }

    .top-menu li {
        flex: 1 0 100%;
    }

    .top-menu a,
    .top-menu .link-button {
        border-radius: 12px;
        font-size: 15px;
        padding: 12px;
    }

    .products-header h1 {
        font-size: 22px;
    }

    .products-header {
        padding: 4px 0 12px;
    }

    .products-title-with-logos {
        gap: 8px;
    }

    .products-title-logo {
        width: 28px;
        height: 28px;
    }

    img.products-title-logo.products-title-logo-right-big,
    img.products-title-logo.products-title-logo-left-big {
        width: 54px;
        height: 54px;
        margin-left: 8px;
        margin-right: 8px;
    }

    .products-header p {
        font-size: 14px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-card {
        display: flex;
        flex-direction: column;
    }

    .product-content {
        padding: 16px;
    }

    .product-title {
        font-size: 16px;
    }

    .product-desc {
        font-size: 13px;
        height: auto;
    }

    .product-price {
        font-size: 18px;
    }

    .btn-add-cart {
        padding: 14px;
        font-size: 15px;
    }

    .product-image {
        height: 160px;
        object-fit: contain;
        background: #f8f9fa;
    }

    .cart-link {
        width: 56px;
        height: 56px;
        bottom: 15px;
        left: 15px;
    }

    .cart-link img {
        width: 30px;
    }

    .badge {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .rules-container {
        padding: 20px 10px;
        text-align: center;
    }

    .rules-card {
        padding: 20px;
        border-radius: 14px;
    }

    .rules-card h2 {
        font-size: 20px;
    }

    .rules-card p {
        font-size: 14px;
    }

    .cart-card {
        padding: 20px;
    }

    .cart-table,
    .cart-table thead,
    .cart-table tbody,
    .cart-table th,
    .cart-table td,
    .cart-table tr {
        display: block;
        width: 100%;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tr {
        background: #fff;
        margin-bottom: 20px;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, .08);
        padding: 15px;
    }

    .cart-table td {
        border: 0;
        padding: 10px 0;
        text-align: center;
    }

    .cart-table td:first-child {
        text-align: right;
    }

    .cart-table td:first-child > div {
        flex-direction: column;
        text-align: center;
    }

    .cart-product .cart-image {
        width: 90px;
        height: 90px;
        margin: 0 auto 10px;
    }

    .cart-table td:nth-child(2)::before {
        content: "قیمت واحد: ";
        font-weight: bold;
    }

    .cart-table td:nth-child(4)::before {
        content: "جمع: ";
        font-weight: bold;
    }

    .cart-table td:nth-child(3),
    .cart-table td:last-child {
        margin-top: 10px;
    }

    .cart-actions {
        flex-direction: column;
    }

    .cart-actions form,
    .cart-btn {
        min-width: 100%;
        width: 100%;
    }

    .cart-total-box {
        text-align: center;
    }

    .profile-order-card summary {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-order-card summary em {
        width: 100%;
    }

    .carousel-stage {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
        gap: 6px;
    }

    .carousel-arrow {
        width: 38px;
        height: 38px;
        font-size: 24px;
    }

    .carousel-viewport {
        min-height: 190px;
    }

    .upload-dropzone {
        min-height: 118px;
        padding: 16px;
    }

    .download-card {
        align-items: stretch;
        flex-direction: column;
    }

    .affiliate-asset-preview,
    .affiliate-asset-audio {
        flex-basis: auto;
        width: 100%;
        max-height: none;
    }

    .download-button,
    .download-locked-badge {
        width: 100%;
    }
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.report-summary-card {
    display: grid;
    gap: 8px;
    min-height: 148px;
    padding: 20px;
    border: 1px solid rgba(249, 240, 0, .35);
    border-radius: 14px;
    background: #151515;
    color: #fff;
}

.report-summary-card span,
.report-summary-card small,
.report-heading p {
    color: #b6b6b6;
}

.report-summary-card strong {
    color: #f9f000;
    font-size: 24px;
}

.report-summary-card small {
    line-height: 1.7;
}

.report-panel {
    margin-bottom: 24px;
}

.report-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.report-heading h2,
.report-panel h2 {
    margin: 0;
}

.report-heading p {
    margin: 8px 0 0;
}

.profile-demographics-form {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .13);
}

.profile-demographics-form h2 {
    margin: 0;
}

.affiliate-performance-name small {
    display: block;
    margin-top: 4px;
}

.profile-message-list {
    display: grid;
    gap: 14px;
}

.product-card {
    position: relative;
}

.product-card .product-guarantee-stamp {
    position: absolute;
    z-index: 3;
    right: 12px;
    bottom: 62px;
    width: 110px;
    height: 110px;
    CONTAIN-INTRINSIC-BLOCK-SIZE: AUTO 100PX;
    pointer-events: none;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .42));
}

.profile-message {
    padding: 16px;
    border: 1px solid var(--border, #d8dce8);
    border-radius: 8px;
    background: #fff;
}

.profile-message.unread {
    border-color: var(--primary, #5b5bd6);
    box-shadow: 0 0 0 1px rgba(91, 91, 214, .3);
}

.profile-message > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.profile-message time {
    color: var(--muted, #687086);
    font-size: 13px;
}

.profile-message p {
    margin: 10px 0 0;
    line-height: 1.8;
    white-space: normal;
}

.admin-message-modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    z-index: 1500;
    padding: 20px;
    background: rgba(14, 20, 40, .62);
}

.admin-message-modal[aria-hidden="false"] {
    display: grid;
}

.admin-message-dialog {
    position: relative;
    width: min(620px, 94vw);
    max-height: 88vh;
    overflow: auto;
    padding: 28px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

.admin-message-dialog h2 {
    margin: 0 0 10px;
}

.admin-message-dialog > p {
    margin: 0 0 20px;
    color: var(--muted, #687086);
    line-height: 1.8;
}

.admin-message-close {
    position: absolute;
    top: 10px;
    left: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #eff1f7;
    color: #24293b;
    font-size: 23px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .report-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .report-summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .report-summary-card {
        min-height: 0;
    }

    .profile-message > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}
