/* ═══════════════════════════════════════════════════
   Layout — Login, Shell, Sidebar, Topbar, Content
   ═══════════════════════════════════════════════════ */

/* ── LOGIN SCREEN ── */
#login-screen {
    position: fixed;
    inset: 0;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
    transition: opacity 0.4s ease;
}
#login-screen::before {
    content: '';
    position: absolute;
    top: -20%; left: -10%;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(27, 191, 138, 0.15) 0%, transparent 70%);
    pointer-events: none;
}
#login-screen::after {
    content: '';
    position: absolute;
    bottom: -20%; right: -10%;
    width: 800px; height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.login-card {
    background: var(--surface);
    width: 100%; max-width: 400px;
    padding: 40px 32px;
    border-radius: var(--r3);
    box-shadow: var(--shadow-lg);
    position: relative; z-index: 10;
}
.login-err {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-bdr);
    padding: 10px;
    border-radius: var(--r);
    font-size: 12px; font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    animation: shake 0.4s ease-in-out;
}
.otp-inputs {
    display: flex; gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}
.otp-inputs input {
    width: 45px; height: 50px;
    text-align: center;
    font-size: 20px; font-weight: 700;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    transition: border-color .2s, box-shadow .2s;
}
.otp-inputs input:focus {
    border-color: var(--blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .1);
}

/* ── SHELL ── */
.shell {
    display: flex;
    height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--nav-w);
    background: var(--navy);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
/* Subtle geometric pattern overlay on sidebar */
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            -45deg,
            transparent, transparent 40px,
            rgba(255,255,255,.012) 40px, rgba(255,255,255,.012) 41px
        );
    pointer-events: none;
    z-index: 0;
}
.sidebar > * { position: relative; z-index: 1; }

.logo-area {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.logo-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.logo-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, #0f9e72 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 800;
    color: #fff;
    letter-spacing: -.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(27, 191, 138, 0.35);
    font-family: var(--font);
}
.logo-name {
    font-size: 17px; font-weight: 800;
    color: #fff;
    letter-spacing: -.3px;
    font-family: var(--font);
}
.logo-name em {
    color: var(--accent);
    font-style: normal;
}
.logo-meta {
    font-size: 11px;
    color: rgba(148, 163, 184, .7);
    line-height: 1.4;
}
.logo-chip {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 8px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(148, 163, 184, .85);
    font-size: 10px; font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: .04em;
}
.live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

.nav-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 16px;
}
.nav-body::-webkit-scrollbar { width: 3px; }
.nav-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 3px; }

.nav-group  { margin-bottom: 8px; }
.nav-label {
    font-size: 10px; font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, .7);
    padding: 12px 20px 6px;
    font-family: var(--font);
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px; margin: 2px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12.5px; font-weight: 500;
    color: rgba(148, 163, 184, .85);
    transition: all .2s var(--ease-out);
    user-select: none;
    position: relative;
}
.nav-item:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    transform: translateX(2px);
}
.nav-item.active {
    background: var(--accent-dim);
    color: #fff; font-weight: 600;
    border: 1px solid rgba(27, 191, 138, .2);
    box-shadow: 0 0 12px rgba(27, 191, 138, .1);
}
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon {
    font-size: 15px; width: 20px;
    text-align: center; flex-shrink: 0;
}

.sidebar-foot {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    font-size: 10.5px;
    color: rgba(100, 116, 139, .7);
    line-height: 1.6;
}

/* ── MAIN ── */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--bg);
}

/* ── TOPBAR ── */
.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(12px) saturate(1.6);
    -webkit-backdrop-filter: blur(12px) saturate(1.6);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 24px; gap: 16px;
    flex-shrink: 0;
    box-shadow: var(--shadow);
    z-index: 10;
}
.topbar-left { flex: 1; min-width: 0; }
.topbar-crumb {
    font-size: 11px;
    color: var(--text-4);
    font-weight: 600;
    margin-bottom: 2px;
}
.topbar-title {
    font-size: 16px; font-weight: 800;
    color: var(--text-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: var(--font);
}
.topbar-pills {
    display: flex; gap: 10px;
    align-items: center; flex-shrink: 0;
}
.tpill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 600;
    padding: 5px 12px; border-radius: 20px;
    white-space: nowrap; cursor: default;
}
.tpill.clickable {
    cursor: pointer;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}
.tpill.clickable:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    filter: brightness(0.95);
}
.tpill.ok   { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bdr); }
.tpill.warn { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bdr); }
.tpill.info { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-bdr); }

.user-profile {
    display: flex; align-items: center; gap: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
    cursor: pointer;
    transition: opacity .2s;
}
.user-profile:hover { opacity: .8; }
.avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
    font-family: var(--font);
}

/* ── CONTENT AREA ── */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 6px; }

.screen {
    display: none;
    animation: screenIn .35s cubic-bezier(0.16, 1, 0.3, 1);
}
.screen.active { display: block; }
@keyframes screenIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
