/* ============================================================
   Aslam — Enterprise Knowledge Engine
   Tema "organismo vivo": fundo profundo, luz bioluminescente,
   glassmorphism e movimento sutil.
   ============================================================ */

:root {
    --primary: #7c5cfc;
    --primary-hover: #6847f0;
    --accent: #22d3ee;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    color-scheme: dark;
    --bg-dark: #04060d;
    --bg-deep: #070b18;
    --page-bg: radial-gradient(120% 120% at 70% -10%, #0b1230 0%, var(--bg-deep) 45%, var(--bg-dark) 100%);
    --glass-bg: rgba(148, 163, 255, 0.05);
    --glass-border: rgba(148, 163, 255, 0.14);
    --text-main: #eef2ff;
    --text-dim: #8b93b8;
    --glow-cyan: rgba(34, 211, 238, 0.35);
    --glow-violet: rgba(124, 92, 252, 0.35);
    --surface: rgba(7, 11, 24, 0.55);
    --surface-strong: rgba(7, 11, 24, 0.78);
    --surface-panel: rgba(7, 11, 24, 0.94);
    --sidebar-bg: rgba(5, 8, 18, 0.72);
    --overlay-fade: linear-gradient(to top, rgba(4, 6, 13, 0.88) 0%, rgba(4, 6, 13, 0.35) 30%, transparent 55%);
    --brand-gradient: linear-gradient(100deg, #fff 10%, #a5b4fc 55%, #67e8f9 100%);
    --title-gradient: linear-gradient(100deg, #fff 5%, #c7d2fe 45%, #67e8f9 80%, #a78bfa 100%);
    --orb-core: #0b1024;
    --nav-active-fg: #fff;
    --chip-icon: #67e8f9;
    --shadow-soft: 0 30px 60px -15px rgba(0, 0, 0, 0.7);
    --deps-bg: rgba(0, 0, 0, 0.22);
    --input-bg: rgba(255, 255, 255, 0.07);
    --modal-bg: #0f172a;
    --modal-scrim: rgba(0, 0, 0, 0.92);
    --chip-bg: rgba(255, 255, 255, 0.04);
    --chip-border: rgba(255, 255, 255, 0.1);
    --soft-hover: rgba(255, 255, 255, 0.08);
    --code-bg: rgba(0, 0, 0, 0.3);
    --btn-soft-fg: #c4b5fd;
}

[data-theme="dark"] {
    color-scheme: dark;
}

/* Light — off-white / cinza claro (referência Claude.ai / Agents) */
[data-theme="light"] {
    color-scheme: light;
    --bg-dark: #faf9f5;
    --bg-deep: #f5f4ed;
    --page-bg: #faf9f5;
    --glass-bg: rgba(31, 30, 29, 0.04);
    --glass-border: rgba(31, 30, 29, 0.12);
    --text-main: #141413;
    --text-dim: #73726c;
    --glow-cyan: rgba(34, 211, 238, 0.16);
    --glow-violet: rgba(124, 92, 252, 0.14);
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --surface-panel: #ffffff;
    --sidebar-bg: rgba(250, 249, 245, 0.96);
    --overlay-fade: linear-gradient(to top, rgba(250, 249, 245, 0.55) 0%, rgba(250, 249, 245, 0.12) 28%, transparent 52%);
    --brand-gradient: linear-gradient(135deg, #5b45c4 0%, #3d3d3a 55%, #141413 100%);
    --title-gradient: linear-gradient(120deg, #141413 0%, #3d3d3a 45%, #5b45c4 100%);
    --orb-core: #f0eee6;
    --nav-active-fg: var(--primary);
    --chip-icon: #5b45c4;
    --shadow-soft: 0 16px 40px -18px rgba(31, 30, 29, 0.22);
    --deps-bg: rgba(31, 30, 29, 0.04);
    --input-bg: #ffffff;
    --modal-bg: #ffffff;
    --modal-scrim: rgba(31, 30, 29, 0.42);
    --chip-bg: #f5f4ed;
    --chip-border: rgba(31, 30, 29, 0.12);
    --soft-hover: rgba(31, 30, 29, 0.06);
    --code-bg: rgba(31, 30, 29, 0.06);
    --btn-soft-fg: #5b45c4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

::selection { background: rgba(124, 92, 252, 0.45); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 255, 0.16);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(148, 163, 255, 0.3); }
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(31, 30, 29, 0.22);
    border: 2px solid transparent;
    background-clip: content-box;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(31, 30, 29, 0.38);
}

body {
    background: var(--page-bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* ---------- fundo animado (aurora sutil) ---------- */

.bg-animated {
    position: fixed;
    inset: 0;
    z-index: -1;
    filter: blur(90px);
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 480px;
    height: 480px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    opacity: 0.14;
    animation: move 26s infinite alternate ease-in-out;
}
[data-theme="light"] .blob { opacity: 0.06; }
[data-theme="light"] .aslam-halo { opacity: 0.28; }

.blob:nth-child(2) {
    background: linear-gradient(135deg, #0ea5e9, #22d3ee);
    left: 60%;
    top: 20%;
    animation-delay: -8s;
}

.blob:nth-child(3) {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    left: 15%;
    top: 55%;
    animation-delay: -16s;
}

@keyframes move {
    from { transform: translate(-12%, -10%) scale(1) rotate(0deg); }
    to   { transform: translate(12%, 10%) scale(1.25) rotate(40deg); }
}

/* ---------- canvas do organismo (login e home) ---------- */

.aslam-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    pointer-events: none;
}

.aslam-halo {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(70vmin, 720px);
    height: min(70vmin, 720px);
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle at 42% 45%, var(--glow-cyan) 0%, transparent 55%),
        radial-gradient(circle at 60% 55%, var(--glow-violet) 0%, transparent 55%);
    filter: blur(60px);
    opacity: 0.55;
    animation: halo-breath 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes halo-breath {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.45; }
    50%      { transform: translate(-50%, -50%) scale(1.12); opacity: 0.7; }
}

/* ---------- página de login ---------- */

.login-page { justify-content: center; }

.login-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.glass-container {
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 48px;
    width: 100%;
    max-width: 460px;
    text-align: center;
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}

.logo .icon { font-size: 32px; }

.logo-orb {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background:
        radial-gradient(circle at 30% 30%, rgba(34, 211, 238, 0.9), transparent 55%),
        radial-gradient(circle at 70% 70%, rgba(124, 92, 252, 0.9), transparent 60%),
        var(--orb-core);
    box-shadow:
        0 0 22px var(--glow-violet),
        0 0 44px var(--glow-cyan);
    animation: orb-pulse 4s ease-in-out infinite;
}

@keyframes orb-pulse {
    0%, 100% { box-shadow: 0 0 18px var(--glow-violet), 0 0 36px var(--glow-cyan); }
    50%      { box-shadow: 0 0 32px var(--glow-cyan), 0 0 62px var(--glow-violet); }
}

.logo h1 {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header .tagline {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 6px;
}

header .subtagline {
    color: var(--text-dim);
    opacity: 0.7;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 32px;
}

header p {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-box { margin-bottom: 40px; }

.auth-box p {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
    color: var(--text-dim);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    border-radius: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.google-btn {
    background: white;
    color: #1f2937;
}

.google-btn:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -6px rgba(103, 232, 249, 0.25);
}

footer p {
    font-size: 12px;
    color: var(--text-dim);
    opacity: 0.6;
}

/* ---------- layout do dashboard ---------- */

.dashboard-page {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
}

.sidebar {
    width: 236px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo .logo-orb {
    width: 38px;
    height: 38px;
    font-size: 18px;
}

.sidebar-logo .icon { font-size: 22px; }

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sidebar-logo h1 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo small {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    opacity: 0.7;
    padding: 14px 14px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 13px;
    opacity: 0.8;
}

.nav-item:hover {
    background: rgba(124, 92, 252, 0.12);
    color: var(--nav-active-fg);
}

.nav-item.active {
    background: linear-gradient(100deg, rgba(124, 92, 252, 0.22), rgba(34, 211, 238, 0.12));
    border-color: rgba(124, 92, 252, 0.35);
    color: var(--nav-active-fg);
    box-shadow: 0 0 18px -6px var(--glow-violet);
}
[data-theme="light"] .nav-item.active {
    background: rgba(124, 92, 252, 0.12);
    border-color: rgba(124, 92, 252, 0.22);
    box-shadow: none;
}
[data-theme="light"] .nav-item:hover {
    color: var(--text-main);
}

.nav-item.soon {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.nav-item .soon-tag {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.14);
    color: var(--chip-icon);
    border: 1px solid rgba(34, 211, 238, 0.25);
}
[data-theme="light"] .nav-item .soon-tag {
    background: rgba(124, 92, 252, 0.1);
    color: var(--primary);
    border-color: rgba(124, 92, 252, 0.22);
}

/* Status de dependências (sinais vitais) — sidebar */
.sidebar-deps {
    padding: 12px 14px;
    margin: 8px 10px 0;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--deps-bg);
}

.sidebar-deps-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.dep-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    margin-bottom: 8px;
    line-height: 1.35;
}

.dep-line:last-child { margin-bottom: 0; }

.dep-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}

.dep-dot.up {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.55);
}

.dep-dot.down {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.dep-dot.unk {
    background: #eab308;
    animation: dep-pulse 1.2s ease-in-out infinite;
}

@keyframes dep-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.42; }
}

.dep-name {
    font-weight: 700;
    color: var(--text-main);
    min-width: 76px;
    flex-shrink: 0;
}

.dep-detail {
    color: var(--text-dim);
    word-break: break-word;
    font-size: 10px;
}

.sidebar-footer {
    padding: 10px 12px 14px;
    border-top: 1px solid var(--glass-border);
    position: relative;
}

.sidebar-user-menu {
    position: relative;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    width: 100%;
    border: 1px solid var(--glass-border);
    background: var(--surface-strong);
    border-radius: 0.75rem;
    padding: 0.2rem 0.25rem 0.2rem 0.35rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-user-menu.is-open .sidebar-user-card,
.sidebar-user-card:hover {
    background: var(--soft-hover);
    border-color: var(--glass-border);
}

.sidebar-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-main);
    border-radius: 0.55rem;
    padding: 0.3rem 0.35rem;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.sidebar-user-trigger:hover,
.sidebar-user-menu.is-open .sidebar-user-trigger {
    background: transparent;
}

.user-avatar-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.user-avatar,
.user-avatar-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.user-avatar {
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 12px -2px var(--glow-violet);
    display: none;
}

.user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6c757d;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
}

.user-avatar-wrap.has-photo .user-avatar { display: block; z-index: 1; }
.user-avatar-wrap.has-photo .user-avatar-placeholder { display: none; }

.user-meta {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.user-meta-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta-sub {
    display: block;
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-popover {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 0.4rem);
    padding: 0.35rem;
    border-radius: 0.85rem;
    background: var(--surface-panel);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    z-index: 20;
}

.sidebar-user-menu.is-open .sidebar-user-popover {
    display: block;
}

.sidebar-user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-main);
    text-decoration: none;
    padding: 0.6rem 0.7rem;
    border-radius: 0.55rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    text-align: left;
}

.sidebar-user-menu-item i {
    width: 1.1rem;
    text-align: center;
    opacity: 0.85;
    font-size: 0.9rem;
}

.sidebar-user-menu-item:hover {
    background: var(--soft-hover);
    color: var(--text-main);
}

.sidebar-user-menu-divider {
    height: 1px;
    margin: 0.25rem 0.4rem;
    background: var(--glass-border);
}

.btn-theme-toggle {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-dim);
    border-radius: 0.55rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.btn-theme-toggle:hover {
    color: var(--text-main);
    background: var(--soft-hover);
}

.login-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--surface);
    color: var(--text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
}

.login-theme-toggle:hover {
    color: var(--text-main);
    border-color: rgba(124, 92, 252, 0.35);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    position: relative;
}

.main-content.is-home {
    padding: 0;
    overflow: hidden;
}

/* ---------- tela inicial: Aslam ---------- */

.view-inicio { height: 100%; }

.aslam-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

.aslam-stage .aslam-halo { top: 44%; }

.aslam-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    padding: 32px 24px 40px;
    background: var(--overlay-fade);
    pointer-events: none;
    z-index: 2;
}

.aslam-overlay > * { pointer-events: auto; }

.aslam-status-pill {
    position: absolute;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.8);
    animation: dep-pulse 1.6s ease-in-out infinite;
}

.pulse-dot.warn {
    background: #eab308;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.8);
}

.aslam-title {
    font-family: var(--font-display);
    font-size: clamp(52px, 8vw, 104px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    background: var(--title-gradient);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: title-sheen 9s ease-in-out infinite;
    text-shadow: 0 0 80px rgba(124, 92, 252, 0.35);
}
[data-theme="light"] .aslam-title {
    text-shadow: none;
    animation: none;
    background-size: 100% 100%;
}

@keyframes title-sheen {
    0%, 100% { background-position: 0% 0; }
    50%      { background-position: 100% 0; }
}

.aslam-sub {
    margin-top: 10px;
    font-size: clamp(14px, 1.6vw, 17px);
    color: var(--text-dim);
    max-width: 560px;
}

.aslam-ask {
    position: relative;
    margin-top: 26px;
    width: min(640px, 92%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 22px;
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 50px -18px rgba(31, 30, 29, 0.18), 0 0 40px -18px var(--glow-violet);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.aslam-ask:focus-within {
    border-color: rgba(124, 92, 252, 0.55);
    box-shadow: 0 18px 50px -18px rgba(31, 30, 29, 0.16), 0 0 46px -14px var(--glow-cyan);
}

.aslam-ask input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 15px;
    min-width: 0;
}

.aslam-ask input::placeholder { color: var(--text-dim); }

.aslam-ask button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    flex-shrink: 0;
    cursor: pointer;
    color: #fff;
    font-size: 15px;
    background: linear-gradient(120deg, var(--primary), var(--accent));
    box-shadow: 0 0 20px -4px var(--glow-violet);
    transition: transform 0.2s, box-shadow 0.2s;
}

.aslam-ask button:hover {
    transform: scale(1.06);
    box-shadow: 0 0 26px -2px var(--glow-cyan);
}

.aslam-stats {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(148, 163, 255, 0.06);
    border: 1px solid var(--glass-border);
    font-size: 12px;
    color: var(--text-dim);
}

.stat-chip strong { color: var(--text-main); font-weight: 700; }

.stat-chip i { font-size: 11px; color: var(--chip-icon); }

.aslam-quick {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: min(780px, 94%);
}

@media (max-width: 860px) {
    .aslam-quick { grid-template-columns: 1fr; }
}

.quick-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    text-decoration: none;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}

.quick-card:hover {
    transform: translateY(-3px);
    border-color: rgba(124, 92, 252, 0.45);
    box-shadow: 0 16px 40px -18px var(--glow-violet);
}

.quick-card.disabled {
    opacity: 0.5;
    cursor: default;
}

.quick-card.disabled:hover {
    transform: none;
    border-color: var(--glass-border);
    box-shadow: none;
}

.quick-card .qc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    font-family: var(--font-display);
}

.quick-card .qc-title i {
    color: #67e8f9;
    font-size: 13px;
}

.quick-card .qc-desc {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.45;
}

.quick-card .qc-soon {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.14);
    color: #67e8f9;
    border: 1px solid rgba(34, 211, 238, 0.25);
    margin-left: 6px;
}

/* ---------- modo conversa (chat na própria home) ---------- */

.aslam-canvas,
.aslam-stage .aslam-halo {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.chat-mode .aslam-canvas {
    opacity: 0.3;
    transform: scale(1.05);
}

.chat-mode .aslam-halo { opacity: 0.2; }

.aslam-title { transition: font-size 0.5s ease; }

.chat-mode .aslam-title { font-size: 34px; }

.aslam-sub,
.aslam-stats,
.aslam-quick {
    max-height: 340px;
    overflow: hidden;
    transition: opacity 0.35s ease, max-height 0.5s ease, margin 0.5s ease;
}

.chat-mode .aslam-sub,
.chat-mode .aslam-stats,
.chat-mode .aslam-quick {
    opacity: 0;
    max-height: 0;
    margin: 0;
    pointer-events: none;
}

.aslam-chat {
    width: min(720px, 94%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 14px 6px 4px;
    scroll-behavior: smooth;
    transition: max-height 0.55s ease, opacity 0.4s ease, margin 0.55s ease;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
    mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
}

.chat-mode .aslam-chat {
    max-height: 58vh;
    opacity: 1;
    margin: 10px 0 8px;
}

.chat-msg { display: flex; }

.chat-msg.user { justify-content: flex-end; }

.chat-bubble {
    max-width: 86%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.65;
    text-align: left;
    word-break: break-word;
    animation: msg-in 0.35s ease;
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.chat-msg.user .chat-bubble {
    background: linear-gradient(120deg, var(--primary), #4f7df2);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 24px -10px var(--glow-violet);
}

.chat-msg.aslam .chat-bubble {
    background: var(--surface-strong);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px);
    border-bottom-left-radius: 6px;
    color: var(--text-main);
}

/* .chat-response (estilos de markdown do dashboard) zera o padding lateral;
   dentro de balão, o respiro interno precisa prevalecer. */
.chat-msg.aslam .chat-bubble.chat-response {
    padding: 14px 18px;
}

.chat-msg.erro .chat-bubble {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.chat-sources {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-dim);
    opacity: 0.85;
    margin-top: 10px;
}

.chat-sources i { font-size: 10px; color: var(--chip-icon); }

.chat-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 16px 18px;
}

.chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--chip-icon);
    box-shadow: 0 0 8px var(--glow-cyan);
    animation: typing 1.2s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

.chat-typing em {
    font-style: normal;
    font-size: 12px;
    color: var(--text-dim);
    margin-left: 8px;
    animation: typing-label 1.8s ease-in-out infinite;
}

@keyframes typing-label {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
    30%           { opacity: 1; transform: translateY(-4px); }
}

.aslam-reset {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(148, 163, 255, 0.08);
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: -10px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.aslam-reset:hover {
    color: var(--nav-active-fg);
    border-color: rgba(124, 92, 252, 0.5);
    background: rgba(124, 92, 252, 0.18);
}
[data-theme="light"] .aslam-reset {
    background: #f0eee6;
    color: #3d3d3a;
}
[data-theme="light"] .aslam-reset:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.chat-mode .aslam-reset { display: flex; }

/* Botão de conversas anteriores: sempre visível */
.aslam-reset.aslam-history { display: flex; }

/* ---------- painel de conversas anteriores ---------- */

.chat-history-panel {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    right: 0;
    background: var(--surface-panel);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px -20px rgba(31, 30, 29, 0.22);
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
    text-align: left;
    z-index: 6;
}

.chat-history-panel.open {
    display: block;
    animation: msg-in 0.25s ease;
}

.chat-history-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 8px 12px 6px;
}

.chat-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s;
}

.chat-history-item:hover { background: rgba(124, 92, 252, 0.12); }

.chat-history-item.current {
    border-color: rgba(124, 92, 252, 0.4);
    background: rgba(124, 92, 252, 0.08);
}

.chi-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chi-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chi-date {
    font-size: 11px;
    color: var(--text-dim);
}

.chi-del {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 12px;
    transition: color 0.15s, background 0.15s;
}

.chi-del:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
}

.chat-history-empty {
    padding: 16px;
    font-size: 13px;
    color: var(--text-dim);
    text-align: center;
}

/* ---------- Buscar com IA (aba Memória) ---------- */

.btn-ia {
    background: linear-gradient(120deg, var(--primary), var(--accent)) !important;
    margin-left: 8px;
    box-shadow: 0 0 18px -8px var(--glow-violet);
}

.btn-ia:hover { box-shadow: 0 0 24px -6px var(--glow-cyan); }

.ia-answer {
    border: 1px solid rgba(124, 92, 252, 0.35);
    background: linear-gradient(160deg, rgba(124, 92, 252, 0.1), rgba(34, 211, 238, 0.05));
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.ia-answer-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #c4b5fd;
    margin-bottom: 10px;
}

.ia-answer-head i { color: #67e8f9; }

@media (max-height: 760px) {
    .aslam-quick { display: none; }
    .aslam-title { font-size: clamp(40px, 6vw, 72px); }
    .aslam-overlay { padding-bottom: 28px; }
    .chat-mode .aslam-chat { max-height: 52vh; }
}

@media (prefers-reduced-motion: reduce) {
    .blob, .aslam-halo, .aslam-title, .logo-orb, .pulse-dot, .dep-dot.unk {
        animation: none;
    }
}

/* ---------- views imersivas (Memória, Áreas, Ensinar) ---------- */

.main-content.is-immersive {
    padding: 0;
    overflow: hidden;
}

.view-immersive {
    height: 100%;
    overflow: hidden;
}

.immersive-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

.immersive-stage .aslam-halo { top: 38%; }

.immersive-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 24px 28px 32px;
    background: var(--overlay-fade);
    z-index: 2;
    overflow-y: auto;
}

.immersive-hero {
    text-align: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.immersive-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    background: var(--title-gradient);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: title-sheen 9s ease-in-out infinite;
}
[data-theme="light"] .immersive-title {
    animation: none;
    background-size: 100% 100%;
}

.immersive-sub {
    margin-top: 8px;
    font-size: clamp(13px, 1.4vw, 15px);
    color: var(--text-dim);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.immersive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
}

.immersive-grid.single-col {
    grid-template-columns: 1fr;
    max-width: 720px;
}

.immersive-grid.agents-catalog-grid {
    grid-template-columns: 1fr;
    max-width: none;
    width: 100%;
}

.view-agents-catalog .immersive-sub {
    max-width: 680px;
}

.agents-catalog-card {
    min-height: min(72vh, 820px);
}

.agents-catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.agents-catalog-toolbar h3 {
    margin-bottom: 0;
}

.agents-catalog-count {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

.agents-toolbar-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.agents-search-row {
    margin-bottom: 0;
}

.agents-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.agents-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.agents-filter-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.agents-filter-chip.active {
    background: rgba(124, 92, 252, 0.18);
    border-color: rgba(124, 92, 252, 0.45);
    color: #c4b5fd;
}

.agents-catalog-scroll {
    min-height: 320px;
}

.immersive-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.immersive-card:hover {
    border-color: rgba(124, 92, 252, 0.35);
    box-shadow: 0 8px 32px -12px rgba(124, 92, 252, 0.25);
}

.immersive-card.span-2 {
    grid-column: span 2;
}

.immersive-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.immersive-card h3 i {
    color: var(--chip-icon);
}
[data-theme="light"] .immersive-card h3 i {
    color: var(--primary);
}

.immersive-card-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    margin-top: 4px;
    /* Evita cortar a borda do primeiro/último card (overflow) */
    padding: 2px 2px 6px;
}

.immersive-card-upload {
    max-height: min(78vh, 820px);
}

.immersive-card-upload .upload-form-scroll {
    padding-right: 4px;
    margin-top: 0;
}

.upload-agents-checklist {
    max-height: 160px;
    overflow-y: auto;
    align-content: flex-start;
}

.memoria-search-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.memoria-search-row input {
    flex: 1;
    min-width: 180px;
    padding: 11px 16px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
}

.memoria-search-row input:focus {
    border-color: var(--primary);
}

.memoria-search-row .btn-primary {
    border-radius: 999px;
    padding: 10px 18px;
}

.doc-card {
    padding: 14px 16px;
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    border-radius: 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.doc-card:hover {
    background: var(--soft-hover);
    border-color: rgba(124, 92, 252, 0.45);
}

.doc-card strong {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.doc-card small {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.4;
}

.vis-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 999px;
    margin-top: 6px;
    margin-right: 4px;
}

.vis-badge.geral {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.vis-badge.area {
    background: rgba(124, 92, 252, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(124, 92, 252, 0.3);
}

.vis-badge.executor {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.vis-badge.projeto {
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.doc-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.doc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    min-width: 0;
}

.doc-crumb {
    background: none;
    border: none;
    color: var(--accent, #a78bfa);
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-weight: 600;
}

.doc-crumb:hover {
    text-decoration: underline;
}

.doc-crumb.current {
    color: var(--text-dim, #94a3b8);
    cursor: default;
    font-weight: 500;
}

.doc-crumb-sep {
    color: var(--text-dim, #64748b);
}

.folder-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    border-radius: 14px;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.folder-card:hover {
    background: var(--soft-hover);
    border-color: rgba(124, 92, 252, 0.45);
}

.folder-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 92, 252, 0.15);
    color: #c4b5fd;
    flex-shrink: 0;
}

.folder-card[data-tipo="geral"] .folder-card-icon {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
}

.folder-card[data-tipo="projeto"] .folder-card-icon {
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
}

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

.folder-card-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.folder-card-info small {
    color: var(--text-dim);
    font-size: 12px;
}

.folder-card-chevron {
    color: var(--text-dim);
    opacity: 0.7;
}

.upload-vis-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.upload-vis-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: border-color 0.15s, background 0.15s;
}

.upload-vis-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(124, 92, 252, 0.12);
}

.upload-vis-option input {
    accent-color: var(--primary);
}

.area-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.area-check-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
    cursor: pointer;
}

.area-check-item:has(input:checked) {
    border-color: var(--accent);
    background: rgba(34, 211, 238, 0.1);
}

.area-check-item input {
    accent-color: var(--accent);
}

.areas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.areas-table th,
.areas-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.areas-table th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.areas-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.area-form-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.area-form-row input {
    flex: 1;
    min-width: 140px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    font-size: 13px;
}

.area-form-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-sm {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    cursor: pointer;
    font-weight: 600;
    transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-area-row {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.user-area-row:last-child {
    border-bottom: none;
}

.user-area-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-area-email {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.nav-item.hidden-nav {
    display: none;
}

.sidebar-nav-section.manutencao {
    margin-top: 8px;
}

.user-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 14px;
}

.user-search-row i {
    color: var(--text-dim);
    font-size: 13px;
}

.user-search-row input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
}

.user-list-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.user-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(124, 92, 252, 0.3);
    transform: translateY(-1px);
}

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

.user-list-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-list-email {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-list-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 280px;
    justify-content: flex-end;
}

.user-list-arrow {
    color: var(--text-dim);
    font-size: 12px;
    flex-shrink: 0;
}

.modal-usuario-areas {
    max-width: 560px;
    height: auto;
    min-height: 0;
}

.modal-usuario-email {
    font-size: 13px;
    color: var(--text-dim);
    margin: 4px 0 0;
    font-weight: 400;
}

.modal-areas-hint {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.modal-area-checks {
    margin-bottom: 20px;
}

.modal-areas-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--glass-border);
}

@media (max-width: 720px) {
    .user-list-item {
        flex-wrap: wrap;
    }
    .user-list-areas {
        max-width: 100%;
        justify-content: flex-start;
        width: 100%;
    }
    .user-list-arrow {
        display: none;
    }
}

@media (max-width: 900px) {
    .immersive-grid {
        grid-template-columns: 1fr;
    }
    .immersive-card.span-2 {
        grid-column: span 1;
    }
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

@media (min-width: 1400px) {
    .agents-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}

@media (max-width: 640px) {
    .agents-grid {
        grid-template-columns: 1fr;
    }
}

.agent-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.agent-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(124, 92, 252, 0.25);
    transform: translateY(-1px);
}

.agent-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(124, 92, 252, 0.15);
    color: #a78bfa;
    font-size: 18px;
}

.agent-card-body {
    flex: 1;
    min-width: 0;
}

.agent-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.agent-card-head strong {
    font-size: 15px;
    line-height: 1.3;
}

.agent-card-badges {
    flex-shrink: 0;
}

.agent-card-badges .vis-badge {
    margin-top: 0;
}

.agent-card-desc {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.45;
    margin: 0 0 10px;
}

.agent-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.agent-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-dim);
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
}

.agent-meta-chip i {
    font-size: 10px;
    opacity: 0.75;
}

/* ---------- login theme toggle helpers ---------- */
.login-theme-toggle .icon-sun { display: none; }
.login-theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .login-theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .login-theme-toggle .icon-moon { display: none; }
[data-theme="light"] .login-theme-toggle .icon-sun { display: none; }
[data-theme="light"] .login-theme-toggle .icon-moon { display: block; }

.btn-theme-toggle .icon-sun { display: none; }
.btn-theme-toggle .icon-moon { display: inline-block; }
[data-theme="dark"] .btn-theme-toggle .icon-sun { display: inline-block; }
[data-theme="dark"] .btn-theme-toggle .icon-moon { display: none; }
[data-theme="light"] .btn-theme-toggle .icon-sun { display: none; }
[data-theme="light"] .btn-theme-toggle .icon-moon { display: inline-block; }

[data-theme="light"] .sidebar-user-card {
    background: #ffffff;
}
[data-theme="light"] .sidebar-user-popover {
    background: #ffffff;
    border-color: rgba(31, 30, 29, 0.12);
    box-shadow: 0 10px 32px rgba(31, 30, 29, 0.14);
}
[data-theme="light"] .aslam-canvas {
    opacity: 0.72;
}
[data-theme="light"] .quick-card .qc-title i,
[data-theme="light"] .folder-card-icon,
[data-theme="light"] .ia-answer-head i,
[data-theme="light"] .chi-del {
    color: var(--primary);
}
[data-theme="light"] .folder-card[data-tipo="geral"] .folder-card-icon,
[data-theme="light"] .folder-card[data-tipo="projeto"] .folder-card-icon {
    color: var(--primary);
}
[data-theme="light"] .upload-zone,
[data-theme="light"] .search-box,
[data-theme="light"] .glass-panel {
    background: var(--surface-strong);
    border-color: var(--glass-border);
    color: var(--text-main);
}
[data-theme="light"] .doc-card,
[data-theme="light"] .folder-card,
[data-theme="light"] .agent-card {
    background: #ffffff;
    border-color: rgba(31, 30, 29, 0.16);
    box-shadow: 0 1px 2px rgba(31, 30, 29, 0.04);
}
[data-theme="light"] .immersive-card {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(31, 30, 29, 0.12);
    box-shadow: none;
    backdrop-filter: blur(12px);
}
[data-theme="light"] .doc-card:hover,
[data-theme="light"] .folder-card:hover {
    border-color: rgba(124, 92, 252, 0.55);
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(31, 30, 29, 0.08);
}
[data-theme="light"] .doc-breadcrumb .doc-crumb {
    color: var(--primary);
}
[data-theme="light"] .doc-breadcrumb .doc-crumb.current {
    color: var(--text-dim);
}

/* ---------- Constelação (universo vivo) ---------- */

.view-constelacao .constelacao-stage {
    background:
        radial-gradient(ellipse at 50% 42%, rgba(34, 211, 238, 0.08), transparent 52%),
        radial-gradient(ellipse at 60% 60%, rgba(139, 92, 246, 0.1), transparent 48%);
}

.constelacao-canvas {
    pointer-events: auto;
    cursor: grab;
    opacity: 1;
}

[data-theme="light"] .constelacao-canvas {
    opacity: 1;
}

.constelacao-halo {
    opacity: 0.35;
}

.constelacao-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.constelacao-hero {
    pointer-events: auto;
    text-align: center;
    padding: 22px 24px 0;
    max-width: 720px;
    margin: 0 auto;
}

.constelacao-hero .immersive-sub {
    margin-bottom: 12px;
}

.constelacao-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.constelacao-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.constelacao-replay {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-main);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.constelacao-replay:hover {
    border-color: var(--primary);
}

.constelacao-tooltip {
    position: absolute;
    pointer-events: none;
    min-width: 140px;
    max-width: 240px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.35;
    z-index: 4;
}

.constelacao-tooltip strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.constelacao-tooltip span {
    color: var(--text-dim);
}

.constelacao-panel {
    pointer-events: auto;
    position: absolute;
    top: 18px;
    right: 18px;
    width: min(340px, calc(100% - 32px));
    max-height: calc(100% - 36px);
    overflow-y: auto;
    padding: 18px 18px 20px;
    border-radius: 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    z-index: 5;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.constelacao-panel h3 {
    font-family: var(--font-display);
    font-size: 22px;
    margin: 0 28px 4px 0;
}

.constelacao-panel h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin: 14px 0 6px;
}

.constelacao-kicker {
    color: var(--text-dim);
    font-size: 12px;
    margin: 0 0 10px;
}

.constelacao-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.constelacao-meta span {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
}

.constelacao-muted {
    color: var(--text-dim);
    font-size: 13px;
}

.constelacao-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
}

.constelacao-list li {
    margin-bottom: 4px;
}

.constelacao-link {
    margin-top: 14px;
    display: inline-flex;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.constelacao-panel-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    color: var(--text-dim);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

[data-theme="light"] .view-constelacao .constelacao-stage {
    background:
        radial-gradient(ellipse at 50% 42%, rgba(8, 145, 178, 0.08), transparent 52%),
        radial-gradient(ellipse at 60% 60%, rgba(91, 69, 196, 0.08), transparent 48%);
}

[data-theme="light"] .constelacao-panel,
[data-theme="light"] .constelacao-tooltip,
[data-theme="light"] .constelacao-replay {
    background: rgba(255, 255, 255, 0.72);
}
