/* ===== Login ===== */
.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    position: relative;
}
.login-card {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    max-width: 420px;
    width: 100%;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}
.login-brand-mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 28px var(--accent-glow);
}
.login-card h1 { margin-bottom: 0.5rem; }
.login-card p { color: var(--muted); margin: 0 0 1.5rem; }
.login-status { min-height: 1.5em; margin-top: 1rem; font-size: 12px; }
.login-status.ok  { color: var(--green); }
.login-status.err { color: var(--red); }
.login-lang {
    position: absolute;
    top: 16px;
    right: 20px;
}

/* ===== App shell ===== */
.app-view {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    width: 100vw;
}

/* ===== Sidebar ===== */
.sidebar {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 14px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
    color: var(--text);
    /* the old gradient-text hack is gone — wordmark stays solid, mark gets the gradient */
}
.brand-mark {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 16px var(--accent-glow);
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--muted);
    border: none;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    transition: background 0.12s, color 0.12s;
}
.nav-item .nav-ico { width: 16px; text-align: center; opacity: 0.8; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(251, 113, 133, 0.14));
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.profile-card {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.profile-card .pc-av {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    flex: none;
}
.profile-card .pc-who { flex: 1; min-width: 0; }
.profile-card .pc-name { font-size: 12px; font-weight: 500; line-height: 1.1; }
.profile-card .pc-role { font-size: 10px; color: var(--muted); }
.profile-card .pc-out {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1;
}
.profile-card .pc-out:hover { background: var(--surface-2); color: var(--text); }

/* ===== Main + topbar ===== */
.main {
    min-width: 0;
    padding: 28px 40px 40px;
    /* full-width: no max-width clamp, no auto margins */
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    gap: 1rem;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.topbar h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.025em;
}
.topbar .topbar-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.view-root { display: flex; flex-direction: column; gap: 24px; }

/* Inner tab bodies inherit the same vertical rhythm */
.view-root > .tabs + div,
.view-root > div > .tabs ~ * { display: flex; flex-direction: column; gap: 24px; }

/* Section intro — brief explainer beneath a panel title */
.section-intro {
    color: var(--muted);
    font-size: 12px;
    margin: -8px 0 4px;
    max-width: 720px;
    line-height: 1.5;
}

/* ===== Drawer ===== */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: rgba(10, 11, 18, 0.85);
    backdrop-filter: blur(24px);
    border-left: 1px solid var(--border);
    z-index: 50;
    display: flex;
    flex-direction: column;
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.18s ease-out;
}
@keyframes slideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--border);
}
.drawer-header h2 { font-size: 16px; }
.drawer-header .drawer-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.drawer-body {
    padding: 14px 18px 18px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
