/*
   Iran Rebate — Onboarding Portal
   Refined • Minimal • Glassmorphic Blue Theme
   (class names kept compatible with app.js)
*/

:root {
    --bg: #eef4fb;
    --bg-gradient: radial-gradient(1200px 600px at 80% -10%, rgba(37,99,235,0.10) 0%, rgba(37,99,235,0) 60%),
                   radial-gradient(900px 500px at 0% 0%, rgba(14,165,233,0.08) 0%, rgba(14,165,233,0) 55%),
                   linear-gradient(180deg, #eef4fb 0%, #f4f8fc 100%);
    --card-bg: rgba(255, 255, 255, 0.66);
    --card-solid: #ffffff;
    --card-border: rgba(37, 99, 235, 0.10);
    --card-hover-border: rgba(37, 99, 235, 0.30);
    --text-main: #0f1e36;
    --text-muted: #41506a;
    --text-light: #7486a0;
    --primary: #2563eb;
    --primary-2: #0ea5e9;
    --primary-hover: #1d4ed8;
    --primary-bg: rgba(37, 99, 235, 0.055);
    --primary-border: rgba(37, 99, 235, 0.16);
    --warning: #f59e0b;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --error: #ef4444;
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 9px;
    --glow-color: rgba(37, 99, 235, 0.10);
    --shadow: 0 6px 26px -10px rgba(31, 51, 99, 0.18);
    --shadow-soft: 0 2px 10px -4px rgba(31, 51, 99, 0.12);
    --grad-primary: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

:root.dark, body.dark {
    --bg: #060a12;
    --bg-gradient: radial-gradient(1200px 600px at 80% -10%, rgba(59,130,246,0.14) 0%, rgba(59,130,246,0) 60%),
                   linear-gradient(180deg, #070d18 0%, #060a12 100%);
    --card-bg: rgba(17, 25, 42, 0.62);
    --card-solid: #0d1526;
    --card-border: rgba(96, 165, 250, 0.14);
    --card-hover-border: rgba(96, 165, 250, 0.38);
    --text-main: #f1f6fd;
    --text-muted: #c2cfe2;
    --text-light: #8294ad;
    --primary: #3b82f6;
    --primary-2: #38bdf8;
    --primary-hover: #2563eb;
    --primary-bg: rgba(59, 130, 246, 0.10);
    --primary-border: rgba(59, 130, 246, 0.22);
    --warning: #fbbf24;
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.10);
    --error: #f87171;
    --glow-color: rgba(59, 130, 246, 0.16);
    --shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 2px 12px -6px rgba(0, 0, 0, 0.5);
    --grad-primary: linear-gradient(135deg, #3b82f6 0%, #38bdf8 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Yekan Bakh', 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.85;
    min-height: 100vh;
    overflow-x: clip;
    transition: background 0.3s ease, color 0.3s ease;
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ---------- Glass card ---------- */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: var(--shadow);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    position: relative;
    overflow: hidden;
}
.glass-card:hover {
    border-color: var(--card-hover-border);
    box-shadow: 0 14px 40px -16px var(--glow-color);
}

/* ---------- Sticky glass header ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 6px 24px -16px rgba(37, 99, 235, 0.45);
}
:root.dark .topbar, body.dark .topbar { background: rgba(10, 16, 28, 0.62); }
.topbar-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
    height: 56px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.brand img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 8px;
}
.brand span { white-space: nowrap; }
.nav-links {
    display: flex;
    gap: 1px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    justify-content: center;
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
    position: relative;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 11px;
    border-radius: 50px;
    transition: color 0.25s, background 0.25s;
    white-space: nowrap;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.active {
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 4px 12px -4px var(--primary);
}
.header-cta {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 7px 14px;
    border-radius: 50px;
    border: 1px solid var(--primary-border);
    white-space: nowrap;
    transition: background 0.25s, color 0.25s;
}
.header-cta:hover { background: var(--primary); color: #fff; }

@media(max-width: 720px) {
    .brand span { display: none; }
    .header-cta { padding: 7px 10px; }
}

/* ---------- Sections ---------- */
section { padding: 30px 0; scroll-margin-top: 74px; }
.sec-head { margin-bottom: 18px; }
.sec-title {
    font-size: 15.5px;
    font-weight: 800;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    letter-spacing: -0.2px;
}
.sec-title i { font-size: 17px; }
.sec-subtitle {
    font-size: 11.5px;
    color: var(--text-light);
    font-weight: 500;
}
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 3px 10px;
    border-radius: 50px;
    margin-bottom: 10px;
}

/* ---------- Hero (full blue, minimal faded motifs) ---------- */
.hero-sec { padding-top: 30px; padding-bottom: 12px; }
.hero-card {
    text-align: center;
    padding: 54px 36px 50px;
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        radial-gradient(820px 320px at 50% -30%, rgba(125, 211, 252, 0.40) 0%, rgba(125, 211, 252, 0) 62%),
        linear-gradient(135deg, #16307a 0%, #1d4ed8 46%, #0ea5e9 100%);
    box-shadow: 0 28px 72px -32px rgba(29, 78, 216, 0.8);
}
/* طرح مینیمال محو: شبکه‌ی نقطه‌ای ظریف */
.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.10) 1px, transparent 0);
    background-size: 24px 24px;
    opacity: 0.55;
    z-index: 0;
}
/* طرح مینیمال محو: حلقه‌های متحدالمرکز ظریف */
.hero-card::after {
    content: '';
    position: absolute;
    top: -150px; left: 50%; transform: translateX(-50%);
    width: 560px; height: 560px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 64px rgba(255, 255, 255, 0.045), 0 0 0 150px rgba(255, 255, 255, 0.03);
    z-index: 0;
}
.hero-card > * { position: relative; z-index: 1; }
.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50px;
    padding: 5px 15px;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 18px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.hero-card h1 {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.55;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}
.hero-card h1 .grad { color: #bae6fd; }
.hero-card p {
    font-size: 12.5px;
    line-height: 1.95;
    color: rgba(255, 255, 255, 0.9);
    max-width: 620px;
    margin: 0 auto 16px;
    font-weight: 500;
}
.hero-slogan {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.26);
    padding: 6px 18px;
    border-radius: 50px;
}

/* ---------- About: lead + feedback + tools ---------- */
.about-lead { font-size: 12.5px; color: var(--text-muted); line-height: 1.95; font-weight: 500; }
.about-callout {
    background: var(--primary-bg);
    border-right: 3px solid var(--primary);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 12px;
    color: var(--primary);
}
.about-why {
    border-top: 1px dashed var(--card-border);
    padding-top: 13px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.9;
}

.feedback-block {
    border-top: 1px solid var(--card-border);
    padding-top: 20px;
    margin-top: 4px;
}
.feedback-head {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
    display: flex; align-items: center; gap: 7px;
}
.feedback-head i { color: var(--primary); font-size: 16px; }
.feedback-sub { font-size: 11.5px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.85; }
.feedback-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 11px;
}
.fb-step {
    position: relative;
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    padding: 14px 14px 13px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s, border-color 0.25s;
}
.fb-step:hover { transform: translateY(-3px); border-color: var(--primary-border); }
.fb-step-num {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: #fff;
    font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 9px;
    box-shadow: 0 4px 10px -3px var(--primary);
}
.fb-step strong { font-size: 11.5px; color: var(--text-main); display: block; margin-bottom: 4px; }
.fb-step p { font-size: 10.5px; color: var(--text-muted); line-height: 1.7; }
.fb-step a { color: var(--primary); font-weight: 800; text-decoration: none; }
.fb-step a:hover { text-decoration: underline; }
.fb-cta {
    display: inline-flex; align-items: center; gap: 7px;
    margin-top: 14px;
    background: var(--grad-primary);
    color: #fff;
    font-size: 11.5px; font-weight: 800;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 50px;
    box-shadow: 0 8px 20px -8px var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}
.fb-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -8px var(--primary); }

/* ---------- Tools: thin bar ---------- */
.tools-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 10px 18px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    margin-top: 18px;
}
.tools-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.tools-title i { color: var(--primary); font-size: 14px; }
.tools-list { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 700;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 50px;
    border: 1px solid var(--card-border);
    background: var(--card-solid);
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
    white-space: nowrap;
}
.tool-item:hover { color: var(--primary); border-color: var(--primary-border); transform: translateY(-1px); }
.tool-item i { font-size: 14px; }

/* ---------- Culture: refined curved mind-map ---------- */
.culture-map-container {
    position: relative;
    padding: 26px 0 14px;
    min-height: 330px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.culture-connections-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.culture-nodes-grid {
    display: grid;
    grid-template-columns: 1fr 150px 1fr;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 740px;
    z-index: 2;
}
@media(max-width: 680px) {
    .culture-nodes-grid { grid-template-columns: 1fr; gap: 9px; }
    .culture-connections-svg { display: none; }
}
.culture-col-left, .culture-col-right {
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.culture-node-center {
    background: var(--grad-primary);
    border: none;
    border-radius: 50%;
    width: 104px;
    height: 104px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 12px;
    color: #fff;
    box-shadow: 0 12px 30px -8px var(--primary);
    text-align: center;
    line-height: 1.5;
    padding: 10px;
    position: relative;
}
.culture-node-center::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 1px dashed var(--primary-border);
}
.culture-node-leaf {
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    padding: 7px 14px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s, border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.culture-node-leaf:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.04);
}

/* ---------- Competencies ---------- */
.comp-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 auto 22px;
    padding: 4px;
    background: var(--primary-bg);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    width: fit-content;
    max-width: 100%;
    justify-content: center;
}
.comp-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 800;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: color 0.25s, background 0.25s, box-shadow 0.25s;
}
.comp-tab-btn.active {
    background: var(--card-solid);
    color: var(--primary);
    box-shadow: var(--shadow-soft);
}
.comp-tab-content {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}
.comp-tab-content.active { display: grid; animation: fadeIn .35s ease-out; }
.comp-card {
    position: relative;
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 18px 16px 16px;
    overflow: hidden;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.comp-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 3px; height: 100%;
    background: var(--grad-primary);
    opacity: 0;
    transition: opacity 0.25s;
}
.comp-card:hover { transform: translateY(-4px); border-color: var(--primary-border); box-shadow: var(--shadow); }
.comp-card:hover::before { opacity: 1; }
.comp-card-icon {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 19px;
    margin-bottom: 11px;
}
.comp-card h4 { font-size: 12.5px; font-weight: 800; margin-bottom: 6px; color: var(--text-main); }
.comp-card p { font-size: 10.5px; color: var(--text-muted); line-height: 1.75; }

/* ---------- Org: compact team bubbles + detail panel ---------- */
.org-teams { display: flex; justify-content: center; width: 100%; overflow-x: auto; }
/* درخت: مدیریت بالا، دایره‌های تیم همه در یک خط و وصل با خطوط اتصال */
.org-tree2, .org-tree2 ul { list-style: none; margin: 0; padding: 0; }
.org-tree2 { display: inline-flex; justify-content: center; min-width: 100%; }
.org-tree2 > li { display: flex; flex-direction: column; align-items: center; }
.org-ceo-node {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    background: var(--card-solid);
    border: 1.5px solid var(--warning);
    border-radius: 50px;
    padding: 7px 18px 7px 8px;
    box-shadow: 0 8px 22px -12px rgba(245, 158, 11, 0.6);
    position: relative;
    z-index: 2;
}
.org-ceo-node img {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--warning);
    background: var(--primary-bg);
}
.org-ceo-node .ceo-name { font-size: 12.5px; font-weight: 900; color: var(--text-main); }
.org-ceo-node .ceo-role { font-size: 10.5px; font-weight: 800; color: var(--warning); }

/* شاخه‌ی تیم‌ها — همه در یک ردیف، با کانکتورهای درختی */
.org-branch {
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding-top: 32px;
    position: relative;
}
.org-branch::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 0; height: 32px;
    border-left: 2px solid var(--primary-border);
    transform: translateX(-50%);
}
.org-branch > li {
    position: relative;
    padding: 32px 4px 0;
    display: flex;
    justify-content: center;
}
.org-branch > li::before, .org-branch > li::after {
    content: '';
    position: absolute;
    top: 0; right: 50%;
    width: 50%; height: 32px;
    border-top: 2px solid var(--primary-border);
}
.org-branch > li::after { right: auto; left: 50%; border-left: 2px solid var(--primary-border); }
.org-branch > li:only-child::before, .org-branch > li:only-child::after { display: none; }
.org-branch > li:first-child::before, .org-branch > li:last-child::after { border: 0 none; }
.org-branch > li:last-child::before { border-right: 2px solid var(--primary-border); border-radius: 0 9px 0 0; }
.org-branch > li:first-child::after { border-radius: 9px 0 0 0; }
.team-col {
    --tc: var(--primary);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 118px;
}
@media(max-width: 720px) {
    .org-branch { flex-wrap: wrap; gap: 20px 6px; padding-top: 24px; }
    .org-branch::before { display: none; }
    .org-branch > li { padding-top: 0; }
    .org-branch > li::before, .org-branch > li::after { display: none; }
}
.team-orb {
    width: 132px; height: 132px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    background-color: var(--primary-bg); /* fallback */
    background:
        radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--tc) 24%, #ffffff) 0%, color-mix(in srgb, var(--tc) 9%, #ffffff) 72%);
    border: 1.5px dashed var(--primary-border); /* fallback */
    border: 1.5px dashed color-mix(in srgb, var(--tc) 42%, #ffffff);
    transition: transform 0.25s, box-shadow 0.25s;
}
.team-bubble:hover .team-orb { transform: scale(1.04); box-shadow: 0 10px 24px -12px var(--tc); }
.orb-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    align-items: center;
    max-width: 104px;
}
.member-mini {
    width: 33px; height: 33px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    background: var(--primary-bg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}
.member-mini.lead { width: 44px; height: 44px; border: 2.5px solid var(--tc); }
.member-more {
    width: 33px; height: 33px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--tc);
    color: #fff;
    font-size: 11px; font-weight: 800;
    border: 2px solid #fff;
}
.team-info-btn {
    position: absolute;
    top: 9px; inset-inline-start: 9px;
    width: 27px; height: 27px;
    border-radius: 50%;
    background: var(--tc);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    z-index: 2;
}
.team-info-btn:hover { transform: scale(1.14); }
.team-bubble-name { font-size: 12.5px; font-weight: 800; color: var(--text-main); text-align: center; }
.team-bubble-lead { font-size: 10px; color: var(--text-light); text-align: center; line-height: 1.5; }

/* چیپ هد تیم — خارج از دایره */
.team-head-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 3px 9px 3px 4px;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-main);
    direction: rtl;
    margin-bottom: 7px;
    max-width: 100%;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.team-head-chip img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--tc, var(--primary));
    flex-shrink: 0;
}
.team-head-chip span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* گرید موبایل چارت سازمانی */
.org-mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 10px;
    width: 100%;
    padding: 0 4px;
}
.org-mobile-card {
    display: flex;
    justify-content: center;
}
.team-open-btn {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: inherit;
    font-size: 10.5px; font-weight: 800;
    cursor: pointer;
    color: var(--tc);
    background: transparent;
    border: none;
    padding: 2px 4px;
}
.team-open-btn:hover { text-decoration: underline; }

/* پنل جزئیات تیم */
.team-detail { --tc: var(--primary); animation: fadeIn 0.35s ease-out; width: 100%; }
.team-back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit;
    font-size: 11px; font-weight: 800;
    cursor: pointer;
    color: var(--text-muted);
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    padding: 7px 15px;
    margin-bottom: 16px;
    transition: color 0.2s, border-color 0.2s;
}
.team-back-btn:hover { color: var(--primary); border-color: var(--primary-border); }
.team-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.team-detail-head .dh-orb {
    width: 64px; height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--primary-bg); /* fallback */
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tc) 24%, #fff), color-mix(in srgb, var(--tc) 9%, #fff));
    border: 2px solid var(--tc);
}
.team-detail-head .dh-orb img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.team-detail-head h3 { font-size: 15px; font-weight: 900; color: var(--text-main); }
.team-detail-head span { font-size: 11px; font-weight: 700; color: var(--tc); }
.team-detail-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.95;
    background: var(--primary-bg);
    border-right: 3px solid var(--tc);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.team-members-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.member-row {
    display: flex; align-items: center; gap: 10px;
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    transition: border-color 0.2s, transform 0.2s;
}
.member-row:hover { border-color: var(--tc); transform: translateX(-2px); }
.member-row > img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--tc); background: var(--primary-bg); flex-shrink: 0; }
.member-row .mr-info { flex: 1; min-width: 0; }
.member-row .mr-name { font-size: 11.5px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 6px; }
.member-row .mr-role { font-size: 10px; color: var(--text-light); }
.member-row .mr-lead-badge { font-size: 8.5px; font-weight: 800; color: var(--tc); background: var(--primary-bg); border-radius: 50px; padding: 1px 7px; }
.member-row .mr-link {
    width: 30px; height: 30px;
    border-radius: 9px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-bg);
    color: var(--tc);
    text-decoration: none;
    font-size: 15px;
    border: 1px solid var(--card-border);
    transition: background 0.2s, color 0.2s;
}
.member-row .mr-link:hover { background: var(--tc); color: #fff; }
.team-detail-hint { margin-top: 14px; font-size: 10.5px; color: var(--text-light); display: flex; align-items: center; gap: 6px; }

/* ---------- چارت سازمانی زیگزاگ (FurniFlex-style) ---------- */
.org-tl-ceo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.org-tl-ceo-line {
    width: 2px;
    height: 28px;
    background: linear-gradient(to bottom, var(--primary-border), transparent);
    opacity: 0.55;
    margin-top: 4px;
}
.org-timeline {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 8px 16px;
}
/* خط عمودی مرکزی */
.org-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-border) 80%, transparent);
    transform: translateX(-50%);
    opacity: 0.45;
    pointer-events: none;
}
.org-tl-item {
    display: grid;
    grid-template-columns: 1fr 32px 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    position: relative;
}
.org-tl-node {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}
.org-tl-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2.5px solid var(--card-solid);
    flex-shrink: 0;
}
.org-tl-side {
    display: flex;
    align-items: center;
}
.org-tl-left  { justify-content: flex-end; }
.org-tl-right { justify-content: flex-start; }
/* برعکس */
.org-tl-item-rev .org-tl-left  { justify-content: flex-start; }
.org-tl-item-rev .org-tl-right { justify-content: flex-end; }

/* دایره تیم در چارت */
.org-tl-orb {
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    flex-shrink: 0;
}
.org-tl-orb:hover { transform: scale(1.06); box-shadow: 0 10px 24px -10px var(--tc); }

/* کارت اطلاعات تیم */
.org-tl-info {
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-width: 220px;
    cursor: pointer;
    direction: rtl;
    transition: box-shadow 0.2s, transform 0.2s;
    border-right: 3px solid var(--tc, var(--primary));
}
.org-tl-info:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.09); transform: translateY(-2px); }
.org-tl-team-name { font-size: 13.5px; font-weight: 900; }
.org-tl-count { font-size: 10.5px; color: var(--text-muted); font-weight: 700; display: flex; align-items: center; gap: 5px; }
.org-tl-count i { font-size: 12px; }

/* موبایل: خط سمت چپ، همه چیز در یک ستون */
@media (max-width: 720px) {
    .org-timeline::before { left: 16px; transform: none; }
    .org-tl-item,
    .org-tl-item-rev {
        grid-template-columns: 32px 1fr;
        grid-template-rows: auto auto;
        gap: 8px 12px;
    }
    .org-tl-node { grid-column: 1; grid-row: 1 / 3; align-self: start; padding-top: 6px; }
    .org-tl-left  { grid-column: 2; grid-row: 1; justify-content: flex-start; }
    .org-tl-right { grid-column: 2; grid-row: 2; justify-content: flex-start; }
    .org-tl-item-rev .org-tl-left  { grid-row: 2; justify-content: flex-start; }
    .org-tl-item-rev .org-tl-right { grid-row: 1; justify-content: flex-start; }
    .org-tl-info { max-width: 100%; width: 100%; }
    .org-tl-orb { width: 108px !important; height: 108px !important; }
    .org-tl-ceo-line { display: none; }
}

/* ---------- Rules: tabs + 3D card stack ---------- */
.rules-split {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 28px;
    align-items: flex-start;
}
@media(max-width: 768px) { .rules-split { grid-template-columns: 1fr; } }
.rules-tabs { display: flex; flex-direction: column; gap: 7px; }
@media(max-width: 768px) {
    .rules-tabs { flex-direction: row; flex-wrap: wrap; overflow-x: visible; gap: 6px; padding-bottom: 0; }
    .rule-tab-btn { flex: 1 1 calc(50% - 6px); text-align: center; }
}
.rule-tab-btn {
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 800;
    padding: 11px 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: right;
    transition: color 0.25s, background 0.25s, border-color 0.25s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
}
.rule-tab-btn i { font-size: 16px; }
.rule-tab-btn:hover { border-color: var(--primary-border); transform: translateX(-2px); }
.rule-tab-btn.active {
    background: var(--grad-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px -8px var(--primary);
}
.rules-deck-container { perspective: 1300px; position: relative; min-height: 230px; }
.rules-deck-card {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    min-height: 210px;
    transform-origin: center bottom;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.5s, z-index 0s 0.2s;
    opacity: 0;
    pointer-events: none;
}
.rules-deck-card.active { opacity: 1; z-index: 10; transform: translateZ(0) translateY(0) rotate(0deg); pointer-events: auto; }
.rules-deck-card.stack-1 { opacity: 0.7; z-index: 9; transform: translateZ(-22px) translateY(11px) scale(0.97) rotate(-1.4deg); }
.rules-deck-card.stack-2 { opacity: 0.45; z-index: 8; transform: translateZ(-44px) translateY(22px) scale(0.94) rotate(1.4deg); }
.rules-deck-card.stack-hidden { opacity: 0; z-index: 5; transform: translateZ(-66px) translateY(32px) scale(0.9); }
.rules-deck-card h4 {
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 12px;
    color: var(--primary);
    display: flex; align-items: center; gap: 7px;
}
.rules-list { display: flex; flex-direction: column; gap: 9px; }
.rule-point { display: flex; gap: 9px; align-items: flex-start; font-size: 11.5px; color: var(--text-muted); line-height: 1.75; }
.rule-point-dot { width: 6px; height: 6px; background: var(--grad-primary); border-radius: 50%; margin-top: 7px; flex-shrink: 0; }

/* ---------- Perks & benefits ---------- */
.perks-wrap { display: flex; flex-direction: column; gap: 16px; }
.perk-feature {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    background: var(--grad-primary);
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 44px -20px var(--primary);
}
.perk-feature::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    top: -90px; left: -40px;
}
.perk-feature i { font-size: 38px; flex-shrink: 0; position: relative; z-index: 1; }
.perk-feature .pf-text { position: relative; z-index: 1; }
.perk-feature h4 { font-size: 14px; font-weight: 900; margin-bottom: 4px; }
.perk-feature p { font-size: 11.5px; opacity: 0.92; line-height: 1.8; }
.perks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 13px;
}
.perk-card {
    text-align: center;
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 20px 14px 16px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    position: relative;
    overflow: hidden;
}
.perk-card:hover { transform: translateY(-5px); border-color: var(--primary-border); box-shadow: 0 16px 34px -16px var(--glow-color); }
.perk-icon-wrap {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin: 0 auto 12px;
    box-shadow: 0 0 0 6px rgba(37,99,235,0.05);
    transition: transform 0.3s;
}
.perk-card:hover .perk-icon-wrap { transform: scale(1.08) rotate(-4deg); }
.perk-card h4 { font-size: 12px; font-weight: 800; margin-bottom: 5px; color: var(--text-main); }
.perk-card p { font-size: 10px; color: var(--text-muted); line-height: 1.7; }

/* ---------- Office spaces ---------- */
.office-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 15px;
}
.office-card {
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.office-card:hover { transform: translateY(-4px); border-color: var(--primary-border); box-shadow: var(--shadow); }
.office-photo-wrap { position: relative; overflow: hidden; height: 150px; }
.office-photo {
    width: 100%; height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}
.office-card:hover .office-photo { transform: scale(1.07); }
.office-tag {
    position: absolute;
    bottom: 9px; right: 9px;
    background: rgba(255,255,255,0.92);
    color: var(--primary);
    font-size: 9.5px; font-weight: 800;
    padding: 3px 10px;
    border-radius: 50px;
    backdrop-filter: blur(4px);
}
:root.dark .office-tag, body.dark .office-tag { background: rgba(13,21,38,0.9); }
.office-details { padding: 13px 14px 14px; }
.office-details h4 { font-size: 12px; font-weight: 800; margin-bottom: 4px; color: var(--text-main); }
.office-details p { font-size: 10.5px; color: var(--text-muted); line-height: 1.7; }

/* ---------- Location ---------- */
.location-split {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 28px;
    align-items: center;
}
@media(max-width: 768px) { .location-split { grid-template-columns: 1fr; justify-items: center; } }
.map-wrap-circle {
    width: 280px; height: 280px;
    border-radius: 50%;
    border: 5px solid var(--card-solid);
    overflow: hidden;
    box-shadow: 0 16px 40px -16px var(--glow-color), 0 0 0 1px var(--primary-border);
    position: relative;
    z-index: 10;
}
.loc-info-card {
    border-radius: var(--radius-md);
    padding: 15px 20px;
}
.loc-info-card.addr { background: var(--primary-bg); border-right: 3px solid var(--primary); }
.loc-info-card.contact { background: var(--success-bg); border-right: 3px solid var(--success); }
.loc-info-card h4 { font-size: 12px; font-weight: 800; color: var(--text-main); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.loc-info-card p, .loc-info-card span { font-size: 11px; color: var(--text-muted); line-height: 1.75; }
.loc-info-card a { color: var(--primary); font-weight: 700; text-decoration: none; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.gallery-thumb {
    width: 50px; height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    cursor: zoom-in;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}
.gallery-thumb:hover { border-color: var(--primary); transform: scale(1.08); }

/* ---------- Checklist ---------- */
.checklist-progress-bar {
    width: 100%; height: 7px;
    background: var(--primary-border);
    border-radius: 10px;
    margin-bottom: 18px;
    overflow: hidden;
}
.checklist-progress-fill {
    height: 100%;
    background: var(--grad-primary);
    width: 0%;
    border-radius: 10px;
    transition: width 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}
.checklist-list { display: flex; flex-direction: column; gap: 9px; }
.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.checklist-item:hover { border-color: var(--primary); transform: translateX(-2px); }
.checklist-checkbox {
    width: 19px; height: 19px;
    border: 1.5px solid var(--primary);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 11px;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}
.checklist-checkbox i { opacity: 0; transform: scale(0.5); transition: opacity 0.2s, transform 0.2s; }
.checklist-item.checked .checklist-checkbox { background: var(--grad-primary); border-color: transparent; }
.checklist-item.checked .checklist-checkbox i { opacity: 1; transform: scale(1); }

.checklist-text { font-size: 11.5px; color: var(--text-muted); line-height: 1.75; flex: 1; }
.checklist-item.checked .checklist-text { color: var(--text-light); text-decoration: line-through; }

.checklist-done-msg {
    display: none;
    text-align: center;
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 800;
    color: var(--success);
    background: var(--success-bg);
    border-radius: var(--radius-md);
    margin-top: 14px;
}
.checklist-done-msg.show { display: block; animation: fadeIn 0.5s ease-out; }

/* ---------- Footer ---------- */
.site-footer {
    text-align: center;
    padding: 22px 20px;
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
    border-top: 1px solid var(--card-border);
    margin-top: 16px;
}

/* ---------- Animations ---------- */
.fade-in { animation: fadeIn 0.55s ease-out both; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- دکمه نقشه گوگل ---------- */
.map-gmaps-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    padding: 6px 16px;
    border: 1px solid var(--primary-border);
    border-radius: 50px;
    background: rgba(37, 99, 235, 0.06);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.map-gmaps-btn:hover {
    background: rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.3);
}

/* ---------- Subtle header link ---------- */
.header-link-subtle {
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    padding: 3px 0;
    border-bottom: 1px dashed transparent;
    transition: color 0.2s, border-color 0.2s;
}
.header-link-subtle:hover { color: var(--primary); border-bottom-color: var(--primary-border); }

/* ---------- Lightbox ---------- */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.90);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}
.lightbox-close {
    position: absolute;
    top: 18px; right: 22px;
    font-size: 30px;
    color: rgba(255,255,255,0.82);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    user-select: none;
}
.lightbox-close:hover { color: #fff; transform: scale(1.14); }
.lightbox-content {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0,0,0,0.55);
    cursor: zoom-out;
}
.lightbox-caption {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    text-align: center;
}

/* ============================================================
   Org chart overrides: دایره با عکس دایره‌ای اعضا، بدون کارت
   ============================================================ */
.team-orb {
    width: 112px !important;
    height: 112px !important;
    overflow: hidden !important;
    position: relative !important;
}
.team-col {
    width: 122px !important;
    cursor: pointer !important;
}
.team-col:hover .team-orb { transform: scale(1.07); box-shadow: 0 12px 28px -10px var(--tc); }
.team-info-btn  { display: none !important; }
.team-bubble-lead { display: none !important; }

/* ============================================================
  
/* ============================================================
   v2 — افزوده‌ها: ابزار ادمین، چارت بنیان‌گذار، بهینه‌سازی موبایل
   ============================================================ */

/* ---------- جلوگیری از اسکرول افقی در کل صفحه ---------- */
html { overflow-x: clip; max-width: 100%; }
body { overflow-x: clip; }
.glass-card { max-width: 100%; }
img, svg, video { max-width: 100%; }

/* ---------- هدر: به‌جای اسکرول افقی، دو/چند ردیفه می‌شود ---------- */
.topbar-row { flex-wrap: wrap; height: auto; min-height: 52px; padding: 6px 0; row-gap: 4px; }
.nav-links {
    overflow-x: visible;
    flex-wrap: wrap;
    justify-content: center;
    mask-image: none;
    -webkit-mask-image: none;
    row-gap: 4px;
    gap: 4px;
}

/* ============================================================
   چارت سازمانی — تأکید بر «همه زیرمجموعهٔ بنیان‌گذار»
   ============================================================ */
.org-teams { overflow-x: visible; }
.org-founder { display: flex; flex-direction: column; align-items: center; position: relative; margin-bottom: 4px; }
.org-founder-label {
    margin-top: 10px;
    font-size: 10.5px; font-weight: 800;
    color: var(--text-light);
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    padding: 4px 12px; border-radius: 50px;
}
.org-founder-label i { color: var(--primary); }
.org-founder::after {
    content: '';
    width: 2px; height: 20px;
    background: linear-gradient(to bottom, var(--primary-border), transparent);
    margin-top: 8px;
}
/* خط مرکزی از بالای تایم‌لاین تا زیر آخرین تیم — همه به بنیان‌گذار وصل‌اند */
.org-timeline { padding-top: 2px; }
.org-timeline::before { top: -8px; }

/* ============================================================
   ابزار ادمین — نوار شناور + کنترل‌های ویرایش/افزودن/حذف
   ============================================================ */
#adminBar {
    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
    z-index: 9000;
    display: flex; align-items: center; gap: 8px;
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    padding: 7px 12px;
    box-shadow: 0 14px 38px -10px rgba(0,0,0,0.4);
    backdrop-filter: blur(14px);
    direction: rtl;
}
.adm-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 900; color: var(--primary); padding-inline-end: 4px; }
.adm-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit; font-size: 12px; font-weight: 800;
    border: 1px solid var(--card-border); background: var(--card-bg);
    color: var(--text-main); padding: 8px 15px; border-radius: 50px; cursor: pointer;
    transition: color .2s, background .2s, border-color .2s, transform .15s;
}
.adm-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.adm-btn.active { background: var(--error); color: #fff; border-color: transparent; }
.adm-btn-save { background: var(--grad-primary); color: #fff; border-color: transparent; }

/* متن قابل ویرایش درون‌خطی */
.adm-ed { outline: 1.5px dashed var(--primary-border); outline-offset: 3px; border-radius: 4px; transition: outline-color .2s, background .2s; cursor: text; min-width: 22px; }
.adm-ed:hover { outline-color: var(--primary); }
.adm-ed:focus { outline: 2px solid var(--primary); background: var(--primary-bg); }

/* دکمه‌های افزودن */
.adm-add {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-family: inherit; font-weight: 800; font-size: 11.5px;
    color: var(--primary); background: var(--primary-bg);
    border: 1.5px dashed var(--primary); border-radius: var(--radius-md);
    padding: 11px 16px; cursor: pointer; transition: background .2s, color .2s, transform .15s;
}
.adm-add:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.adm-add-grid { width: 100%; min-height: 64px; }
.adm-add-inline { margin-top: 8px; }
.adm-add-mini { padding: 6px 12px; font-size: 10.5px; border-radius: var(--radius-sm); margin-top: 8px; }

/* دکمه حذف روی هر آیتم */
.adm-del {
    position: absolute; top: -9px; inset-inline-start: -9px;
    width: 24px; height: 24px; border-radius: 50%;
    border: 2px solid var(--card-solid); background: var(--error); color: #fff;
    font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 40; box-shadow: 0 3px 9px rgba(0,0,0,0.28);
    transition: transform .15s; padding: 0; line-height: 1;
}
.adm-del:hover { transform: scale(1.15); }
.adm-del-sm { width: 19px; height: 19px; font-size: 9px; top: -3px; inset-inline-start: -3px; }
.adm-link-btn {
    width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--card-border); background: var(--card-solid);
    color: var(--primary); cursor: pointer; font-size: 12px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; margin-inline-start: 4px;
}
.adm-link-btn:hover { background: var(--primary); color: #fff; }

/* در حالت ویرایش: فضای کافی برای دکمه حذف */
body.adm-editing .comp-card,
body.adm-editing .perk-card,
body.adm-editing .office-card,
body.adm-editing .fb-step,
body.adm-editing .culture-node-leaf,
body.adm-editing .checklist-item,
body.adm-editing .rules-deck-card,
body.adm-editing .rule-point,
body.adm-editing .tool-item-wrap,
body.adm-editing .gthumb-wrap { position: relative; overflow: visible; }
.tool-item-wrap { position: relative; display: inline-flex; align-items: center; }
.gthumb-wrap { position: relative; display: inline-flex; }

/* در حالت ویرایش: کارت‌های قوانین از حالت پشته خارج شوند تا همه قابل ویرایش باشند */
body.adm-editing .rules-deck-container { perspective: none; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
body.adm-editing .rules-deck-card { position: relative !important; opacity: 1 !important; transform: none !important; pointer-events: auto !important; }

/* تصاویر قابل جایگزینی در حالت ویرایش */
.adm-img-editable { outline: 2px dashed var(--primary); outline-offset: 2px; cursor: pointer; }
body.adm-editing .office-photo { cursor: pointer; }

/* ============================================================
   موبایل — حذف کامل اسکرول افقی + جمع‌وجورسازی
   ============================================================ */
@media (max-width: 720px) {
    .container { padding: 0 14px; }
    .glass-card { padding: 18px 15px; }
    section { padding: 22px 0; }
    .nav-links a { font-size: 10.5px; padding: 5px 9px; }
    .nav-links { gap: 3px 4px; }

    /* چارت: تک‌ستونه و بدون اسکرول */
    .org-timeline { max-width: 100%; padding: 0 4px 14px; }
    .org-tl-info { max-width: 100%; }
    .org-ceo-node { padding: 6px 14px 6px 7px; }
    .org-ceo-node img { width: 40px; height: 40px; }

    /* گریدها: حداقل عرض کوچک‌تر تا سرریز نشوند */
    .perks-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
    .office-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .comp-tab-content.active { grid-template-columns: 1fr 1fr; gap: 10px; }
    .feedback-steps { grid-template-columns: 1fr; }
    .map-wrap-circle { width: 220px; height: 220px; }

    #adminBar { bottom: 10px; padding: 6px 9px; gap: 6px; }
    .adm-btn { padding: 7px 12px; font-size: 11.5px; }
}

@media (max-width: 480px) {
    .comp-tab-content.active { grid-template-columns: 1fr; }
    .perks-grid { grid-template-columns: 1fr 1fr; }
    .office-grid { grid-template-columns: 1fr; }
    .culture-map-container { min-height: 0; }
    .org-tl-orb { width: 96px !important; height: 96px !important; }
    .sec-title { font-size: 14px; }
}

/* اطمینان از اینکه ردیف‌های عضو در پنل تیم سرریز نکنند */
.team-members-list { max-width: 100%; }
.member-row { flex-wrap: nowrap; }
.member-row .mr-name { overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   v3 — هدر جمع‌وجور، چارت بنیان‌گذار/زیگزاگ بازطراحی‌شده، تب‌های قوانین
   ============================================================ */

/* هدر: چندردیفهٔ مرتب در موبایل، بدون لوگو/برند */
.topbar-row { justify-content: center; }
.nav-links { gap: 5px; }
@media (max-width: 720px) {
    .nav-links a { font-size: 10.5px; padding: 5px 10px; }
}

/* ---------- بنیان‌گذار بالای همه ---------- */
.org-founder { display: flex; flex-direction: column; align-items: center; margin-bottom: 2px; }
.org-founder::after { display: none; }   /* خنثی‌سازی کانکتور قدیمی */
.founder-card {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: var(--card-solid);
    border: 1.5px solid var(--warning);
    border-radius: 18px;
    padding: 16px 28px 13px;
    box-shadow: 0 14px 32px -16px rgba(245, 158, 11, 0.6);
}
.founder-badge {
    position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    background: var(--warning); color: #fff;
    font-size: 9.5px; font-weight: 800; white-space: nowrap;
    padding: 3px 13px; border-radius: 50px;
    display: inline-flex; align-items: center; gap: 4px;
    box-shadow: 0 4px 10px -3px rgba(245, 158, 11, 0.7);
}
.founder-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--warning); background: var(--primary-bg); margin-top: 7px; }
.founder-name { font-size: 14px; font-weight: 900; color: var(--text-main); }
.founder-role { font-size: 10.5px; font-weight: 800; color: var(--warning); }
.founder-stem { width: 2px; height: 26px; background: linear-gradient(to bottom, var(--warning), var(--primary-border)); opacity: .6; }

/* ---------- اعضا (یک طرف زیگزاگ): استک تمیزِ آواتارها ---------- */
.org-members { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.org-members-stack { display: flex; flex-direction: row-reverse; align-items: center; justify-content: center; padding-inline-start: 12px; }
.org-members-stack .tm-avatar {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
    border: 2.5px solid var(--card-solid); background: var(--primary-bg);
    margin-inline-start: -12px; box-shadow: 0 2px 7px rgba(0,0,0,0.14);
    transition: transform .2s;
}
.org-members:hover .tm-avatar { transform: translateY(-2px); }
.org-members-stack .tm-empty {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-bg); color: var(--tc, var(--primary)); font-size: 18px;
    border: 2px dashed var(--primary-border);
}
.org-members-count {
    font-size: 10px; font-weight: 800; color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--card-solid); border: 1px solid var(--card-border);
    padding: 3px 11px; border-radius: 50px;
}
.org-members-count i { color: var(--tc, var(--primary)); font-size: 13px; }

/* ---------- کارت اطلاعات تیم (طرف دیگر): نام + توضیح کوتاه + هد تیم ---------- */
.org-tl-desc {
    font-size: 10.5px; color: var(--text-muted); line-height: 1.7; margin: 2px 0 5px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.team-head-chip {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--primary-bg); border: 1px solid var(--card-border);
    border-radius: 50px; padding: 4px 6px 4px 11px; margin-top: 4px; max-width: 100%;
}
.team-head-chip img { width: 27px; height: 27px; border-radius: 50%; object-fit: cover; border: 2px solid var(--tc, var(--primary)); background: var(--card-solid); flex-shrink: 0; }
.thc-name { font-size: 10.5px; font-weight: 800; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thc-badge { font-size: 8.5px; font-weight: 800; color: #fff; background: var(--tc, var(--primary)); border-radius: 50px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex-shrink: 0; }
.thc-badge i { font-size: 10px; }

/* ---------- موبایل: چارت تک‌ستونه و تمیز (بدون درهم‌ریختگی) ---------- */
@media (max-width: 720px) {
    .org-timeline { max-width: 100%; padding: 0; }
    .org-timeline::before { display: none; }
    .org-tl-item, .org-tl-item-rev {
        display: flex; flex-direction: column; align-items: stretch; gap: 12px;
        background: var(--card-solid); border: 1px solid var(--card-border);
        border-right: 4px solid var(--tc, var(--primary));
        border-radius: var(--radius-md); padding: 15px 16px; margin-bottom: 14px;
    }
    .org-tl-node { display: none; }
    .org-tl-side { width: 100%; justify-content: flex-start !important; }
    .org-tl-info { max-width: 100%; width: 100%; border: none; padding: 0; background: transparent; box-shadow: none; }
    .org-tl-info:hover { transform: none; box-shadow: none; }
    .org-members { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 12px; }
}

/* ---------- تب‌های قوانین: شبکهٔ دوتایی منظم در موبایل ---------- */
@media (max-width: 768px) {
    .rules-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
    .rule-tab-btn { flex: none; width: 100%; justify-content: center; text-align: center; padding: 10px 8px; font-size: 10.5px; gap: 6px; }
    .rule-tab-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rule-tab-btn i { font-size: 14px; }
}

/* ---------- دکمهٔ موقعیت زیر تصویر: برجسته ---------- */
.map-gmaps-btn {
    background: var(--grad-primary); color: #fff; border: none;
    box-shadow: 0 10px 24px -10px var(--primary);
    font-weight: 800;
}
.map-gmaps-btn:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); }

/* ============================================================
   v4 — چارت سازمانی: کارت‌های تیمی در گرید (جایگزین زیگزاگ)
   فضای خالی حذف، نمایش تمیز در دسکتاپ و موبایل
   ============================================================ */
.org-teams { display: block; width: 100%; overflow: visible; }
.org-founder { margin-bottom: 20px; }
.founder-sub { margin-top: 9px; font-size: 10.5px; font-weight: 800; color: var(--text-light); display: inline-flex; align-items: center; gap: 5px; background: var(--primary-bg); border: 1px solid var(--primary-border); padding: 5px 14px; border-radius: 50px; }
.founder-sub i { color: var(--primary); }

.org-teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px; width: 100%; }
.team-card {
    background: var(--card-solid);
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--tc, var(--primary));
    border-radius: var(--radius-md);
    padding: 15px 16px 16px;
    cursor: pointer;
    display: flex; flex-direction: column; gap: 10px;
    box-shadow: var(--shadow-soft);
    transition: transform .2s, box-shadow .2s;
}
.team-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -20px var(--tc, var(--primary)); }
.tc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tc-title-wrap { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tc, var(--primary)); flex-shrink: 0; box-shadow: 0 0 0 3px var(--primary-bg); }
.tc-title { font-size: 13.5px; font-weight: 900; color: var(--tc, var(--primary)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-count { font-size: 10px; font-weight: 800; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; background: var(--primary-bg); border-radius: 50px; padding: 3px 10px; white-space: nowrap; flex-shrink: 0; }
.tc-count i { font-size: 12px; color: var(--tc, var(--primary)); }
.tc-desc { font-size: 10.5px; color: var(--text-muted); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.3em; margin: 0; }
.tc-head { display: flex; align-items: center; gap: 8px; background: var(--primary-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 6px 9px; }
.tc-head > img { width: 33px; height: 33px; border-radius: 50%; object-fit: cover; border: 2px solid var(--tc, var(--primary)); background: var(--card-solid); flex-shrink: 0; }
.tc-head-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tc-head-name { font-size: 11px; font-weight: 800; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-head-role { font-size: 9px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-head-badge { font-size: 8px; font-weight: 800; color: #fff; background: var(--tc, var(--primary)); border-radius: 50px; padding: 3px 8px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex-shrink: 0; }
.tc-head-badge i { font-size: 10px; }
.tc-members { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding-top: 10px; border-top: 1px dashed var(--card-border); margin-top: auto; }
.tc-members .tm-avatar { width: 31px; height: 31px; border-radius: 50%; object-fit: cover; border: 2px solid var(--card-solid); box-shadow: 0 1px 4px rgba(0,0,0,0.13); background: var(--primary-bg); transition: transform .15s; }
.tc-members .tm-avatar:hover { transform: scale(1.12); }
.tc-members .tm-none { font-size: 10px; color: var(--text-light); }

@media (max-width: 720px) {
    .org-teams-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* v5 — هدر چسبان (sticky) تضمینی */
.topbar { position: -webkit-sticky; position: sticky; top: 0; z-index: 1000; }

/* v6 — کپشن قابل‌ویرایش زیر هر تصویر گالری (متن جایگزین عکس) */
.gthumb-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; vertical-align: top; }
.gthumb-cap { font-size: 9px; font-weight: 700; color: var(--text-light); max-width: 64px; text-align: center; line-height: 1.4; word-break: break-word; }
.gthumb-cap.adm-ed { min-width: 50px; }

/* v7 — فونت یکان بخ لوکال (بدون درخواست خارجی) */
@font-face {
    font-family: 'Yekan Bakh';
    src: local('Yekan Bakh'),
         url('fonts/YekanBakhFaNum-VF.woff2') format('woff2-variations'),
         url('fonts/YekanBakhFaNum-VF.woff2') format('woff2'),
         url('fonts/YekanBakhFaNum-VF.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* v8 — کاروسل مزایا: دسکتاپ تک‌ردیفه با فلش، موبایل دوردیفه‌ی خودکار */
.perks-carousel { position: relative; }
.perks-carousel .perks-grid {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    grid-template-columns: none;
    gap: 13px; scroll-behavior: smooth; scroll-snap-type: x proximity;
    padding: 4px 2px 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.perks-carousel .perks-grid::-webkit-scrollbar { display: none; }
.perks-carousel .perks-grid .perk-card { flex: 0 0 180px; scroll-snap-align: start; }
.perks-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--card-border); background: var(--card-solid); color: var(--primary);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 6px 18px -6px rgba(0,0,0,0.28); z-index: 5; font-size: 18px;
    transition: background .2s, color .2s, transform .15s;
}
.perks-arrow:hover { background: var(--primary); color: #fff; transform: translateY(-50%) scale(1.08); }
.perks-prev { right: -6px; }
.perks-next { left: -6px; }
@media (max-width: 720px) {
    .perks-arrow { display: none; }
    .perks-carousel .perks-grid {
        display: grid; grid-auto-flow: column;
        grid-template-rows: 1fr 1fr; grid-template-columns: none;
        grid-auto-columns: 44%; gap: 10px; scroll-snap-type: x mandatory;
    }
    .perks-carousel .perks-grid .perk-card { flex: none; width: auto; scroll-snap-align: start; }
}
