
:root {
    --bg: #07090e;
    --bg-soft: #10141d;
    --panel: rgba(13, 17, 24, 0.88);
    --panel-strong: rgba(18, 23, 33, 0.96);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 155, 0, 0.22);
    --text: #eef2ff;
    --muted: #a1abc1;
    --accent: #ff9b00;
    --accent-soft: rgba(255, 155, 0, 0.16);
    --danger: #ff6b6b;
    --success: #4ce0a1;
    --warning: #ffcc66;
    --shadow: 0 34px 84px rgba(0, 0, 0, 0.48);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --container: 1200px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 14% 18%, rgba(255, 155, 0, 0.10), transparent 24%),
        radial-gradient(circle at 86% 14%, rgba(255, 136, 0, 0.08), transparent 22%),
        linear-gradient(180deg, #0a0d13 0%, #06070b 100%);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.page-shell,
.dashboard-shell {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
}

.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 95%);
    pointer-events: none;
}

.architect-lines,
.background-frame {
    position: absolute;
    pointer-events: none;
}

.architect-lines {
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0, transparent 8%, rgba(255,255,255,0.035) 8.1%, transparent 8.2%, transparent 50%, rgba(255,255,255,0.025) 50.1%, transparent 50.2%, transparent 92%, rgba(255,255,255,0.03) 92.1%, transparent 92.2%),
        linear-gradient(180deg, transparent 0, transparent 18%, rgba(255,255,255,0.028) 18.1%, transparent 18.2%, transparent 80%, rgba(255,255,255,0.03) 80.1%, transparent 80.2%);
    opacity: 0.6;
}

.background-frame {
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 34px;
}

.frame-one {
    width: 520px;
    height: 520px;
    top: -120px;
    right: -90px;
    transform: rotate(14deg);
}

.frame-two {
    width: 420px;
    height: 420px;
    left: -120px;
    bottom: -120px;
    transform: rotate(-10deg);
}

.ambient {
    position: absolute;
    border-radius: 999px;
    filter: blur(78px);
    opacity: 0.4;
    pointer-events: none;
}

.ambient-one {
    width: 300px;
    height: 300px;
    background: rgba(255, 155, 0, 0.14);
    top: 4%;
    left: -5%;
}

.ambient-two {
    width: 360px;
    height: 360px;
    background: rgba(255, 106, 0, 0.10);
    right: -8%;
    bottom: -8%;
}

.ambient-three {
    width: 240px;
    height: 240px;
    background: rgba(255, 190, 90, 0.08);
    left: 50%;
    top: 7%;
    transform: translateX(-50%);
}

.auth-layout {
    position: relative;
    z-index: 1;
    width: min(calc(100% - 32px), 1180px);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: center;
    padding: 32px 0;
}

.auth-page-centered {
    display: grid;
    place-items: center;
}

.single-panel-layout {
    width: min(calc(100% - 32px), 760px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.compact-auth-layout {
    width: min(calc(100% - 32px), 700px);
}

.brand-panel,
.auth-panel,
.glass-card {
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    background: linear-gradient(180deg, rgba(24, 28, 40, 0.78), rgba(13, 16, 23, 0.88));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.brand-panel {
    border-radius: calc(var(--radius-lg) + 4px);
    padding: 40px;
    min-height: 640px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-mark {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 155, 0, 0.14), rgba(255, 155, 0, 0.04));
    border: 1px solid rgba(255, 155, 0, 0.2);
    margin-bottom: 24px;
}

.brand-mark img { width: 56px; height: 56px; object-fit: contain; }
.eyebrow, .card-mini-label, .footer-label {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
}

.brand-panel h1,
.dashboard-brand h1 {
    margin: 12px 0 14px;
    font-size: clamp(36px, 5vw, 62px);
    line-height: 0.98;
}

.lead,
.auth-subtitle,
.dashboard-hero p,
.placeholder-card p,
.feature-card p {
    color: var(--muted);
    line-height: 1.6;
}

.feature-list {
    display: grid;
    gap: 14px;
    margin-top: 34px;
}

.feature-card {
    display: flex;
    gap: 14px;
    padding: 18px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.feature-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffb033, #ff8c00);
    margin-top: 7px;
    box-shadow: 0 0 20px rgba(255, 155, 0, 0.5);
}

.auth-panel-wrap {
    display: flex;
    justify-content: center;
}

.auth-panel {
    width: min(100%, 470px);
    border-radius: var(--radius-lg);
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.auth-panel::before,
.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 155, 0, 0.10), transparent 36%, transparent 70%, rgba(255, 255, 255, 0.02));
    pointer-events: none;
}

.auth-topline,
.auth-footer,
.dashboard-header,
.dashboard-brand,
.dashboard-grid {
    display: flex;
    align-items: center;
}

.auth-topline,
.auth-footer {
    justify-content: space-between;
    gap: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 155, 0, 0.16);
    background: rgba(255, 155, 0, 0.07);
    color: #ffd089;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.status-pill.muted {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.auth-panel h2,
.dashboard-hero h2,
.placeholder-card h3 {
    margin: 22px 0 10px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.05;
}

.auth-form {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.field-group {
    display: grid;
    gap: 8px;
}

.field-group span {
    color: #dfe5f7;
    font-size: 13px;
    font-weight: 600;
}

.field-group input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 14px 16px;
    color: var(--text);
    outline: none;
    transition: 0.2s ease;
    font: inherit;
}

.field-group input:focus {
    border-color: rgba(255, 155, 0, 0.44);
    box-shadow: 0 0 0 4px rgba(255, 155, 0, 0.10);
    background: rgba(255, 255, 255, 0.06);
}

.primary-button,
.ghost-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 52px;
    border-radius: 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.primary-button {
    border: 1px solid rgba(255, 155, 0, 0.28);
    background: linear-gradient(180deg, #ffab22, #ff8d07);
    color: #17130b;
    box-shadow: 0 18px 40px rgba(255, 143, 7, 0.18);
}

.primary-button:hover,
.ghost-button:hover { transform: translateY(-1px); }
.primary-button:active,
.ghost-button:active { transform: translateY(1px); }

.ghost-button {
    padding: 0 20px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text);
}

.alert {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert-warning {
    background: rgba(255, 204, 102, 0.08);
    color: #ffd998;
    border-color: rgba(255, 204, 102, 0.15);
}

.alert-error {
    background: rgba(255, 107, 107, 0.08);
    color: #ffb2b2;
    border-color: rgba(255, 107, 107, 0.18);
}

.alert-success {
    background: rgba(76, 224, 161, 0.08);
    color: #b3f3d7;
    border-color: rgba(76, 224, 161, 0.2);
}

.auth-footer {
    margin-top: 16px;
    flex-wrap: wrap;
}

.auth-footer strong,
.feature-card strong,
.placeholder-card h3 { color: var(--text); }

.dashboard-header {
    position: relative;
    z-index: 1;
    justify-content: space-between;
    padding: 24px 0 8px;
}

.dashboard-brand {
    gap: 16px;
}

.dashboard-brand img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 155, 0, 0.1);
    border: 1px solid rgba(255, 155, 0, 0.15);
}

.dashboard-main {
    position: relative;
    z-index: 1;
    padding: 20px 0 40px;
}

.glass-card {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 28px;
}

.dashboard-grid {
    margin-top: 20px;
    gap: 20px;
    align-items: stretch;
}

.placeholder-card { flex: 1; min-height: 230px; }
.muted-card { opacity: 0.94; }

.centered-wrap {
    width: 100%;
    justify-content: center;
}

.auth-panel-premium {
    width: min(100%, 540px);
    padding: 30px 30px 22px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background:
        linear-gradient(180deg, rgba(19, 23, 32, 0.94), rgba(8, 10, 15, 0.98)),
        radial-gradient(circle at top, rgba(255, 155, 0, 0.08), transparent 42%);
    box-shadow:
        0 38px 90px rgba(0, 0, 0, 0.50),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel-glow {
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,155,0,0.14), transparent 24%, transparent 74%, rgba(255,255,255,0.05));
    opacity: 0.9;
    pointer-events: none;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    padding: 1px;
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.auth-logo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand-mark.large {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    margin: 0 auto 14px;
    box-shadow: 0 18px 40px rgba(255, 143, 7, 0.12);
}

.brand-mark.large img {
    width: 54px;
    height: 54px;
}

.centered-topline {
    justify-content: center;
    margin-top: 10px;
}

.auth-title {
    margin: 14px 0 8px;
    text-align: center;
    font-size: clamp(30px, 5vw, 42px);
    line-height: 1.02;
}

.auth-subtitle-centered {
    text-align: center;
    max-width: 430px;
    margin: 0 auto;
}

.field-glow input {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
    border-color: rgba(255,255,255,0.10);
}

.soft-warning {
    margin-top: 16px;
}

.auth-footer-center {
    justify-content: center;
    text-align: center;
}

.auth-footer-center > div {
    width: 100%;
}

.auth-panel-refined {
    width: min(100%, 560px);
    padding: 30px 30px 22px;
}

.auth-logo-block-refined {
    gap: 8px;
    margin-bottom: 2px;
}

.brand-mark-refined {
    width: 88px;
    height: 88px;
    margin-bottom: 4px;
    background: linear-gradient(180deg, rgba(255, 155, 0, 0.10), rgba(255, 155, 0, 0.03));
    border-color: rgba(255, 155, 0, 0.14);
    box-shadow:
        0 20px 44px rgba(255, 143, 7, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.brand-mark-refined img {
    width: 54px;
    height: 54px;
}

.eyebrow-soft {
    color: #ffbf5b;
    letter-spacing: 0.24em;
    font-size: 10px;
}

.auth-topline-soft {
    margin-top: 8px;
}

.auth-subtitle-wide {
    max-width: 470px;
    margin-top: 0;
}

.soft-warning-refined {
    padding: 13px 14px;
    background: linear-gradient(180deg, rgba(255, 204, 102, 0.08), rgba(255, 204, 102, 0.04));
    border-color: rgba(255, 204, 102, 0.14);
}

.auth-form-refined {
    margin-top: 18px;
    gap: 14px;
}

.auth-form-refined .primary-button {
    margin-top: 2px;
}

.auth-footer-refined {
    margin-top: 16px;
    padding-top: 0;
    border-top: 0;
}

.access-note {
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(180deg, rgba(255,255,255,0.038), rgba(255,255,255,0.02));
    text-align: left;
}

.access-note-label {
    margin-bottom: 7px;
    color: #ffbf5b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.access-note-text {
    color: #d3dbef;
    font-size: 13px;
    line-height: 1.55;
}

.auth-panel-official {
    border-color: rgba(255,255,255,0.09);
}

.auth-logo-block-official {
    position: relative;
    gap: 10px;
    margin-bottom: 2px;
}

.brand-mark-official {
    position: relative;
    width: 136px;
    height: 96px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    background:
        radial-gradient(circle at 50% 14%, rgba(255,255,255,0.14), transparent 34%),
        linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,155,0,0.05) 52%, rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow:
        0 24px 52px rgba(0, 0, 0, 0.34),
        0 10px 28px rgba(255, 143, 7, 0.12),
        inset 0 1px 0 rgba(255,255,255,0.08);
    overflow: hidden;
    isolation: isolate;
}

.brand-mark-official::before {
    content: "";
    position: absolute;
    width: 104px;
    height: 104px;
    top: -42px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 174, 71, 0.30) 0%, rgba(255, 174, 71, 0.10) 42%, transparent 72%);
    filter: blur(14px);
    z-index: 0;
    pointer-events: none;
}

.brand-mark-official::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 29px;
    border: 1px solid rgba(255,255,255,0.05);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 38%, rgba(255,255,255,0.015));
    z-index: 0;
    pointer-events: none;
}

.brand-mark-official img {
    position: relative;
    z-index: 1;
    width: 76px;
    height: auto;
    max-height: 68px;
    object-fit: contain;
    filter: drop-shadow(0 10px 24px rgba(255, 155, 0, 0.20));
}

.auth-title-official {
    letter-spacing: -0.03em;
}

.auth-subtitle-official {
    font-size: 14px;
}

.official-notice {
    color: #e7d6a8;
}

.access-note-official {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.018));
}

@media (max-width: 980px) {
    .auth-layout {
        grid-template-columns: 1fr;
        padding: 18px 0 22px;
    }

    .single-panel-layout,
    .compact-auth-layout {
        width: min(calc(100% - 24px), 700px);
        padding: 14px 0 18px;
    }

    .brand-panel {
        min-height: unset;
        padding: 28px;
    }

    .auth-panel {
        width: 100%;
    }

    .dashboard-grid {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .auth-layout,
    .container,
    .single-panel-layout,
    .compact-auth-layout {
        width: min(calc(100% - 18px), var(--container));
    }

    .brand-panel,
    .auth-panel,
    .glass-card,
    .auth-panel-refined,
    .auth-panel-premium {
        border-radius: 22px;
        padding: 22px 18px 18px;
    }

    .brand-mark-official {
        width: 122px;
        height: 98px;
        border-radius: 30px;
    }

    .brand-mark-official::after {
        inset: 14px 24px 18px;
    }

    .brand-panel h1,
    .dashboard-brand h1 {
        font-size: 34px;
    }

    .auth-panel h2,
    .dashboard-hero h2,
    .placeholder-card h3 {
        font-size: 28px;
    }

    .dashboard-header {
        align-items: flex-start;
        gap: 12px;
    }

    .dashboard-header,
    .dashboard-brand,
    .auth-topline,
    .auth-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-topline {
        align-items: center;
    }

    .centered-topline {
        justify-content: center;
    }

    .primary-button,
    .ghost-button {
        width: 100%;
    }

    .feature-card {
        padding: 16px;
    }

    .frame-one,
    .frame-two {
        display: none;
    }

    .brand-mark.large,
    .brand-mark-refined {
        width: 78px;
        height: 78px;
        border-radius: 22px;
    }

    .brand-mark.large img,
    .brand-mark-refined img {
        width: 46px;
        height: 46px;
    }

    .auth-title {
        font-size: 30px;
    }

    .auth-subtitle-official,
    .access-note-text,
    .alert {
        font-size: 13px;
    }
}

/* Workspace dashboard */
.workspace-shell {
    overflow: visible;
}

.workspace-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    background: rgba(8, 11, 18, 0.78);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.workspace-header-inner {
    width: min(calc(100% - 28px), 1520px);
    margin: 0 auto;
    min-height: 78px;
    display: grid;
    grid-template-columns: auto minmax(260px, 420px) 1fr;
    gap: 20px;
    align-items: center;
}

.workspace-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.workspace-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,155,0,0.08));
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 10px 24px rgba(0,0,0,0.24);
}

.workspace-brand-mark img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.workspace-brand-name {
    display: block;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #ffffff;
}

.workspace-brand-name span {
    color: #9d84ff;
}

.workspace-brand-subtitle {
    display: block;
    margin-top: 2px;
    color: #90a0bc;
    font-size: 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(7, 12, 20, 0.82);
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.search-box svg,
.header-icon-button svg,
.menu-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
}

.search-box input::placeholder {
    color: #8090ac;
}

.search-shortcut {
    padding: 5px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: #9aabc8;
    font-size: 12px;
    font-weight: 600;
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: none;
    padding: 10px;
    border-radius: 18px;
    background: rgba(12, 17, 27, 0.97);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 28px 50px rgba(0,0,0,0.38);
}

.search-results.is-open {
    display: grid;
    gap: 6px;
}

.search-result-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.search-result-item:hover {
    background: rgba(255,255,255,0.06);
}

.search-result-type {
    color: #8ea0be;
    font-size: 12px;
}

.workspace-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.header-icon-button,
.header-text-button,
.workspace-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: #dfe7fb;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.header-icon-button:hover,
.header-text-button:hover,
.workspace-logout:hover,
.workspace-menu-item:hover {
    background: rgba(255,255,255,0.06);
}

.workspace-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    margin-left: 4px;
    border-left: 1px solid rgba(255,255,255,0.08);
}

.workspace-profile-name {
    color: #ffffff;
    font-weight: 700;
    white-space: nowrap;
}

.workspace-layout {
    position: relative;
    z-index: 1;
    width: min(calc(100% - 28px), 1520px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 22px;
    padding: 22px 0 28px;
    align-items: start;
}

.workspace-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.workspace-sidebar-inner,
.content-card,
.news-card,
.empty-state,
.hero-mini-card,
.content-hero {
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(22, 28, 40, 0.92), rgba(13, 17, 25, 0.98));
    box-shadow: 0 24px 70px rgba(0,0,0,0.32);
}

.workspace-sidebar-inner {
    padding: 22px 16px;
}

.workspace-sidebar-top {
    padding: 4px 8px 16px;
}

.workspace-side-label,
.card-tag,
.hero-mini-label,
.news-date {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: #a7b5cf;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-sidebar-top h1,
.section-heading h2,
.empty-state h2,
.content-hero h2 {
    margin: 14px 0 8px;
    font-size: clamp(30px, 3.3vw, 42px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.workspace-sidebar-top p,
.section-heading p,
.empty-state p,
.content-hero p,
.content-card p,
.hero-mini-card span,
.news-card p {
    color: #93a2bd;
    line-height: 1.65;
}

.workspace-menu {
    display: grid;
    gap: 6px;
}

.workspace-menu-divider {
    height: 1px;
    margin: 8px 6px;
    background: rgba(255,255,255,0.08);
}

.workspace-menu-item {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #9daecc;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.workspace-menu-item.is-active {
    background: rgba(255,255,255,0.06);
    color: #ffffff;
}

.menu-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.04);
    color: #93a5c5;
    flex-shrink: 0;
}

.menu-label {
    flex: 1;
    min-width: 0;
}

.menu-badge {
    padding: 3px 8px;
    border-radius: 8px;
    background: #7c73ff;
    color: white;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.workspace-content {
    min-width: 0;
}

.workspace-view {
    display: none;
}

.workspace-view.is-active {
    display: block;
}

.content-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    padding: 28px;
}

.content-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,155,0,0.10);
    border: 1px solid rgba(255,155,0,0.12);
    color: #ffcf84;
    font-size: 12px;
    font-weight: 700;
}

.hero-mini-card,
.content-card,
.news-card,
.empty-state {
    padding: 24px;
}

.hero-mini-card {
    display: grid;
    align-content: start;
    gap: 10px;
}

.hero-mini-card strong,
.content-card h3,
.news-card h3 {
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.overview-grid,
.news-list {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-card h3,
.news-card h3,
.empty-state h2 {
    margin: 14px 0 10px;
}

.section-heading {
    margin-bottom: 18px;
}

.empty-state {
    min-height: calc(100vh - 180px);
    display: grid;
    align-content: center;
}

@media (max-width: 1240px) {
    .workspace-header-inner {
        grid-template-columns: 1fr;
        padding: 14px 0;
    }

    .workspace-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

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

    .workspace-sidebar {
        position: relative;
        top: 0;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .content-hero {
        grid-template-columns: 1fr;
    }

    .workspace-profile {
        width: 100%;
        justify-content: space-between;
        border-left: 0;
        padding-left: 0;
        margin-left: 0;
    }

    .header-icon-button,
    .header-text-button,
    .workspace-logout {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .workspace-header-inner,
    .workspace-layout {
        width: min(calc(100% - 18px), 1520px);
    }

    .search-shortcut {
        display: none;
    }

    .workspace-sidebar-top h1,
    .section-heading h2,
    .empty-state h2,
    .content-hero h2 {
        font-size: 28px;
    }

    .workspace-menu-item {
        min-height: 44px;
    }
}

/* Refined workspace */
.workspace-shell-refined {
    background:
        radial-gradient(circle at top center, rgba(255, 158, 44, 0.10), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 110, 34, 0.08), transparent 26%),
        linear-gradient(180deg, #0d1016 0%, #0a0d13 100%);
}

.workspace-header-refined {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(10, 13, 19, 0.72);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.workspace-header-inner-refined,
.workspace-layout-refined {
    width: min(calc(100% - 40px), 1480px);
}

.workspace-header-inner-refined {
    display: grid;
    grid-template-columns: 260px minmax(280px, 1fr) auto;
    gap: 18px;
    align-items: center;
    min-height: 78px;
}

.workspace-brand-refined {
    gap: 14px;
}

.workspace-brand-mark-refined {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 155, 0, 0.12), rgba(255, 155, 0, 0.04));
    border: 1px solid rgba(255, 155, 0, 0.18);
    box-shadow: 0 10px 30px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.05);
}

.workspace-brand-mark-refined img {
    width: 30px;
    height: 30px;
}

.workspace-brand-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.workspace-brand-name span {
    color: #ffb35a;
}

.workspace-brand-subtitle {
    color: rgba(210, 216, 230, 0.64);
    font-size: 12px;
}

.workspace-search-refined {
    min-height: 50px;
    border-radius: 16px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.workspace-search-refined input,
.workspace-search-refined svg,
.workspace-search-refined .search-shortcut {
    color: #d6dbea;
}

.workspace-actions-refined {
    gap: 10px;
}

.header-icon-button-refined,
.header-text-button-refined,
.profile-toggle,
.profile-dropdown-item,
.account-tab,
.settings-row,
.secondary-button {
    font: inherit;
}

.header-icon-button-refined,
.header-text-button-refined {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
    color: #f4f6fb;
}

.header-icon-button-refined span,
.header-text-button-refined {
    font-size: 13px;
    font-weight: 600;
}

.header-icon-button-refined svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    opacity: 0.84;
}

.workspace-layout-refined {
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    gap: 22px;
    padding-top: 24px;
    padding-bottom: 36px;
    align-items: start;
}

.workspace-sidebar-refined {
    position: sticky;
    top: 104px;
}

.workspace-sidebar-inner-refined {
    padding: 18px;
    border-radius: 26px;
    min-height: calc(100vh - 132px);
    background: linear-gradient(180deg, rgba(21, 25, 35, 0.84), rgba(12, 15, 22, 0.92));
}

.workspace-sidebar-top-refined h1 {
    font-size: 28px;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
}

.workspace-sidebar-top-refined p {
    font-size: 13px;
    max-width: 220px;
}

.workspace-menu {
    gap: 4px;
}

.workspace-menu-item {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 14px;
    color: rgba(228, 233, 245, 0.78);
    background: transparent;
    border: 1px solid transparent;
}

.workspace-menu-item .menu-icon {
    width: 18px;
    height: 18px;
    color: rgba(228, 233, 245, 0.56);
}

.workspace-menu-item .menu-label {
    font-weight: 500;
}

.workspace-menu-item.is-active {
    background: linear-gradient(180deg, rgba(255, 155, 0, 0.10), rgba(255, 155, 0, 0.05));
    border-color: rgba(255, 155, 0, 0.16);
    color: #fff2db;
}

.workspace-menu-item.is-active .menu-icon {
    color: #ffc36e;
}

.menu-badge {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255, 155, 0, 0.12);
    color: #ffcf8b;
    font-size: 10px;
    letter-spacing: 0.08em;
}

.workspace-content-refined {
    min-width: 0;
}

.glass-card.compact-card,
.home-hero,
.account-header,
.account-section,
.empty-state-refined,
.news-card {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    padding: 28px;
}

.home-hero h2,
.section-heading-refined h2,
.empty-state-refined h2,
.account-header-copy h2 {
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.02;
    letter-spacing: -0.04em;
    margin: 10px 0 10px;
}

.home-hero p,
.section-heading-refined p,
.empty-state-refined p,
.account-section-heading p,
.account-header-copy p,
.settings-row-copy span {
    color: rgba(215, 221, 234, 0.70);
    line-height: 1.65;
}

.hero-mini-card-refined {
    min-height: 100%;
    border-radius: 22px;
    padding: 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    display: grid;
    gap: 8px;
    align-content: start;
}

.overview-grid-refined {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.compact-card {
    padding: 22px;
}

.compact-card h3 {
    margin: 10px 0 10px;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.compact-card p {
    color: rgba(215, 221, 234, 0.70);
    line-height: 1.7;
}

.profile-menu {
    position: relative;
}

.profile-toggle {
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.035);
    color: #f5f7fb;
    padding: 6px 10px 6px 8px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.profile-toggle-avatar,
.account-avatar,
.settings-row-icon {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 155, 0, 0.16), rgba(255, 155, 0, 0.05));
    color: #ffe2b7;
    border: 1px solid rgba(255, 155, 0, 0.18);
}

.profile-toggle-avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
    font-weight: 800;
}

.profile-toggle-copy {
    display: grid;
    text-align: left;
    line-height: 1.2;
}

.profile-toggle-copy strong {
    font-size: 13px;
}

.profile-toggle-copy span {
    font-size: 11px;
    color: rgba(215, 221, 234, 0.58);
}

.profile-toggle-arrow {
    width: 14px;
    height: 14px;
    opacity: 0.68;
}

.profile-menu.is-open .profile-toggle {
    border-color: rgba(255, 155, 0, 0.18);
    box-shadow: 0 14px 30px rgba(0,0,0,0.24);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 252px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(21, 25, 35, 0.94), rgba(12, 15, 22, 0.97));
    box-shadow: 0 24px 50px rgba(0,0,0,0.35);
    display: none;
}

.profile-menu.is-open .profile-dropdown {
    display: grid;
    gap: 6px;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    color: #f3f5fa;
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}

.profile-dropdown-item:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.05);
}

.profile-dropdown-item.danger {
    color: #ffd8c1;
}

.profile-dropdown-icon {
    width: 18px;
    height: 18px;
    color: rgba(255,255,255,0.72);
}

.profile-dropdown-icon svg,
.modal-close svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.account-shell {
    display: grid;
    gap: 18px;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px 26px;
}

.account-avatar {
    width: 64px;
    height: 64px;
    font-size: 24px;
    font-weight: 800;
}

.account-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.account-tab {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.025);
    color: rgba(232, 236, 245, 0.74);
    cursor: pointer;
}

.account-tab.is-active {
    color: #fff0d5;
    border-color: rgba(255, 155, 0, 0.16);
    background: linear-gradient(180deg, rgba(255, 155, 0, 0.10), rgba(255, 155, 0, 0.04));
}

.account-section {
    padding: 24px 24px 10px;
}

.account-section-heading h3 {
    margin: 0 0 6px;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.settings-row {
    width: 100%;
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.025);
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    cursor: pointer;
    transition: 0.2s ease;
}

.settings-row:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 155, 0, 0.14);
    background: rgba(255,255,255,0.04);
    box-shadow: 0 16px 30px rgba(0,0,0,0.18);
}

.settings-row-icon {
    width: 48px;
    height: 48px;
    font-weight: 700;
}

.settings-row-copy {
    display: grid;
    gap: 4px;
}

.settings-row-copy strong {
    font-size: 16px;
}

.settings-row-action {
    margin-left: auto;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    color: #f7f7fb;
    font-size: 13px;
    font-weight: 600;
}

.workspace-alert {
    margin: 0;
}

.empty-state-refined {
    min-height: 360px;
    padding: 28px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 9, 13, 0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
    z-index: 40;
}

.workspace-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    z-index: 41;
    padding: 20px;
}

.modal-backdrop.is-visible,
.workspace-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.workspace-modal-dialog {
    width: min(100%, 520px);
    border-radius: 26px;
    padding: 24px;
}

.workspace-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.workspace-modal-head h3 {
    margin: 12px 0 0;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.modal-close {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: #f1f4fa;
    cursor: pointer;
}

.modal-form {
    display: grid;
    gap: 18px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.secondary-button {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: #f1f4fa;
    cursor: pointer;
}

@media (max-width: 1240px) {
    .workspace-header-inner-refined {
        grid-template-columns: 1fr;
    }

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

    .workspace-sidebar-refined {
        position: relative;
        top: 0;
    }

    .workspace-sidebar-inner-refined {
        min-height: auto;
    }

    .overview-grid-refined {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .workspace-header-inner-refined,
    .workspace-layout-refined {
        width: min(calc(100% - 22px), 1480px);
    }

    .home-hero {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .workspace-actions-refined {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .profile-toggle {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .workspace-sidebar-inner-refined,
    .workspace-modal-dialog,
    .account-header,
    .account-section,
    .compact-card,
    .empty-state-refined {
        padding: 18px;
    }

    .account-tabs,
    .modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .settings-row {
        align-items: flex-start;
    }

    .settings-row-action {
        margin-left: 0;
    }
}


/* v5 fixes and avatar workflow */
.brand-panel,
.auth-panel,
.glass-card,
.profile-dropdown,
.profile-toggle,
.workspace-menu-item,
.header-icon-button,
.header-text-button,
.search-result-item,
.settings-row,
.workspace-modal-dialog,
.news-card,
.content-card,
.hero-mini-card,
.primary-button,
.secondary-button,
.modal-close {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-clip: padding-box;
}

.auth-panel::before,
.glass-card::before {
    border-radius: inherit;
}

.profile-toggle-avatar,
.account-avatar,
.settings-row-icon {
    overflow: hidden;
}

.profile-toggle-avatar img,
.account-avatar img,
.settings-row-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-avatar-large {
    width: 84px;
    height: 84px;
    font-size: 30px;
}

.account-avatar-button {
    position: relative;
    width: 84px;
    height: 84px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.account-avatar-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    padding: 12px 10px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(8, 10, 14, 0.04), rgba(8, 10, 14, 0.86));
    color: #fff3dc;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.18s ease, transform 0.18s ease;
    text-align: center;
}

.account-avatar-overlay strong {
    font-size: 12px;
    font-weight: 700;
}

.account-avatar-overlay span {
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 236, 205, 0.72);
}

.account-avatar-button:hover .account-avatar-overlay,
.account-avatar-button:focus-visible .account-avatar-overlay {
    opacity: 1;
    transform: scale(1);
}

.account-avatar-button:focus-visible {
    outline: 2px solid rgba(255, 155, 0, 0.45);
    outline-offset: 4px;
}

.workspace-modal-large .workspace-modal-dialog {
    width: min(100%, 720px);
}

.avatar-modal-dialog {
    padding-bottom: 20px;
}

.avatar-crop-shell {
    display: grid;
    gap: 18px;
}

.avatar-crop-stage {
    width: min(100%, 360px);
    aspect-ratio: 1;
    margin: 0 auto;
    position: relative;
    border-radius: 28px;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.avatar-crop-stage.is-dragging {
    cursor: grabbing;
}

.avatar-crop-image {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    user-select: none;
    -webkit-user-drag: none;
    max-width: none;
}

.avatar-crop-mask {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
    background:
        radial-gradient(circle at center, transparent 0 44%, rgba(7, 9, 13, 0.08) 44.1% 45%, rgba(7, 9, 13, 0.42) 45.1% 100%),
        linear-gradient(180deg, rgba(255, 155, 0, 0.03), rgba(255, 155, 0, 0.01));
    pointer-events: none;
}

.avatar-crop-controls {
    display: grid;
    gap: 12px;
}

.field-group-compact {
    gap: 10px;
}

.avatar-crop-hint {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 14px;
}

input[type="range"][data-crop-zoom] {
    width: 100%;
    accent-color: var(--accent);
}


/* v6 fixes */
.workspace-header-refined,
.workspace-header-inner-refined,
.workspace-actions,
.workspace-actions-refined,
.profile-menu {
    overflow: visible;
}

.profile-menu {
    flex: 0 0 auto;
}

.profile-dropdown {
    min-width: 260px;
    max-width: min(320px, calc(100vw - 24px));
    z-index: 60;
}

.profile-toggle-avatar,
.account-avatar,
.settings-row-icon,
.account-avatar-button {
    flex-shrink: 0;
}

.account-empty-state {
    padding: 26px;
}
