:root {
    --pbb-bg: #07111f;
    --pbb-panel: #0f1b2d;
    --pbb-panel-soft: #13233b;
    --pbb-text: #eff6ff;
    --pbb-muted: #8ea1bf;
    --pbb-blue: #1f6feb;
    --pbb-red: #d62839;
    --pbb-yellow: #f4c430;
    --pbb-black: #04070c;
}

body {
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(31, 111, 235, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(214, 40, 57, 0.16), transparent 32%),
        linear-gradient(135deg, #050911, #0a1424 42%, #111927);
    color: var(--pbb-text);
    min-height: 100vh;
}

body.light-mode {
    --pbb-bg: #f5f7fb;
    --pbb-panel: #ffffff;
    --pbb-panel-soft: #eef3fb;
    --pbb-text: #111827;
    --pbb-muted: #56657d;
    background:
        radial-gradient(circle at top left, rgba(31, 111, 235, 0.12), transparent 32%),
        radial-gradient(circle at bottom right, rgba(244, 196, 48, 0.16), transparent 28%),
        linear-gradient(180deg, #eff4fb, #f8fafc 50%, #eef2f9);
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar,
.topbar,
.panel-card,
.login-card,
.footer-bar {
    background: rgba(15, 27, 45, 0.78);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-mode .sidebar,
body.light-mode .topbar,
body.light-mode .panel-card,
body.light-mode .login-card,
body.light-mode .footer-bar {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.sidebar {
    padding: 24px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(31, 111, 235, 0.22), rgba(214, 40, 57, 0.18));
    font-weight: 800;
}

.brand-button {
    width: 100%;
    justify-content: center;
    color: var(--pbb-text);
    border: 0;
    cursor: pointer;
}

.nav-link-custom {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--pbb-text);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 8px;
}

.nav-link-custom.active,
.nav-link-custom:hover {
    background: linear-gradient(90deg, rgba(31, 111, 235, 0.22), rgba(244, 196, 48, 0.18));
}

.main-content {
    padding: 20px;
}

.topbar {
    border-radius: 22px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.panel-card {
    border-radius: 24px;
    padding: 22px;
    height: 100%;
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    inset: auto -20px -20px auto;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(244, 196, 48, 0.22), transparent 70%);
}

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-layout {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
}

.login-hero {
    border-radius: 32px;
    padding: 38px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(31, 111, 235, 0.28), transparent 28%),
        radial-gradient(circle at 80% 75%, rgba(214, 40, 57, 0.24), transparent 30%),
        linear-gradient(145deg, rgba(4, 7, 12, 0.92), rgba(12, 22, 39, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 560px;
}

.login-hero::after {
    content: '';
    position: absolute;
    inset: auto -120px -120px auto;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(244, 196, 48, 0.24), transparent 68%);
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fbff;
    font-size: 0.92rem;
    letter-spacing: 0.03em;
}

.login-title {
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 0.95;
    font-weight: 800;
    margin: 26px 0 18px;
    max-width: 8ch;
}

.login-lead {
    max-width: 58ch;
    color: rgba(239, 246, 255, 0.78);
    font-size: 1.05rem;
}

.hero-points {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.hero-point {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-card {
    width: min(520px, 100%);
    border-radius: 28px;
    padding: 36px;
    align-self: center;
}

.login-card .form-control {
    min-height: 56px;
    border-radius: 16px;
}

.login-card .btn {
    min-height: 56px;
    border-radius: 16px;
    font-weight: 700;
}

.login-muted {
    color: var(--pbb-muted);
}

body.light-mode .login-hero {
    background:
        radial-gradient(circle at 20% 20%, rgba(31, 111, 235, 0.16), transparent 28%),
        radial-gradient(circle at 80% 75%, rgba(214, 40, 57, 0.14), transparent 30%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(236, 242, 250, 0.94));
    border: 1px solid rgba(17, 24, 39, 0.08);
}

body.light-mode .login-kicker,
body.light-mode .hero-point {
    background: rgba(17, 24, 39, 0.04);
    color: var(--pbb-text);
    border-color: rgba(17, 24, 39, 0.06);
}

body.light-mode .login-lead {
    color: rgba(17, 24, 39, 0.72);
}

.footer-bar {
    border-radius: 18px;
    padding: 16px 18px;
    margin-top: 20px;
    color: var(--pbb-muted);
    text-align: center;
}

.editor-wrap {
    min-height: 720px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #ffffff;
}

#grapes-editor {
    min-height: 720px;
    background: #fff;
}

#unlayer-editor {
    min-height: 720px;
}

.editor-panel {
    padding: 0;
}

.editor-panel .panel-card-header {
    padding: 22px 22px 0;
}

.editor-panel .editor-wrap,
.editor-panel #grapes-editor {
    border-radius: 0 0 24px 24px;
}

.user-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

@media (max-width: 991px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .login-layout {
        grid-template-columns: 1fr;
    }

    .login-hero {
        min-height: auto;
    }

    .sidebar {
        padding-bottom: 8px;
    }
}
