:root {
    --bs-body-font-family: "IRANSans", Tahoma, sans-serif;
    --bs-primary: #0f766e;
    --bs-primary-rgb: 15, 118, 110;
    --bs-link-color: #0f766e;
    --bs-link-hover-color: #115e59;
    --sidebar-width: 280px;
    --sidebar-bg: #0b3b3a;
    --sidebar-bg-2: #0f4c4a;
    --content-bg: #f0f4f5;
    --card-shadow: 0 0.5rem 1.25rem rgba(15, 42, 51, 0.06);
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "IRANSans", Tahoma, sans-serif;
    background: var(--content-bg);
    color: #1e293b;
}

.landing-shell,
.admin-shell,
.navbar,
.card,
.btn,
.form-control,
.nav-link {
    font-family: "IRANSans", Tahoma, sans-serif;
}

/* —— Landing (public site) —— */
.landing-shell {
    --lp-ink: #0c1f1e;
    --lp-muted: #4a6462;
    --lp-teal: #0f766e;
    --lp-teal-deep: #0a4f4a;
    --lp-sand: #e8f2f0;
    --lp-foam: #f3faf8;
    --lp-line: rgba(15, 118, 110, 0.14);
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(15, 118, 110, 0.08), transparent 55%),
        linear-gradient(180deg, #f7fbfa 0%, #ffffff 42%, #f4f8f7 100%);
    color: var(--lp-ink);
}

.landing-shell .btn,
.landing-shell .nav-link,
.landing-shell .navbar-brand {
    font-family: "IRANSans", Tahoma, sans-serif;
}

/* Nav */
.lp-nav {
    background: rgba(247, 251, 250, 0.82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--lp-line);
    z-index: 1030;
}

.lp-nav-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem 1rem;
    min-height: 4.25rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.lp-nav-brand {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--lp-teal-deep);
    line-height: 1;
    grid-column: 1;
}

.lp-nav-brand:hover { color: var(--lp-teal); }

.lp-nav-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    grid-column: 3;
    justify-self: end;
}

.lp-lang {
    display: inline-flex;
    border: 1px solid var(--lp-line);
    border-radius: 0.55rem;
    overflow: hidden;
    background: #fff;
}

.lp-lang button {
    border: 0;
    background: transparent;
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--lp-muted);
}

.lp-lang button.is-active {
    background: var(--lp-teal);
    color: #fff;
}

.lp-nav-toggle {
    display: none !important;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--lp-line);
    border-radius: 0.55rem;
    padding: 0.35rem 0.5rem;
    background: #fff;
}

.landing-shell .lp-nav-menu {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    min-width: 0;
    grid-column: 2;
    width: 100%;
    visibility: visible;
    opacity: 1;
}

.lp-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}

.lp-nav-link {
    border: 0;
    background: transparent;
    color: var(--lp-muted);
    font-weight: 500;
    padding: 0.45rem 0.7rem;
    border-radius: 0.45rem;
    width: auto;
    text-align: start;
    white-space: nowrap;
}

.lp-nav-link:hover,
.lp-nav-link.active {
    color: var(--lp-teal-deep);
    background: rgba(15, 118, 110, 0.08);
}

.lp-nav-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

@media (max-width: 991.98px) {
    .lp-nav-inner {
        grid-template-columns: 1fr auto;
    }

    .lp-nav-brand { grid-column: 1; }
    .lp-nav-tools { grid-column: 2; }

    .lp-nav-toggle {
        display: inline-flex !important;
    }

    .landing-shell .lp-nav-menu {
        display: none !important;
        grid-column: 1 / -1;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 0.35rem 0 0.75rem;
    }

    .landing-shell .lp-nav-menu.is-open {
        display: flex !important;
    }

    .lp-nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        flex: none;
    }

    .lp-nav-link {
        width: 100%;
        padding: 0.55rem 0.7rem;
    }
}

/* Buttons */
.lp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    border-radius: 0.7rem;
    padding: 0.85rem 1.35rem;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lp-btn:hover { transform: translateY(-1px); }
.lp-btn-sm { padding: 0.5rem 0.95rem; font-size: 0.85rem; }

.lp-btn-primary {
    background: var(--lp-teal);
    color: #fff;
}

.lp-btn-primary:hover {
    background: var(--lp-teal-deep);
    color: #fff;
}

.lp-btn-ghost {
    background: transparent;
    border-color: rgba(15, 118, 110, 0.28);
    color: var(--lp-teal-deep);
}

.lp-btn-ghost:hover {
    background: rgba(15, 118, 110, 0.08);
    color: var(--lp-teal-deep);
}

.lp-btn-light {
    background: #fff;
    color: var(--lp-teal-deep);
}

.lp-btn-light:hover {
    background: var(--lp-foam);
    color: var(--lp-teal-deep);
}

/* Hero — brand copy + product visual, no absolute overlap */
.lp-hero {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 4.25rem);
    display: flex;
    align-items: stretch;
    background:
        radial-gradient(ellipse 70% 60% at 80% 40%, rgba(20, 184, 166, 0.18), transparent 58%),
        linear-gradient(125deg, #e8f4f1 0%, #f4faf8 42%, #dceee9 100%);
}

.lp-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(1.5rem, 3vw, 2.75rem);
    align-items: center;
    width: 100%;
    padding-block: clamp(2rem, 6vh, 3.5rem);
}

.lp-hero-visual {
    position: relative;
    z-index: 0;
    min-height: 22rem;
    display: flex;
    overflow: hidden;
}

.lp-hero-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 70% at 50% 40%, rgba(20, 184, 166, 0.2), transparent 62%),
        linear-gradient(165deg, #0b3b3a 0%, #0f5250 48%, #134e4a 100%);
}

.lp-hero-atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 15%, transparent 78%);
    animation: lp-grid-drift 18s linear infinite;
}

.lp-widget {
    position: relative;
    z-index: 1;
    flex: 1;
    color: #ecfdf8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.5rem, 4vh, 2.5rem) clamp(1.25rem, 3vw, 2rem);
    pointer-events: none;
    width: 100%;
}

.lp-widget-head {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.35rem;
}

.lp-widget-head strong {
    font-size: 1.2rem;
    font-weight: 800;
}

.lp-widget-head span {
    font-size: 0.78rem;
    opacity: 0.78;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.lp-widget-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lp-bubble {
    max-width: 92%;
    padding: 0.7rem 0.85rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    line-height: 1.45;
    animation: lp-bubble-in 0.55s ease both;
}

.lp-bubble-meta {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.7;
    margin-bottom: 0.2rem;
}

.lp-bubble-agent {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lp-bubble-visitor {
    align-self: flex-end;
    background: #14b8a6;
    color: #042f2e;
    font-weight: 600;
    animation-delay: 0.18s;
}

.lp-bubble-typing {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    width: fit-content;
    padding: 0.65rem 0.9rem;
    animation-delay: 0.32s;
}

.lp-bubble-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: lp-dot 1.2s ease-in-out infinite;
}

.lp-bubble-typing i:nth-child(2) { animation-delay: 0.15s; }
.lp-bubble-typing i:nth-child(3) { animation-delay: 0.3s; }

.lp-widget-composer {
    margin-top: 1.1rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.lp-hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 34rem;
    width: 100%;
    margin: 0;
    animation: lp-rise 0.7s ease both;
}

.lp-brand {
    margin: 0 0 1.1rem;
    font-size: clamp(2.4rem, 5.5vw, 3.75rem);
    font-weight: 900;
    letter-spacing: -0.045em;
    line-height: 1.05;
    color: var(--lp-teal-deep);
}

.lp-title {
    margin: 0 0 1rem;
    font-size: clamp(1.35rem, 2.6vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.35;
    color: var(--lp-ink);
}

.lp-lead {
    margin: 0 0 1.75rem;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--lp-muted);
    max-width: 30rem;
}

.lp-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.lp-cta-inline { margin-top: 2.5rem; }

@media (max-width: 991.98px) {
    .lp-hero {
        min-height: auto;
    }

    .lp-hero-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-block: 2rem 2.25rem;
    }

    .lp-hero-visual {
        min-height: 16.5rem;
        order: 2;
    }

    .lp-hero-copy {
        order: 1;
        max-width: none;
    }

    .lp-widget {
        padding: 1.35rem 1.15rem 1.2rem;
    }
}

/* Steps */
.lp-section {
    padding: 4.5rem 0;
}

.lp-section-head {
    max-width: 36rem;
    margin-bottom: 2.5rem;
}

.lp-section-head h2 {
    font-size: clamp(1.55rem, 2.6vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 0.65rem;
}

.lp-section-head p {
    margin: 0;
    color: var(--lp-muted);
    line-height: 1.7;
}

.lp-steps {
    background: linear-gradient(180deg, transparent, rgba(15, 118, 110, 0.04) 40%, transparent);
}

.lp-step-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .lp-step-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.75rem;
    }
}

.lp-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    padding: 0.25rem 0;
    border-top: 1px solid var(--lp-line);
    padding-top: 1.25rem;
}

.lp-step-num {
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--lp-teal);
    letter-spacing: 0.06em;
    padding-top: 0.2rem;
}

.lp-step h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 0.4rem;
}

.lp-step p {
    margin: 0;
    color: var(--lp-muted);
    line-height: 1.65;
    font-size: 0.95rem;
}

/* CTA band */
.lp-band {
    padding: 0 0 4.5rem;
}

.lp-band-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2.25rem clamp(1.25rem, 4vw, 2.5rem);
    border-radius: 1.25rem;
    background:
        radial-gradient(600px 180px at 90% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
        linear-gradient(120deg, #0b3b3a, #0f766e 55%, #0d9488);
    color: #ecfdf8;
}

.lp-band-copy {
    max-width: 36rem;
}

.lp-band-copy h2 {
    margin: 0 0 0.55rem;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    font-weight: 500;
    line-height: 1.35;
}

.lp-band-copy h2 span {
    display: block;
    opacity: 0.78;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.lp-band-copy h2 strong {
    font-weight: 900;
    letter-spacing: -0.02em;
}

.lp-band-copy p {
    margin: 0;
    opacity: 0.82;
    line-height: 1.65;
}

/* Footer */
.lp-footer {
    border-top: 1px solid var(--lp-line);
    background: #fff;
    padding: 3rem 0;
    color: var(--lp-muted);
}

.lp-footer-brand {
    font-weight: 900;
    color: var(--lp-teal-deep);
    letter-spacing: -0.03em;
    margin-bottom: 0.65rem;
}

.lp-footer h6 {
    font-weight: 800;
    color: var(--lp-ink);
    margin-bottom: 0.85rem;
}

.lp-footer-link {
    border: 0;
    background: transparent;
    padding: 0.2rem 0;
    color: var(--lp-muted);
    font-size: 0.9rem;
}

.lp-footer-link:hover { color: var(--lp-teal); }

@keyframes lp-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes lp-bubble-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes lp-dot {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

@keyframes lp-grid-drift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 48px 48px, 48px 48px; }
}

@media (prefers-reduced-motion: reduce) {
    .lp-hero-copy,
    .lp-bubble,
    .lp-hero-atmosphere::after {
        animation: none !important;
    }
}

/* —— Panel (FileStorage template) —— */
.text-teal { color: #0f766e !important; }
.bg-teal { background-color: #0f766e !important; }

.code-snippet {
    background: #0f172a;
    color: #a7f3d0;
    border: 1px solid #134e4a;
    font-size: 0.85rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    margin: 0;
}

.btn-teal {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0f766e;
    --bs-btn-border-color: #0f766e;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0d9488;
    --bs-btn-hover-border-color: #0d9488;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #115e59;
    --bs-btn-active-border-color: #115e59;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #0f766e;
    --bs-btn-disabled-border-color: #0f766e;
}

.btn-outline-teal {
    --bs-btn-color: #0f766e;
    --bs-btn-border-color: #0f766e;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0f766e;
    --bs-btn-hover-border-color: #0f766e;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #115e59;
    --bs-btn-active-border-color: #115e59;
}

.admin-shell {
    min-height: 100vh;
}

.admin-shell.authenticated {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
}

.panel-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.panel-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 3.75rem;
    padding: 0.55rem 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
}

.panel-topbar-spacer {
    flex: 1;
    min-width: 0;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.mobile-brand strong {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu {
    flex-shrink: 0;
}

.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    max-width: min(280px, 72vw);
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 0.28rem 0.7rem 0.28rem 0.28rem;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html[dir="rtl"] .user-menu-toggle {
    padding: 0.28rem 0.28rem 0.28rem 0.7rem;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus-visible,
.user-menu.show .user-menu-toggle {
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
    outline: none;
}

.user-avatar {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.user-menu-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.2;
    text-align: start;
}

.user-menu-text strong {
    font-size: 0.88rem;
    max-width: 10rem;
}

.user-menu-text small {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: #64748b;
    max-width: 11rem;
}

.user-menu-caret {
    font-size: 0.75rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.user-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

.user-status-dot.is-online {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.user-status-dot.is-offline {
    background: #94a3b8;
}

.user-menu-dropdown {
    min-width: 16.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    box-shadow: 0 12px 32px rgba(15, 42, 51, 0.12);
    padding: 0.35rem;
    margin-top: 0.45rem !important;
}

.user-menu-profile .text-teal {
    color: #0f766e !important;
    font-weight: 600;
}

.user-presence-switch {
    width: 2.5rem;
    height: 1.3rem;
    cursor: pointer;
}

.user-presence-switch:checked {
    background-color: #16a34a;
    border-color: #16a34a;
}

.user-logout-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.55rem;
    color: #b91c1c;
    font-weight: 600;
}

.user-logout-item:hover,
.user-logout-item:focus {
    background: #fef2f2;
    color: #991b1b;
}

.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    line-height: 1;
}

.btn-icon:hover,
.btn-icon:focus-visible {
    background: rgba(15, 118, 110, 0.1);
    color: inherit;
}

.sidebar {
    min-height: 0;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: #e2e8f0;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    z-index: 1040;
}

.sidebar > .nav {
    flex: 1 1 auto;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: flex-start;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(153, 246, 228, 0.35) transparent;
}

.sidebar > .nav > .nav-link,
.sidebar > .nav > .nav-group {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
}

.sidebar > .nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar > .nav::-webkit-scrollbar-thumb {
    background: rgba(153, 246, 228, 0.35);
    border-radius: 999px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem 0.65rem;
    flex-shrink: 0;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(20, 184, 166, 0.35);
    flex-shrink: 0;
}

.brand-mark-sm {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.brand strong {
    display: block;
    font-size: 1.05rem;
    color: #fff;
}

.brand small {
    color: #99f6e4;
    opacity: 0.85;
}

.sidebar-close {
    margin-inline-start: auto;
    color: #e2e8f0;
}

.sidebar-close:hover,
.sidebar-close:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 12px;
    padding: 0.75rem 0.95rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: all .15s ease;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.35rem;
    text-align: center;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(20, 184, 166, 0.18);
    color: #fff;
}

.nav-unread-badge {
    margin-inline-start: auto;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.agent-msg-toast {
    position: fixed;
    z-index: 1200;
    inset-inline-end: 1rem;
    bottom: 1rem;
    max-width: min(22rem, calc(100vw - 2rem));
    display: flex;
    align-items: stretch;
    gap: 0.15rem;
    background: #0f766e;
    color: #fff;
    border-radius: 0.9rem;
    box-shadow: 0 16px 40px rgba(15, 118, 110, 0.35);
    overflow: hidden;
    animation: agent-toast-in 0.28s ease;
}

.agent-msg-toast-body {
    flex: 1;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: start;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
}

.agent-msg-toast-body i {
    margin-top: 0.15rem;
    font-size: 1.1rem;
    opacity: 0.95;
}

.agent-msg-toast-close {
    border: 0;
    background: rgba(0, 0, 0, 0.12);
    color: #fff;
    padding: 0 0.75rem;
    cursor: pointer;
}

.agent-msg-toast-close:hover {
    background: rgba(0, 0, 0, 0.22);
}

@keyframes agent-toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar .nav-group {
    margin-bottom: 0.25rem;
}

.sidebar .nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    border-radius: 12px;
    padding: 0.75rem 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-align: start;
    transition: all .15s ease;
}

.sidebar .nav-group-toggle i:first-child {
    font-size: 1.1rem;
    width: 1.35rem;
    text-align: center;
}

.sidebar .nav-group-toggle:hover {
    background: rgba(20, 184, 166, 0.12);
    color: #fff;
}

.sidebar .nav-group-caret {
    margin-inline-start: auto;
    font-size: 0.85rem;
    opacity: 0.75;
    transition: transform .15s ease;
}

.sidebar .nav-group.is-open .nav-group-caret {
    transform: rotate(180deg);
}

.sidebar .nav-sub {
    display: none;
    padding-inline-start: 0.85rem;
    margin-bottom: 0.15rem;
}

.sidebar .nav-group.is-open .nav-sub {
    display: block;
}

.sidebar .nav-sub .nav-link {
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
}

.visit-chart {
    direction: ltr;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 18rem;
}

.visit-chart-body {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    gap: 0.35rem 0.5rem;
    align-items: stretch;
    min-height: 16rem;
}

.visit-chart-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0.35rem 0 1.85rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.visit-chart-y-tick {
    line-height: 1;
}

.visit-chart-plot {
    position: relative;
    min-width: 0;
    border-inline-start: 1px solid #e2e8f0;
    border-block-end: 1px solid #e2e8f0;
    background:
        linear-gradient(180deg, rgba(15, 118, 110, 0.03), transparent 42%),
        #fff;
    border-radius: 0 0.5rem 0 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.visit-chart-grid {
    position: absolute;
    inset: 0.35rem 0 1.85rem 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    z-index: 0;
}

.visit-chart-grid-line {
    border-top: 1px dashed #e2e8f0;
    width: 100%;
}

.visit-chart-line-wrap {
    position: relative;
    z-index: 1;
    min-width: max(100%, 28rem);
    height: 100%;
    min-height: 16rem;
    padding: 0.35rem 0.75rem 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.visit-chart-svg {
    position: absolute;
    inset: 0.35rem 0.75rem 1.85rem 0.75rem;
    width: auto;
    height: auto;
    overflow: visible;
    pointer-events: none;
}

.visit-chart-area {
    fill: rgba(15, 118, 110, 0.14);
}

.visit-chart-curve {
    stroke: #0f766e;
    stroke-width: 2.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.visit-chart-points {
    position: absolute;
    inset: 0.35rem 0.75rem 1.85rem 0.75rem;
    pointer-events: none;
}

.visit-chart-point {
    position: absolute;
    transform: translate(-50%, 50%);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    cursor: default;
}

.visit-chart-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: #fff;
    border: 2px solid #0f766e;
    box-shadow: 0 1px 4px rgba(15, 118, 110, 0.25);
}

.visit-chart-point:hover .visit-chart-dot {
    transform: scale(1.15);
    border-color: #14b8a6;
}

.visit-chart-point-value {
    position: absolute;
    bottom: 100%;
    margin-bottom: 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #0f766e;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .15s ease;
}

.visit-chart-point:hover .visit-chart-point-value {
    opacity: 1;
}

.visit-chart-x-row {
    margin-top: auto;
    height: 1.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
}

.visit-chart-x {
    flex: 1 1 0;
    min-width: 0;
    height: 1.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    color: #64748b;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    transform: rotate(-40deg);
    transform-origin: center;
}

.visit-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    justify-content: center;
    font-size: 0.78rem;
    color: #64748b;
}

@media (max-width: 575.98px) {
    .visit-chart-line-wrap {
        min-width: max(100%, 22rem);
    }

    .visit-chart-x {
        font-size: 0.55rem;
    }
}

.visit-bars {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 420px;
    overflow-y: auto;
}

.visit-bar-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr 2.5rem;
    gap: 0.55rem;
    align-items: center;
}

.visit-bar-label {
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
}

.visit-bar-track {
    height: 0.55rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.visit-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e, #14b8a6);
    min-width: 0;
}

.visit-bar-value {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: end;
    color: #0f766e;
}

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.85rem 0.25rem 0.15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.15rem;
    line-height: 1.3;
    color: rgba(226, 232, 240, 0.55);
    font-size: 0.7rem;
    letter-spacing: 0.01em;
    user-select: none;
}

.sidebar-footer strong {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.72);
}

.content-area {
    padding: 1.5rem;
    min-width: 0;
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: var(--content-bg);
}

.content-area:has(.inbox) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 1rem;
}

.content-area:has(.inbox) > .alert,
.content-area:has(.inbox) > .d-flex {
    flex-shrink: 0;
}

.content-area:has(.inbox) > .inbox {
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
}

.page-title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stat-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    height: 100%;
}

.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
}

.panel-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
}

.panel-card .card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 1rem 1rem 0 0 !important;
    font-weight: 700;
}

.table > :not(caption) > * > * {
    padding: 0.85rem 0.75rem;
    vertical-align: middle;
}

.table thead th {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 700;
    background: #f8fafc;
    border-bottom-width: 1px;
}

/* Inbox */
.inbox {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1rem;
    height: calc(100dvh - 7.5rem);
    max-height: calc(100dvh - 7.5rem);
    min-height: 28rem;
    overflow: hidden;
}

.inbox-list, .inbox-thread {
    background: #fff;
    border: 0;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    padding: 1rem;
    min-height: 0;
    overflow: hidden;
}

.inbox-list {
    overflow-y: auto;
}

.conv-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
    text-align: start;
    border: 0;
    background: transparent;
    border-radius: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    font: inherit;
}

.conv-item:hover, .conv-item.active { background: #f0fdfa; }

.visitor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    font-size: 0.8rem;
    color: #475569;
}

.visitor-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
}

.visitor-meta-item i {
    color: #0f766e;
    opacity: 0.9;
}

a.visitor-meta-page {
    color: #0f766e;
    text-decoration: none;
    max-width: min(100%, 28rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.visitor-meta-page:hover {
    text-decoration: underline;
}

.conv-item.has-unread {
    background: #ecfdf5;
    border-inline-start: 3px solid #0f766e;
    font-weight: 600;
}

.conv-item strong {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.conv-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #0f766e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.inbox-thread {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

.inbox-thread-header {
    flex-shrink: 0;
}

.messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.75rem 0;
}

.bubble {
    max-width: 70%;
    padding: 0.65rem 0.8rem;
    border-radius: 0.8rem;
    background: #f1f5f9;
}

.bubble.agent { align-self: flex-start; background: #ccfbf1; }
.bubble.visitor { align-self: flex-end; }
.bubble.deleted {
    opacity: 0.85;
    background: #f8fafc;
}
.bubble.system {
    align-self: center;
    max-width: 90%;
    background: transparent;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.45rem 0.75rem;
}
.bubble small { color: #64748b; }

.chat-link {
    color: #0f766e;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}

.chat-link:hover {
    color: #115e59;
}

.msg-deleted {
    font-style: italic;
    color: #64748b;
    font-size: 0.9rem;
}

.msg-edited {
    color: #94a3b8;
    font-size: 0.75rem;
}

.bubble-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.msg-menu {
    position: relative;
    flex-shrink: 0;
    z-index: 2;
}

.btn-msg-more {
    border: 0;
    background: transparent;
    color: #94a3b8;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.45rem;
    display: inline-grid;
    place-items: center;
    padding: 0;
    line-height: 1;
    opacity: 0.55;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
}

.bubble:hover .btn-msg-more,
.bubble.menu-open .btn-msg-more,
.btn-msg-more:focus-visible {
    opacity: 1;
}

.btn-msg-more:hover {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}

.msg-menu-panel {
    position: absolute;
    top: calc(100% + 0.2rem);
    inset-inline-end: 0;
    z-index: 40;
    min-width: 8.5rem;
    padding: 0.3rem;
    border-radius: 0.7rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    box-sizing: border-box;
}

.bubble,
.bubble-head {
    overflow: visible;
}

.msg-menu-item {
    border: 0;
    background: transparent;
    color: #334155;
    text-align: start;
    border-radius: 0.5rem;
    padding: 0.45rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.86rem;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
}

.msg-menu-item:hover {
    background: #f0fdfa;
    color: #0f766e;
}

.msg-menu-item.danger {
    color: #b91c1c;
}

.msg-menu-item.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.msg-body-manageable {
    cursor: context-menu;
    touch-action: manipulation;
}

.msg-edit {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.msg-edit-actions {
    display: flex;
    gap: 0.35rem;
}

.msg-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.msg-receipt {
    font-size: 0.72rem;
    white-space: nowrap;
    color: #94a3b8;
}

.msg-receipt.seen {
    color: #0f766e;
    font-weight: 600;
}

.typing-indicator {
    flex-shrink: 0;
    padding: 0.2rem 0.35rem 0.45rem;
    font-size: 0.8rem;
    color: #64748b;
    font-style: italic;
}

.typing-indicator span {
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 1px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typing-blink 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-blink {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

.composer-dock {
    flex-shrink: 0;
    margin: 0 -1rem 0;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 0 0 1rem 1rem;
}

.composer {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin: 0;
    padding: 0.85rem 1rem;
    border-top: 0;
    background: transparent;
    border-radius: 0;
    position: static;
}

.composer-hint {
    padding: 0 1rem 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
}

.composer input { flex: 1; }
.composer-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.composer-attach input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.chat-image {
    display: block;
    max-width: min(280px, 100%);
    max-height: 220px;
    border-radius: 0.55rem;
    margin-top: 0.35rem;
    object-fit: cover;
}
.chat-file {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    color: #0f766e;
    text-decoration: none;
    font-size: 0.9rem;
}
.chat-file:hover { text-decoration: underline; }
.inbox-closed-note {
    flex-shrink: 0;
    margin: 0 -1rem 0;
    padding: 0.85rem 1rem;
    border-top: 1px solid #e2e8f0;
}

.report-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.report-layout.has-detail {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.9fr);
}

.report-detail {
    max-height: calc(100dvh - 8rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.report-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.report-table tbody tr:hover {
    background: #f0fdfa;
}

.report-pagination {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.report-pagination .page-link {
    color: #0f766e;
    min-width: 2rem;
    text-align: center;
}

.report-pagination .page-item.active .page-link {
    background-color: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.report-pagination .page-item.disabled .page-link {
    color: #94a3b8;
}

@media (max-width: 1100px) {
    .report-layout.has-detail {
        grid-template-columns: 1fr;
    }
}

.site-card pre,
pre {
    white-space: pre-wrap;
}

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: "IRANSans", Tahoma, sans-serif;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    left: 0.75rem;
    top: 0.5rem;
}

/* Boot screen (also in index.html critical CSS) */
.boot-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(15, 118, 110, 0.12), transparent 55%),
        linear-gradient(165deg, #f3faf8 0%, #e8f2f0 45%, #f7fbfa 100%);
    color: var(--lp-ink, #0c1f1e);
}

.boot-card {
    width: min(22rem, 100%);
    text-align: center;
}

.boot-mark {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 0.85rem;
    border-radius: 0.9rem;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(145deg, #0f766e, #0a4f4a);
    box-shadow: 0 10px 28px rgba(15, 118, 110, 0.28);
}

.boot-brand {
    margin: 0 0 0.35rem;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0a4f4a;
}

.boot-status {
    margin: 0 0 1.25rem;
    font-size: 0.92rem;
    color: #4a6462;
}

.boot-track {
    height: 0.35rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    overflow: hidden;
}

.boot-bar {
    height: 100%;
    width: 40%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #0f766e);
    animation: boot-slide 1.15s ease-in-out infinite;
}

.boot-pct {
    margin-top: 0.75rem;
    min-height: 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f766e;
    font-variant-numeric: tabular-nums;
}

.boot-pct:empty,
.loading-progress-text:empty { display: none; }

.loading-progress-text {
    margin-top: 0.75rem;
    min-height: 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f766e;
    font-variant-numeric: tabular-nums;
}

@keyframes boot-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
    .boot-bar {
        animation: none;
        width: 70%;
        margin-inline: auto;
    }
}

@media (max-width: 991.98px) {
    .admin-shell.authenticated {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .panel-topbar {
        padding: 0.55rem 0.85rem;
    }

    .user-menu-text strong {
        max-width: 7rem;
    }

    .user-menu-text small {
        max-width: 8rem;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .admin-shell.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: min(var(--sidebar-width), 86vw);
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        min-height: 0;
        transform: translateX(100%);
        transition: transform 0.22s ease;
        box-shadow: none;
        overflow: hidden;
    }

    html[dir="ltr"] .sidebar {
        transform: translateX(-100%);
    }

    .admin-shell.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(15, 42, 51, 0.28);
    }

    body:has(.admin-shell.sidebar-open) {
        overflow: hidden;
    }

    .content-area {
        padding: 1rem;
    }
}

@media (max-width: 960px) {
    .content-area:has(.inbox) {
        overflow: auto;
    }

    .content-area:has(.inbox) > .inbox {
        flex: none;
    }

    .inbox {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
    }

    .inbox-list {
        max-height: 14rem;
    }

    .inbox-thread {
        height: min(70dvh, 36rem);
        max-height: 70dvh;
    }
}

@media (max-width: 575.98px) {
    .content-area {
        padding: 0.85rem;
    }
}

/* —— Shamsi date picker —— */
.shamsi-datepicker {
    position: relative;
}

.shamsi-datepicker-panel {
    position: absolute;
    inset-inline-start: 0;
    top: calc(100% + 0.35rem);
    z-index: 1080;
    width: min(19.5rem, 92vw);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    box-shadow: 0 14px 36px rgba(15, 42, 51, 0.14);
    padding: 0.7rem;
}

.shamsi-datepicker-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
}

.shamsi-datepicker-title {
    flex: 1;
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 0.35rem;
}

.shamsi-datepicker-weekdays,
.shamsi-datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.2rem;
}

.shamsi-datepicker-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    padding: 0.25rem 0;
}

.shamsi-day {
    border: 0;
    background: transparent;
    border-radius: 0.5rem;
    aspect-ratio: 1;
    font-size: 0.85rem;
    color: #0f172a;
    padding: 0;
}

.shamsi-day:not(.is-empty):hover {
    background: rgba(15, 118, 110, 0.1);
}

.shamsi-day.is-empty {
    pointer-events: none;
}

.shamsi-day.is-today {
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.45);
}

.shamsi-day.is-selected {
    background: #0f766e;
    color: #fff;
    font-weight: 700;
}

.shamsi-datepicker-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 0.45rem;
    padding-top: 0.25rem;
    border-top: 1px solid #f1f5f9;
}
