/* Shared design tokens and application shell. Theme is applied before the first paint. */
:root {
    --purple-50: #f1ebff;
    --purple-100: #e8ddfb;
    --purple-200: #d4bff6;
    --purple-400: #a180e0;
    --purple-500: #8756d5;
    --purple-600: #7540c8;
    --purple-700: #6031ae;
    --purple-800: #432075;
    --purple-900: #321952;
    --color-primary: #7140bf;
    --color-primary-dark: #562d98;
    --color-primary-light: #a180e0;
    --color-primary-fill: #7540c8;
    --color-bg: #f5f6fa;
    --color-bg-subtle: #eceef5;
    --color-surface: #fff;
    --color-surface-raised: #f8f9fc;
    --color-hover: #f0edf8;
    --color-text: #252939;
    --color-text-on-bg: #252939;
    --color-text-muted: #697084;
    --color-border: #e4e7ef;
    --color-border-strong: #cbd0dd;
    --success-bg: #eaf7f0;
    --success-text: #23714d;
    --danger-bg: #fcecf0;
    --danger-text: #ac3651;
    --warning-bg: #fff5df;
    --warning-text: #8b6015;
    --info-bg: #eaf2fc;
    --info-text: #326799;
    --shadow-sm: 0 2px 6px #20243b04;
    --shadow-md: 0 8px 28px #20243b08;
    --shadow-lg: 0 20px 60px #20243b18;
    --radius: 16px;
    --topbar-height: 78px;
    --sidebar-width: 248px;
    --font: "Inter", system-ui, -apple-system, sans-serif;
}
:root[data-theme="dark"] {
    --purple-50: #30233f;
    --purple-100: #39294d;
    --purple-200: #614382;
    --purple-900: #e4d5fb;
    --color-primary: #be9bf7;
    --color-primary-dark: #d8baff;
    --color-primary-light: #c7a7fa;
    --color-primary-fill: #8150cf;
    --color-bg: #10131c;
    --color-bg-subtle: #171c28;
    --color-surface: #1a1f2c;
    --color-surface-raised: #212735;
    --color-hover: #29243a;
    --color-text: #e6e9f2;
    --color-text-on-bg: #e6e9f2;
    --color-text-muted: #a2abc0;
    --color-border: #303747;
    --color-border-strong: #4a5368;
    --success-bg: #18392d;
    --success-text: #89d6ad;
    --danger-bg: #40232d;
    --danger-text: #f3a3b4;
    --warning-bg: #3b301e;
    --warning-text: #e8c17a;
    --info-bg: #203349;
    --info-text: #9cc6f1;
    --shadow-sm: 0 2px 6px #0000000a;
    --shadow-md: 0 8px 28px #00000012;
    --shadow-lg: 0 20px 60px #00000055;
}
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    background: var(--color-bg);
    scroll-behavior: smooth;
}
body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}
a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    color: var(--color-primary-dark);
}
button,
input,
select,
textarea {
    font: inherit;
}
button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}
button {
    touch-action: manipulation;
}
:focus-visible {
    outline: 3px solid var(--color-primary-light);
    outline-offset: 3px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 5000;
    padding: 12px 18px;
    background: var(--color-surface);
    border: 2px solid var(--color-primary);
    border-radius: 10px;
}
.skip-link:focus {
    top: 12px;
}
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    z-index: 1100;
    padding: 30px 18px 22px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 5px 38px;
}
.sidebar__brand {
    display: flex;
    gap: 11px;
    align-items: center;
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 750;
    letter-spacing: -0.025em;
}
.sidebar__brand:hover {
    color: var(--color-text);
}
.sidebar__brand img {
    border-radius: 12px;
}
.sidebar__brand small {
    display: block;
    margin-top: 3px;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    color: var(--color-text-muted);
    font-weight: 600;
}
.sidebar__label {
    margin: 0 14px 14px;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-muted);
}
.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 11px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 550;
}
.sidebar__link > i {
    width: 21px;
    text-align: center;
    font-size: 1rem;
}
.sidebar__link:hover {
    background: var(--color-surface-raised);
    color: var(--color-text);
}
.sidebar__link--active,
.sidebar__link--active:hover {
    background: var(--purple-50);
    color: var(--color-primary);
    font-weight: 650;
}
.sidebar__active-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-left: auto;
}
.sidebar__bottom {
    margin-top: auto;
    padding-top: 40px;
}
.sidebar__app {
    padding: 18px 16px;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: 14px;
}
.sidebar__app > i {
    display: block;
    margin-bottom: 12px;
    color: var(--color-primary);
    font-size: 1.3rem;
}
.sidebar__app strong {
    display: block;
    font-size: 0.78rem;
    line-height: 1.6;
}
.sidebar__app p {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin: 7px 0 13px;
}
.sidebar__app a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 650;
}
.sidebar__signature {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--color-text-muted);
    font-size: 0.67rem;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--topbar-height);
    margin-left: var(--sidebar-width);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.topbar__inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 36px;
    gap: 16px;
}
.topbar__context,
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}
.workspace-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.workspace-label span {
    padding: 0 10px;
    color: var(--color-border-strong);
}
.workspace-label b {
    color: var(--color-text);
    font-weight: 550;
}
.icon-control {
    width: 42px;
    height: 42px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
}
.topbar__toggle,
.sidebar__close {
    display: none;
}
.theme-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}
.theme-picker select {
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 9px;
    padding: 8px 10px;
    min-height: 40px;
    cursor: pointer;
    width: auto;
}
.topbar__credits {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 7px;
    padding: 5px 9px;
    font-size: 0.69rem;
    white-space: nowrap;
}
.topbar__credits--success {
    color: var(--success-text);
    background: var(--success-bg);
}
.topbar__credits--danger {
    color: var(--warning-text);
    background: var(--warning-bg);
}
.topbar__credits--primary {
    color: var(--color-primary);
    background: var(--purple-50);
}
.topbar__user {
    position: relative;
}
.topbar__user-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    background: transparent;
    border: 0;
    color: var(--color-text);
    font-size: 0.78rem;
    cursor: pointer;
}
.topbar__user-btn > i {
    color: var(--color-text-muted);
    font-size: 0.55rem;
}
.topbar__user-name {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar__avatar {
    width: 35px;
    height: 35px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--color-primary);
    background: var(--purple-50);
    font-weight: 700;
}
.topbar__dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 14px);
    min-width: 235px;
    max-width: calc(100vw - 32px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.topbar__dropdown--open {
    display: block;
}
.topbar__identity {
    padding: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.topbar__identity small {
    display: block;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    font-weight: 400;
}
.topbar__dropdown-item {
    width: 100%;
    padding: 13px 16px;
    text-align: left;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--color-border);
    cursor: pointer;
    color: var(--danger-text);
    font-size: 0.8rem;
}
.topbar__dropdown-item:hover {
    background: var(--danger-bg);
}
.main-content {
    margin-left: var(--sidebar-width);
    padding: 34px 36px 60px;
    min-height: calc(100vh - var(--topbar-height));
}
.page-header {
    margin-bottom: 28px;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}
.page-header__title {
    color: var(--color-text);
    font-size: clamp(1.4rem, 2.1vw, 1.9rem);
    letter-spacing: -0.035em;
    line-height: 1.3;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.page-header__subtitle {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: 9px;
    max-width: 700px;
}
.section-heading {
    color: var(--color-text);
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin: 30px 0 16px;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.card-grid .card {
    padding: 24px;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.card__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--purple-50);
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-bottom: 18px;
}
.card__title {
    font-size: 1rem;
    font-weight: 650;
    margin-bottom: 8px;
}
.card__text {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 20px;
}
.card__link {
    font-size: 0.8rem;
    font-weight: 650;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-grid .card:hover {
    border-color: var(--purple-200);
    box-shadow: var(--shadow-md);
}
.hero {
    position: relative;
    overflow: hidden;
    padding: 36px;
    border-radius: 20px;
    background: linear-gradient(115deg, #45237b, #7540c8 65%, #8c57d4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.hero__eyebrow {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #e0cdfb;
    margin-bottom: 14px;
}
.hero h2 {
    font-size: clamp(1.5rem, 2.8vw, 2.3rem);
    line-height: 1.25;
    letter-spacing: -0.035em;
    max-width: 460px;
    font-weight: 650;
}
.hero p {
    max-width: 480px;
    font-size: 0.83rem;
    line-height: 1.8;
    color: #e7dcf7;
    margin: 14px 0 24px;
}
.hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.hero .btn-primary {
    background: #fff;
    color: #542d8a;
    border-color: #fff;
}
.hero .btn-primary:hover {
    background: #eee5fc;
}
.hero .btn-outline-secondary {
    color: #fff;
    border-color: #b999e3;
}
.hero .btn-outline-secondary:hover {
    background: #ffffff15;
}
.hero__art {
    position: relative;
    flex: 0 0 160px;
    height: 190px;
    display: grid;
    place-items: center;
}
.hero__art::before {
    content: "";
    width: 170px;
    height: 170px;
    position: absolute;
    border: 1px solid #ffffff26;
    border-radius: 50%;
    box-shadow:
        0 0 0 28px #ffffff08,
        0 0 0 56px #ffffff04;
}
.hero__art > i {
    font-size: 100px;
    position: relative;
    color: #f4eaff;
    transform: rotate(-8deg);
    text-shadow: 0 10px 20px #25134155;
}
.workflow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
}
.workflow article {
    display: flex;
    gap: 13px;
}
.workflow article > span {
    flex: 0 0 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 650;
    border-radius: 9px;
    background: var(--color-surface-raised);
    color: var(--color-primary);
}
.workflow h3 {
    font-size: 0.8rem;
    margin-bottom: 5px;
    font-weight: 650;
}
.workflow p {
    font-size: 0.74rem;
    color: var(--color-text-muted);
    line-height: 1.8;
}
.sidebar-scrim {
    display: none;
}
@media (min-width: 1600px) {
    .main-content {
        padding-left: max(
            40px,
            calc((100vw - var(--sidebar-width) - 1320px) / 2)
        );
        padding-right: max(
            40px,
            calc((100vw - var(--sidebar-width) - 1320px) / 2)
        );
    }
}
@media (max-width: 1200px) {
    .topbar__inner {
        padding: 0 24px;
    }
    .workspace-label {
        display: none;
    }
    .main-content {
        padding: 28px 24px 48px;
    }
    .topbar__credits {
        display: none;
    }
}
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        visibility: hidden;
        transition:
            transform 0.2s,
            visibility 0.2s;
        width: 270px;
    }
    .sidebar__head {
        margin-bottom: 28px;
    }
    .topbar {
        margin-left: 0;
    }
    .main-content {
        margin-left: 0;
    }
    .topbar__toggle,
    .sidebar__close {
        display: block;
    }
    .workspace-label {
        display: block;
    }
    .workspace-label > span,
    .workspace-label > b {
        display: none;
    }
    .navigation-open .sidebar {
        transform: translateX(0);
        visibility: visible;
    }
    .navigation-open {
        overflow: hidden;
    }
    .navigation-open .sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1050;
        border: 0;
        background: #0a0b1477;
        backdrop-filter: blur(3px);
    }
}
@media (max-width: 640px) {
    :root {
        --topbar-height: 70px;
    }
    .topbar__inner {
        padding: 0 16px;
        gap: 8px;
    }
    .topbar__context,
    .topbar__actions {
        gap: 10px;
    }
    .topbar__user-name,
    .topbar__user-btn > i,
    .workspace-label,
    .theme-picker > i {
        display: none;
    }
    .theme-picker select {
        max-width: 115px;
        font-size: 0.75rem;
    }
    .main-content {
        padding: 24px 16px 40px;
    }
    .hero {
        padding: 26px 22px;
    }
    .hero__art {
        display: none;
    }
    .hero p {
        font-size: 0.8rem;
    }
    .workflow {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .page-header__subtitle {
        font-size: 0.8rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
