:root {
    --bg: #f4f5f8;
    --card: #ffffff;
    --ink: #1a2332;
    --muted: #5c6678;
    --primary: #5b4cdb;
    --primary-hover: #4839c2;
    --sun: #ffcf5c;
    --pink: #ff7ab6;
    --mint: #8be8cb;
    --line: #e8eaef;
    --border-card: rgba(15, 23, 42, 0.07);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 40px rgba(15, 23, 42, 0.06);
    --radius-card: 14px;
    --radius-btn: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

img {
    display: block;
    width: 100%;
}

button,
.primary,
.ghost-button,
.whatsapp {
    border: 0;
    border-radius: var(--radius-btn);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 42px;
    padding: 0.62rem 1rem;
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.12s ease,
        box-shadow 0.15s ease;
}

button:active,
.primary:active,
.whatsapp:active {
    transform: translateY(1px);
}

.primary {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

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

.primary.small {
    min-height: 36px;
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
}

.card .primary,
.auth-card .primary {
    font-weight: 600;
}

.ghost-button {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
}

.card button:not(.primary),
.card .btn-muted {
    font-weight: 600;
    border-radius: var(--radius-btn);
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}

.card button:not(.primary):hover,
.auth-card button:not(.primary):hover {
    background: #f8f9fb;
    border-color: #dce0e8;
}

.topbar-install {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    min-height: auto;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
}

.topbar-install:hover {
    color: var(--ink);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.8);
}

.whatsapp {
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    font-weight: 600;
    box-shadow: none;
}

.whatsapp:hover {
    background: #d1fae5;
}

.support-float {
    position: fixed;
    right: 1rem;
    bottom: calc(5.6rem + env(safe-area-inset-bottom));
    z-index: 22;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1rem;
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 25;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.62rem 1rem;
    border-bottom: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--ink);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    min-width: 0;
    flex: 1;
}

.brand:hover {
    color: var(--primary);
}

.brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-mark {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.locale-bar {
    display: flex;
    justify-content: center;
    padding: 0.38rem 1rem 0.5rem;
    background: transparent;
}

.locale-bar__track {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: #eef0f4;
    border: 1px solid var(--line);
}

.locale-bar__opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.65rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-decoration: none;
    transition:
        background 0.12s ease,
        color 0.12s ease;
}

.locale-bar__opt:hover {
    color: var(--ink);
}

.locale-bar__opt.is-active {
    color: var(--ink);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.tabs {
    position: sticky;
    top: 66px;
    z-index: 4;
    display: flex;
    gap: 0.45rem;
    padding: 0 1rem 0.85rem;
    overflow-x: auto;
    background: rgba(255, 249, 237, 0.88);
    backdrop-filter: blur(18px);
}

.tabs a,
.tabs button {
    min-height: 38px;
    white-space: nowrap;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.55rem 0.8rem;
    font-size: 0.92rem;
}

.tabs form {
    margin: 0;
}

.shell {
    width: min(1040px, 100%);
    margin: 0 auto;
    padding: 1rem;
}

.auth-card,
.card,
.hero,
.event-card {
    background: var(--card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(460px, calc(100% - 2rem));
    margin: 2rem auto;
    padding: 1.25rem;
}

.card,
.hero {
    padding: 1.1rem;
    margin-bottom: 1rem;
}

.guide-card {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-card);
    background: #fff;
    border: 1px solid var(--border-card);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.guide-card strong,
.form-help strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 700;
}

.guide-card p,
.form-help p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.guide-card--admin {
    border-left: 3px solid #64748b;
}

.form-help {
    margin: 0.6rem 0 1rem;
    padding: 0.85rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--card);
    border-left: 3px solid var(--primary);
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(1.8rem, 9vw, 3.3rem);
    line-height: 0.95;
    margin-bottom: 0.65rem;
}

h2 {
    font-size: 1.06rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.eyebrow {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

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

.center {
    text-align: center;
}

.stack,
.grid-form {
    display: grid;
    gap: 0.85rem;
}

.grid-form {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.wide {
    grid-column: 1 / -1;
}

label,
legend {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius-btn);
    padding: 0.65rem 0.85rem;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--primary), var(--line));
    box-shadow: 0 0 0 3px rgba(91, 76, 219, 0.12);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 1rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.chips label {
    display: inline-flex;
    align-items: center;
    width: auto;
    padding: 0.5rem 0.7rem;
    color: var(--ink);
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.chips input {
    width: auto;
    min-height: auto;
}

.flash {
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.flash.success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #bbf7d0;
}

.flash.error {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.stat {
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-card);
    box-shadow: none;
}

.stat strong {
    display: block;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.stat span {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: capitalize;
}

.event-grid {
    display: grid;
    gap: 1rem;
}

.content-grid {
    display: grid;
    gap: 1rem;
}

.event-card,
.content-card {
    overflow: hidden;
    transition:
        transform 0.14s ease,
        box-shadow 0.14s ease;
}

.event-card:hover,
.content-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 16px 42px rgba(15, 23, 42, 0.08);
}

.event-card img,
.content-card img {
    height: 190px;
    object-fit: cover;
}

.event-card > div,
.content-card > div {
    padding: 1rem;
}

.event-card form {
    margin-top: 0.9rem;
}

.event-card .primary {
    width: 100%;
}

.content-card {
    background: var(--card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.price {
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
    font-weight: 800;
}

.article-view img {
    margin: 0.8rem 0 1rem;
    border-radius: var(--radius-card);
}

.article-body {
    color: var(--ink);
    line-height: 1.8;
}

.article-inline-image {
    max-height: 260px;
    object-fit: cover;
}

.quick-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
    margin: 1rem 0;
}

.quick-card {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.85rem 1rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-btn);
}

.quick-card--primary {
    min-height: 76px;
    border-color: rgba(91, 76, 219, 0.22);
    background: rgba(91, 76, 219, 0.06);
}

.quick-card strong,
.quick-card small {
    display: block;
}

.quick-card small {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

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

.shop-admin-actions {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.category-manager {
    padding: 0;
    overflow: hidden;
}

.category-manager summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 1rem;
    cursor: pointer;
    font-weight: 800;
}

.category-manager summary::after {
    content: "+";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #eef0f4;
}

.category-manager[open] summary::after {
    content: "-";
}

.category-add-form,
.category-card-grid {
    padding: 0 1rem 1rem;
}

.category-card-grid {
    display: grid;
    gap: 0.8rem;
}

.category-card {
    display: grid;
    gap: 0.7rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: #fafbfc;
}

.category-card__head,
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.section-title-row {
    margin-bottom: 1rem;
}

.section-title-row h2 {
    margin-bottom: 0;
}

.admin-product-grid {
    display: grid;
    gap: 1rem;
}

.admin-product-card {
    overflow: hidden;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.admin-product-card img,
.admin-product-card__placeholder {
    height: 180px;
    object-fit: cover;
}

.admin-product-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    font-weight: 800;
}

.admin-product-card__body {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
}

.admin-product-card__body strong {
    font-size: 1.05rem;
}

.admin-product-card__body .row-action {
    width: 100%;
}

.empty-state {
    display: grid;
    justify-items: start;
    gap: 0.6rem;
    padding: 1rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius-card);
    background: #fafbfc;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ink);
}

.inline-check input {
    width: auto;
    min-height: auto;
}

.editor-textarea {
    min-height: 280px;
    line-height: 1.6;
}

.editor-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
}

.list-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
}

.list-row:last-child {
    border-bottom: 0;
}

.list-row span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
}

.row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    border-radius: 9px;
    border: 1px solid var(--line);
    color: var(--ink);
    background: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
}

.row-action:hover {
    background: #f8fafc;
}

.row-action--primary {
    border-color: transparent;
    color: #fff;
    background: var(--primary);
}

.row-action--primary:hover {
    color: #fff;
    background: var(--primary-hover);
}

.pill {
    display: inline-flex !important;
    width: fit-content;
    padding: 0.28rem 0.55rem;
    color: var(--muted) !important;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 0.75rem !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.split {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.skill-edit {
    display: grid;
    grid-template-columns: 1fr 64px 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
}

.points-form {
    display: grid;
    gap: 0.8rem;
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
}

.mini-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.7rem 0;
}

.mini-totals span {
    padding: 0.4rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--dot), white 80%);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 600;
}

.chart {
    max-height: 320px;
}

@media (min-width: 720px) {
    .shell {
        padding: 1.5rem;
    }

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

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

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

    .list-row {
        grid-template-columns: 1fr auto auto auto;
    }

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

@media (max-width: 520px) {
    .hero,
    .split {
        align-items: flex-start;
        flex-direction: column;
    }

    .skill-edit {
        grid-template-columns: 1fr;
    }
}

html[lang="fa"] body,
html[lang="ar"] body {
    font-family: "Vazirmatn", "Noto Naskh Arabic", Inter, ui-sans-serif, system-ui, sans-serif;
}

.shell--with-nav {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.4rem 0.35rem calc(0.5rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    max-width: 104px;
    margin: 0 auto;
    padding: 0.4rem 0.15rem;
    border-radius: 16px;
    font-size: 0.66rem;
    font-weight: 900;
    color: var(--muted);
    text-decoration: none;
}

.bottom-nav__ico {
    font-size: 1.22rem;
    line-height: 1;
}

.bottom-nav__item.is-active {
    color: var(--primary);
    background: rgba(91, 76, 219, 0.08);
}

.hero--compact {
    align-items: flex-start;
}

.hero--compact h1 {
    font-size: clamp(1.35rem, 5vw, 2rem);
}

.hero--admin {
    border-left-color: #64748b;
}

.skill-chart-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.skill-chart-cell {
    padding: 0.85rem;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-card);
    background: #fafbfc;
}

.skill-chart-cell h3 {
    margin: 0 0 0.45rem;
    font-size: 1rem;
}

.chart-line-mini {
    max-height: 220px;
}

.chart-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.chart-values span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.55rem;
    border-radius: 999px;
    color: var(--ink);
    background: color-mix(in srgb, var(--dot), white 82%);
    font-size: 0.8rem;
    font-weight: 700;
}

.chart-values strong {
    font-weight: 700;
}

.chart--overview {
    max-height: 320px;
}

.stats--admin .stat {
    border: 1px solid var(--border-card);
}

.card--elevated {
    border-color: var(--border-card);
}

.skill-edit--wide {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-items: start;
}

.locale-option {
    display: inline-flex;
    padding: 0.38rem 0.75rem;
    margin: 0.25rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--muted);
    background: #fff;
    text-decoration: none;
}

.locale-option:hover {
    color: var(--ink);
}

.locale-option.is-active {
    border-color: transparent;
    background: #eef0f4;
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.lang-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

button.wide {
    width: 100%;
}

.admin-more {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 720px) {
    .skill-chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-admin-actions,
    .admin-product-grid,
    .category-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
