﻿/* ============================================================
   V â€” ØªÙ… Ù…ÛŒÙ†ÛŒÙ…Ø§Ù„ ÙÙ„Øª (Ø¢Ø¨ÛŒ / Ø³Ø¨Ø² / Ù†Ø§Ø±Ù†Ø¬ÛŒ Ù¾Ø§Ø³ØªÙ„ÛŒ)
   ============================================================ */

:root {
    --primary-color: #6e62c8;
    --primary-dark: #5c53ae;
    --primary-deep: #4c4494;
    --secondary-color: #7566cf;
    --accent-color: #73cfe3;
    --gold: #a78bfa;
    --gold-dark: #8b6cf0;
    --gold-soft: rgba(167, 139, 250, 0.12);
    --green-soft: rgba(115, 207, 227, 0.10);
    --bg-color: #f6f7f9;
    --surface: #ffffff;
    --text-color: #29292f;
    --text-muted: #6b6b7b;
    --border-color: #ececf2;
    --shadow-sm: 0 1px 2px rgba(91, 93, 123, 0.05);
    --shadow-md: 0 4px 14px rgba(91, 93, 123, 0.06);
    --shadow-lg: 0 20px 48px rgba(91, 93, 123, 0.08);
    --shadow-soft: 0 12px 34px rgba(105, 109, 129, 0.06);
    --shadow-raised: 0 18px 38px rgba(89, 78, 177, 0.12);
    --pattern-light: none;
    --pattern-dark: none;
}

* {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: var(--pattern-light);
    background-size: 72px 72px;
    color: var(--text-color);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* ============================================================
   Ù†ÙˆØ§Ø± Ø¨Ø§Ù„Ø§ÛŒÛŒ â€” Ø³Ø¨Ø² Ø²Ù…Ø±Ø¯ÛŒ Ø¨Ø§ Ø®Ø· Ø·Ù„Ø§ÛŒÛŒ
   ============================================================ */
.navbar-modern {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-deep) 100%);
    background-image: var(--pattern-dark), linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-deep) 100%);
    background-size: 72px 72px, 100% 100%;
    padding: 0.9rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: none;
    box-shadow: 0 10px 30px rgba(55, 65, 77, 0.25);
}

/* Ø®Ø· Ø·Ù„Ø§ÛŒÛŒ Ø¸Ø±ÛŒÙ Ø²ÛŒØ± Ù†ÙˆØ§Ø± */
.navbar-modern::after {
    content: '';
    position: absolute;
    right: 0;
    left: 0;
    bottom: -3px;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 18%, #b9d3ee 50%, var(--gold) 82%, transparent 100%);
}

/* Brand */
.brand-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.35rem;
    color: #0b4da2 !important;
    text-decoration: none;
    padding: 0.35rem 0;
    transition: color 0.25s ease;
}

.brand-modern:hover {
    color: #0b4da2 !important;
}

.brand-icon {
    color: var(--gold);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(11, 77, 162, 0.25);
    border-radius: 999px 999px 10px 10px;
    padding: 6px;
    width: 44px;
    height: 44px;
    transition: all 0.25s ease;
}

.brand-modern:hover .brand-icon {
    background: rgba(11, 77, 162, 0.08);
    transform: translateY(-1px);
}

.brand-text {
    background: linear-gradient(180deg, #1669c7 0%, #0b4da2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
}

/* Ù„ÛŒÙ†Ú©â€ŒÙ‡Ø§ÛŒ Ù†Ø§ÙˆØ¨Ø±ÛŒ */
.nav-links-modern {
    gap: 0.25rem;
}

.nav-link-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem !important;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    color: #25364d !important;
    transition: all 0.25s ease;
    position: relative;
    margin: 0 0.15rem;
}

.nav-link-modern::before {
    content: '';
    position: absolute;
    bottom: 0.2rem;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link-modern:hover {
    color: #0b4da2 !important;
    background: rgba(11, 77, 162, 0.06);
}

.nav-link-modern:hover::before {
    width: 55%;
}

.nav-link-modern.active {
    color: #0b4da2 !important;
    background: #e7f1ff;
    font-weight: 700;
}

.nav-link-modern.active::before {
    width: 55%;
}

.nav-icon {
    flex-shrink: 0;
    opacity: 0.9;
}

/* Ø¯Ú©Ù…Ù‡ Ù‡Ù…Ø¨Ø±Ú¯Ø±ÛŒ */
.custom-toggler {
    border: 1px solid rgba(11, 77, 162, 0.4);
    border-radius: 10px;
    padding: 0.45rem 0.7rem;
    transition: all 0.25s ease;
}

.custom-toggler:hover {
    background: rgba(11, 77, 162, 0.06);
}

.custom-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(11, 77, 162, 0.3);
}

.custom-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2811, 77, 162, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Ø¯Ú©Ù…Ù‡â€ŒÙ‡Ø§ÛŒ Ù†ÙˆØ§Ø± Ø¨Ø§Ù„Ø§ÛŒÛŒ */
.btn-nav-outline,
.btn-nav-primary,
.btn-nav-user,
.btn-nav-danger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.25s ease;
    border: 1px solid;
    white-space: nowrap;
}

.btn-nav-outline {
    background: transparent;
    border-color: rgba(11, 77, 162, 0.35);
    color: #25364d;
}

.btn-nav-outline:hover {
    background: rgba(11, 77, 162, 0.06);
    border-color: rgba(11, 77, 162, 0.6);
    color: #0b4da2;
}

.btn-nav-primary {
    background: linear-gradient(180deg, #1669c7 0%, #0b4da2 100%);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(11, 77, 162, 0.3);
}

.btn-nav-primary:hover {
    background: linear-gradient(180deg, #1d7fe0 0%, #083a7a 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.btn-nav-user {
    background: rgba(11, 77, 162, 0.05);
    border-color: rgba(11, 77, 162, 0.35);
    color: #25364d;
    position: relative;
}

.btn-nav-user:hover,
.btn-nav-user:focus,
.btn-nav-user.show {
    background: rgba(11, 77, 162, 0.08);
    color: #0b4da2;
    border-color: rgba(11, 77, 162, 0.6);
}

.btn-nav-user .dropdown-arrow {
    transition: transform 0.3s ease;
    margin-right: 0.25rem;
}

.btn-nav-user.show .dropdown-arrow {
    transform: rotate(180deg);
}

/* Ù…Ù†ÙˆÛŒ Ú©Ø§Ø±Ø¨Ø± */
.dropdown-menu-modern {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--gold);
    border-radius: 14px;
    box-shadow: var(--shadow-raised);
    padding: 0.5rem;
    margin-top: 0.75rem;
    min-width: 250px;
    animation: dropdownFadeIn 0.25s ease;
}

/* RTL Dropdown positioning */
[dir="rtl"] .dropdown-menu-end {
    left: 0 !important;
    right: auto !important;
    transform-origin: top right;
}

[dir="rtl"] .dropdown-menu-modern.dropdown-menu-end {
    left: 0 !important;
    right: auto !important;
}

#userMenu {
    position: relative;
}

[dir="rtl"] #userMenu .dropdown-menu {
    left: 0 !important;
    right: auto !important;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.user-info-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, var(--green-soft) 0%, var(--gold-soft) 100%);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 999px 999px 10px 10px;
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-dark) 100%);
    border: 1px solid rgba(11, 77, 162, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eef6ff;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 0.2rem 0;
    text-decoration: none;
}

.dropdown-item-modern:hover {
    background: var(--green-soft);
    color: var(--primary-color);
}

.dropdown-item-modern.active {
    background: var(--gold-soft);
    color: var(--primary-color);
    font-weight: 700;
}

.dropdown-item-modern svg {
    flex-shrink: 0;
}

.dropdown-item-danger {
    color: #e06767;
}

.dropdown-item-danger:hover {
    background: rgba(224, 103, 103, 0.08);
    color: #c94f4f;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
    opacity: 0.7;
}

.btn-nav-danger {
    background: transparent;
    border-color: #e06767;
    color: #e06767;
}

.btn-nav-danger:hover {
    background: #e06767;
    color: white;
}

/* Ù†Ø§ÙˆØ¨Ø±ÛŒ ÙˆØ§Ú©Ù†Ø´â€ŒÚ¯Ø±Ø§ */
@media (max-width: 991px) {
    .navbar-modern {
        padding: 0.75rem 0;
    }

    .nav-link-modern {
        padding: 0.75rem 1rem !important;
        margin: 0.2rem 0;
    }

    .btn-nav-outline,
    .btn-nav-primary {
        width: 100%;
        justify-content: center;
        margin: 0.25rem 0;
    }

    #authButtons {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    #userMenu {
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
    }

    #userMenu .btn-nav-user {
        width: 100%;
        justify-content: center;
    }

    .dropdown-menu-modern {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* ============================================================
   Ø¨Ø®Ø´ Ù‚Ù‡Ø±Ù…Ø§Ù† (Ù„Ù†Ø¯ÛŒÙ†Ú¯)
   ============================================================ */
.hero-section {
    padding: 3.5rem 1rem 2.5rem;
    margin-bottom: 1.5rem;
}

.hero-medallion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin-bottom: 1.5rem;
    color: var(--gold-dark);
    background:
        radial-gradient(circle at 50% 38%, rgba(11, 77, 162, 0.16) 0%, rgba(11, 77, 162, 0.04) 62%, transparent 72%),
        var(--surface);
    border: 1px solid rgba(11, 77, 162, 0.5);
    border-radius: 999px;
    box-shadow: var(--shadow-soft), inset 0 0 0 5px var(--surface), inset 0 0 0 6px rgba(11, 77, 162, 0.35);
}

.hero-kicker {
    font-size: 1.05rem;
    color: var(--gold-dark);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.1rem);
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    line-height: 1.35;
}

.hero-title .hero-title-accent {
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.08rem;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto;
    line-height: 2;
}

/* Ø¬Ø¯Ø§Ú©Ù†Ù†Ø¯Ù‡ ØªØ²Ø¦ÛŒÙ†ÛŒ */
.ornament-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: 2rem auto 0;
    max-width: 420px;
    color: var(--gold);
}

.ornament-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 100%);
}

.ornament-line:last-child {
    background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
}

/* ============================================================
   Ú©Ø§Ø±Øªâ€ŒÙ‡Ø§ÛŒ Ù‚Ø§Ø¨Ù„ÛŒØª (Ù„Ù†Ø¯ÛŒÙ†Ú¯)
   ============================================================ */
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-color) !important;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Ø®Ø· Ø·Ù„Ø§ÛŒÛŒ Ø¨Ø§Ù„Ø§ÛŒ Ú©Ø§Ø±Øª */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, #b9d3ee 50%, var(--gold) 70%, transparent 100%);
    opacity: 0.85;
}

.feature-card .card-body {
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
}

/* Ù‚Ø§Ø¨ Ù…Ø­Ø±Ø§Ø¨ÛŒ Ø¢ÛŒÚ©ÙˆÙ† */
.feature-arch {
    width: 74px;
    height: 86px;
    margin: 2rem auto 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 14px;
    color: var(--primary-color);
    background: linear-gradient(180deg, var(--gold-soft) 0%, rgba(11, 77, 162, 0.06) 100%);
    border: 1px solid rgba(11, 77, 162, 0.45);
    border-radius: 999px 999px 12px 12px;
    box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px rgba(11, 77, 162, 0.3);
    transition: all 0.25s ease;
}

.feature-card .card-title {
    color: #0b4da2;
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.feature-card .card-text {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.9;
    margin-bottom: 1rem;
}

.feature-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--gold-dark);
    font-size: 0.85rem;
    font-weight: 700;
}

.feature-more::after {
    content: '\2190';
    /* ÙÙ„Ø´ Ú†Ù¾ Ø¨Ø±Ø§ÛŒ RTL */
    transition: transform 0.25s ease;
}

.card-link {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.card-link:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-raised) !important;
    border-color: rgba(11, 77, 162, 0.7) !important;
}

.card-link:hover .card-title {
    color: var(--primary-color);
}

.card-link:hover .feature-arch {
    background: linear-gradient(180deg, rgba(11, 77, 162, 0.25) 0%, rgba(11, 77, 162, 0.1) 100%);
    transform: translateY(-3px);
}

.card-link:hover .feature-more::after {
    transform: translateX(-4px);
}

/* Ù†Ø³Ø®Ù‡ ÙØ´Ø±Ø¯Ù‡ Ú©Ø§Ø±Øªâ€ŒÙ‡Ø§ÛŒ Ù„Ù†Ø¯ÛŒÙ†Ú¯ (Ø´Ø´ Ú©Ø§Ø±Øª Ø¯Ø± Ø¯Ùˆ Ø±Ø¯ÛŒÙ) */
.feature-card--compact .card-body {
    padding: 1.1rem 1rem 1rem;
}

.feature-card--compact .feature-arch {
    width: 56px;
    height: 64px;
    margin-top: 1.25rem;
}

.feature-card--compact .feature-arch svg {
    width: 22px;
    height: 22px;
}

.feature-card--compact .card-title {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.feature-card--compact .card-text {
    font-size: 0.85rem;
    line-height: 1.8;
    margin-bottom: 0.6rem;
}

.feature-card--compact .feature-more {
    font-size: 0.8rem;
}

/* ============================================================
   Ù¾Ø§Ù†ÙˆØ´Øª
   ============================================================ */
.footer {
    background: transparent;
    border-top: none;
    padding: 1.5rem 0 2rem;
    margin-top: auto;
}

.footer-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    max-width: 480px;
    margin: 0 auto 1rem;
    color: var(--gold);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .main-content {
        padding: 1rem 0;
    }

    .hero-section {
        padding: 2rem 0.5rem 1.5rem;
    }
}

/* ============================================================
   Ù…ÙˆØ¯Ø§Ù„â€ŒÙ‡Ø§ Ùˆ ÙØ±Ù…â€ŒÙ‡Ø§
   ============================================================ */
.modal-content {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--gold);
    box-shadow: var(--shadow-raised);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.4rem 1.5rem;
}

.modal-title {
    color: var(--primary-dark);
    font-weight: 800;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-control,
.form-select {
    background-color: #ffffff;
    border-color: var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
}

.form-select:focus,
.form-control:focus {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(11, 77, 162, 0.18);
    color: var(--text-color);
}

.btn-primary {
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-deep) 100%);
    border-color: var(--primary-deep);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--green-soft);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================================
   ØµÙØ­Ù‡ Ø¬Ø³ØªØ¬Ùˆ
   ============================================================ */
.search-form-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.3s ease;
}

.search-form-card:hover {
    box-shadow: var(--shadow-raised) !important;
}

.input-group {
    border-radius: 10px;
    overflow: hidden;
}

.input-group .btn {
    border-radius: 0;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border-width: 1px;
    transition: all 0.2s ease;
    min-width: 48px;
}

/* RTL: Input on left, buttons on right */
[dir="rtl"] .input-group .form-control {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-left: none;
}

[dir="rtl"] .input-group .btn:first-of-type {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-right: none;
}

[dir="rtl"] .input-group .btn:last-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-left: none;
}

/* LTR: Input on left, buttons on right */
[dir="ltr"] .input-group .form-control {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-right: none;
}

[dir="ltr"] .input-group .btn:first-of-type {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-left: none;
}

[dir="ltr"] .input-group .btn:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-right: none;
}

.input-group .form-control {
    border-width: 1px;
}

.input-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(11, 77, 162, 0.18);
    z-index: 2;
}

.input-group .form-control:focus+.btn,
.input-group .form-control:focus~.btn {
    border-color: var(--primary-color);
}

#searchSettingsBtn.active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

#searchSettingsBtn.active:hover {
    background-color: var(--primary-deep);
    border-color: var(--primary-deep);
}

.input-group .btn-primary:hover {
    background-color: var(--primary-deep);
    border-color: var(--primary-deep);
    z-index: 3;
}

.btn-group .btn {
    transition: all 0.2s ease;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
}

.btn-group .btn-check:checked+.btn {
    box-shadow: 0 2px 8px rgba(11, 77, 162, 0.3);
}

.result-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border-radius: 12px;
}

.result-card:hover {
    transform: translateY(-2px);
    border-color: rgba(11, 77, 162, 0.6);
    box-shadow: var(--shadow-soft) !important;
}

[data-bs-toggle="tooltip"] {
    cursor: help;
}

#fusionOptionsRow {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

@media (max-width: 768px) {
    .btn-group.flex-wrap .btn {
        flex: 1 1 50%;
        margin-bottom: 0.5rem;
    }

    #fusionOptionsRow .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.alert {
    border-radius: 10px;
    border: none;
}

.text-danger {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================================
   Ø§Ø¹Ù„Ø§Ù†â€ŒÙ‡Ø§ (Toast)
   ============================================================ */
.toast {
    border-radius: 14px;
    border: none;
    box-shadow: var(--shadow-raised);
    min-width: 300px;
    max-width: 500px;
}

.toast-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.75rem 1rem;
    font-weight: 700;
}

.toast-body {
    padding: 1rem;
    font-size: 0.95rem;
}

.toast-success {
    background-color: #4d9c76;
    color: white;
}

.toast-success .toast-header {
    background-color: rgba(52, 120, 90, 0.95);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.toast-error,
.toast-danger {
    background-color: #e88585;
    color: white;
}

.toast-error .toast-header,
.toast-danger .toast-header {
    background-color: rgba(201, 79, 79, 0.92);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.toast-warning {
    background-color: #c96f2e;
    color: white;
}

.toast-warning .toast-header {
    background-color: rgba(176, 98, 32, 0.95);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.toast-info {
    background-color: #2e6f8e;
    color: white;
}

.toast-info .toast-header {
    background-color: rgba(46, 111, 142, 0.95);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.toast-confirm {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--gold);
}

.toast-confirm .toast-header {
    background-color: var(--primary-dark);
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.toast-confirm .toast-body {
    color: var(--text-color);
}

.toast-confirm .btn {
    margin: 0 0.25rem;
    min-width: 80px;
}

.toast-icon {
    width: 20px;
    height: 20px;
    margin-left: 0.5rem;
    display: inline-block;
    vertical-align: middle;
}

/* ============================================================
   Ø¨Ù„ÙˆÚ© Ú©Ø¯
   ============================================================ */
.code-block-container {
    position: relative;
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
    background-color: #f4f8fc;
    direction: ltr;
    font-size: 0.95rem;
    line-height: 1.5;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f6f9fd;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    border-radius: 8px 8px 0 0;
    min-height: 30px;
}

.code-language {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.copy-code-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: #555;
    height: 24px;
    width: 24px;
    min-width: 24px;
}

.copy-code-btn:hover {
    background-color: var(--gold-soft);
    border-color: var(--gold);
    transform: translateY(-1px);
}

.copy-code-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
}

.code-block-content {
    margin: 0;
    padding: 12px 16px;
    background-color: #ffffff;
    overflow-x: auto;
    white-space: pre;
    font-size: 0.95rem;
    line-height: 1.5;
    border: none;
    border-radius: 0;
    color: #2d3748;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    letter-spacing: 0.2px;
}

.language-js,
.language-javascript {
    color: #e44920;
}

.language-python {
    color: #3572A5;
}

.language-html {
    color: #e34c26;
}

.language-css {
    color: #264de4;
}

.language-json {
    color: #000000;
}

@media (max-width: 768px) {
    .code-block-container {
        font-size: 0.9rem;
        margin: 12px 0;
    }

    .code-block-header {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .code-block-content {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* ==== FLAT-PASTEL OVERRIDES ==== */

body {
    background-image: none;
}

/* --- navbar: flat & light --- */
.navbar-modern {
    background: #ffffff;
    background-image: none;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.65rem 0;
}

.navbar-modern::after {
    display: none;
}

.brand-modern {
    color: var(--text-color) !important;
    gap: 0.6rem;
    font-size: 1.2rem;
}

.brand-modern:hover {
    color: var(--primary-deep) !important;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #eef6ff;
    color: #083a7a;
    font-weight: 800;
    font-size: 1.2rem;
    line-height: 1;
}

.brand-text {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: currentColor;
    color: var(--text-color);
}

.nav-link-modern {
    color: var(--text-color) !important;
}

.nav-link-modern::before {
    background: var(--gold);
}

.nav-link-modern:hover {
    color: var(--primary-deep) !important;
    background: #f0f6fd;
}

.nav-link-modern.active {
    color: #083a7a !important;
    background: rgba(11, 77, 162, 0.12);
    font-weight: 700;
}

.custom-toggler {
    border-color: var(--border-color);
}

.custom-toggler:hover {
    background: #f0f6fd;
}

.custom-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(11, 77, 162, 0.2);
}

.custom-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2863, 71, 89, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- nav buttons: flat pastel --- */
.btn-nav-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-nav-outline:hover {
    background: #f0f6fd;
    border-color: #b9d3ee;
    color: var(--primary-deep);
}

.btn-nav-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: none;
}

.btn-nav-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
    transform: none;
    box-shadow: none;
}

.btn-nav-user {
    background: #f0f6fd;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-nav-user:hover,
.btn-nav-user:focus,
.btn-nav-user.show {
    background: rgba(11, 77, 162, 0.12);
    border-color: #b9d3ee;
    color: var(--primary-deep);
}

.btn-nav-danger {
    background: #fdf0f0;
    border-color: #f5d5d5;
    color: #c94f4f;
}

.btn-nav-danger:hover {
    background: #fbe3e3;
    border-color: #efc3c3;
    color: #b34444;
}

/* --- bootstrap buttons: flat --- */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    box-shadow: none;
}

.btn-outline-primary {
    color: #083a7a;
    border-color: #b9d3ee;
}

.btn-outline-primary:hover {
    background: rgba(11, 77, 162, 0.12);
    border-color: #b9d3ee;
    color: #0b4da2;
}

/* --- cards: flat --- */
.card {
    border: 1px solid var(--border-color) !important;
    border-radius: 16px;
    box-shadow: none !important;
}

.feature-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
}

.feature-card::before {
    display: none;
}

.card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(55, 65, 77, 0.07) !important;
    border-color: #b9d3ee !important;
}

.feature-arch {
    background: #eef6ff;
    color: #0b4da2;
    border: none;
    border-radius: 14px;
    box-shadow: none;
}

/* --- hero: flat text --- */
.hero-title,
.hero-title .hero-title-accent {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: currentColor;
}

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

.hero-title .hero-title-accent {
    color: #083a7a;
}

/* --- footer: flat --- */
.footer {
    background: #ffffff;
    background-image: none;
    border-top: 1px solid var(--border-color);
    box-shadow: none;
}

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

/* --- forms: soft pastel focus --- */
.form-control,
.form-select {
    border-color: var(--border-color);
    border-radius: 10px;
}

.form-control:focus,
.form-select:focus {
    border-color: #b9d3ee;
    box-shadow: 0 0 0 0.2rem rgba(11, 77, 162, 0.15);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

hr {
    border-color: var(--border-color);
    opacity: 1;
}

/* --- alerts: pastel --- */
.alert-danger {
    background: #fdf0f0;
    border-color: #f5d5d5;
    color: #b34444;
}

.alert-success {
    background: #eaf7f0;
    border-color: #cdebdb;
    color: #2e7d5b;
}

/* --- agent form tabs --- */
.agent-form-tabs {
    gap: 0.4rem;
    background: #f0f6fd;
    padding: 0.35rem;
    border-radius: 14px;
    display: inline-flex;
}

.agent-form-tabs .nav-link {
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.55rem 1.15rem;
}

.agent-form-tabs .nav-link:hover {
    color: var(--primary-deep);
}

.agent-form-tabs .nav-link.active {
    background: #ffffff;
    color: #083a7a;
    box-shadow: 0 1px 3px rgba(55, 65, 77, 0.08);
}

.source-row,
.tool-row {
    background: #f9fbfe !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px;
}

/* ============================================================
   PRO PANEL â€” Ø§Ø±ØªÙ‚Ø§ÛŒ Ú©Ù„ÛŒ Ø¨Ù‡ Ø³Ø·Ø­ Ù¾Ù†Ù„ Ø§Ø¯Ù…ÛŒÙ† Ø­Ø±ÙÙ‡â€ŒØ§ÛŒ
   ============================================================ */

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(11, 77, 162, 0.22);
    color: #25364d;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c5d5e6;
    border-radius: 999px;
    border: 3px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: #b5c9e0;
}

a {
    color: #12aabd;
}

a:hover {
    color: #0b4da2;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: var(--text-color);
    font-weight: 700;
}

.main-content h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.main-content h1+.text-muted,
.main-content .h3.mb-1+.text-muted {
    font-size: 0.92rem;
}

.main-content .container-fluid {
    animation: pageFadeIn 0.35s ease;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* --- navbar: Ø´ÛŒØ´Ù‡â€ŒØ§ÛŒ Ø¸Ø±ÛŒÙ --- */
.navbar-modern {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    box-shadow: 0 1px 0 rgba(55, 65, 77, 0.04), 0 4px 16px rgba(55, 65, 77, 0.05);
}

/* --- cards --- */
.card {
    border: 1px solid #dbe5f0 !important;
    border-radius: 14px;
    box-shadow: 0 5px 16px rgba(18, 52, 91, 0.08) !important;
    background: var(--surface);
}

.card .card-body {
    padding: 1.25rem 1.35rem;
}

.card-header {
    background: #fbfdff !important;
    border-bottom: 1px solid #e1ebf5;
    padding: 0.95rem 1.35rem;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--text-color);
}

.card-header:first-child {
    border-radius: 13px 13px 0 0;
}

.card-footer {
    background: #fbfdff !important;
    border-top: 1px solid #e1ebf5;
    padding: 0.85rem 1.35rem;
}

.card-footer:last-child {
    border-radius: 0 0 13px 13px;
}

/* --- tables: ØªÙ…Ù¾Ù„ÛŒØª Ø§Ø¯Ù…ÛŒÙ† --- */
.table {
    --bs-table-hover-bg: #f6f9fd;
    margin-bottom: 0;
    font-size: 0.93rem;
}

.table thead th {
    background: #f9fbfe;
    color: #718096;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #dbe5f0;
}

.table tbody td {
    padding: 0.9rem 1.1rem;
    border-color: #e9f1fa;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom-color: transparent;
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover {
    background: #f6f9fd;
}

.table > :not(caption) > * > * {
    border-color: #e9f1fa;
}

/* --- badges: Ù¾Ø§Ø³ØªÙ„ÛŒ Ùˆ ÛŒÚ©Ù†ÙˆØ§Ø®Øª --- */
.badge {
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.42em 0.78em;
    border-radius: 8px;
}

.badge.bg-primary,
.badge.text-bg-primary {
    background: rgba(11, 77, 162, 0.12) !important;
    color: #083a7a !important;
}

.badge.bg-secondary,
.badge.text-bg-secondary {
    background: #e9f1fa !important;
    color: #718096 !important;
}

.badge.bg-success,
.badge.text-bg-success {
    background: #e2f4ea !important;
    color: #257952 !important;
}

.badge.bg-danger,
.badge.text-bg-danger {
    background: #fdeaea !important;
    color: #c24545 !important;
}

.badge.bg-warning,
.badge.text-bg-warning {
    background: #fdf3e2 !important;
    color: #b06a1c !important;
}

.badge.bg-info,
.badge.text-bg-info {
    background: rgba(18, 170, 189, 0.10) !important;
    color: #0d8a99 !important;
}

.badge.bg-light {
    background: #f6f9fd !important;
    color: #718096 !important;
}

/* --- buttons --- */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-sm {
    border-radius: 8px;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(8, 58, 122, 0.35);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(8, 58, 122, 0.28);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(8, 58, 122, 0.3);
}

.btn-outline-secondary {
    color: #718096;
    border-color: #dbe5f0;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: #f0f6fd;
    border-color: #b9d3ee;
    color: var(--primary-deep);
}

.btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(11, 77, 162, 0.25);
}

/* --- forms: Ø­Ù„Ù‚Ù‡ Ù…ØªÙ…Ø±Ú©Ø² --- */
.form-control,
.form-select {
    font-size: 0.95rem;
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    box-shadow: inset 0 1px 2px rgba(55, 65, 77, 0.03);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(11, 77, 162, 0.14);
}

.form-control::placeholder,
.form-select::placeholder {
    color: #718096;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #25364d;
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(11, 77, 162, 0.14);
}

/* --- alerts --- */
.alert {
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    font-size: 0.93rem;
}

/* --- modal: ÙˆØ±ÙˆØ¯ Ù†Ø±Ù… --- */
.modal-content {
    animation: modalPop 0.28s ease;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }

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

.modal-backdrop.show {
    opacity: 0.5;
}

/* Ø§Ø³ØªØ«Ù†Ø§ÛŒ Ú©Ø§Ø±Øªâ€ŒÙ‡Ø§ÛŒ Ù„Ù†Ø¯ÛŒÙ†Ú¯ */
.feature-card .card-body {
    padding: 1.75rem 1.5rem 1.5rem;
}

.feature-card--compact .card-body {
    padding: 1.1rem 1rem 1rem;
}

/* ============================================================
   APP LAYOUT â€” Ø³Ø§ÛŒØ¯Ø¨Ø§Ø± ØªÛŒØ±Ù‡ + Ø¨Ø¯Ù†Ù‡ Ù…Ø­ØªÙˆØ§
   ============================================================ */

:root {
    --sidebar-w: 264px;
    --sidebar-top: #ffffff;
    --sidebar-bottom: #fbfdff;
    --sidebar-text: #25364d;
    --sidebar-muted: #718096;
    --sidebar-hover-bg: #eef6ff;
    --sidebar-hover-text: #083a7a;
}

.app-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-right: var(--sidebar-w);
}

.app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%);
    border-left: 1px solid var(--border-color);
    flex-direction: column;
    z-index: 1030;
    padding: 1.1rem 0.85rem 0.9rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(55, 65, 77, 0.25) transparent;
}

.app-sidebar::-webkit-scrollbar {
    width: 6px;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: #c5d5e6;
    border: none;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.3rem 0.55rem 1.2rem;
    color: var(--text-color);
    text-decoration: none;
}

.side-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0b4da2 0%, #1669c7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.05rem;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(8, 58, 122, 0.45);
    flex-shrink: 0;
}

.side-brand-name {
    font-weight: 800;
    font-size: 1.12rem;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--sidebar-muted);
    padding: 0.95rem 0.85rem 0.45rem;
}

.side-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--sidebar-muted);
    padding: 0.95rem 0.85rem 0.45rem;
    cursor: pointer;
    transition: color 0.18s ease;
}

.side-group-toggle:hover {
    color: var(--sidebar-hover-text);
}

.side-group-chevron {
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.side-group-toggle[aria-expanded="true"] .side-group-chevron {
    transform: rotate(90deg);
}

.side-group-toggle[aria-expanded="true"] {
    color: var(--sidebar-text);
}

.side-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: all 0.18s ease;
    margin-bottom: 2px;
}

.side-link svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.side-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
}

.side-link.active {
    background: #e7f1ff;
    color: #0b4da2;
    font-weight: 700;
}

.side-link.active svg {
    opacity: 1;
}

.side-link.active::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -0.45rem;
    width: 3px;
    height: 22px;
    background: var(--gold);
    border-radius: 3px;
}

.side-link.side-sub {
    padding-inline-start: 2.7rem;
    font-size: 0.88rem;
}

.side-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.side-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0 0.2rem;
}

.side-btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #25364d;
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 10px;
    padding: 0.5rem 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.18s ease;
}

.side-btn-outline:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
    border-color: #b9d3ee;
}

.side-btn-primary {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 10px;
    padding: 0.5rem 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.18s ease;
}

.side-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
}

.side-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.4rem;
}

.side-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1669c7 0%, #0b4da2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.side-user-info {
    flex: 1;
    min-width: 0;
}

.side-user-name {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-user-logout {
    background: none;
    border: none;
    color: var(--sidebar-muted);
    padding: 0.45rem;
    border-radius: 8px;
    display: flex;
    transition: all 0.18s ease;
}

.side-user-logout:hover {
    background: rgba(224, 103, 103, 0.10);
    color: #c94f4f;
}

.side-theme-toggle {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--sidebar-text);
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 10px;
    padding: 0.5rem 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.18s ease;
}

.side-theme-toggle:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
    border-color: #b9d3ee;
}

.side-theme-toggle .icon-sun,
.theme-toggle-icon .icon-sun {
    display: none;
}

html[data-theme="dark"] .side-theme-toggle .icon-sun,
html[data-theme="dark"] .theme-toggle-icon .icon-sun {
    display: block;
}

html[data-theme="dark"] .side-theme-toggle .icon-moon,
html[data-theme="dark"] .theme-toggle-icon .icon-moon {
    display: none;
}

.theme-toggle-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 10px;
    width: 2.6rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.theme-toggle-icon:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
    border-color: #b9d3ee;
}

[dir="rtl"] .user-menu-wrap .dropdown-menu {
    left: 0 !important;
    right: auto !important;
}

@media (max-width: 991.98px) {

    .app-body {
        margin-right: 0;
    }
}

/* ============================================================
   DARK THEME â€” ØªÙ… Ø¯Ø§Ø±Ú© ÛŒÚ©Ù¾Ø§Ø±Ú†Ù‡ Ø¨Ø§ Ø³Ø§ÛŒØ¯Ø¨Ø§Ø±
   ============================================================ */

html[data-theme="dark"] {
    --bg-color: #0f141b;
    --surface: #1a222d;
    --surface-2: #1e2833;
    --tint: #202b38;
    --border-color: #2a3644;
    --text-color: #dbe3ec;
    --text-muted: #8b9bad;
    --primary-ink: #9cc3ee;
    --success-ink: #6fd3a5;
    --danger-ink: #ff9d9d;
    --warning-ink: #f0b46a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-raised: 0 10px 28px rgba(0, 0, 0, 0.5);
    --gold-soft: rgba(239, 159, 94, 0.16);
    --green-soft: rgba(124, 196, 160, 0.14);

    /* Bootstrap 5.3 â€” dark */
    --bs-body-bg: #0f141b;
    --bs-body-bg-rgb: 15, 20, 27;
    --bs-body-color: #dbe3ec;
    --bs-body-color-rgb: 219, 227, 236;
    --bs-tertiary-bg: #1e2833;
    --bs-tertiary-bg-rgb: 30, 40, 51;
    --bs-secondary-bg: #202b38;
    --bs-secondary-bg-rgb: 32, 43, 56;
    --bs-secondary-color: #8b9bad;
    --bs-secondary-color-rgb: 139, 155, 173;
    --bs-emphasis-color: #0f141b;
    --bs-border-color: #2a3644;
    --bs-border-color-translucent: rgba(139, 155, 173, 0.25);
    --bs-link-color: #7cb3e0;
    --bs-link-color-rgb: 124, 179, 224;
    --bs-link-hover-color: #a8d0f0;
    --bs-link-hover-color-rgb: 168, 208, 240;
    --bs-primary: #4d8fd1;
    --bs-primary-rgb: 77, 143, 209;
    --bs-light: #202b38;
    --bs-light-rgb: 32, 43, 56;
    --bs-code-color: #f0b46a;
    --bs-highlight-bg: #2a3644;
    --bs-focus-ring-color: rgba(77, 143, 209, 0.4);
    --bs-dropdown-bg: #1a222d;
    --bs-dropdown-color: #dbe3ec;
    --bs-dropdown-border-color: #2a3644;
    --bs-dropdown-link-color: #dbe3ec;
    --bs-dropdown-link-hover-bg: rgba(77, 143, 209, 0.15);
    --bs-dropdown-link-active-bg: #4d8fd1;
    --bs-modal-bg: #1a222d;
    --bs-toast-bg: #1a222d;
    --bs-toast-border-color: #2a3644;
    --bs-table-bg: transparent;
    --bs-table-color: #dbe3ec;
    --bs-table-border-color: #2a3644;
    --bs-table-striped-bg: rgba(139, 155, 173, 0.06);
    --bs-table-striped-color: #dbe3ec;
    --bs-table-active-bg: rgba(139, 155, 173, 0.12);
    --bs-table-active-color: #dbe3ec;
    --bs-table-hover-bg: #202b38;
    --bs-table-hover-color: #dbe3ec;
    --bs-btn-color: #dbe3ec;
    --bs-btn-bg: #232e3b;
    --bs-btn-border-color: #2a3644;
    --bs-btn-hover-color: #dbe3ec;
    --bs-btn-hover-bg: #2a3644;
    --bs-btn-hover-border-color: #34424f;
    --bs-btn-active-color: #dbe3ec;
    --bs-btn-active-bg: #2f3d4c;
    --bs-btn-active-border-color: #34424f;
    --bs-btn-disabled-color: #8b9bad;
    --bs-btn-disabled-bg: #232e3b;
    --bs-btn-disabled-border-color: #2a3644;
    --bs-btn-primary-bg: #4d8fd1;
    --bs-btn-primary-border-color: #4d8fd1;
    --bs-btn-primary-hover-bg: #3a78b8;
    --bs-btn-primary-hover-border-color: #3a78b8;
    --bs-btn-primary-active-bg: #2d6094;
    --bs-btn-primary-active-border-color: #2d6094;
    --bs-btn-primary-disabled-bg: #2d6094;
    --bs-btn-primary-disabled-border-color: #2d6094;
    --bs-btn-secondary-bg: #232e3b;
    --bs-btn-secondary-border-color: #2a3644;
    --bs-btn-secondary-color: #dbe3ec;
    --bs-btn-secondary-hover-bg: #2a3644;
    --bs-btn-secondary-hover-border-color: #34424f;
    --bs-btn-secondary-hover-color: #dbe3ec;
    --bs-btn-secondary-active-bg: #2f3d4c;
    --bs-btn-secondary-active-border-color: #34424f;
    --bs-btn-secondary-disabled-bg: #232e3b;
    --bs-btn-secondary-disabled-border-color: #2a3644;
    --bs-btn-light-bg: #202b38;
    --bs-btn-light-border-color: #2a3644;
    --bs-btn-light-color: #dbe3ec;
    --bs-btn-light-hover-bg: #2a3644;
    --bs-btn-light-hover-border-color: #34424f;
    --bs-btn-light-hover-color: #dbe3ec;
    --bs-btn-light-active-bg: #2f3d4c;
    --bs-btn-light-active-border-color: #34424f;
    --bs-btn-light-disabled-bg: #202b38;
    --bs-btn-light-disabled-border-color: #2a3644;
    --bs-btn-outline-color: #7cb3e0;
    --bs-btn-outline-border-color: rgba(77, 143, 209, 0.5);
    --bs-btn-outline-hover-bg: #4d8fd1;
    --bs-btn-outline-hover-border-color: #4d8fd1;
    --bs-btn-outline-hover-color: #ffffff;
    --bs-btn-outline-active-bg: #3a78b8;
    --bs-btn-outline-active-border-color: #3a78b8;
    --bs-btn-outline-active-color: #ffffff;
    --bs-btn-outline-disabled-bg: transparent;
    --bs-btn-outline-secondary-color: #8b9bad;
    --bs-btn-outline-secondary-border-color: #2a3644;
    --bs-btn-outline-secondary-hover-bg: #232e3b;
    --bs-btn-outline-secondary-hover-border-color: #34424f;
    --bs-btn-outline-secondary-hover-color: #dbe3ec;
    --bs-btn-outline-secondary-active-bg: #2a3644;
    --bs-btn-outline-secondary-active-border-color: #34424f;
    --bs-btn-outline-secondary-active-color: #dbe3ec;
}

html[data-theme="dark"] body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

html[data-theme="dark"] ::selection {
    background: rgba(77, 143, 209, 0.4);
    color: #ffffff;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #34424f;
    border-color: var(--bg-color);
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #3f5061;
}

html[data-theme="dark"] a {
    color: var(--bs-link-color);
}

html[data-theme="dark"] a:hover {
    color: var(--bs-link-hover-color);
}

/* --- navbar (Ù…ÙˆØ¨Ø§ÛŒÙ„): Ø¯Ø§Ø±Ú© --- */
html[data-theme="dark"] .navbar-modern {
    background: rgba(18, 25, 33, 0.92) !important;
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .brand-mark {
    background: rgba(77, 143, 209, 0.18);
    color: var(--primary-ink);
}

html[data-theme="dark"] .nav-link-modern:hover {
    background: rgba(77, 143, 209, 0.12);
    color: #dbe3ec !important;
}

html[data-theme="dark"] .nav-link-modern.active {
    background: rgba(77, 143, 209, 0.2);
    color: var(--primary-ink) !important;
}

html[data-theme="dark"] .custom-toggler:hover {
    background: rgba(77, 143, 209, 0.12);
}

html[data-theme="dark"] .btn-nav-outline {
    color: var(--text-color);
    border-color: var(--border-color);
}

html[data-theme="dark"] .btn-nav-outline:hover {
    background: rgba(77, 143, 209, 0.12);
    border-color: rgba(77, 143, 209, 0.45);
    color: var(--primary-ink);
}

html[data-theme="dark"] .btn-nav-user {
    background: rgba(77, 143, 209, 0.12);
    border-color: var(--border-color);
    color: var(--text-color);
}

html[data-theme="dark"] .btn-nav-user:hover,
html[data-theme="dark"] .btn-nav-user:focus,
html[data-theme="dark"] .btn-nav-user.show {
    background: rgba(77, 143, 209, 0.2);
    border-color: rgba(77, 143, 209, 0.45);
    color: var(--primary-ink);
}

html[data-theme="dark"] .btn-nav-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    color: var(--danger-ink);
}

html[data-theme="dark"] .btn-nav-danger:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ff8787;
}

html[data-theme="dark"] .btn-outline-primary {
    color: var(--primary-ink);
    border-color: rgba(77, 143, 209, 0.45);
}

html[data-theme="dark"] .btn-outline-primary:hover {
    background: rgba(77, 143, 209, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-ink);
}

html[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-secondary:focus {
    background: var(--tint);
    border-color: #34424f;
    color: var(--text-color);
}

/* --- alerts --- */
html[data-theme="dark"] .card {
    border-color: var(--border-color) !important;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .card-header {
    background: var(--surface-2) !important;
    border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .card-footer {
    background: var(--surface-2) !important;
    border-top-color: var(--border-color);
}

html[data-theme="dark"] .feature-card {
    background: var(--surface);
}

html[data-theme="dark"] .card-link:hover {
    border-color: rgba(77, 143, 209, 0.5) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .feature-arch {
    background: rgba(77, 143, 209, 0.14);
    color: var(--primary-ink);
}

html[data-theme="dark"] .hero-title .hero-title-accent {
    color: #7cb3e0;
}

html[data-theme="dark"] .footer {
    background: #131a22 !important;
    border-top-color: var(--border-color);
}

/* --- ÙØ±Ù…â€ŒÙ‡Ø§ --- */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background-color: var(--surface);
    border-color: var(--border-color);
    color: var(--text-color);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    background-color: var(--surface);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(77, 143, 209, 0.16);
}

html[data-theme="dark"] .form-label {
    color: #aebccb;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .form-select::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .form-check-input {
    background-color: #232e3b;
    border-color: #34424f;
}

/* --- Ø¨Ù„ÙˆÚ© Ú©Ø¯ --- */
html[data-theme="dark"] .code-block-container {
    background-color: #141b23;
    border-color: var(--border-color);
}

html[data-theme="dark"] .code-block-header {
    background-color: #1c2530;
    color: var(--text-muted);
    border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .copy-code-btn {
    background: #232e3b;
    color: var(--text-muted);
    border-color: var(--border-color);
}

html[data-theme="dark"] .code-block-content {
    background-color: #141b23;
    color: #d7e0ea;
}

html[data-theme="dark"] .language-python {
    color: #7cb3e0;
}

html[data-theme="dark"] .language-css {
    color: #8ab4f8;
}

html[data-theme="dark"] .language-json {
    color: #d7e0ea;
}

/* --- Ø¢Ð»ÐµÑ€Øªâ€ŒÙ‡Ø§ --- */
html[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    color: var(--danger-ink);
}

html[data-theme="dark"] .alert-success {
    background: rgba(46, 158, 99, 0.1);
    border-color: rgba(46, 158, 99, 0.35);
    color: var(--success-ink);
}

/* --- ØªØ¨â€ŒÙ‡Ø§ÛŒ ÙØ±Ù… agent --- */
html[data-theme="dark"] .agent-form-tabs {
    background: var(--surface-2);
}

html[data-theme="dark"] .agent-form-tabs .nav-link {
    color: var(--text-muted);
}

html[data-theme="dark"] .agent-form-tabs .nav-link:hover {
    color: var(--primary-ink);
}

html[data-theme="dark"] .agent-form-tabs .nav-link.active {
    background: #232e3b;
    color: var(--primary-ink);
    box-shadow: none;
}

html[data-theme="dark"] .source-row,
html[data-theme="dark"] .tool-row {
    background: #161d26 !important;
}

/* --- Ø¬Ø¯ÙˆÙ„â€ŒÙ‡Ø§ --- */
html[data-theme="dark"] .table thead th {
    background: var(--surface-2);
    color: var(--text-muted);
    border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .table tbody td {
    border-color: #232e3b;
}

html[data-theme="dark"] .table tbody tr:hover {
    background: var(--tint);
}

html[data-theme="dark"] .table > :not(caption) > * > * {
    border-color: #232e3b;
}

/* --- Ø¨Ø¬â€ŒÙ‡Ø§ --- */
html[data-theme="dark"] .badge.bg-primary,
html[data-theme="dark"] .badge.text-bg-primary {
    background: rgba(77, 143, 209, 0.16) !important;
    color: var(--primary-ink) !important;
}

html[data-theme="dark"] .badge.bg-secondary,
html[data-theme="dark"] .badge.text-bg-secondary {
    background: rgba(139, 155, 173, 0.16) !important;
    color: #b6c4d4 !important;
}

html[data-theme="dark"] .badge.bg-success,
html[data-theme="dark"] .badge.text-bg-success {
    background: rgba(46, 158, 99, 0.16) !important;
    color: var(--success-ink) !important;
}

html[data-theme="dark"] .badge.bg-danger,
html[data-theme="dark"] .badge.text-bg-danger {
    background: rgba(239, 68, 68, 0.16) !important;
    color: var(--danger-ink) !important;
}

html[data-theme="dark"] .badge.bg-warning,
html[data-theme="dark"] .badge.text-bg-warning {
    background: rgba(245, 158, 11, 0.16) !important;
    color: var(--warning-ink) !important;
}

html[data-theme="dark"] .badge.bg-info,
html[data-theme="dark"] .badge.text-bg-info {
    background: rgba(77, 143, 209, 0.16) !important;
    color: var(--primary-ink) !important;
}

html[data-theme="dark"] .badge.bg-light {
    background: var(--tint) !important;
    color: #b6c4d4 !important;
}

/* --- progress --- */
html[data-theme="dark"] .progress {
    background: #232e3b;
}

html[data-theme="dark"] .progress-bar {
    background: var(--primary-color);
}

/* --- toast --- */
html[data-theme="dark"] .toast {
    background: var(--surface);
    border-color: var(--border-color);
    color: var(--text-color);
}

html[data-theme="dark"] .toast-header {
    background: var(--surface-2);
    border-bottom-color: var(--border-color);
    color: var(--text-color);
}

/* --- modal --- */
html[data-theme="dark"] .modal-content {
    background: var(--surface);
    border-color: var(--border-color);
    color: var(--text-color);
}

html[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}

html[data-theme="dark"] .modal-backdrop.show {
    background: #05080c;
    opacity: 0.7;
}

/* ============================================================
   DARK THEME — سایدبار
   ============================================================ */

html[data-theme="dark"] {
    --sidebar-top: #25313f;
    --sidebar-bottom: #1a2430;
    --sidebar-text: #a9b8c8;
    --sidebar-muted: #6e8093;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.055);
    --sidebar-hover-text: #e9eff6;
}

html[data-theme="dark"] .app-sidebar {
    border-left-color: rgba(255, 255, 255, 0.06);
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

html[data-theme="dark"] .app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

html[data-theme="dark"] .side-brand {
    color: #ffffff;
}

html[data-theme="dark"] .side-link.active {
    background: rgba(77, 143, 209, 0.2);
    color: #ffffff;
}

html[data-theme="dark"] .side-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .side-btn-outline {
    border-color: rgba(255, 255, 255, 0.22);
    color: #cfd9e4;
}

html[data-theme="dark"] .side-btn-outline:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

html[data-theme="dark"] .side-user-name {
    color: #e9eff6;
}

html[data-theme="dark"] .side-user-logout:hover {
    background: rgba(224, 103, 103, 0.16);
    color: #ff9d9d;
}

html[data-theme="dark"] .side-theme-toggle {
    border-color: rgba(255, 255, 255, 0.22);
    color: #cfd9e4;
}

html[data-theme="dark"] .side-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

html[data-theme="dark"] .theme-toggle-icon {
    border-color: rgba(255, 255, 255, 0.22);
    color: #a9b8c8;
}

html[data-theme="dark"] .theme-toggle-icon:hover {
    background: rgba(77, 143, 209, 0.12);
    color: var(--primary-ink);
    border-color: rgba(77, 143, 209, 0.45);
}