/* Reset and base */
* {
    box-sizing: border-box;
}

html, body {
    /*height: 100%;*/
    /*margin: 0;*/
    /*padding: 0;*/
    /*font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;*/
    /*background-color: var(--bg);*/
    /*color: var(--text);*/
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: inherit;
    background-color: var(--bg);
    color: var(--text);
}

body.logged-in,
body.has-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.layout-wrapper {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--header-h));
    overflow: hidden;
    position: relative;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--brand-2);
    padding: 14px 12px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;

    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;

    height: 100%;
    overflow: hidden; /* ✅ اسکرول از خود sidebar حذف شود */

    transform: translateX(0);
    transition: transform 0.3s ease;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;

    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;

    padding-inline-end: 6px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}


/* سایدبار بسته */
#sidebar-toggle:not(:checked) ~ .layout-wrapper .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
}

/* جابه‌جایی main هنگام بسته بودن سایدبار */
#sidebar-toggle:not(:checked) ~ .layout-wrapper main,
#sidebar-toggle:not(:checked) ~ .layout-wrapper footer {
    margin-left: 0;
}

body.has-sidebar .layout-wrapper main,
body.has-sidebar .layout-wrapper footer {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    transition: margin-left 0.3s ease;
}

/* Firefox */
.sidebar nav {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--text-muted) 55%, transparent) transparent;
}

/* Chrome/Edge/Safari */
.sidebar nav::-webkit-scrollbar {
    width: 10px;
}

.sidebar nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar nav::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-muted) 45%, transparent);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.sidebar nav::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--text) 40%, transparent);
}

/* سایدبار بسته -> اسکرول کامل بسته شود */
#sidebar-toggle:not(:checked) ~ .layout-wrapper .sidebar nav {
    overflow: hidden !important;
    scrollbar-width: none;
}

#sidebar-toggle:not(:checked) ~ .layout-wrapper .sidebar nav::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#sidebar-toggle:not(:checked) ~ .layout-wrapper .sidebar {
    pointer-events: none;
}

#sidebar-toggle:checked ~ .layout-wrapper .sidebar {
    pointer-events: auto;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    position: relative;
    min-height: 36px;
    font-size: 14px;
    line-height: 1.3;
}

.sidebar nav a:hover {
    background: var(--surface-2);

}

.sidebar nav a.active {
    background: color-mix(in srgb, var(--surface-2) 88%, var(--brand-accent) 8%);
    border: 1px solid color-mix(in srgb, var(--border-2) 72%, var(--brand-accent) 22%);
    color: var(--text);
    font-weight: 800;
}

/* left indicator bar */
.sidebar nav a.active::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: var(--brand-accent);
}

.sidebar nav a i {
    width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: color-mix(in srgb, var(--text) 80%, var(--text-muted) 20%);
    flex-shrink: 0;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-label {
    padding: 0 10px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

header {
    background-color: var(--brand);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-3);
    z-index: 3;
    position: relative;
}

header img {
    height: 50px;
    width: auto;
}

header h1 {
    color: #fff;
    font-weight: 600;
    font-size: 22px;
    margin: 0;
    user-select: none;
}

main {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px 50px;
    background-color: var(--bg);
    height: 100%;
}

footer {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    user-select: none;
    padding: 20px 0;
    background: var(--surface-2);
}

footer a {
    color: var(--link);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

.page-container {
    max-width: 100%;
    margin: auto;
    background-color: var(--surface);
    padding: 40px 50px;
    border: 1px solid var(--border-2);
    border-radius: 8px;
    box-shadow: var(--shadow-1);
}

.dashboard-container {
    max-width: 100%;
    background: none;
    box-shadow: none;
    padding: 0;
}

.hamburger {
    width: 36px;
    height: 36px;
    margin-right: 6px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.10);
}

/* فرم و المان‌ها */
h2 {
    margin-top: 0;
    color: var(--text);
    font-weight: 600;
    font-size: 28px;
    text-align: center;
    margin-bottom: 30px;
    user-select: none;
}

form label {
    font-weight: 600;
    color: var(--text);
    display: block;
    margin-bottom: 8px;
    margin-top: 20px;
    user-select: none;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="file"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border-radius: 6px;
    border: 1.8px solid var(--border);
    transition: border-color 0.25s ease;
    resize: none;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    min-height: 44px;
    line-height: 1.25;
}

form textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border-radius: 6px;
    border: 1.8px solid var(--border);
    transition: border-color 0.25s ease;
    resize: vertical;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    min-height: 100px;
    line-height: 1.6;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form input[type="file"]:focus,
form textarea:focus {
    border-color: var(--brand);
    outline: none;
}

textarea {
    min-height: 100px;
    line-height: 1.6;
}

.note {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
    user-select: none;
}

/* دکمه‌ها */
.btn-custom {
    margin-top: 30px;
    background-color: var(--brand);
    color: #fff !important;
    border: none;
    padding: 14px 0;
    font-size: 17px;
    font-weight: 700;
    border-radius: 7px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease;
}

.btn-custom:hover {
    background-color: var(--brand-hover);
    color: #fff !important;
}

/* بخش پیگیری */
.tracking-section {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    padding-top: 30px;
}

.tracking-section label {
    margin-top: 0;
}

.tracking-btn {
    background-color: #444; /* اگر خواستی توکنی می‌کنیم */
    margin-top: 10px;
    padding: 12px 0;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    border: none;
    width: 100%;
    transition: background-color 0.3s ease;
}

.tracking-btn:hover {
    background-color: #222;
}

/* پیام‌ها */
.message {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-muted);
    text-align: center;
}

.error {
    color: var(--danger);
}

.status {
    font-weight: 700;
    color: var(--success);
}

/* استایل خطاهای فرم */
.errorlist {
    color: var(--danger);
    margin-top: 5px;
    margin-bottom: 10px;
    font-size: 14px;
    list-style-type: none;
    padding-left: 0;
}

.errorlist li {
    margin-left: 0;
}

.nonfield-errors {
    color: var(--danger);
    font-weight: bold;
    margin-bottom: 15px;
}

.form_tools {
    width: min(100%, 760px);
    max-width: 100%;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border-radius: 6px;
    border: 1.8px solid var(--border);
    transition: border-color 0.25s ease;
    font-family: inherit;
    padding-right: 42px;
    background: var(--surface);
    color: var(--text);
}

.password-wrapper input:focus {
    border-color: var(--brand);
    outline: none;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
}

#floating-alert-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

/* برای alert ها چون توکن اختصاصی نداری، ثابت نگه داشتم */
.floating-alert {
    position: relative;
    background-color: #f8d7da;
    color: #721c24;
    padding: 14px 18px 20px;
    margin-top: 10px;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 360px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

.floating-alert.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.close-alert {
    position: absolute;
    top: 1px;
    right: 10px;
    font-size: 18px;
    font-weight: bold;
    color: inherit;
    cursor: pointer;
}

.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background-color: #dc3545;
    animation: alertProgress 4s linear forwards;
}

.floating-alert.success .alert-progress {
    background-color: #28a745;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .spinner-border {
    width: 1rem;
    height: 1rem;
    margin-left: 8px;
    vertical-align: middle;
}

.user-hover {
    position: relative;
    display: inline-block;
}

.profile-hover-box {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-2);
    padding: 15px;
    border-radius: 8px;
    width: 250px;
    display: none;
    z-index: 1002;
    border: 1px solid var(--border-2);
}

.profile-hover-box form label {
    font-size: 14px;
    margin-top: 10px;
    color: var(--text);
}

.profile-hover-box form input {
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 100%;
    background: var(--surface);
    color: var(--text);
}

.profile-hover-box .btn {
    margin-top: 12px;
    width: 100%;
}

.user-hover:hover .profile-hover-box {
    display: block;
}

.subscription-box {
    background-color: var(--surface-2);
    border-left: 4px solid var(--success);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 15px;
    color: var(--text);
}

.subscription-box strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

@keyframes alertProgress {
    from {
        width: 100%;
    }
    to {
        width: 0;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 480px) {
    main {
        padding: 25px 20px;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
        z-index: 1001;
        position: relative;
    }

    .layout-wrapper {
        position: relative;
    }

    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: var(--sidebar-w-mobile);
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background-color: var(--brand-2);
        z-index: 100;
    }

    #sidebar-toggle:checked ~ .layout-wrapper .sidebar {
        transform: translateX(0);
    }

    .layout-wrapper {
        flex-direction: column;
    }

    body.has-sidebar .layout-wrapper main,
    body.has-sidebar .layout-wrapper footer {
        margin-left: 0;
        width: 100%;
    }

    main {
        padding: 20px 15px;
    }

    .page-container {
        padding: 20px 15px;
        box-shadow: none;
    }

    header h1 {
        font-size: 15px;
    }

    .form_tools {
        max-width: 100%;
    }
}

/* Home - hero */
.hero-wrapper {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border-bottom: 1px solid var(--border-2);
}

.hero-inner {
    max-width: 980px;
    margin: 28px auto;
    text-align: center;
    padding: 24px 16px 8px;
}

.hero-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    opacity: .9;
    margin-bottom: 8px;
    color: var(--brand-2); /* کل SVG از این رنگ می‌گیرد */

}

.hero-title {
    font-size: 22px;
    margin: 0;
    color: var(--text);
}

.hero-subtitle {
    color: var(--text-muted);
    margin: 6px 0 18px;
}

/* CTA group */
.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Reusable cards */
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 18px;
    box-shadow: var(--shadow-2);
    color: var(--text);
}

.feature-card i {
    font-size: 22px;
}

.feature-card h5 {
    margin: 10px 0 6px;
}

/* How it works */
.hiw {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .hiw {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.hiw-step {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: var(--text);
}

.hiw-index {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-2);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

/* Section headings */
.section-title {
    font-size: 18px;
    margin-bottom: 14px;
    color: var(--text);
}

/* CTA strip */
.cta-strip {
    border: 1px dashed var(--border);
    border-radius: 12px;
    margin-top: 28px;
    padding: 12px 16px;
    background: var(--surface);
    color: var(--text);
}

.home-banner {
    max-width: 980px;
    margin: 12px auto;
}

/* (تکراری‌های hero در فایل اصلی را هم توکنی کردم، اما نگه داشتم تا ساختار فایل‌ات بهم نخورد) */
.hero-inner {
    max-width: 980px;
    margin: 28px auto;
    text-align: center;
    padding: 24px 16px 12px;
}

.hero-title {
    font-size: 24px;
}

.hero-ctas {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.trust-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.trust-row i {
    margin-right: 4px;
}

.feature-card h3 {
    font-size: 16px;
    margin: 8px 0 6px;
}

.hiw {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .hiw {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.plan-card .card-title {
    font-weight: 600;
}

.xsmall {
    font-size: 12px;
}

.quote-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 16px;
    font-style: italic;
    box-shadow: var(--shadow-2);
    color: var(--text);
}

.quote-card footer {
    margin-top: 8px;
    font-style: normal;
    color: var(--text-muted);
    font-size: 13px;
    background: transparent;
    padding: 0;
}

.cta-strip {
    border: 1px dashed var(--border);
    border-radius: 12px;
    margin-top: 28px;
    padding: 12px 16px;
}

/* Article title box: wrap, justify, no scrollbar */
.article-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-align: justify;
    line-height: 1.35;
    word-break: break-word;
    hyphens: auto;
    font-size: .95rem;
    padding: .6rem .75rem;
    border: 1px solid var(--border);
    border-radius: .375rem;
    background: var(--surface-2);
    color: var(--text);
}

/* keep stars on the left */
.star-row {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

/* star rating (unchanged behavior) */
.star-rating {
    display: inline-flex !important;
    direction: ltr;
    flex-direction: row-reverse;
    gap: .35rem;
    white-space: nowrap;
    line-height: 1;
    align-items: center;
}

.star-rating input {
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    pointer-events: none !important;
}

.star-rating label {
    display: inline-block !important;
    cursor: pointer;
    user-select: none;
    font-size: 1.8rem;
    color: #c7c7c7; /* اگر خواستی توکن می‌کنیم */
    transition: transform .08s ease, color .12s ease;
}

.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #ffcc33;
    transform: scale(1.05);
}

.star-rating input:checked ~ label {
    color: #ffcc33;
}

/* Main header container */
.main-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--brand);
    color: #fff;
    height: var(--header-h);
    min-width: 0;
}

/* Logo + divider + title */
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 0;
    flex: 1 1 auto;
}

.header-logo {
    height: 34px;
    width: auto;
    filter: brightness(0) invert(1);
}

.header-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.25);
}

.header-title {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0;
    color: #f2f2f2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User info */
.header-user {
    margin-left: auto;
    color: #fff;
    font-size: 14px;
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    flex: 0 1 auto;
}

.header-user-icon {
    font-size: 18px;
}

.header-username {
    font-size: 14px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-action {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fff !important;
    text-decoration: none;
    padding: 0;
    flex-shrink: 0;
}

.header-action:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff !important;
}

.header-logout:hover {
    border-color: color-mix(in srgb, #fff 25%, var(--danger) 45%);
    color: #ffd6d6 !important;
}

@media (max-width: 900px) {
    .header-title {
        max-width: 260px;
    }

    .header-username {
        max-width: 120px;
    }
}

@media (max-width: 620px) {
    .header-divider,
    .header-title {
        display: none;
    }

    .header-brand {
        flex: 0 0 auto;
    }
}

/* Footer container */
.site-footer {
    background: var(--brand);
    color: #ddd;
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 1px solid #222; /* اگر خواستی: var(--border) */
}

/* Columns wrapper */
.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
}

/* Individual column */
.footer-col {
    flex: 1;
    min-width: 260px;
}

.footer-logo {
    height: 40px;
    filter: brightness(0) invert(1);
    margin-bottom: 12px;
}

.footer-powered {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 14px;
    color: #bfbfbf; /* اگر خواستی توکن می‌کنیم */
}

.footer-copy {
    font-size: 12px;
    color: #888; /* اگر خواستی توکن می‌کنیم */
}

.footer-col h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 12px;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    margin-bottom: 10px;
    font-size: 13px;
    color: #ccc; /* اگر خواستی توکن می‌کنیم */
    line-height: 1.5;
}

.site-footer a {
    color: #E9EEF7FF !important;
    text-decoration: none;
    transition: 0.2s;
}

.site-footer a:hover {
    color: #c6e7ff;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 28px;
    }
}

footer, .site-footer {
    margin-top: auto !important;
}

body.has-sidebar .site-footer {
    transition: margin-inline-start 0.3s ease, width 0.3s ease;
}

body.has-sidebar:not(.logged-in) .layout-wrapper {
    flex: 0 0 auto;
    height: auto;
    min-height: calc(100vh - var(--header-h));
}

#sidebar-toggle:checked ~ .site-footer {
    margin-inline-start: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
}

#sidebar-toggle:not(:checked) ~ .site-footer {
    margin-inline-start: 0;
    width: 100%;
}

.scroll-hint {
    position: fixed;
    right: 28px;
    bottom: 95px;
    z-index: 9999;
    color: #fff;
    font-size: 32px;
    opacity: 0.85;
    cursor: pointer;
    transition: opacity 0.3s ease;
    animation: scrollBounce 1.4s infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(6px);
    }
}

.scroll-hint.hide {
    opacity: 0;
    pointer-events: none;
}

/* ===== Dashboard: table -> cards on mobile/tablet ===== */
@media (max-width: 992px) {
    .dashboard-table thead {
        display: none;
    }

    .dashboard-table,
    .dashboard-table tbody,
    .dashboard-table tr {
        display: block;
        width: 100%;
    }

    .dashboard-table tr {
        margin-bottom: 14px;
        border: 1px solid var(--border-2);
        border-radius: 12px;
        background: var(--surface);
        box-shadow: var(--shadow-2);
        overflow: hidden;
        color: var(--text);
    }

    .dashboard-table td {
        display: flex;
        gap: 12px;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px solid var(--border-2);
        padding: 10px 12px;
        text-align: left !important;
        font-size: 14px;
        width: 100%;
        color: var(--text);
        background: var(--surface);
    }

    .dashboard-table tr td:last-child {
        border-bottom: none;
    }

    .dashboard-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        flex: 0 0 42%;
        white-space: nowrap;
    }

    .dashboard-table td > * {
        flex: 1 1 auto;
    }

    .dashboard-right {
        overflow-x: visible;
    }
}

/* Quick actions cards */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 10px 0 22px;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border: 1px solid var(--border-2);
    border-radius: 12px;
    background: var(--surface);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-2);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.quick-card:hover {
    transform: translateY(-2px);
    border-color: var(--border);
    box-shadow: var(--shadow-1);
}

.quick-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.quick-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.quick-card-title {
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .2px;
}

.quick-card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.quick-card-arrow {
    margin-left: auto;
    color: var(--text-muted);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Theme toggle button (header) */
.theme-toggle {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    box-shadow: none;
    padding: 0;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.10);
}

.theme-toggle__icon {
    font-size: 16px;
    line-height: 1;
}

.footer-about {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75); /* چون فوترت brand تیره است */
}

/* ===============================
   Intro.js – Theme-ready
   =============================== */

/* Overlay */
.introjs-overlay {
    background: rgba(0, 0, 0, 0.55) !important;
}

/* Highlight */
.pe-tour-highlight {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18),
    0 10px 30px rgba(0, 0, 0, 0.35) !important;
    border-radius: 10px !important;
}

/* Tooltip container */
.pe-tour-tooltip.introjs-tooltip {
    min-width: 260px;
    max-width: 320px;
    padding: 14px 16px 12px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;

    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border-2) !important;

    box-shadow: var(--shadow-strong) !important;
}

/* remove arrow */
.pe-tour-tooltip .introjs-arrow {
    display: none !important;
}

/* Title */
.pe-tour-tooltip .introjs-tooltip-title {
    font-weight: 700;
    font-size: 13px;
    margin: 0 0 6px;
    color: var(--text) !important;
}

/* Body text */
.pe-tour-tooltip .introjs-tooltiptext {
    padding-right: 24px;
    color: var(--text-muted) !important;
}

/* Buttons (base) */
.pe-tour-tooltip .introjs-button {
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;

    background: var(--surface-2) !important;
    color: var(--text) !important;

    font-size: 12px !important;
    font-weight: 600;
    padding: 7px 12px !important;

    box-shadow: none !important;
    text-shadow: none !important;
}

/* Next/Done */
.pe-tour-tooltip .introjs-nextbutton,
.pe-tour-tooltip .introjs-donebutton {
    background: var(--brand) !important;
    color: var(--text-on-brand) !important;
    border-color: var(--brand) !important;
}

/* Buttons wrapper */
.pe-tour-tooltip .introjs-tooltipbuttons {
    border-top: 1px solid var(--border-2) !important;
    padding-top: 10px !important;
    margin-top: 10px !important;
}

/* Skip */
.pe-tour-tooltip .introjs-skipbutton {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    font-size: 0 !important;
    cursor: pointer;
}

.pe-tour-tooltip .introjs-skipbutton::before {
    content: "×";
    font-size: 18px;
    color: var(--text-muted);
    line-height: 28px;
    display: block;
    text-align: center;
}

/* Progress */
.pe-tour-tooltip .introjs-progress {
    background: var(--border-2) !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    height: 6px !important;
    margin-bottom: 10px;
}

.pe-tour-tooltip .introjs-progressbar {
    background: var(--brand) !important;
}

/* Z-index safety */
.introjs-tooltip,
.introjs-helperLayer,
.introjs-overlay {
    z-index: 10000 !important;
}

/* Mobile tweaks */
@media (max-width: 768px) {
    .pe-tour-tooltip.introjs-tooltip {
        max-width: calc(100vw - 24px);
    }
}

/* =========================
   Auth pages (Login/Register/Reset) – theme-safe colors
   ========================= */

/* Title + subtitle */
.auth-title {
    color: var(--text);
}

.auth-subtitle {
    color: var(--text-muted);
}

/* Links */
.auth-links a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-links a:hover {
    opacity: .9;
}

/* Checkbox + label */
.auth-remember input[type="checkbox"] {
    accent-color: var(--brand);
}

/* Better focus for inputs in both themes */
form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form textarea:focus {
    box-shadow: 0 0 0 .2rem rgba(127, 127, 127, 0.22);
}

/* Toggle password icon color in dark/light */
.toggle-password {
    color: var(--text-muted);
}

.toggle-password:hover {
    color: var(--text);
}

.page-container a {
    color: var(--link);
}

.page-container a:hover {
    color: var(--link-hover, var(--link));
}

/* Ensure inputs follow theme */
.page-container input[type="text"],
.page-container input[type="email"],
.page-container input[type="password"] {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-2);
}

.page-container input::placeholder {
    color: var(--text-muted);
}

/* btn-custom must follow theme */
.page-container .btn-custom {
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand);
}

.page-container .btn-custom:hover {
    filter: brightness(1.05);
    color: #fff;
}

.page-title {
    margin-top: 0;
    color: var(--text);
    font-weight: 800;
    font-size: 30px;
    user-select: none;
    letter-spacing: 0;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    user-select: none;
    margin-top: 6px;
}

.page-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 15px;
    user-select: none;
}

.submission-form {
    width: min(100%, 720px);
    margin: 26px auto 0;
    padding: 24px;
    border: 1px solid var(--border-2);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

.submission-form label {
    margin-top: 16px;
    color: var(--text);
    font-size: 14px;
}

.submission-form label:first-of-type {
    margin-top: 0;
}

.submission-form input[type="text"],
.submission-form input[type="email"],
.submission-form input[type="file"],
.submission-form textarea {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.submission-form textarea {
    min-height: 140px;
}

.submission-form .btn-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    margin-top: 18px;
}

.upload-panel {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border-2);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 88%, var(--brand-accent-soft) 12%);
}

.upload-panel__icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--brand-accent-soft);
    color: var(--brand-accent);
    font-size: 22px;
}

.upload-panel__body label {
    margin-top: 0;
}

.upload-panel__hint {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.submission-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--border) 70%, #f59e0b 30%);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 84%, #f59e0b 16%);
    color: var(--text);
    font-size: 13px;
    line-height: 1.6;
}

.submission-alert i {
    color: #b7791f;
    margin-top: 2px;
}

@media (max-width: 992px) {
    .submission-form {
        padding: 18px;
    }

    .upload-panel {
        grid-template-columns: 1fr;
    }
}

/* =========================
   Paragraph Language Editing (theme-safe)
   ========================= */

/* Justify for input/output/compare */
.textarea-wrap textarea,
.card-content,
.diff-view {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

.card-content,
.diff-view,
.diff-view ins,
.diff-view del {
    font-family: inherit;
}

/* Tabs container */
.le-tabs {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-1);
}

.le-tablist {
    display: flex;
    gap: 0;
    padding: 4px;
    border-bottom: 1px solid var(--border-2);
    background: var(--surface-2);
}

.le-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;

    padding: 10px 12px;
    font-weight: 700;
    color: var(--text-muted);
    position: relative;
    border-radius: 8px;
    transition: background .15s ease, color .15s ease;
}

.le-tab svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.le-tab:hover {
    background: color-mix(in srgb, var(--surface) 70%, var(--text) 6%);
    color: var(--text);
}

.le-tab[aria-selected="true"] {
    color: var(--text);
    background: var(--surface);
}

.le-tab[aria-selected="true"]::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -5px;
    height: 3px;
    background: var(--text);
    border-radius: 3px;
}

.le-tab:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

/* Panels */
.le-panel {
    padding: 12px;
    min-height: 280px;
}

@media (max-width: 640px) {
    .le-panel {
        min-height: 220px;
    }
}

/* Notice (replaces fixed yellow colors) */
.le-notice {
    background: color-mix(in srgb, var(--surface) 85%, var(--link) 10%);
    border: 1px solid color-mix(in srgb, var(--border) 70%, var(--link) 25%);
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text);
    margin-bottom: 12px;
    font-size: 14px;
}

/* Labels and spacing */
.le-label {
    margin-top: 10px;
    display: inline-block;
}

/* Textarea wrap + counter */
.textarea-wrap {
    position: relative;
}

.textarea-wrap textarea {
    width: 100%;
}

.char-counter {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-2);
}

/* Icon button */
.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);

    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.icon-btn:hover {
    background: color-mix(in srgb, var(--surface-2) 80%, var(--text) 6%);
    border-color: var(--border-2);
}

/* Edited/Original cards */
.card-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 0;
    background: var(--surface-2);
    color: var(--text);
}

.card-success {
    background: color-mix(in srgb, var(--surface-2) 85%, var(--link) 10%);
    border-color: color-mix(in srgb, var(--border) 70%, var(--link) 25%);
}

.card-muted {
    background: var(--surface-2);
    border-color: var(--border-2);
}

.le-empty {
    color: var(--text-muted);
    font-size: 14px;
    padding: 10px;
}

/* Compare (diff) */
.diff-view {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 12px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text);
}

/* If your diff_html uses <ins>/<del> or classes, support both */
.diff-view ins,
.diff-ins {
    background: color-mix(in srgb, var(--surface-2) 80%, var(--link) 12%);
    color: var(--text);
    border-bottom: 2px solid color-mix(in srgb, var(--link) 85%, var(--text) 10%);
    padding: 0 1px;
    border-radius: 3px;
    text-decoration: none;
}

.diff-view del,
.diff-del {
    background: color-mix(in srgb, var(--surface-2) 75%, #ff4d4f 12%);
    color: var(--text);
    text-decoration: line-through;
    padding: 0 1px;
    border-radius: 3px;
}

/* Legend */
.diff-legend {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.diff-legend .legend-add {
    background: color-mix(in srgb, var(--surface-2) 80%, var(--link) 12%);
    border-bottom: 2px solid color-mix(in srgb, var(--link) 85%, var(--text) 10%);
    padding: 2px 6px;
    border-radius: 6px;
    margin-right: 8px;
}

.diff-legend .legend-del {
    background: color-mix(in srgb, var(--surface-2) 75%, #ff4d4f 12%);
    text-decoration: line-through;
    padding: 2px 6px;
    border-radius: 6px;
}

/* Toast */
.copy-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;

    background: var(--text);
    color: var(--surface);

    padding: 8px 12px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    box-shadow: var(--shadow-1);
    border: 1px solid var(--border-2);
}

.copy-toast.show {
    opacity: 1;
}

/* =========================
   Instruction Modal (theme-safe)
   ========================= */

.instruction-modal.modal-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    box-shadow: var(--shadow-1);
}

.instruction-modal .modal-header {
    border-bottom: 1px solid var(--border-2);
    background: var(--surface);
}

.instruction-modal .modal-title {
    color: var(--text);
}

.instruction-modal .btn-close {
    filter: var(--bs-btn-close-white-filter, none);
}

/* Body text sizing (replaces inline font-size) */
.instruction-body {
    font-size: 14px;
    color: var(--text);
}

/* Code blocks */
.instruction-code {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;

    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);

    background: var(--surface-2);
    color: var(--text);
    font-size: 13px;
    line-height: 1.6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* OK/Bad variants (subtle tint, still theme-safe) */
.instruction-code--ok {
    background: color-mix(in srgb, var(--surface-2) 85%, var(--link) 10%);
    border-color: color-mix(in srgb, var(--border) 70%, var(--link) 25%);
}

.instruction-code--bad {
    background: color-mix(in srgb, var(--surface-2) 80%, #ff4d4f 12%);
    border-color: color-mix(in srgb, var(--border) 70%, #ff4d4f 22%);
}

/* Warning paragraph */
.instruction-warning {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--border) 65%, #ff4d4f 22%);
    background: color-mix(in srgb, var(--surface-2) 80%, #ff4d4f 10%);
    color: var(--text);
    font-weight: 500;
}

.instruction-icon {
    margin-right: 6px;
}

/* Force close button visibility in both themes */
#instructionModal .btn-close {
    opacity: 1; /* بعضی وقت‌ها کمش می‌کنند */
}

/* Light mode: close icon should be dark */
html[data-theme="light"] #instructionModal .btn-close {
    filter: none !important; /* مطمئن شو invert روی لایت نیست */
}

/* Dark mode: close icon should be light */
html[data-theme="dark"] #instructionModal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}


/* =========================
   Track page (theme-safe)
   ========================= */

.track-form {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.track-input {
    min-width: 320px;
    max-width: 520px;
    width: 100%;
    padding: 10px 12px;

    background: var(--surface-2);
    color: var(--text);
    border: 1.8px solid var(--border);
    border-radius: 10px;
}

.track-input::placeholder {
    color: var(--text-muted);
}

.track-input:focus {
    outline: none;
    border-color: var(--link);
}

/* Button */
.track-btn {
    padding: 10px 16px;
    border-radius: 10px;
}

/* Messages */
.message {
    margin: 14px auto 0;
    max-width: 720px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-1);
}

.message--error {
    border-color: color-mix(in srgb, var(--border-2) 70%, #ff4d4f 25%);
    background: color-mix(in srgb, var(--surface-2) 80%, #ff4d4f 10%);
}

/* Status pill */
.status-pill {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text) !important;
}

/* Success / Warning / Error variants */
.status-pill--ok {
    background: color-mix(in srgb, var(--surface) 82%, var(--link) 12%) !important;
    border-color: color-mix(in srgb, var(--border) 70%, var(--link) 25%) !important;
    color: var(--success) !important;
}

.status-pill--warn {
    background: color-mix(in srgb, var(--surface) 82%, #f59e0b 12%) !important;
    border-color: color-mix(in srgb, var(--border) 70%, #f59e0b 25%) !important;
    color: #e67e22 !important;
}

.status-pill--bad {
    background: color-mix(in srgb, var(--surface) 82%, #ff4d4f 12%) !important;
    border-color: color-mix(in srgb, var(--border) 70%, #ff4d4f 25%) !important;
    color: var(--danger) !important;
}

/* =========================
   Subscription Plans (theme-safe)
   ========================= */

.theme-link {
    color: var(--link);
}

.theme-link:hover {
    color: var(--link-hover);
}

.plan-tabs.nav-tabs {
    border-bottom: 1px solid var(--border-2);
}

.plan-tabs .nav-link {
    color: var(--text-muted);
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    padding: 10px 14px;
    font-weight: 500;
}

.plan-tabs .nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border-2);
}

.plan-tabs .nav-link.active {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border-2);
    border-bottom-color: var(--surface);
}

/* Cards */
.plan-card.card {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-2);
    border-radius: 14px;
    box-shadow: var(--shadow-1);
}

.plan-title {
    color: var(--text);
    font-weight: 900;
}

.plan-muted {
    color: var(--text-muted);
}

.plan-price {
    color: var(--text);
    font-weight: 900;
    font-size: 18px;
}

.plan-footnote {
    color: var(--text-muted);
}

/* Icons (use opacity rather than bootstrap text-* colors) */
.plan-icon {
    opacity: 0.9;
}

.plan-icon--primary {
    color: var(--link) !important;
}

.plan-icon--success {
    color: color-mix(in srgb, var(--link) 50%, #22c55e 50%);
}

.plan-icon--warning {
    color: color-mix(in srgb, var(--link) 20%, #f59e0b 80%);
}


/* =========================
   Subscription Details (theme-safe)
   ========================= */

.sub-card.card {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-2);
    border-radius: 14px;
    box-shadow: var(--shadow-1);
}

.sub-card-header.card-header {
    background: var(--surface-2);
    color: var(--text);
    border-bottom: 1px solid var(--border-2);
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.sub-meta {
    color: var(--text);
}

.sub-meta strong {
    color: var(--text);
}

/* Table */
.sub-table.table {
    margin-bottom: 14px;
    color: var(--text);
}

.sub-table th {
    color: var(--text-muted) !important;
    font-weight: 800;
    width: 45%;
    border-color: var(--border-2) !important;
}

.sub-table td {
    color: var(--text) !important;
    border-color: var(--border-2) !important;
}

.sub-table > :not(caption) > * > * {
    background-color: transparent !important;
}

/* Credit */
.sub-credit {
    font-weight: 900;
    color: var(--text);
}


/* Button: theme-safe outline style */
.sub-btn.btn {
    background: transparent;
    color: var(--text);
    border: 1.8px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
}

.sub-btn.btn:hover {
    background: var(--surface-2);
    border-color: var(--border-2);
}


/* =========================
   Edit Profile (theme-safe)
   ========================= */

.profile-form {
    max-width: 640px; /* جایگزین width:40% */
    width: 100%;
    margin: 0 auto;
    padding: 10px 0;
}

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

.profile-field label {
    display: block;
    margin-top: 10px;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--text);
}

/* Make inputs consistent with theme (if not already globally styled) */
.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="password"] {
    width: 100%;
    background: var(--surface-2);
    color: var(--text);
    border: 1.8px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    min-height: 44px;
    line-height: 1.25;
    resize: none;
}

.profile-form input::placeholder {
    color: var(--text-muted);
}

.profile-form input:focus {
    outline: none;
    border-color: var(--link);
}


/* Submit button spacing */
.profile-submit {
    width: 100%;
    margin-top: 14px;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-form {
        padding: 0 12px;
    }
}


/* =========================
   Auth (Register/Login) – theme-safe
   ========================= */

.auth-form {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    padding: 10px 12px;
}

.auth-field label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--text);
}

/* Inputs */
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    background: var(--surface-2);
    color: var(--text);
    border: 1.8px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    min-height: 44px;
    line-height: 1.25;
    resize: none;
}

.auth-form input::placeholder {
    color: var(--text-muted);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--link);
}

/* Submit */
.auth-submit {
    width: 100%;
    margin-top: 14px;
    border-radius: 12px;
}

/* Bottom text */
.auth-footnote {
    font-size: 13px;
    margin-top: 20px;
    color: var(--text-muted);
}


/* =========================
   Contact form (theme-safe)
   ========================= */

.contact-form {
    margin-top: 25px;
    max-width: 960px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 12px;
}

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

.contact-field label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--text);
}

.contact-input,
.contact-textarea {
    width: 100%;
    background: var(--surface-2);
    color: var(--text);
    border: 1.8px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}

.contact-textarea {
    resize: vertical;
    min-height: 140px;
}

.contact-input::placeholder,
.contact-textarea::placeholder {
    color: var(--text-muted);
}

.contact-input:focus,
.contact-textarea:focus {
    outline: none;
    border-color: var(--link);
}

.contact-submit {
    width: 100%;
    margin-top: 14px;
    border-radius: 12px;
}

.contact-field {
    margin-bottom: 14px;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   Thank You page (theme-safe)
   ========================= */

.thank-card {
    max-width: 720px;
    margin: 50px auto;
    padding: 36px 40px;

    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border-2);
    border-radius: 14px;
    box-shadow: var(--shadow-1);

    text-align: center;
}

.thank-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 900;
    color: var(--text);
}

/* subtle success accent (theme-safe) */
.thank-title::before {
    content: "✓";
    display: inline-block;
    margin-right: 10px;
    color: color-mix(in srgb, var(--link) 40%, #22c55e 60%);
}

.thank-text {
    font-size: 16px;
    color: var(--text);
    margin: 8px 0;
}

.thank-text--spaced {
    margin-top: 16px;
}

.thank-subtext {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-muted);
}

.thank-code {
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

@media (max-width: 768px) {
    .thank-card {
        margin: 24px auto;
        padding: 22px 18px;
    }
}

.hero-logo-mask {
    width: 260px;
    height: 260px;
    background-color: var(--logo-color);
    -webkit-mask: url("/static/img/p-editor-logo.svg") no-repeat center / contain;
    mask: url("/static/img/p-editor-logo.svg") no-repeat center / contain;
}

/* =========================
   Status / Success pages
   ========================= */

.status-card {
    max-width: 720px;
    width: 100%;
    margin: 40px auto;
    padding: 28px 22px;

    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 14px;
    box-shadow: var(--shadow-1);
}

.status-actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.status-btn {
    max-width: 220px;
    width: 100%;
    text-align: center;
    border-radius: 12px;
}


/* ==========================================
   RTL / LTR Logical Properties Support
   این بخش را در انتهای styles.css اضافه کن
   ========================================== */

/* ---------- Sidebar positioning ---------- */
.sidebar {
    inset-inline-start: 0; /* جایگزین left: 0 */
    left: auto;
    right: auto;
}

/* دسکتاپ: main بعد از sidebar قرار گیرد */
body.has-sidebar .layout-wrapper main,
body.has-sidebar .layout-wrapper footer {
    margin-inline-start: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    transition: margin-inline-start 0.3s ease;
}

/* وقتی sidebar بسته است */
#sidebar-toggle:not(:checked) ~ .layout-wrapper main,
#sidebar-toggle:not(:checked) ~ .layout-wrapper footer {
    margin-inline-start: 0;
    width: 100%;
}

/* حرکت سایدبار هنگام بسته شدن */
#sidebar-toggle:not(:checked) ~ .layout-wrapper .sidebar {
    transform: translateX(
            calc(
                    (var(--dir-multiplier, -1)) * var(--sidebar-w)
            )
    );
}

/* مقدار پیش‌فرض برای LTR */
html {
    --dir-multiplier: -1;
}

/* در RTL سایدبار باید به سمت راست خارج شود */
html[dir="rtl"] {
    --dir-multiplier: 1;
}

/* ---------- Active indicator in sidebar ---------- */
.sidebar nav a.active::before {
    inset-inline-start: 6px; /* جایگزین left: 6px */
    left: auto;
    right: auto;
}

/* ---------- Header user alignment ---------- */
.header-user {
    margin-inline-start: auto; /* جایگزین margin-left: auto */
    margin-left: 0;
    margin-right: 0;
}

/* ---------- Quick card arrow ---------- */
.quick-card-arrow {
    margin-inline-start: auto; /* جایگزین margin-left: auto */
    margin-left: 0;
    margin-right: 0;
}

/* ---------- Floating alerts ---------- */
#floating-alert-wrapper {
    inset-inline-end: 24px; /* جایگزین right: 24px */
    right: auto;
    left: auto;
}

.close-alert {
    inset-inline-end: 10px; /* جایگزین right: 10px */
    right: auto;
    left: auto;
}

.alert-progress {
    inset-inline-start: 0; /* جایگزین left: 0 */
    left: auto;
    right: auto;
}

/* ---------- Password toggle ---------- */
.toggle-password {
    inset-inline-end: 14px; /* جایگزین right: 14px */
    right: auto;
    left: auto;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-inline-end: 42px;
    padding-right: 0;
    padding-left: 0;
}

/* ---------- Profile hover box ---------- */
.profile-hover-box {
    inset-inline-start: 0; /* جایگزین left: 0 */
    left: auto;
    right: auto;
}

/* ---------- Scroll hint ---------- */
.scroll-hint {
    inset-inline-end: 28px; /* جایگزین right: 28px */
    right: auto;
    left: auto;
}

/* ---------- Character counter ---------- */
.char-counter {
    inset-inline-end: 10px; /* جایگزین right: 10px */
    right: auto;
    left: auto;
}

/* ---------- Copy toast ---------- */
.copy-toast {
    inset-inline-end: 16px; /* جایگزین right: 16px */
    right: auto;
    left: auto;
}

/* ---------- Intro.js skip button ---------- */
.pe-tour-tooltip .introjs-skipbutton {
    inset-inline-end: 10px; /* جایگزین right: 10px */
    right: auto;
    left: auto;
}

.pe-tour-tooltip .introjs-tooltiptext {
    padding-inline-end: 24px;
    padding-right: 0;
    padding-left: 0;
}

/* ---------- Subscription box accent ---------- */
.subscription-box {
    border-inline-start: 4px solid var(--success); /* جایگزین border-left */
    border-left: none;
}

/* ---------- Footer spacing ---------- */
.footer-list,
.errorlist {
    padding-inline-start: 0;
    padding-left: 0;
    padding-right: 0;
}

/* ---------- Trust row icons ---------- */
.trust-row i,
.instruction-icon {
    margin-inline-end: 4px;
    margin-right: 0;
    margin-left: 0;
}

/* ---------- Thank title check mark ---------- */
.thank-title::before {
    margin-inline-end: 10px;
    margin-right: 0;
    margin-left: 0;
}

/* ---------- Dashboard mobile labels ---------- */
@media (max-width: 768px) {
    .dashboard-table td {
        text-align: start !important;
    }

    .dashboard-table td::before {
        text-align: start;
    }
}

/* ---------- Mobile sidebar ---------- */
@media (max-width: 768px) {
    .sidebar {
        inset-inline-start: 0;
        left: auto;
        right: auto;
        transform: translateX(calc(var(--dir-multiplier, -1) * 100%));
    }

    #sidebar-toggle:checked ~ .layout-wrapper .sidebar {
        transform: translateX(0);
    }
}

/* ---------- Logical text alignment helpers ---------- */
.page-title,
.page-subtitle,
.page-note,
.auth-footnote,
.footer-about,
.hero-subtitle,
.plan-muted,
.plan-footnote,
.sub-meta,
.thank-subtext {
    text-align: start;
}

/* ---------- Forms and labels ---------- */
form label,
.auth-field label,
.contact-field label,
.profile-field label {
    text-align: start;
}

/* ---------- Inputs and textareas ---------- */
input,
textarea,
select {
    text-align: start;
}

/* ---------- Utility classes ---------- */
.text-start-logical {
    text-align: start !important;
}

.text-end-logical {
    text-align: end !important;
}

.ms-auto-logical {
    margin-inline-start: auto !important;
}

.me-auto-logical {
    margin-inline-end: auto !important;
}

