.glass-card,
.nav-shell,
.sidebar,
.flash,
.metric-card,
.feature-card,
.auth-shell,
.form-shell,
.chat-panel,
.tab-shell,
.timeline-card,
.command-center {
    background: var(--surface-glow), var(--bg-elevated);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-radius: var(--radius-lg);
}

.bot-chip,
.tab-shell,
.glass-card,
.button,
.notification-toggle,
.theme-toggle,
.nav-link,
.site-nav a {
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background 0.24s ease, color 0.24s ease, opacity 0.24s ease;
}

.glass-card:hover,
.metric-card:hover,
.feature-card:hover,
.bot-chip:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-glow);
}

.nav-shell:hover,
.app-topbar:hover,
.footer-shell:hover {
    transform: none;
}

.chat-bubble.has-avatar {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    max-width: min(92%, 44rem);
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-end;
    gap: 0.75rem;
}

.chat-bubble.has-avatar .chat-bubble-shell {
    min-width: 0;
    padding: 1rem 1.1rem;
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 34px rgba(5, 9, 24, 0.16);
}

.chat-bubble.has-avatar .bubble-content {
    min-width: 0;
    line-height: 1.68;
    overflow-wrap: anywhere;
}

.bubble-user.has-avatar,
.bubble-admin.has-avatar {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: end;
}

.bubble-user.has-avatar .chat-avatar,
.bubble-admin.has-avatar .chat-avatar {
    order: 2;
}

.bubble-user.has-avatar .chat-bubble-shell,
.bubble-admin.has-avatar .chat-bubble-shell {
    order: 1;
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.09);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.92), rgba(99, 102, 241, 0.9));
    box-shadow: 0 14px 28px rgba(99, 102, 241, 0.2);
}

.bubble-assistant.has-avatar .chat-bubble-shell,
.bubble-customer.has-avatar .chat-bubble-shell {
    color: var(--text-primary);
    border-color: var(--border);
    background:
        linear-gradient(135deg, rgba(139, 92, 246, 0.13), rgba(99, 102, 241, 0.06)),
        rgba(17, 24, 39, 0.62);
}

html[data-theme='light'] .bubble-assistant.has-avatar .chat-bubble-shell,
html[data-theme='light'] .bubble-customer.has-avatar .chat-bubble-shell {
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.09), rgba(99, 102, 241, 0.05)),
        rgba(255, 255, 255, 0.9);
}

.bubble-error.has-avatar .chat-bubble-shell {
    background: rgba(255, 107, 148, 0.12);
    border-color: rgba(255, 107, 148, 0.28);
    color: var(--text-primary);
}

.typing-bubble.has-avatar {
    width: fit-content;
    max-width: none;
}

.typing-bubble.has-avatar .chat-bubble-shell {
    min-width: 4.4rem;
    padding: 0.85rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.layout-topbar,
.footer-shell {
    max-width: 1240px;
    margin: 0 auto;
    position: relative;
}

.layout-topbar {
    display: grid;
    grid-template-columns: min-content minmax(0, 1fr) min-content;
    align-items: start;
    gap: 1rem;
}

.layout-topbar::after {
    content: '';
    display: block;
    width: 64px;
    min-width: 64px;
    height: 1px;
}

.layout-topbar.layout-topbar-site {
    max-width: calc(1240px + 8rem);
}

.layout-topbar.layout-topbar-app {
    max-width: calc(1400px + 3rem);
    margin-top: 1rem;
    padding-inline: clamp(1rem, 2vw, 1.5rem);
}

.nav-control-dock {
    width: 64px;
    min-width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.1), rgba(7, 11, 26, 0.92));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: relative;
    z-index: 1412;
}

.nav-shell,
.footer-shell,
.sidebar,
.page-intro,
.metric-card,
.feature-card,
.history-item,
.signal-card,
.chat-bubble,
.chat-bubble-shell {
    display: grid;
    gap: 1rem;
}

.nav-shell {
    display: grid;
    gap: 0.9rem;
    padding: 1rem 1.2rem;
    transition: background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
    width: 100%;
    max-width: none;
    margin: 0;
}

.footer-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 1.2rem;
}

.chat-avatar {
    position: relative;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(5, 9, 24, 0.18);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #FFFFFF;
}

.chat-avatar.is-user,
.chat-avatar.is-customer {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
}

.chat-avatar.is-admin {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.88), rgba(99, 102, 241, 0.82));
}

.chat-avatar.is-assistant {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.92), rgba(99, 102, 241, 0.82));
}

.chat-avatar.is-assistant .chat-avatar-fallback {
    font-size: 0.74rem;
}

.nav-shell-main,
.app-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
}

.topbar-slot {
    display: flex;
    align-items: center;
    min-width: 0;
}

.topbar-slot-start {
    justify-self: start;
    justify-content: flex-start;
    min-height: 1px;
}

.topbar-slot-center {
    justify-self: center;
    justify-content: center;
}

.topbar-slot-end {
    justify-self: end;
    justify-content: flex-end;
    width: 100%;
}

.app-topbar-brand-left {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1.25rem;
}

.app-topbar-brand-left .topbar-slot-start {
    min-height: auto;
}

.app-topbar-brand-left .topbar-slot-center {
    justify-self: stretch;
    justify-content: flex-start;
}

.app-topbar-brand-left .topbar-slot-end {
    width: auto;
}

.app-topbar-brand-left .brand {
    justify-content: flex-start;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    justify-content: center;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    position: relative;
}

.brand-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.35rem;
    height: 3.6rem;
    padding: 0.18rem 0.95rem 0.1rem 0.85rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(198, 214, 255, 0.14);
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 214, 162, 0.2), transparent 22%),
        radial-gradient(circle at 78% 78%, rgba(103, 216, 255, 0.14), transparent 30%),
        linear-gradient(145deg, rgba(24, 36, 78, 0.72), rgba(12, 18, 42, 0.74) 54%, rgba(28, 36, 88, 0.7));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 0 1px rgba(94, 126, 219, 0.08),
        0 10px 24px rgba(4, 9, 28, 0.18);
    overflow: hidden;
    isolation: isolate;
    backdrop-filter: blur(16px) saturate(1.08);
    -webkit-backdrop-filter: blur(16px) saturate(1.08);
}

.brand-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 0 26%, rgba(255, 255, 255, 0.05) 38%, transparent 54%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 58%);
    pointer-events: none;
}

.brand-badge::after {
    content: '';
    position: absolute;
    inset: 0.24rem;
    border-radius: calc(1.15rem - 0.24rem);
    border: 1px solid rgba(255, 255, 255, 0.04);
    background:
        radial-gradient(circle at 16% 16%, rgba(255, 240, 207, 0.14), transparent 18%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 44%);
    opacity: 0.9;
    pointer-events: none;
}

.brand-badge-word,
.brand-badge-side {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    color: rgba(247, 250, 255, 0.98);
}

.brand-badge-word {
    font-size: 1.74rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    text-shadow:
        0 2px 12px rgba(94, 126, 219, 0.14),
        0 0 16px rgba(255, 255, 255, 0.05);
}

.brand-badge-side {
    position: absolute;
    right: 0.32rem;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.42rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: rgba(214, 226, 255, 0.58);
}

.sidebar .brand-badge {
    min-width: 6.2rem;
    height: 4.3rem;
    padding-inline: 1.15rem 1.05rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 0 1px rgba(94, 126, 219, 0.08),
        0 14px 30px rgba(4, 9, 28, 0.2);
}

.sidebar .brand-badge-word {
    font-size: 2.08rem;
}

.site-nav,
.nav-actions,
.sidebar-nav,
.intro-actions,
.hero-actions,
.pill-row,
.composer-actions,
.table-actions,
.topbar-actions {
    display: flex;
    gap: 1rem;
}

.nav-toggle {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(22, 30, 62, 0.92), rgba(10, 14, 32, 0.86));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-direction: column;
    padding: 0.9rem;
    position: relative;
    z-index: 1415;
    pointer-events: auto;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-nav-toggle {
    display: inline-flex;
}

.nav-toggle span {
    width: 100%;
    max-width: 1.35rem;
    height: 2px;
    border-radius: 4px;
    background: var(--text);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle span:nth-child(2) {
    max-width: 1.05rem;
}

.nav-toggle span:nth-child(3) {
    max-width: 0.8rem;
}

.nav-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
    border-color: var(--line-strong);
}

.nav-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    max-width: 1.35rem;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    max-width: 1.35rem;
}

.nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
    max-width: 1.35rem;
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    max-width: 1.35rem;
}

.nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    max-width: 1.35rem;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    max-width: 1.35rem;
}

.site-nav {
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.site-nav-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-nav-group-workspace,
.site-nav-footer {
    display: none;
}

.site-nav.site-nav-authenticated .site-nav-group-public {
    display: none;
}

.site-nav.site-nav-authenticated .site-nav-group-workspace {
    display: flex;
}

.site-nav a,
.nav-link {
    color: var(--text-muted);
    font-weight: 500;
}

.site-nav a {
    position: relative;
    padding: 0.72rem 0.95rem;
    border-radius: 14px;
}

.site-nav a:hover,
.site-nav a.is-active {
    transform: translateY(-1px);
    background: var(--surface-quiet);
    box-shadow: 0 12px 26px rgba(20, 30, 76, 0.18);
}

.site-nav a.is-active,
.nav-link.is-active {
    color: var(--text);
}

.nav-link {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid transparent;
}

.nav-link.is-active,
.nav-link:hover {
    border-color: var(--line);
    background: var(--surface-quiet-strong);
    color: var(--text);
}

.nav-actions,
.intro-actions,
.hero-actions,
.composer-actions,
.table-actions,
.topbar-actions {
    align-items: center;
    flex-wrap: wrap;
}

.nav-actions,
.topbar-actions {
    justify-content: flex-end;
}

.nav-profile-thumb {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, rgba(108, 160, 255, 0.28), rgba(132, 102, 255, 0.22));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e8f0ff;
    font-weight: 700;
    text-decoration: none;
}

.nav-profile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-profile-thumb:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 8px 22px rgba(139, 92, 246, 0.28);
    border-color: rgba(132, 102, 255, 0.35);
}

.nav-profile-thumb span {
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.notification-toggle,
.theme-toggle,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 999px;
}

.notification-toggle {
    min-width: 122px;
    padding: 0.72rem 0.95rem;
    border: 1px solid var(--line);
    background: var(--surface-quiet);
    color: var(--text);
    position: relative;
}

.notification-toggle:hover,
.notification-toggle[aria-expanded='true'] {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-glow);
    background: var(--surface-quiet-strong);
}

.notification-bell {
    position: relative;
    width: 0.95rem;
    height: 1rem;
    flex: 0 0 auto;
    border: 1.8px solid currentColor;
    border-top-left-radius: 0.7rem;
    border-top-right-radius: 0.7rem;
    border-bottom-left-radius: 0.38rem;
    border-bottom-right-radius: 0.38rem;
    border-bottom-width: 1.1px;
    transform: translateY(-1px);
}

.notification-bell::before,
.notification-bell::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.notification-bell::before {
    top: -0.28rem;
    width: 0.28rem;
    height: 0.18rem;
    border-radius: 999px 999px 0 0;
    border: 1.5px solid currentColor;
    border-bottom: 0;
}

.notification-bell::after {
    bottom: -0.24rem;
    width: 0.44rem;
    height: 0.16rem;
    border-radius: 999px;
    background: currentColor;
}

.notification-label {
    font-weight: 600;
    white-space: nowrap;
}

.notification-badge {
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #eff5ff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 8px 18px rgba(139, 92, 246, 0.35);
    opacity: 0;
    transform: scale(0.82);
}

.notification-badge.is-visible {
    opacity: 1;
    transform: scale(1);
}

.button {
    padding: 0.9rem 1.2rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 16px 34px rgba(60, 111, 255, 0.28);
}

.button-secondary {
    background: var(--surface-quiet);
    color: var(--text);
    border-color: var(--line);
}

.button-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--text-muted);
}

.button-danger {
    background: rgba(255, 107, 148, 0.14);
    border-color: rgba(255, 107, 148, 0.3);
    color: #ffd2de;
}

html[data-theme='light'] .button-danger {
    color: #bb234f;
}

.button-small {
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
}

.button-block {
    width: 100%;
}

.theme-toggle {
    justify-content: space-between;
    min-width: 118px;
    padding: 0.7rem 0.95rem;
    border: 1px solid var(--line);
    color: var(--text);
    background: var(--surface-quiet);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.theme-toggle-icon {
    width: 0.95rem;
    height: 0.95rem;
    flex: 0 0 auto;
    border-radius: 999px;
    position: relative;
}

html[data-theme='dark'] .theme-toggle-icon {
    background: linear-gradient(135deg, rgba(168, 197, 255, 0.98), rgba(92, 146, 255, 0.96));
    box-shadow: inset -0.2rem -0.1rem 0 rgba(5, 8, 22, 0.55), 0 0 0 0.12rem rgba(126, 175, 255, 0.26);
}

html[data-theme='light'] .theme-toggle-icon {
    background: linear-gradient(135deg, #ffd35f, #ffb347);
    box-shadow: 0 0 0 0.16rem rgba(255, 211, 95, 0.28), 0 0 24px rgba(255, 181, 71, 0.22);
}

.auto-refresh-widget {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 16;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0.95rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(7, 11, 26, 0.88);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

html[data-theme='light'] .auto-refresh-widget {
    background: rgba(255, 255, 255, 0.9);
}

.auto-refresh-copy {
    display: grid;
    gap: 0.18rem;
}

.auto-refresh-copy strong {
    font-size: 0.9rem;
    line-height: 1.1;
}

.auto-refresh-copy small {
    color: var(--text-soft);
    font-size: 0.76rem;
    max-width: 14rem;
}

.auto-refresh-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-quiet);
    color: var(--text);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.auto-refresh-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.auto-refresh-toggle-track {
    width: 2.55rem;
    height: 1.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    position: relative;
    transition: background 0.22s ease;
}

.auto-refresh-toggle-thumb {
    position: absolute;
    top: 0.17rem;
    left: 0.17rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
    transition: transform 0.22s ease, background 0.22s ease;
}

.auto-refresh-toggle-state {
    min-width: 2.2rem;
    text-align: center;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auto-refresh-widget:not(.is-off) .auto-refresh-toggle-track {
    background: rgba(139, 92, 246, 0.26);
}

.auto-refresh-widget:not(.is-off) .auto-refresh-toggle-thumb {
    transform: translateX(1.08rem);
    background: var(--primary);
}

.auto-refresh-widget.is-paused .auto-refresh-copy small {
    color: var(--accent);
}

.auto-refresh-widget.is-off .auto-refresh-copy small {
    color: var(--text-muted);
}

.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.notification-overlay.open {
    opacity: 1;
    visibility: visible;
}

.notification-popover {
    position: fixed;
    top: 5.5rem;
    right: 1rem;
    width: min(26rem, calc(100vw - 2rem));
    max-height: min(34rem, calc(100dvh - 6rem));
    padding: 1.05rem;
    border-radius: 24px;
    border: 1px solid rgba(129, 140, 248, 0.18);
    background: linear-gradient(180deg, rgba(22, 28, 56, 0.98), rgba(8, 11, 24, 0.985));
    box-shadow:
        0 30px 80px rgba(1, 4, 16, 0.58),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 14px 32px rgba(99, 102, 241, 0.12);
    z-index: 1705;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 1rem;
    overflow: hidden;
    isolation: isolate;
    backdrop-filter: blur(24px) saturate(135%);
    -webkit-backdrop-filter: blur(24px) saturate(135%);
    contain: paint;
}

.notification-popover::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at top right, rgba(139, 92, 246, 0.22), transparent 42%),
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.1), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.notification-popover > * {
    position: relative;
    z-index: 1;
}

.notification-popover-head,
.notification-popover-top,
.notification-popover-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.notification-popover-head {
    align-items: flex-start;
    padding: 0.05rem 0.1rem 0.7rem;
    border-bottom: 1px solid rgba(129, 140, 248, 0.12);
}

.notification-popover-copy {
    display: grid;
    gap: 0.38rem;
}

.notification-popover-copy .eyebrow {
    color: rgba(206, 214, 255, 0.7);
    letter-spacing: 0.08em;
}

.notification-popover-copy strong {
    font-size: 1.15rem;
    line-height: 1.15;
    color: #f5f7ff;
}

.notification-popover-head [data-notification-open-drawer] {
    min-height: 3rem;
    padding: 0.72rem 1rem;
    border-radius: 16px;
    border-color: rgba(129, 140, 248, 0.28);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.16), rgba(67, 56, 202, 0.1));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.notification-popover-head [data-notification-open-drawer]:hover {
    border-color: rgba(167, 139, 250, 0.38);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.24), rgba(67, 56, 202, 0.14));
}

.notification-popover-list {
    display: grid;
    gap: 0.85rem;
    max-height: min(28rem, 68vh);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.2rem;
    scrollbar-gutter: stable;
}

.notification-popover-item {
    position: relative;
    border-radius: 18px;
    border: 1px solid rgba(129, 140, 248, 0.14);
    background: linear-gradient(180deg, rgba(21, 27, 50, 0.96), rgba(15, 19, 36, 0.98));
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.notification-popover-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), transparent 56%);
    opacity: 0.78;
    pointer-events: none;
}

.notification-popover-item.is-unread {
    border-color: rgba(139, 92, 246, 0.42);
    background: linear-gradient(180deg, rgba(32, 38, 68, 0.98), rgba(16, 20, 39, 0.985));
    box-shadow: 0 10px 22px rgba(139, 92, 246, 0.12);
}

.notification-popover-item:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.32);
    box-shadow: 0 14px 28px rgba(5, 9, 24, 0.24), 0 0 0 1px rgba(167, 139, 250, 0.08) inset;
}

.notification-popover-open {
    width: 100%;
    display: grid;
    gap: 0.85rem;
    text-align: left;
    align-items: flex-start;
    padding: 1rem 1rem 0.95rem;
    color: var(--text);
    position: relative;
    z-index: 1;
}

.notification-popover-open:hover {
    background: rgba(255, 255, 255, 0.025);
}

.notification-popover-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 1.9rem;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #f4f7ff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.notification-popover-item.is-unread .notification-popover-title::before {
    content: '';
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #9f7aea, #6366f1);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.68);
}

.notification-popover-time,
.notification-popover-ticket {
    color: var(--text-soft);
    font-size: 0.78rem;
}

.notification-popover-time {
    white-space: nowrap;
}

.notification-popover-preview {
    margin: 0;
    color: rgba(224, 229, 255, 0.82);
    font-size: 0.94rem;
    line-height: 1.58;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-popover-footer {
    align-items: center;
}

.notification-popover-ticket {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.85rem;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
}

.notification-popover-read {
    min-height: 1.9rem;
    padding: 0.34rem 0.68rem;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: #b9c4ff;
    font-size: 0.78rem;
    font-weight: 600;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.notification-popover-read:hover:not(:disabled) {
    border-color: rgba(167, 139, 250, 0.34);
    background: rgba(99, 102, 241, 0.12);
    color: #eef2ff;
}

.notification-popover-read:disabled {
    color: rgba(163, 173, 214, 0.68);
    cursor: default;
    border-color: rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.notification-popover-list::-webkit-scrollbar {
    width: 10px;
}

.notification-popover-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-popover-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 2px solid transparent;
    background: rgba(129, 140, 248, 0.3);
    background-clip: padding-box;
}

.notification-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: clamp(22rem, 31vw, 26.5rem);
    z-index: 9999;
    background:
        radial-gradient(circle at top left, rgba(129, 140, 248, 0.16), transparent 26%),
        linear-gradient(180deg, rgba(24, 30, 59, 0.985), rgba(8, 11, 24, 0.992));
    border-left: 1px solid rgba(129, 140, 248, 0.18);
    box-shadow:
        -30px 0 70px rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        -10px 0 34px rgba(99, 102, 241, 0.12);
    padding: 1.15rem;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 1rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow: hidden;
    pointer-events: none;
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.notification-drawer.open {
    transform: translateX(0);
    pointer-events: auto;
}

body.notification-open {
    overflow: hidden;
}

.notification-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.1rem 0.1rem 0.95rem;
    border-bottom: 1px solid rgba(129, 140, 248, 0.12);
}

.notification-drawer-copy {
    display: grid;
    gap: 0.42rem;
    min-width: 0;
}

.notification-drawer-copy .eyebrow {
    color: rgba(206, 214, 255, 0.74);
    letter-spacing: 0.08em;
}

.notification-drawer-title-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.notification-drawer-title-row h3 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.05;
    color: #f5f7ff;
}

.notification-drawer-count {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(223, 229, 255, 0.86);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.notification-drawer-subcopy {
    margin: 0;
    max-width: 28ch;
    color: rgba(176, 185, 219, 0.82);
    font-size: 0.86rem;
    line-height: 1.5;
}

.notification-drawer-close {
    min-width: 3.15rem;
    width: 3.15rem;
    height: 3.15rem;
    padding: 0;
    border-radius: 18px;
    border-color: rgba(129, 140, 248, 0.22);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(15, 19, 36, 0.04));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-size: 1.15rem;
}

.notification-drawer-close:hover {
    border-color: rgba(167, 139, 250, 0.34);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.16), rgba(21, 26, 49, 0.08));
}

.notification-views {
    display: grid;
    gap: 1rem;
    grid-template-rows: 1fr auto;
    height: 100%;
    min-height: 0;
}

.notification-list {
    overflow-y: auto;
    display: grid;
    gap: 0.8rem;
    min-height: 0;
    padding-right: 0.2rem;
    scrollbar-gutter: stable;
}

.notification-item {
    padding: 0;
    width: 100%;
    position: relative;
    display: block;
    border: 1px solid rgba(129, 140, 248, 0.12);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(20, 25, 47, 0.96), rgba(12, 16, 31, 0.98));
    color: var(--text);
    text-decoration: none;
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    appearance: none;
    -webkit-appearance: none;
}

.notification-item::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.95), rgba(99, 102, 241, 0.9));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.notification-item:hover {
    border-color: rgba(167, 139, 250, 0.26);
    box-shadow: 0 16px 30px rgba(4, 8, 24, 0.22), 0 0 0 1px rgba(167, 139, 250, 0.08) inset;
    transform: translateY(-2px);
}

.notification-item:focus-visible {
    outline: none;
    border-color: rgba(196, 181, 253, 0.56);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18), 0 14px 28px rgba(5, 9, 24, 0.24);
}

.notification-item.is-unread {
    border-color: rgba(139, 92, 246, 0.28);
    background: linear-gradient(180deg, rgba(30, 36, 64, 0.985), rgba(14, 18, 35, 0.992));
    box-shadow: 0 10px 24px rgba(139, 92, 246, 0.12);
}

.notification-item.is-unread::before,
.notification-item.is-active::before {
    opacity: 1;
}

.notification-item.is-active {
    border-color: rgba(167, 139, 250, 0.38);
    background: linear-gradient(180deg, rgba(36, 41, 73, 0.985), rgba(17, 21, 40, 0.992));
    box-shadow: 0 18px 34px rgba(99, 102, 241, 0.16), 0 0 0 1px rgba(167, 139, 250, 0.12) inset;
}

.notification-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--primary);
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.7);
    margin-top: 0.55rem;
}

.notification-dot.is-read {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.notification-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem 1rem 0.96rem;
}

.notification-body {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.notification-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.notification-title-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.notification-title {
    margin: 0;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.2;
    color: #f4f7ff;
}

.notification-card-status.status-pill {
    min-height: 1.45rem;
    padding: 0.18rem 0.48rem;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}

.notification-time {
    flex-shrink: 0;
    color: rgba(176, 185, 219, 0.72);
    font-size: 0.76rem;
    line-height: 1.3;
    white-space: nowrap;
}

.notification-preview {
    margin: 0;
    color: rgba(212, 218, 241, 0.8);
    overflow: hidden;
    font-size: 0.92rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    font-size: 0.78rem;
    color: var(--text-soft);
}

.notification-ticket-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.75rem;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
    color: rgba(220, 225, 246, 0.8);
}

.notification-action-hint {
    color: rgba(167, 179, 223, 0.76);
    font-weight: 600;
}

.notification-chevron {
    align-self: center;
    color: rgba(167, 179, 223, 0.48);
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
}

.notification-item:hover .notification-chevron,
.notification-item.is-active .notification-chevron {
    color: rgba(233, 237, 255, 0.88);
    transform: translateX(2px);
}

.notification-thread {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.85rem;
    height: 100%;
    min-height: 0;
}

.notification-thread-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(129, 140, 248, 0.14);
    background: linear-gradient(180deg, rgba(20, 25, 47, 0.94), rgba(12, 16, 31, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.notification-thread-head-main {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.notification-thread-back {
    display: none;
    width: fit-content;
    border-color: rgba(129, 140, 248, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

.notification-drawer.thread-open .notification-thread-back {
    display: inline-flex;
}

.notification-drawer.thread-open .notification-views {
    grid-template-rows: 1fr;
}

.notification-thread-head strong {
    display: block;
    color: #f4f7ff;
    font-size: 1rem;
    line-height: 1.2;
}

.notification-thread-head p {
    margin: 0.2rem 0 0;
    color: rgba(176, 185, 219, 0.82);
    font-size: 0.84rem;
    line-height: 1.45;
}

.notification-messages {
    border: 1px solid rgba(129, 140, 248, 0.14);
    border-radius: 18px;
    padding: 0.95rem;
    background: linear-gradient(180deg, rgba(18, 23, 43, 0.96), rgba(11, 15, 29, 0.985));
    overflow-y: auto;
    display: grid;
    gap: 0.8rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.notification-reply-form textarea {
    min-height: 4.5rem;
    border-radius: 18px;
    border-color: rgba(129, 140, 248, 0.16);
    background: linear-gradient(180deg, rgba(14, 18, 34, 0.96), r   gba(9, 13, 25, 0.98));
}

.notification-reply-form .composer-actions {
    justify-content: space-between;
    align-items: center;
}

.notification-shell {
    position: relative;
}

.notification-empty {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px dashed rgba(129, 140, 248, 0.18);
    background: linear-gradient(180deg, rgba(18, 23, 43, 0.92), rgba(12, 15, 29, 0.96));
    color: rgba(180, 188, 220, 0.82);
}

.notification-empty p {
    margin: 0;
}

.notification-list::-webkit-scrollbar {
    width: 10px;
}

.notification-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 2px solid transparent;
    background: rgba(129, 140, 248, 0.26);
    background-clip: padding-box;
}

.toast {
    min-width: 240px;
    max-width: 320px;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--bg-panel);
    box-shadow: var(--shadow-soft);
    color: var(--text);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: flex-end;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.7rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text-muted);
    background: var(--surface-quiet);
}

.pagination-link.is-active {
    color: var(--text);
    border-color: rgba(139, 92, 246, 0.32);
    box-shadow: var(--shadow-glow);
}

.pagination-link.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.site-footer {
    padding-bottom: 1.4rem;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.sidebar {
    position: sticky;
    top: 1.2rem;
    align-self: start;
    min-height: calc(100vh - 2.4rem);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    transition: transform 0.32s ease, box-shadow 0.32s ease, opacity 0.24s ease;
    z-index: 1400;
    pointer-events: auto;
}

.sidebar-nav {
    display: grid;
    gap: 0.55rem;
}

.sidebar-footer {
    display: grid;
    gap: 0.85rem;
}

.user-chip {
    display: grid;
    gap: 0.55rem;
}

.user-chip-meta {
    display: grid;
}

.user-chip-meta small,
.ghost-link {
    color: var(--text-soft);
}

.app-topbar {
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1.25rem;
    margin: 0;
    max-width: none;
    position: relative;
    z-index: 1406;
    width: 100%;
}

.app-topbar .brand.compact img {
    height: 2.8rem;
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 18, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 900;
    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

.nav-overlay[hidden],
.notification-overlay[hidden],
.notification-popover[hidden],
.notification-drawer[hidden] {
    display: none !important;
    pointer-events: none !important;
}

body.nav-open .nav-overlay {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.footer-brand-block {
    display: grid;
    gap: 0.8rem;
}

.footer-brand-block .brand-badge {
    min-width: 5.8rem;
    height: 4rem;
}

.footer-brand-block .brand-badge-word {
    font-size: 1.95rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-shell {
    margin-top: 1rem;
}

.footer-shell p,
.footer-links a {
    color: var(--text-soft);
}

body.has-unified-topbar .footer-shell {
    max-width: none;
    align-items: flex-start;
    gap: clamp(1.25rem, 3vw, 3rem);
    padding: clamp(1.1rem, 2vw, 1.6rem);
}

.footer-link-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(9rem, 1fr));
    gap: clamp(1rem, 2vw, 1.6rem);
    width: min(100%, 42rem);
}

.footer-column {
    display: grid;
    align-content: start;
    gap: 0.55rem;
}

.footer-column strong {
    color: var(--text);
    font-size: 0.82rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.footer-column a {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.footer-column a:hover {
    color: var(--text);
}

@media (max-width: 780px) {
    body.has-unified-topbar .footer-shell {
        flex-direction: column;
    }

    .footer-link-groups {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

body.app-body .glass-card,
body.app-body .sidebar,
body.app-body .metric-card,
body.app-body .tab-shell {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

body.admin-page .glass-card,
body.admin-page .sidebar,
body.admin-page .metric-card,
body.admin-page .tab-shell {
    background: var(--admin-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: var(--admin-shadow);
}

body.admin-page .sidebar,
body.admin-page .page-intro,
body.admin-page .metric-card,
body.admin-page .tab-shell,
body.admin-page .overview-kpi-card,
body.admin-page .overview-panel,
body.admin-page .overview-note {
    transition: none;
}

body.admin-page .glass-card:hover,
body.admin-page .metric-card:hover,
body.admin-page .page-intro:hover,
body.admin-page .overview-kpi-card:hover,
body.admin-page .overview-panel:hover,
body.admin-page .overview-note:hover {
    transform: none;
    border-color: var(--line);
    box-shadow: var(--admin-shadow);
}

body.admin-page .tab-shell,
body.admin-page .metric-card,
body.admin-page .overview-panel,
body.admin-page .overview-note {
    contain: layout paint;
}

.heatmap-shell,
.heatmap-chart-shell {
    width: 100%;
}

.heatmap-grid {
    --heatmap-columns: 8;
    display: grid;
    grid-template-columns: 4.5rem repeat(calc(var(--heatmap-columns) - 1), minmax(0, 1fr));
    gap: 0.38rem;
    align-items: center;
}

.heatmap-axis {
    color: var(--text-soft);
    font-size: 0.72rem;
    line-height: 1.1;
}

.heatmap-day,
.heatmap-corner {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.heatmap-cell {
    width: 100%;
    min-height: 1.15rem;
    border-radius: 0.45rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.82), rgba(99, 102, 241, 0.88));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.activity-trend-canvas {
    width: 100%;
    min-height: 260px;
    display: block;
}

.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.training-sample-list {
    display: grid;
    gap: 0.85rem;
}

.training-sample-card {
    display: grid;
    gap: 0.4rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--surface-quiet);
}

.training-sample-card p,
.training-sample-card small {
    margin: 0;
    color: var(--text-soft);
}

@media (min-width: 1025px) {
    .layout-topbar {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 1.25rem;
    }

    .layout-topbar::after {
        display: none;
    }

    .nav-shell,
    .app-topbar {
        grid-column: 2;
    }

    .nav-control-dock {
        position: sticky;
        top: 0;
        left: auto;
        z-index: 1000;
        background: linear-gradient(180deg, rgba(18, 25, 58, 0.98), rgba(7, 11, 26, 0.99));
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 0 18px 34px rgba(5, 10, 28, 0.34);
        isolation: isolate;
    }

    .nav-toggle {
        touch-action: manipulation;
    }

    body.sidebar-collapsed .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(calc(-100% - 1.5rem));
        opacity: 0;
        pointer-events: none;
    }

    .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: sticky;
        top: 0;
        left: clamp(0.8rem, 1.2vw, 1.2rem);
        width: min(320px, calc(100vw - 2rem));
        max-width: 320px;
        height: calc(100vh - 6.8rem);
        min-height: 0;
        padding: 1rem;
        overflow-y: auto;
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        z-index: 1000;
        box-shadow: 0 22px 42px rgba(5, 10, 28, 0.26);
    }

    body.site-nav-collapsed .site-nav {
        display: none !important;
    }

    body:not(.site-nav-collapsed) .site-nav {
        display: flex !important;
    }

    .nav-overlay {
        display: none !important;
        pointer-events: none !important;
        opacity: 0 !important;
    }
}

@media (max-width: 1024px) {
    .layout-topbar {
        gap: 0.75rem;
        position: sticky;
        top: 0;
        z-index: 1410;
    }

    .layout-topbar::after {
        width: 58px;
        min-width: 58px;
    }

    .layout-topbar.layout-topbar-app,
    .layout-topbar.layout-topbar-site {
        max-width: none;
    }

    .nav-control-dock {
        width: 58px;
        min-width: 58px;
        height: 58px;
        padding: 0.3rem;
    }

    .nav-shell,
    .app-topbar {
        padding: 0.95rem 1rem;
    }

    .nav-shell-main,
    .app-topbar {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        text-align: center;
        gap: 0.85rem;
    }

    .topbar-slot-start {
        display: none;
    }

    .topbar-slot-end,
    .nav-actions,
    .topbar-actions {
        width: 100%;
        justify-content: center;
    }

    .sidebar {
        position: sticky;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(84vw, 340px);
        max-width: 360px;
        transform: translateX(-100%);
        z-index: 1000;
        min-height: 100vh;
        padding: 1rem;
        overflow-y: auto;
        box-shadow: var(--shadow-soft);
        background: var(--bg-elevated);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        pointer-events: auto;
    }

    .sidebar.is-open,
    .sidebar.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    body.nav-open {
        overflow: hidden;
    }

    .site-header {
        z-index: 1404;
    }

    .nav-shell,
    .footer-shell,
    .page-intro,
    .cta-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        display: none;
        flex-direction: column;
        background: var(--surface-glow), var(--bg-elevated);
        padding: 0.75rem 0.5rem;
        width: 100%;
        border-radius: var(--radius-md);
        border: 1px solid var(--line);
        position: relative;
        z-index: 1406;
        transform: translateY(-0.75rem);
        opacity: 0;
        pointer-events: none;
    }

    .site-nav.is-open,
    .site-nav.active {
        display: flex;
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .site-nav a {
        width: 100%;
        padding: 0.65rem 0.75rem;
        border-radius: 12px;
    }

    .site-nav-toggle {
        display: inline-flex;
    }

    .heatmap-grid {
        grid-template-columns: 3.8rem repeat(calc(var(--heatmap-columns) - 1), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    body.nav-open,
    body.notification-open {
        overflow-x: hidden;
        overflow-y: hidden;
    }

    .notification-popover {
        position: fixed;
        top: 1rem;
        left: 0.85rem;
        right: 0.85rem;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 1.7rem);
        overflow: hidden;
    }

    .notification-popover-list {
        max-height: calc(100vh - 9rem);
    }

    .notification-drawer {
        top: auto;
        bottom: 0;
        width: 100%;
        height: calc(100dvh - 4.75rem);
        max-height: calc(100dvh - 4.75rem);
        border-left: 0;
        border-top: 1px solid var(--line-strong);
        border-radius: 24px 24px 0 0;
        padding: 0.95rem;
        gap: 0.85rem;
    }

    .notification-drawer-head {
        padding: 0 0.05rem 0.75rem;
        gap: 0.8rem;
    }

    .notification-drawer-title-row h3 {
        font-size: 1.35rem;
    }

    .notification-drawer-subcopy {
        max-width: none;
        font-size: 0.82rem;
    }

    .notification-drawer-close {
        min-width: 2.95rem;
        width: 2.95rem;
        height: 2.95rem;
        border-radius: 16px;
    }

    .notification-list {
        gap: 0.72rem;
        padding-right: 0.05rem;
    }

    .notification-item {
        border-radius: 18px;
    }

    .notification-card {
        gap: 0.72rem;
        padding: 0.88rem 0.9rem 0.86rem;
    }

    .notification-card-head {
        gap: 0.55rem;
    }

    .notification-title {
        font-size: 0.92rem;
    }

    .notification-preview {
        font-size: 0.88rem;
    }

    .notification-meta {
        flex-wrap: wrap;
        gap: 0.45rem;
    }

    .notification-ticket-tag,
    .notification-action-hint,
    .notification-time {
        font-size: 0.74rem;
    }

    .notification-chevron {
        font-size: 1.05rem;
    }

    .notification-drawer.thread-open .notification-list {
        display: none;
    }

    .notification-drawer.thread-open .notification-thread {
        display: grid;
    }

    .notification-drawer.thread-open .notification-views {
        grid-template-rows: 1fr;
    }

    .notification-thread-back {
        display: inline-flex;
    }

    body.notification-open .auto-refresh-widget {
        opacity: 0;
        pointer-events: none;
    }

    .auto-refresh-widget {
        left: 0.85rem;
        right: 0.85rem;
        bottom: 0.85rem;
        justify-content: space-between;
    }

    .heatmap-grid {
        gap: 0.28rem;
    }

    .heatmap-axis {
        font-size: 0.64rem;
    }
}

@media (max-width: 640px) {
    .auto-refresh-widget {
        gap: 0.7rem;
        padding: 0.8rem 0.85rem;
    }

    .auto-refresh-copy small {
        max-width: none;
    }

    .auto-refresh-toggle {
        flex-shrink: 0;
    }
}

/* ==========================================================================
   AUTO REFRESH UI OVERLAP AND LAYOUT FIXES (GLOBAL)
   ========================================================================== */

.auto-refresh {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 50;
  pointer-events: auto;
}

body:not(.sidebar-collapsed) .auto-refresh {
  left: 90px; /* adjust to sidebar width */
}

body.sidebar-collapsed .auto-refresh {
  left: 20px;
}

.hamburger {
  position: relative;
  z-index: 100;
}

.main-content {
  max-width: 100%;
  overflow-x: hidden;
}

.card, .chat-box, .panel {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

@media (max-width: 768px) {
  .auto-refresh {
    bottom: 12px;
    left: 12px;
    transform: scale(0.9);
  }
}

/* ==========================================================================
   Obsidian Purple component refinement
   ========================================================================== */

.glass-card,
.nav-shell,
.sidebar,
.flash,
.metric-card,
.feature-card,
.auth-shell,
.form-shell,
.chat-panel,
.tab-shell,
.timeline-card,
.command-center {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        var(--surface-glow),
        var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

html[data-theme='light'] .glass-card,
html[data-theme='light'] .nav-shell,
html[data-theme='light'] .sidebar,
html[data-theme='light'] .flash,
html[data-theme='light'] .metric-card,
html[data-theme='light'] .feature-card,
html[data-theme='light'] .auth-shell,
html[data-theme='light'] .form-shell,
html[data-theme='light'] .chat-panel,
html[data-theme='light'] .tab-shell,
html[data-theme='light'] .timeline-card,
html[data-theme='light'] .command-center {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.46)),
        var(--surface-glow),
        var(--bg-elevated);
}

.glass-card:hover,
.metric-card:hover,
.feature-card:hover,
.bot-chip:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-glow);
}

.nav-shell:hover,
.app-topbar:hover,
.footer-shell:hover,
.sidebar:hover,
.chat-panel:hover,
.tab-shell:hover {
    transform: none;
}

.nav-control-dock,
.nav-toggle {
    border-radius: 14px;
    border-color: var(--border);
    background:
        linear-gradient(180deg, rgba(139, 92, 246, 0.14), rgba(5, 7, 15, 0.9)),
        var(--bg-secondary);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

html[data-theme='light'] .nav-control-dock,
html[data-theme='light'] .nav-toggle {
    background:
        linear-gradient(180deg, rgba(124, 58, 237, 0.1), rgba(255, 255, 255, 0.9)),
        var(--surface);
    box-shadow: 0 14px 32px rgba(17, 24, 39, 0.08);
}

.nav-toggle span {
    background: var(--text-primary);
}

.brand-badge,
.sidebar .brand-badge,
.footer-brand-block .brand-badge {
    min-width: auto;
    height: auto;
    padding: 0;
    gap: 0.56rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.brand-badge::before {
    content: '';
    position: relative;
    inset: auto;
    width: 1.08rem;
    height: 1.18rem;
    flex: 0 0 auto;
    border-radius: 0;
    background: linear-gradient(145deg, #C4B5FD 0%, #8B5CF6 42%, #6D28D9 100%);
    clip-path: polygon(50% 0, 100% 100%, 76% 100%, 50% 38%, 24% 100%, 0 100%);
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.62));
}

.brand-badge::after {
    content: '';
    position: absolute;
    left: 0.38rem;
    top: 0.68rem;
    width: 0.48rem;
    height: 0.14rem;
    border-radius: 999px;
    background: rgba(245, 243, 255, 0.86);
    transform: rotate(-18deg);
    box-shadow: 0 0 10px rgba(245, 243, 255, 0.28);
}

.brand-badge-side {
    display: none;
}

.brand-badge-word,
.sidebar .brand-badge-word,
.footer-brand-block .brand-badge-word {
    font-family: var(--font-body);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0;
    color: #F8F7FF;
    text-shadow: none;
}

html[data-theme='light'] .brand-badge-word,
html[data-theme='light'] .sidebar .brand-badge-word,
html[data-theme='light'] .footer-brand-block .brand-badge-word {
    color: #111827;
}

.sidebar .brand {
    justify-content: flex-start;
}

.sidebar {
    gap: 1.05rem;
    padding: 1rem;
}

.sidebar-nav {
    gap: 0.42rem;
}

.site-nav a,
.nav-link {
    color: var(--text-secondary);
}

.site-nav a,
.nav-link,
.tab-button {
    border-radius: 12px;
}

.nav-link {
    position: relative;
    padding: 0.78rem 0.9rem;
    border-color: transparent;
}

.nav-link.is-active,
.nav-link:hover,
.site-nav a:hover,
.site-nav a.is-active {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.26);
    color: var(--text-primary);
    box-shadow: none;
}

.sidebar .nav-link.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    bottom: 0.65rem;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #8B5CF6, #6366F1);
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.42);
}

.nav-actions,
.topbar-actions {
    gap: 0.65rem;
}

.notification-toggle,
.theme-toggle,
.button {
    border-radius: 12px;
}

.button {
    min-height: 44px;
    padding: 0.78rem 1.05rem;
    font-weight: 700;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.button:hover {
    transform: scale(1.03);
}

.button-primary {
    color: #FFFFFF;
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.26);
}

.button-primary:hover {
    box-shadow: 0 14px 32px rgba(139, 92, 246, 0.32);
}

.button-secondary,
.button-ghost {
    background: transparent;
    border-color: rgba(139, 92, 246, 0.42);
    color: var(--text-primary);
    box-shadow: none;
}

.button-secondary:hover,
.button-ghost:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.58);
    box-shadow: 0 10px 24px rgba(139, 92, 246, 0.12);
}

.button:disabled,
.button[disabled],
button:disabled {
    opacity: 0.52;
    cursor: not-allowed;
    box-shadow: none;
}

.button:disabled:hover,
.button[disabled]:hover,
button:disabled:hover {
    transform: none;
    box-shadow: none;
}

.notification-toggle,
.theme-toggle {
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--border);
}

html[data-theme='light'] .notification-toggle,
html[data-theme='light'] .theme-toggle {
    background: rgba(255, 255, 255, 0.7);
}

.notification-toggle:hover,
.notification-toggle[aria-expanded='true'],
.theme-toggle:hover {
    transform: scale(1.03);
    border-color: rgba(139, 92, 246, 0.34);
    box-shadow: 0 10px 24px rgba(139, 92, 246, 0.14);
}

.notification-badge {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    box-shadow: 0 8px 18px rgba(139, 92, 246, 0.32);
}

.nav-profile-thumb {
    border-radius: 12px;
    border-color: var(--border);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.32), rgba(99, 102, 241, 0.24));
}

.tab-button {
    background: transparent;
}

.tab-button:hover {
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.32);
    background: rgba(139, 92, 246, 0.08);
}

.pagination-link {
    border-radius: 12px;
}

.pagination-link.is-active {
    border-color: rgba(139, 92, 246, 0.38);
    box-shadow: 0 10px 24px rgba(139, 92, 246, 0.14);
}

.activity-list li,
.notification-item,
.notification-popover-item,
.training-sample-card,
.bot-summary-card,
.history-item,
.ticket-summary-card {
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.activity-list li:hover,
.notification-item:hover,
.training-sample-card:hover,
.bot-summary-card:hover,
.history-item:hover,
.ticket-summary-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
}

body.admin-page .glass-card,
body.admin-page .sidebar,
body.admin-page .metric-card,
body.admin-page .tab-shell {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
        var(--admin-surface);
    border-color: var(--border);
    box-shadow: var(--admin-shadow);
}

body.admin-page .glass-card:hover,
body.admin-page .metric-card:hover,
body.admin-page .page-intro:hover,
body.admin-page .overview-kpi-card:hover,
body.admin-page .overview-panel:hover,
body.admin-page .overview-note:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: var(--admin-shadow);
}

body[data-page='profile'] .profile-page .glass-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
        var(--surface-glow),
        var(--bg-elevated);
    border-color: var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body[data-page='profile'] .profile-page .field input {
    border-radius: 12px;
    border-color: var(--border);
    background: var(--input-bg);
    color: var(--text-primary);
}

body[data-page='profile'] .profile-page .field input:focus {
    border-color: rgba(139, 92, 246, 0.7);
    background: var(--input-bg);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}

body[data-page='profile'] .profile-page .avatar-shell {
    border-color: rgba(139, 92, 246, 0.22);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(99, 102, 241, 0.14));
}

body[data-page='profile'] .profile-page .status-pill,
body[data-page='profile'] .profile-page .ghost-link {
    color: var(--primary);
}

body[data-page='login'] .auth-grid {
    align-items: center;
}

body[data-page='login'] .auth-shell {
    max-width: none;
    width: 100%;
    justify-self: stretch;
}

.asst-operator-console {
    display: grid;
    gap: clamp(1rem, 2vw, 1.35rem);
}

.operator-hero-panel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: clamp(1rem, 2vw, 1.35rem);
    border: 1px solid rgba(139, 164, 255, 0.2);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(105, 183, 255, 0.11), rgba(139, 92, 246, 0.1)),
        rgba(9, 14, 31, 0.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 18px 42px rgba(5, 9, 24, 0.22);
}

.operator-hero-panel h2 {
    margin: 0.25rem 0 0.45rem;
    font-size: clamp(1.35rem, 3vw, 2.1rem);
    letter-spacing: 0;
}

.operator-hero-panel p {
    max-width: 68ch;
    margin: 0;
    color: var(--text-muted);
}

.operator-status-stack,
.operator-toggle-row,
.operator-action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.operator-status-stack {
    justify-content: flex-end;
    min-width: min(100%, 18rem);
}

.operator-action-chip {
    border: 1px solid rgba(139, 164, 255, 0.2);
    border-radius: 999px;
    background: rgba(255,255,255,0.055);
    color: var(--text-primary);
    padding: 0.58rem 0.78rem;
    font: inherit;
    font-size: 0.86rem;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.operator-action-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(105, 183, 255, 0.38);
    background: rgba(105, 183, 255, 0.08);
}

.operator-health-list,
.operator-feed,
.operator-mini-grid {
    display: grid;
    gap: 0.72rem;
}

.operator-health-row,
.operator-feed-item,
.operator-mini-grid > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.78rem 0.86rem;
    border: 1px solid rgba(139, 164, 255, 0.14);
    border-radius: 16px;
    background: rgba(255,255,255,0.045);
}

.operator-health-row > div,
.operator-feed-item > div {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.operator-health-row small,
.operator-feed-item small,
.operator-feed-item p,
.operator-mini-grid span {
    color: var(--text-muted);
}

.operator-feed-item p {
    margin: 0;
}

.operator-health-row.is-good {
    border-color: rgba(56, 248, 165, 0.2);
}

.operator-health-row.is-warning {
    border-color: rgba(255, 193, 104, 0.26);
}

.operator-health-row.is-danger {
    border-color: rgba(255, 107, 148, 0.3);
}

.operator-feed.compact,
.operator-health-list {
    gap: 0.58rem;
}

.operator-mini-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.operator-mini-grid > div {
    display: grid;
    justify-items: start;
}

.operator-mini-grid strong {
    font-size: 1.35rem;
}

.operator-toggle-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
}

.panel-header.compact {
    margin-top: 1.2rem;
}

@media (max-width: 767px) {
    .operator-hero-panel {
        display: grid;
    }

    .operator-status-stack {
        justify-content: flex-start;
    }

    .operator-mini-grid {
        grid-template-columns: 1fr;
    }

    .operator-health-row,
    .operator-feed-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .button {
        width: auto;
        max-width: 100%;
        white-space: normal;
    }

    .brand-badge-word,
    .sidebar .brand-badge-word,
    .footer-brand-block .brand-badge-word {
        font-size: 1rem;
    }

    .brand-badge::before {
        width: 0.98rem;
        height: 1.08rem;
    }
}
