:root {
    --bg: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f5f8fc;
    --line: #d7e0ea;
    --text: #16324f;
    --muted: #62748a;
    --primary: #1e5a8a;
    --primary-dark: #17486d;
    --accent: #dceaf7;
    --danger: #b42318;
    --link: #1e5a8a;
    --link-hover: #17486d;
    --shadow: 0 18px 40px rgba(16, 40, 68, 0.08);
    --radius: 20px;
    --sidebar-width: 280px;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(30, 90, 138, 0.10), transparent 35%),
        linear-gradient(180deg, #f8fbfe 0%, var(--bg) 100%);
}

body {
    min-height: 100vh;
}

body.app-shell--dark {
    position: relative;
    isolation: isolate;
}

body.app-shell--dark::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at top left, rgba(124, 92, 255, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(31, 176, 255, 0.10), transparent 32%),
        linear-gradient(180deg, #202336 0%, #171a28 100%);
    pointer-events: none;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.18s ease, opacity 0.18s ease;
}

a:hover {
    color: var(--link-hover);
}

.auth-shell {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(100%, 440px);
    background: var(--surface);
    border: 1px solid rgba(215, 224, 234, 0.8);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
    padding: 32px;
}

.auth-card--login {
    width: min(100%, 480px);
}

.auth-card__header {
    text-align: center;
    margin-bottom: 24px;
}

.brand-mark {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #2f7bb0);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 10px 24px rgba(30, 90, 138, 0.28);
}

.auth-card__header h1,
.topbar__title,
.welcome-card h2 {
    margin: 0;
    line-height: 1.1;
}

.auth-card__header p,
.muted {
    color: var(--muted);
}

.form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    font: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 90, 138, 0.12);
}

.field__error,
.alert {
    font-size: 0.92rem;
}

.field__error {
    color: var(--danger);
}

.alert {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.alert--error {
    background: #fff5f5;
    color: var(--danger);
    border: 1px solid rgba(180, 35, 24, 0.18);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid transparent;
    padding: 0 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--primary-dark);
}

.btn--secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--line);
}

.btn--secondary:hover {
    background: var(--surface-soft);
}

ul,
ol {
    margin: 0.8rem 0;
    padding-left: 1.35rem;
}

li {
    margin-bottom: 0.45rem;
}

.landing-shell {
    padding: 22px;
}

.landing-shell main {
    max-width: 1200px;
    margin: 0 auto 48px;
}

.landing-header {
    max-width: 1200px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid rgba(215, 224, 234, 0.8);
    border-radius: calc(var(--radius) + 2px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 250, 255, 0.88));
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

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

.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f3f7fc);
    border: 1px solid rgba(215, 224, 234, 0.9);
    box-shadow: 0 10px 24px rgba(30, 90, 138, 0.18);
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.landing-nav a {
    color: var(--link);
    font-weight: 600;
}

.landing-nav a:hover {
    color: var(--link-hover);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.landing-nav__button {
    color: var(--text) !important;
}

.hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
    gap: 22px;
    padding: 28px;
    border-radius: calc(var(--radius) + 8px);
    border: 1px solid rgba(215, 224, 234, 0.8);
    background:
        radial-gradient(circle at top right, rgba(30, 90, 138, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(250, 252, 255, 0.98), rgba(241, 246, 252, 0.98));
    box-shadow: var(--shadow);
}

.hero-copy h1 {
    margin: 14px 0 12px;
    font-size: clamp(2.3rem, 5vw, 4.3rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.hero-copy p {
    max-width: 64ch;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.7;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.88rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

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

.hero-meta div,
.hero-stat,
.feature-card,
.faq-card,
.demo-card {
    border: 1px solid rgba(215, 224, 234, 0.8);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 253, 0.94));
}

.hero-meta div {
    border-radius: 18px;
    padding: 14px;
}

.hero-meta strong,
.hero-stat strong {
    display: block;
    font-size: 1.02rem;
    margin-bottom: 4px;
}

.hero-meta span,
.hero-stat span,
.demo-row span {
    color: var(--muted);
    font-size: 0.92rem;
}

.hero-panel {
    border-radius: 28px;
    padding: 22px;
    background: linear-gradient(180deg, #1e5a8a 0%, #133956 100%);
    color: #fff;
    box-shadow: 0 20px 44px rgba(19, 57, 86, 0.24);
    display: grid;
    gap: 18px;
}

.hero-panel__top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    color: rgba(255, 255, 255, 0.82);
}

.hero-panel__top strong {
    color: #fff;
}

.hero-stats {
    display: grid;
    gap: 12px;
}

.hero-stat {
    border-radius: 20px;
    padding: 18px;
}

.hero-stat strong {
    font-size: 1.5rem;
    margin-top: 6px;
}

.hero-panel__note {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    line-height: 1.6;
}

.section-block {
    margin-top: 24px;
    padding: 28px;
    border-radius: calc(var(--radius) + 8px);
    border: 1px solid rgba(215, 224, 234, 0.8);
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.94), rgba(241, 246, 252, 0.94));
    box-shadow: var(--shadow);
}

.section-block--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

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

.section-head h2 {
    margin: 8px 0 8px;
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.section-head p {
    color: var(--muted);
    margin: 0;
}

.section-kicker {
    display: inline-flex;
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.84rem;
    font-weight: 700;
}

.feature-grid,
.faq-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.feature-card,
.faq-card {
    border-radius: 20px;
    padding: 18px;
}

.feature-card h3,
.faq-card h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.feature-card p,
.faq-card p {
    color: var(--muted);
    line-height: 1.65;
    margin: 0;
}

.demo-card {
    border-radius: 24px;
    padding: 20px;
    display: grid;
    gap: 14px;
    position: sticky;
    top: 22px;
}

.demo-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(215, 224, 234, 0.8);
}

.demo-row strong {
    text-align: right;
}

.demo-card__button {
    width: 100%;
    margin-top: 8px;
}

.login-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.app-shell {
    overflow-x: hidden;
    min-height: 100vh;
}

.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    background: transparent;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    border-right: 1px solid rgba(215, 224, 234, 0.9);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(12px);
}

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

.brand-title {
    font-weight: 800;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 0.92rem;
}

.sidebar__nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    color: var(--text);
    min-width: 0;
}

.nav-link.is-active,
.nav-link:hover {
    background: var(--accent);
}

.nav-link.is-disabled {
    color: #94a3b8;
    cursor: default;
}

.nav-link--danger {
    color: var(--danger);
}

.nav-link__icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-link__icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar__footer {
    margin-top: auto;
    display: grid;
    gap: 14px;
}

.user-card {
    padding: 16px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.user-card__name {
    font-weight: 800;
}

.user-card__meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.92rem;
}

.main {
    min-width: 0;
    padding: 24px;
    background: transparent;
    min-height: 100vh;
    min-height: 100dvh;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar__eyebrow,
.section-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.menu-button {
    display: none;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    cursor: pointer;
    padding: 0 12px;
}

.menu-button span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 999px;
}

.menu-button span + span {
    margin-top: 5px;
}

.page {
    display: grid;
    gap: 20px;
    background: transparent;
}

.dashboard-grid {
    display: grid;
    gap: 20px;
}

.stack {
    display: grid;
    gap: 20px;
}

.welcome-card,
.summary-card,
.panel {
    background: var(--surface);
    border: 1px solid rgba(215, 224, 234, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.welcome-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    align-items: center;
}

.welcome-card__badge {
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
    background: var(--accent);
    color: var(--primary-dark);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

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

.summary-grid--finance {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
    padding: 20px;
}

.summary-card__label {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.summary-card__value {
    font-size: 1.6rem;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.toolbar-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid rgba(215, 224, 234, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.toolbar-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.filters__actions,
.form__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.field--full {
    grid-column: 1 / -1;
}

.field--inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.field--inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.form--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.table th {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.row-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.text-link {
    color: var(--primary);
    font-weight: 700;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.text-link--danger {
    color: var(--danger);
}

.nav-link__dot {
    margin-right: 10px;
    flex: 0 0 auto;
}

.company-logo-preview {
    min-height: 120px;
    border-radius: 16px;
    border: 1px dashed var(--line);
    background: var(--surface-soft);
    display: grid;
    place-items: center;
    padding: 16px;
    overflow: hidden;
}

.company-logo-preview img {
    max-width: 100%;
    max-height: 96px;
    object-fit: contain;
    display: block;
}

ul {
    padding-left: 1.5rem;
}

.recent-list {
    display: grid;
    gap: 12px;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--surface-soft);
}

.recent-item__amount {
    font-weight: 800;
    white-space: nowrap;
}

.product-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    display: block;
}

.product-thumb--empty {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.gallery-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: var(--surface-soft);
}

.gallery-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.gallery-card__meta {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    width: fit-content;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.status-badge,
.attachment-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    width: fit-content;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-badge {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: var(--text);
}

.status-badge--success {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.18);
    color: #0f766e;
}

.status-badge--warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.18);
    color: #9a6700;
}

.status-badge--danger {
    background: rgba(180, 35, 24, 0.10);
    border-color: rgba(180, 35, 24, 0.18);
    color: var(--danger);
}

.status-badge--neutral {
    background: var(--surface-soft);
    border-color: var(--line);
    color: var(--muted);
}

.attachment-chip {
    background: var(--accent);
    color: var(--primary-dark);
}

.attachment-actions,
.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.product-hero {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.product-hero__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.product-hero__empty {
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    border-radius: 20px;
    border: 1px dashed var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 700;
}

.product-hero__meta {
    display: grid;
    gap: 10px;
    color: var(--text);
}

.balance-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    font-weight: 700;
}

.balance-pill--positive {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.18);
    color: #0f766e;
}

.balance-pill--negative {
    background: rgba(180, 35, 24, 0.10);
    border-color: rgba(180, 35, 24, 0.18);
    color: var(--danger);
}

.panel__header {
    padding: 18px 20px 0;
}

.panel__body {
    padding: 16px 20px 20px;
}

.app-shell__backdrop {
    display: none;
}

@media (max-width: 1080px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-grid--phase2,
    .filters,
    .form--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        transform: translateX(-102%);
        transition: transform 0.25s ease;
        z-index: 40;
    }

    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .app-shell.sidebar-open .app-shell__backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(15, 23, 42, 0.45);
    }

    .menu-button {
        display: inline-grid;
        place-items: center;
    }

    .main {
        padding: 18px;
    }

    .summary-grid,
    .summary-grid--phase2,
    .panel-grid,
    .filters,
    .form--grid {
        grid-template-columns: 1fr;
    }

    .welcome-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 700px) {
    .toolbar-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .row-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .auth-card {
        padding: 24px 18px;
    }

    .main {
        padding: 14px;
    }

    .topbar {
        align-items: flex-start;
    }

    .landing-shell {
        padding: 14px;
    }

    .landing-header {
        padding: 14px;
    }

    .hero-card,
    .section-block,
    .section-block--split {
        padding: 18px;
    }

    .hero-meta,
    .feature-grid,
    .faq-grid,
    .section-block--split {
        grid-template-columns: 1fr;
    }

    .landing-header,
    .landing-nav,
    .hero-actions,
    .login-links {
        flex-direction: column;
        align-items: flex-start;
    }
}

body.app-shell--dark {
    --bg: #171a28;
    --surface: #1f2435;
    --surface-soft: #252b3d;
    --line: rgba(124, 138, 171, 0.18);
    --text: #eef2ff;
    --muted: rgba(218, 227, 244, 0.76);
    --primary: #8fb5ff;
    --primary-dark: #7aa5ff;
    --accent: rgba(124, 92, 255, 0.16);
    --danger: #ff9f9f;
    --link: #8fb5ff;
    --link-hover: #b7d0ff;
    color: #d8e2f1;
    color-scheme: dark;
    background:
        radial-gradient(circle at top left, rgba(124, 92, 255, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(31, 176, 255, 0.10), transparent 32%),
        linear-gradient(180deg, #202336 0%, #171a28 100%);
}

body.app-shell--dark .app-layout {
    background: transparent;
}

body.app-shell--dark .sidebar {
    background:
        linear-gradient(180deg, rgba(22, 25, 39, 0.98) 0%, rgba(20, 22, 34, 0.96) 100%);
    border-right-color: rgba(124, 138, 171, 0.18);
    box-shadow: 20px 0 60px rgba(5, 7, 12, 0.28);
}

body.app-shell--dark .toolbar-card,
body.app-shell--dark .welcome-card,
body.app-shell--dark .summary-card,
body.app-shell--dark .panel {
    color: #eef2ff;
}

body.app-shell--dark .brand-title,
body.app-shell--dark .topbar__title,
body.app-shell--dark .topbar-user__meta strong,
body.app-shell--dark .hero-panel h2,
body.app-shell--dark .hero-panel h3,
body.app-shell--dark .panel h3,
body.app-shell--dark .panel h2,
body.app-shell--dark .section-kicker,
body.app-shell--dark .summary-card__value,
body.app-shell--dark .summary-card__label,
body.app-shell--dark .summary-card__meta,
body.app-shell--dark .recent-item strong,
body.app-shell--dark .stack-item strong,
body.app-shell--dark .bar-row__label strong,
body.app-shell--dark .payment-row__label,
body.app-shell--dark .hero-panel__eyebrow,
body.app-shell--dark .hero-balance strong,
body.app-shell--dark .hero-metric strong,
body.app-shell--dark .status-card__label,
body.app-shell--dark .status-card__value,
body.app-shell--dark .status-card__meta {
    color: #f4f7ff;
}

body.app-shell--dark .brand-subtitle,
body.app-shell--dark .sidebar-section__label,
body.app-shell--dark .topbar-user__meta span,
body.app-shell--dark .muted,
body.app-shell--dark .hero-panel__description,
body.app-shell--dark .hero-balance span,
body.app-shell--dark .hero-balance small,
body.app-shell--dark .hero-metric span,
body.app-shell--dark .recent-item .muted,
body.app-shell--dark .stack-item .muted,
body.app-shell--dark .bar-row__label span,
body.app-shell--dark .payment-row__values span {
    color: rgba(232, 238, 248, 0.78);
}

body.app-shell--dark .nav-link {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(124, 138, 171, 0.12);
    color: #d8e2f1;
}

body.app-shell--dark .nav-link:hover,
body.app-shell--dark .nav-link.is-active {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.28), rgba(96, 138, 255, 0.18));
    border-color: rgba(124, 92, 255, 0.42);
    color: #fff;
}

body.app-shell--dark .nav-link--danger {
    color: #ffb4b4;
}

body.app-shell--dark .nav-link__dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(124, 138, 171, 0.48);
    flex: 0 0 auto;
}

body.app-shell--dark .nav-link.is-active .nav-link__dot {
    background: #8f79ff;
}

body.app-shell--dark .table th,
body.app-shell--dark .table td {
    border-bottom-color: rgba(124, 138, 171, 0.16);
    color: #eef2ff;
}

body.app-shell--dark .table th {
    color: rgba(232, 238, 248, 0.84);
}

body.app-shell--dark .summary-card,
body.app-shell--dark .panel,
body.app-shell--dark .toolbar-card,
body.app-shell--dark .welcome-card {
    background:
        linear-gradient(180deg, rgba(31, 35, 51, 0.98), rgba(20, 23, 36, 0.98));
    border-color: rgba(124, 138, 171, 0.14);
}

body.app-shell--dark .filters,
body.app-shell--dark .form--grid {
    color: #eef2ff;
}

body.app-shell--dark .field input,
body.app-shell--dark .field select,
body.app-shell--dark .field textarea {
    background: rgba(12, 15, 25, 0.86);
    border-color: rgba(124, 138, 171, 0.18);
    color: #eef2ff;
}

body.app-shell--dark .field input::placeholder,
body.app-shell--dark .field textarea::placeholder {
    color: rgba(218, 227, 244, 0.38);
}

body.app-shell--dark .recent-item,
body.app-shell--dark .stack-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(124, 138, 171, 0.10);
}

body.app-shell--dark .balance-pill {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(124, 138, 171, 0.14);
    color: #eef2ff;
}

body.app-shell--dark .text-link {
    color: #8fb5ff;
}

body.app-shell--dark .text-link--danger {
    color: #ff9f9f;
}

.sidebar-section {
    display: grid;
    gap: 10px;
}

.sidebar-section__label {
    padding: 0 6px;
    color: rgba(218, 227, 244, 0.52);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
}

.sidebar-section__items {
    display: grid;
    gap: 8px;
}

body.app-shell--dark .main {
    padding: 22px 22px 32px;
    background: transparent;
    min-height: 100vh;
}

body.app-shell--dark .topbar {
    position: sticky;
    top: 16px;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 20px;
    border: 1px solid rgba(124, 138, 171, 0.16);
    border-radius: 22px;
    background: rgba(23, 26, 40, 0.88);
    box-shadow: 0 18px 40px rgba(5, 7, 12, 0.24);
    backdrop-filter: blur(14px);
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0 16px;
    border: 1px solid rgba(124, 138, 171, 0.16);
    border-radius: 18px;
    background: rgba(14, 17, 28, 0.6);
}

.topbar-search__icon {
    color: rgba(218, 227, 244, 0.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #eef2ff;
    outline: none;
    padding: 14px 0;
}

.topbar-search input::placeholder {
    color: rgba(218, 227, 244, 0.42);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(124, 138, 171, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #eef2ff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.topbar-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(124, 138, 171, 0.24);
    transform: translateY(-1px);
}

.topbar-icon svg,
.topbar-search__icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

.topbar-user__avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #7c5cff, #33d1b6);
    color: #fff;
    font-weight: 800;
}

.topbar-user__meta {
    display: grid;
    gap: 2px;
    font-size: 0.9rem;
}

body.app-shell--dark .page {
    display: grid;
    gap: 20px;
    background: transparent;
}

body.app-shell--dark .topbar-search {
    background: rgba(14, 17, 28, 0.72);
}

body.app-shell--dark .topbar-search__icon {
    color: rgba(232, 238, 248, 0.76);
}

body.app-shell--dark .topbar-icon {
    background: rgba(255, 255, 255, 0.04);
    color: #eef2ff;
}

body.app-shell--dark .topbar-icon:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(124, 138, 171, 0.28);
}

body.app-shell--dark .topbar-icon--link {
    color: #eef2ff;
}

body.app-shell--dark a {
    color: black;
}

body.app-shell--dark a:hover {
    color: var(--link-hover);
}

.dashboard-shell {
    display: grid;
    gap: 20px;
}

.hero-grid,
.analytics-grid,
.detail-grid {
    display: grid;
    gap: 20px;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
}

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

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

.detail-grid--wide {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

body.app-shell--dark .panel,
body.app-shell--dark .summary-card,
body.app-shell--dark .welcome-card,
body.app-shell--dark .toolbar-card,
body.app-shell--dark .auth-card,
body.app-shell--dark .hero-panel,
body.app-shell--dark .chart-panel,
body.app-shell--dark .detail-panel {
    border: 1px solid rgba(124, 138, 171, 0.14);
    background: linear-gradient(180deg, rgba(27, 31, 46, 0.92), rgba(20, 23, 36, 0.94));
    box-shadow: 0 16px 36px rgba(5, 7, 12, 0.22);
}

body.app-shell--dark .panel__header,
body.app-shell--dark .panel__body {
    border-color: rgba(124, 138, 171, 0.10);
}

body.app-shell--dark .field input,
body.app-shell--dark .field select,
body.app-shell--dark .field textarea {
    border-color: rgba(124, 138, 171, 0.18);
    background: rgba(15, 18, 29, 0.82);
    color: #eef2ff;
}

body.app-shell--dark .field input::placeholder,
body.app-shell--dark .field textarea::placeholder {
    color: rgba(232, 238, 248, 0.52);
}

body.app-shell--dark ul,
body.app-shell--dark ol {
    color: #eef2ff;
}

body.app-shell--dark li::marker {
    color: #8f79ff;
}

body.app-shell--dark .field span {
    color: rgba(232, 238, 248, 0.9);
}

body.app-shell--dark .btn--secondary {
    background: rgba(23, 28, 42, 0.92);
    border-color: rgba(124, 138, 171, 0.22);
    color: #eef2ff;
}

body.app-shell--dark .btn--secondary:hover {
    background: rgba(31, 37, 54, 0.96);
}

body.app-shell--dark .btn--secondary {
    background: rgba(255, 255, 255, 0.03);
    color: #eef2ff;
    border-color: rgba(124, 138, 171, 0.16);
}

body.app-shell--dark .btn--secondary:hover {
    background: rgba(255, 255, 255, 0.06);
}

body.app-shell--dark .summary-card {
    min-height: 132px;
}

.summary-grid--dense {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card--dark {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.summary-card__meta {
    font-size: 0.9rem;
}

.hero-panel {
    display: grid;
    gap: 18px;
    padding: 22px;
    border-radius: 24px;
}

.hero-panel--intro h2 {
    margin: 8px 0 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

.hero-panel__eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.16);
    color: #cfc4ff;
    font-size: 0.82rem;
    font-weight: 700;
}

.hero-panel__description {
    line-height: 1.7;
    max-width: 65ch;
}

.hero-balance {
    display: grid;
    gap: 4px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
}

.hero-balance strong {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn--soft {
    background: rgba(124, 92, 255, 0.16);
    color: #eef2ff;
    border-color: rgba(124, 92, 255, 0.18);
}

.btn--soft:hover {
    background: rgba(124, 92, 255, 0.28);
}

.hero-panel--stats {
    gap: 16px;
}

.hero-stats__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.hero-avatar {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, #7c5cff, #33d1b6);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
}

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

.hero-metric {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

.hero-metric strong {
    font-size: 1.4rem;
}

.panel__header--split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.bar-list,
.payment-list,
.recent-list,
.stack-list {
    display: grid;
    gap: 12px;
}

.bar-row,
.payment-row,
.recent-item,
.stack-item {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(124, 138, 171, 0.08);
}

.bar-row {
    gap: 12px;
}

.bar-row__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bar-track,
.payment-row__bars {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.bar-fill,
.payment-bar {
    height: 100%;
    border-radius: inherit;
}

.bar-fill--income,
.payment-bar--income,
.month-bar--income {
    background: linear-gradient(135deg, #36d399, #2fb27f);
}

.bar-fill--expense,
.payment-bar--expense,
.month-bar--expense {
    background: linear-gradient(135deg, #ff7b7b, #d85f8a);
}

.month-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    min-height: 280px;
}

.month-chart__item {
    display: grid;
    gap: 10px;
    align-content: end;
}

.month-chart__bars {
    display: flex;
    align-items: end;
    gap: 8px;
    min-height: 210px;
    padding: 16px 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(124, 138, 171, 0.08);
}

.month-bar {
    flex: 1;
    min-height: 14px;
    border-radius: 12px 12px 4px 4px;
}

.month-chart__label {
    font-size: 0.84rem;
    color: rgba(218, 227, 244, 0.6);
    text-align: center;
}

.month-chart__values {
    display: grid;
    gap: 4px;
    font-size: 0.82rem;
    text-align: center;
    color: rgba(218, 227, 244, 0.72);
}

.payment-row {
    gap: 12px;
}

.payment-row__label {
    font-weight: 700;
}

.payment-row__bars {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    height: 12px;
}

.payment-bar {
    min-width: 6px;
}

.payment-row__values {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.88rem;
}

.recent-item,
.stack-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.recent-item__body {
    display: grid;
    gap: 6px;
}

.recent-item__amount,
.stack-item__amount {
    font-weight: 800;
    color: #cfe0ff;
}

.tab-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-button {
    border: 1px solid rgba(124, 138, 171, 0.14);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(218, 227, 244, 0.74);
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tab-button.is-active {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.32), rgba(51, 209, 182, 0.2));
    color: #fff;
    border-color: rgba(124, 92, 255, 0.42);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.alert-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.status-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(124, 138, 171, 0.12);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 10px;
}

.status-card--success {
    border-color: rgba(54, 211, 153, 0.22);
    background: rgba(54, 211, 153, 0.08);
}

.status-card--warning {
    border-color: rgba(255, 196, 61, 0.22);
    background: rgba(255, 196, 61, 0.08);
}

.status-card--danger {
    border-color: rgba(255, 123, 123, 0.22);
    background: rgba(255, 123, 123, 0.08);
}

.status-card--info {
    border-color: rgba(96, 138, 255, 0.22);
    background: rgba(96, 138, 255, 0.08);
}

.status-card__label {
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.status-card__value {
    font-size: 1.6rem;
    font-weight: 800;
}

.status-card__meta {
    line-height: 1.6;
}

@media (max-width: 1180px) {
    .hero-grid,
    .analytics-grid,
    .detail-grid,
    .detail-grid--wide,
    .summary-grid--dense,
    .alert-grid {
        grid-template-columns: 1fr 1fr;
    }

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

@media (max-width: 860px) {
    body.app-shell--dark .topbar {
        grid-template-columns: auto minmax(0, 1fr);
    }

    body.app-shell--dark .topbar-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .hero-grid,
    .analytics-grid,
    .detail-grid,
    .detail-grid--wide,
    .summary-grid--dense,
    .hero-metrics,
    .alert-grid {
        grid-template-columns: 1fr;
    }

    .month-chart {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    body.app-shell--dark .main {
        padding: 14px;
    }

    body.app-shell--dark .topbar {
        padding: 12px 14px;
    }

    .hero-grid,
    .analytics-grid,
    .detail-grid,
    .summary-grid--dense {
        gap: 14px;
    }

    .month-chart {
        grid-template-columns: 1fr;
    }

    .topbar-search {
        width: 100%;
    }

    .topbar-user__meta {
        display: none;
    }
}
