:root {
    --bg: #e7dff4;
    --bg-deep: #d8caef;
    --shell: rgba(255, 255, 255, 0.78);
    --panel: rgba(255, 255, 255, 0.9);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --border: rgba(92, 71, 140, 0.12);
    --border-strong: rgba(92, 71, 140, 0.18);
    --text: #2d2340;
    --muted: #8a7da7;
    --muted-strong: #685c84;
    --accent: #7b5de7;
    --accent-soft: rgba(123, 93, 231, 0.14);
    --accent-strong: #6a4ee0;
    --danger: #de5a59;
    --danger-soft: rgba(222, 90, 89, 0.12);
    --success: #39a674;
    --success-soft: rgba(57, 166, 116, 0.14);
    --warning: #cf9151;
    --warning-soft: rgba(207, 145, 81, 0.14);
    --shadow: 0 24px 70px rgba(88, 60, 130, 0.12);
    --shadow-soft: 0 18px 40px rgba(88, 60, 130, 0.08);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --font-sans: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="dark"] {
    --bg: #151221;
    --bg-deep: #0f0c19;
    --shell: rgba(21, 18, 33, 0.92);
    --panel: rgba(33, 27, 50, 0.92);
    --panel-strong: rgba(40, 33, 58, 0.96);
    --border: rgba(184, 169, 230, 0.14);
    --border-strong: rgba(184, 169, 230, 0.26);
    --text: #f1ecff;
    --muted: #b3a8cf;
    --muted-strong: #d2caea;
    --accent-soft: rgba(123, 93, 231, 0.2);
    --danger-soft: rgba(222, 90, 89, 0.18);
    --success-soft: rgba(57, 166, 116, 0.2);
    --warning-soft: rgba(207, 145, 81, 0.2);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.24);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.48), transparent 22%),
        radial-gradient(circle at bottom right, rgba(123, 93, 231, 0.12), transparent 28%),
        linear-gradient(180deg, var(--bg), var(--bg-deep));
}

body[data-theme="dark"] {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 24%),
        radial-gradient(circle at bottom right, rgba(123, 93, 231, 0.18), transparent 30%),
        linear-gradient(180deg, var(--bg), var(--bg-deep));
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.site-bg {
    min-height: 100vh;
    padding: 0;
}

.app-frame {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    width: 100%;
    max-width: none;
    height: 100vh;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 0;
    background: var(--shell);
    backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

body[data-theme="dark"] .app-frame,
body[data-theme="dark"] .login-showcase,
body[data-theme="dark"] .login-card {
    border-color: rgba(184, 169, 230, 0.1);
    background: var(--shell);
}

body[data-theme="dark"] .sidebar {
    background: rgba(29, 24, 44, 0.82);
}

body[data-theme="dark"] .card,
body[data-theme="dark"] .panel-card,
body[data-theme="dark"] .balance-card,
body[data-theme="dark"] .trend-card,
body[data-theme="dark"] .inventory-card,
body[data-theme="dark"] .inventory-product-card,
body[data-theme="dark"] .report-summary-card,
body[data-theme="dark"] .report-card,
body[data-theme="dark"] .settings-card,
body[data-theme="dark"] .toolbar-card,
body[data-theme="dark"] .showcase-card,
body[data-theme="dark"] .profile-chip,
body[data-theme="dark"] .profile-chip--header,
body[data-theme="dark"] .account-menu__dropdown,
body[data-theme="dark"] .modal__panel,
body[data-theme="dark"] .mini-tile,
body[data-theme="dark"] .stat-pill {
    background: var(--panel);
    border-color: var(--border);
}

body[data-theme="dark"] .button--secondary,
body[data-theme="dark"] .button--soft,
body[data-theme="dark"] .button--ghost,
body[data-theme="dark"] .button--chip,
body[data-theme="dark"] .table-action {
    background: rgba(40, 33, 58, 0.94);
    border-color: var(--border);
    color: var(--text);
}

body[data-theme="dark"] .toolbar-card input,
body[data-theme="dark"] .login-form input,
body[data-theme="dark"] .modal__form input,
body[data-theme="dark"] .modal__form select,
body[data-theme="dark"] .modal__form textarea,
body[data-theme="dark"] .settings-form input,
body[data-theme="dark"] .settings-form select,
body[data-theme="dark"] .settings-form textarea {
    background: rgba(17, 14, 28, 0.96);
    border-color: var(--border);
    color: var(--text);
}

body[data-theme="dark"] .data-table th,
body[data-theme="dark"] .data-table td,
body[data-theme="dark"] .activity-item {
    border-bottom-color: rgba(184, 169, 230, 0.08);
}

body[data-theme="dark"] .input-readonly,
body[data-theme="dark"] .calculated-field,
body[data-theme="dark"] .product-preview,
body[data-theme="dark"] .inventory-product-card__stats div {
    background: rgba(123, 93, 231, 0.08);
    border-color: rgba(184, 169, 230, 0.1);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 28px 20px;
    border-right: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.42);
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar__brand,
.profile-chip,
.nav-link,
.mobile-nav__link,
.page-hero,
.page-hero__actions,
.toolbar-card__form,
.toolbar-card__actions,
.section-header,
.section-header--plain,
.balance-card__metrics,
.balance-card__progress-copy,
.activity-item,
.product-cell,
.metric-inline,
.login-showcase__badge,
.login-card__header,
.trend-visual,
.legend-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar__brand {
    align-items: center;
    justify-content: center;
}

.brand-mark,
.profile-chip__avatar,
.table-action,
.mobile-nav__link,
.button--chip {
    display: inline-grid;
    place-items: center;
}

.brand-mark {
    width: 176px;
    height: 176px;
    flex: 0 0 176px;
}

.brand-mark__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar__brand h1,
.page-hero h2,
.login-showcase h1,
.login-card h2,
.balance-card strong,
.stat-pill strong,
.showcase-card strong {
    margin: 0;
    letter-spacing: -0.04em;
}

.sidebar__brand h1 {
    font-size: 1.05rem;
}

.sidebar__brand p,
.profile-chip p,
.page-hero__eyebrow,
.page-hero__description,
.section-header__summary,
.login-showcase p,
.login-card p,
.activity-item p,
.activity-item small,
.balance-card__label,
.balance-card small,
.stat-pill span,
.toolbar-card label span,
.trend-visual__axis span,
.trend-visual__labels span,
.mini-tile span,
.showcase-card span,
.showcase-card small,
.inventory-card p,
.inventory-points,
.empty-state,
.flash,
.input-readonly span,
.form-note,
.product-preview p,
.settings-form label span {
    margin: 0;
    color: var(--muted);
}

.form-note {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
}

.profile-chip {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
}

.profile-chip__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(123, 93, 231, 0.2), rgba(123, 93, 231, 0.42));
    color: var(--accent-strong);
    font-weight: 700;
}

.profile-chip--header {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.account-menu {
    position: relative;
    flex-shrink: 0;
}

.account-menu__trigger {
    cursor: pointer;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.account-menu__trigger:hover,
.account-menu__trigger[aria-expanded="true"] {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft);
}

.account-menu__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 190px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid rgba(123, 93, 231, 0.12);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-soft);
    z-index: 20;
}

.account-menu__form {
    margin: 0;
}

.account-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--text);
}

.account-menu__item:hover {
    background: rgba(123, 93, 231, 0.08);
}

.account-menu__item--button {
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.profile-chip--header p {
    margin: 0;
    line-height: 1.3;
}

.profile-chip--header p:first-child {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.profile-chip--header p:last-child {
    font-size: 0.75rem;
    color: var(--muted);
}

.sidebar__nav,
.sidebar__footer,
.activity-list,
.settings-card__body,
.login-form,
.modal__form,
.inventory-points,
.trend-visual__axis,
.trend-visual__labels {
    display: grid;
    gap: 10px;
}

.sidebar__footer {
    margin-top: auto;
}

.nav-link,
.mobile-nav__link {
    padding: 14px 16px;
    border-radius: 18px;
    color: var(--muted-strong);
    transition: 160ms ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-nav__link:hover,
.mobile-nav__link.is-active,
.nav-link--button:hover {
    background: rgba(123, 93, 231, 0.12);
    color: var(--accent-strong);
}

.nav-link--button {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.content-shell {
    padding: 28px;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.content-shell::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    display: none;
}

.page-hero {
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.page-hero h2 {
    font-size: clamp(2rem, 2.4vw, 2.4rem);
}

.page-hero__eyebrow {
    margin-bottom: 8px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.page-hero__description {
    max-width: 620px;
    font-size: 0.97rem;
}

.page-hero__actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.toolbar-card,
.panel-card,
.stat-pill,
.trend-card,
.balance-card,
.login-card,
.settings-card,
.inventory-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.toolbar-card {
    margin-bottom: 18px;
    padding: 18px;
}

.toolbar-card__form {
    justify-content: space-between;
    flex-wrap: wrap;
}

.toolbar-card label,
.login-form label,
.modal__form label,
.settings-form label {
    display: grid;
    gap: 8px;
}

.toolbar-card input,
.login-form input,
.modal__form input,
.modal__form select,
.modal__form textarea,
.settings-form input,
.settings-form select,
.settings-form textarea {
    min-height: 48px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(123, 93, 231, 0.12);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
}

.modal__form textarea,
.settings-form textarea {
    min-height: 140px;
    padding: 14px;
    resize: vertical;
}

.toolbar-card input:focus,
.login-form input:focus,
.modal__form input:focus,
.modal__form select:focus,
.modal__form textarea:focus,
.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
    outline: 2px solid rgba(123, 93, 231, 0.18);
    border-color: rgba(123, 93, 231, 0.24);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 16px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--primary {
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    color: #fff;
    box-shadow: 0 16px 34px rgba(123, 93, 231, 0.22);
}

.button--secondary,
.button--soft,
.button--ghost,
.button--chip {
    background: rgba(255, 255, 255, 0.78);
    border-color: var(--border);
    color: var(--text);
}

.button--soft {
    background: rgba(123, 93, 231, 0.08);
    color: var(--accent-strong);
}

.button--ghost,
.button--chip {
    min-height: 40px;
    color: var(--muted-strong);
}

.button--full {
    width: 100%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-grid--bottom {
    align-items: start;
}

.dashboard-grid--product-stats {
    grid-template-columns: 1fr;
    margin-bottom: 18px;
}

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

.balance-card {
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(123, 93, 231, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 238, 251, 0.92));
}

.balance-card--profit {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 244, 255, 0.92));
}

.balance-card--profit .balance-card__label,
.balance-card--profit .balance-card__metrics span,
.balance-card--profit .balance-card__progress span {
    color: #1d4ed8;
}

.balance-card--profit .balance-card__progress-bar {
    background: rgba(37, 99, 235, 0.16);
}

.balance-card--profit .balance-card__progress-bar span {
    background: linear-gradient(90deg, #2563eb, #7fb5ff);
}

.balance-card--interactive {
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.balance-card--interactive:hover,
.balance-card--interactive:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    outline: none;
}

.balance-card strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(2rem, 3vw, 2.5rem);
}

.balance-card__metrics {
    justify-content: space-between;
    margin-top: 28px;
}

.balance-card__metrics div,
.balance-card__progress {
    width: 100%;
}

.balance-card__metrics span,
.balance-card__progress span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.balance-card__metrics strong,
.balance-card__progress strong {
    margin-top: 8px;
    font-size: 1rem;
    letter-spacing: normal;
}

.balance-card__progress {
    margin-top: 24px;
}

.balance-card__hint {
    display: inline-flex;
    margin-top: 18px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(123, 93, 231, 0.08);
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 600;
}

.balance-card__progress-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(123, 93, 231, 0.14);
    overflow: hidden;
    margin-bottom: 10px;
}

.balance-card__progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #c6b7ff);
}

.trend-card,
.panel-card {
    padding: 22px;
}

.product-stats-card,
.outstanding-card {
    padding: 24px;
}

.section-header {
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-header--plain {
    padding: 0;
}

.section-header h3 {
    margin: 0;
    font-size: 1.04rem;
    letter-spacing: -0.03em;
}

.section-link {
    color: var(--accent-strong);
    font-size: 0.9rem;
}

.trend-visual__canvas-wrap {
    position: relative;
    width: 100%;
    height: 220px;
}

.legend-row {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--muted);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-dot--accent {
    background: rgba(123, 93, 231, 0.85);
}

.legend-dot--muted {
    background: rgba(123, 93, 231, 0.2);
}

.legend-dot--revenue {
    background: rgba(37, 99, 235, 0.85);
}

.legend-dot--expense {
    background: rgba(220, 38, 38, 0.72);
}

.product-stats-inner {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    margin-top: 16px;
}

.product-stats-chart-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto;
}

.product-stats-total {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.product-stats-total strong {
    font-size: 1rem;
    letter-spacing: -0.03em;
    color: var(--text);
}

.product-stats-total span {
    font-size: 0.75rem;
    color: var(--muted);
}

.product-stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.product-stats-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
}

.product-stats-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}

.product-stats-name {
    flex: 1;
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-stats-units {
    color: var(--muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.product-stats-amount {
    font-weight: 700;
    color: var(--text);
    flex-shrink: 0;
}

.outstanding-total {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 14px 0;
}

.outstanding-total strong {
    font-size: 1.8rem;
    letter-spacing: -0.04em;
    color: var(--text);
}

.outstanding-total span {
    color: var(--muted);
    font-size: 0.85rem;
}

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

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

.outstanding-item__info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
}

.outstanding-item__info span {
    font-size: 0.78rem;
    color: var(--muted);
}

.outstanding-item__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.outstanding-item__due {
    font-size: 0.9rem;
    color: var(--text);
    min-width: 52px;
    text-align: right;
}

.stat-pill--warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.activity-list {
    gap: 14px;
}

.activity-item {
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid rgba(123, 93, 231, 0.08);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-item__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 7px;
}

.activity-item__dot--positive {
    background: var(--success);
}

.activity-item__dot--negative {
    background: var(--danger);
}

.activity-item__body {
    flex: 1;
}

.activity-item__body strong {
    display: block;
    margin-bottom: 4px;
}

.activity-item__amount {
    font-weight: 700;
    white-space: nowrap;
}

.activity-item__amount--positive {
    color: var(--success);
}

.activity-item__amount--negative {
    color: var(--danger);
}

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

.tile-grid--tight {
    margin-top: 18px;
}

.mini-tile {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(123, 93, 231, 0.1);
}

.mini-tile strong {
    display: block;
    margin-top: 8px;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-pill {
    padding: 18px 20px;
}

.stat-pill--sales {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), rgba(219, 234, 254, 0.72));
    border-color: rgba(59, 130, 246, 0.14);
}

.stat-pill--expense {
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.12), rgba(254, 226, 226, 0.72));
    border-color: rgba(220, 38, 38, 0.14);
}

.stat-pill--sales strong,
.stat-pill--sales span {
    color: #1d4ed8;
}

.stat-pill--expense strong,
.stat-pill--expense span {
    color: #b91c1c;
}

.stat-pill strong {
    display: block;
    margin-top: 8px;
    font-size: 1.3rem;
}

.panel-card--table {
    padding-bottom: 10px;
}

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

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

.data-table th,
.data-table td {
    padding: 16px 10px;
    border-bottom: 1px solid rgba(123, 93, 231, 0.08);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.data-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.align-right {
    text-align: right !important;
}

.align-center {
    text-align: center !important;
}

.muted-cell {
    color: var(--muted);
}

.product-cell {
    justify-content: flex-start;
}

.product-cell img,
.product-cell__fallback {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    object-fit: cover;
}

.product-cell__fallback,
.product-preview__icon,
.product-preview__icon img {
    display: grid;
    place-items: center;
    background: rgba(123, 93, 231, 0.08);
    border: 1px solid rgba(123, 93, 231, 0.1);
    color: var(--accent-strong);
}

.status,
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.76rem;
}

.pill {
    background: rgba(123, 93, 231, 0.08);
    color: var(--accent-strong);
}

.status-success {
    background: var(--success-soft);
    color: var(--success);
}

.status-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-info {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.progress {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(123, 93, 231, 0.1);
    overflow: hidden;
}

.progress__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #b89fff);
}

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

.table-action-form {
    margin: 0;
}

.table-action {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(123, 93, 231, 0.12);
    background: rgba(255, 255, 255, 0.82);
}

.table-action--danger {
    color: var(--danger);
}

.flash {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
}

.flash--success {
    background: var(--success-soft);
    color: var(--success);
}

.flash--error {
    background: var(--danger-soft);
    color: var(--danger);
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 40;
}

.modal.is-open {
    display: block;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(40, 25, 72, 0.34);
    backdrop-filter: blur(12px);
}

.modal__panel {
    position: relative;
    width: min(910px, calc(100vw - 26px));
    max-height: calc(100vh - 28px);
    margin: 14px auto;
    overflow: auto;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.modal__panel--report {
    width: min(1160px, calc(100vw - 26px));
}

.modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 28px;
    border-bottom: 1px solid rgba(123, 93, 231, 0.08);
}

.modal__header h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
}

.modal__close,
.modal__close-link {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: rgba(123, 93, 231, 0.08);
    color: var(--muted-strong);
    cursor: pointer;
}

.modal__form {
    padding: 28px;
    display: grid;
    gap: 22px;
}

.product-preview {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(123, 93, 231, 0.05);
}

.product-preview__icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(123, 93, 231, 0.1);
    display: grid;
    place-items: center;
    color: var(--accent);
}

.product-preview__icon--upload {
    cursor: pointer;
}

.visually-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.modal__form .button--full {
    margin-top: 6px;
}

.report-modal__body {
    display: grid;
    gap: 22px;
    padding: 28px;
}

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

.report-summary-card,
.report-card {
    padding: 22px;
    border-radius: 22px;
    background: rgba(123, 93, 231, 0.05);
    border: 1px solid rgba(123, 93, 231, 0.08);
}

.report-summary-card span,
.report-summary-card small {
    display: block;
}

.report-summary-card strong {
    margin: 8px 0 6px;
    font-size: 1.5rem;
    color: var(--text);
}

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

.report-table th,
.report-table td {
    white-space: nowrap;
}

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

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

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

.calculated-field,
.input-readonly {
    display: grid;
    gap: 8px;
    align-content: center;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(123, 93, 231, 0.05);
    border: 1px solid rgba(123, 93, 231, 0.1);
}

.empty-state {
    padding: 30px 20px;
    text-align: center;
}

.empty-state--compact {
    padding: 18px 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-scene {
    display: grid;
    grid-template-columns: 1.1fr 460px;
    gap: 24px;
    width: min(1200px, 100%);
    align-items: stretch;
}

.login-showcase,
.login-card {
    padding: 34px;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.login-showcase {
    display: grid;
    align-content: space-between;
    min-height: 620px;
}

.login-showcase__badge {
    width: fit-content;
    padding: 10px 18px 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(123, 93, 231, 0.1);
    gap: 16px;
}

.login-showcase__logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
}

.login-showcase h1 {
    max-width: 540px;
    font-size: clamp(2.4rem, 4vw, 4rem);
    line-height: 0.96;
}

.login-showcase__panel {
    position: relative;
    min-height: 260px;
    padding: 20px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(123, 93, 231, 0.12), rgba(255, 255, 255, 0.62));
    overflow: hidden;
}

.showcase-card {
    position: relative;
    z-index: 2;
    width: min(320px, 100%);
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
}

.showcase-card strong {
    display: block;
    margin-top: 10px;
    font-size: 2rem;
}

.showcase-orb {
    position: absolute;
    right: -44px;
    bottom: -34px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.7), rgba(123, 93, 231, 0.46));
    filter: blur(2px);
}

.login-card {
    display: grid;
    align-content: center;
}

.login-card__header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 18px;
}

.inventory-showcase,
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-grid {
    grid-template-columns: minmax(340px, 0.95fr) minmax(460px, 1.15fr);
    gap: 22px;
}

.inventory-card {
    padding: 28px;
}

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

.pagination-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.pagination-row--compact {
    margin-top: 14px;
}

.pagination-row__status {
    font-size: 0.88rem;
    color: var(--muted);
}

.button.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.inventory-card--empty {
    grid-column: 1 / -1;
}

.inventory-product-card {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 18px;
    padding: 22px;
    border-radius: 26px;
    border: 1px solid rgba(123, 93, 231, 0.1);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
}

.inventory-product-card__media {
    width: 110px;
    height: 110px;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(123, 93, 231, 0.08);
    border: 1px solid rgba(123, 93, 231, 0.1);
    display: grid;
    place-items: center;
    color: var(--accent-strong);
}

.inventory-product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventory-product-card__body {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.inventory-product-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.inventory-product-card__top h3 {
    margin: 0 0 6px;
    font-size: 1.02rem;
    color: var(--text);
}

.inventory-product-card__top p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.inventory-product-card__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.inventory-product-card__stats div {
    padding: 14px;
    border-radius: 18px;
    background: rgba(123, 93, 231, 0.05);
}

.inventory-product-card__stats span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
}

.inventory-product-card__stats strong {
    color: var(--text);
    font-size: 0.95rem;
}

.inventory-product-card__actions {
    display: flex;
    justify-content: flex-end;
}

.inventory-card__badge {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(123, 93, 231, 0.1);
    color: var(--accent-strong);
    font-size: 0.8rem;
    margin-bottom: 14px;
}

.inventory-card--muted {
    background: rgba(255, 255, 255, 0.72);
}

.settings-card {
    overflow: hidden;
    min-height: 100%;
}

.settings-card .section-header {
    margin-bottom: 0;
    padding: 24px 26px 0;
}

.settings-card .section-header h3 {
    line-height: 1.2;
}

.settings-form {
    padding: 24px 26px;
}

.settings-card__body {
    padding: 0 26px 26px;
}

.mobile-nav {
    position: fixed;
    inset: auto 12px 12px;
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    z-index: 30;
}

.mobile-nav__link {
    flex-direction: column;
    justify-content: center;
    min-height: 68px;
    gap: 6px;
    font-size: 0.76rem;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

@media (max-width: 1180px) {
    .dashboard-grid,
    .inventory-showcase,
    .settings-grid,
    .login-scene {
        grid-template-columns: 1fr;
    }

    .dashboard-grid--three {
        grid-template-columns: 1fr;
    }

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

    .inventory-grid,
    .inventory-product-card__stats {
        grid-template-columns: 1fr;
    }

    .stats-strip,
    .form-grid--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .site-bg {
        padding: 0;
    }

    .app-frame {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        display: none;
    }

    .content-shell {
        padding: 18px 18px 110px;
        overflow-y: visible;
    }

    .mobile-nav {
        display: grid;
    }
}

@media (max-width: 720px) {
    .page-hero,
    .toolbar-card__form,
    .toolbar-card__actions,
    .balance-card__metrics,
    .section-header,
    .product-cell {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-hero__actions,
    .toolbar-card__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .button {
        width: 100%;
    }

    .stats-strip,
    .tile-grid,
    .inventory-grid,
    .form-grid--two,
    .form-grid--three,
    .form-grid--four {
        grid-template-columns: 1fr;
    }

    .report-summary-grid,
    .report-section-grid {
        grid-template-columns: 1fr;
    }

    .product-stats-inner {
        grid-template-columns: 1fr;
    }

    .inventory-product-card {
        grid-template-columns: 1fr;
    }

    .inventory-product-card__media {
        width: 100%;
        max-width: 180px;
        height: 180px;
    }

    .inventory-product-card__top {
        flex-direction: column;
    }

    .outstanding-item,
    .outstanding-item__right {
        align-items: flex-start;
        flex-direction: column;
    }

    .outstanding-item__right {
        width: 100%;
    }

    .outstanding-item__due {
        min-width: 0;
        text-align: left;
    }

    .modal__panel {
        width: calc(100vw - 12px);
        margin: 6px auto;
    }

    .login-showcase,
    .login-card {
        padding: 24px;
    }
}

.savings-tip {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: rgba(123, 93, 231, 0.06);
    border: 1px solid rgba(123, 93, 231, 0.18);
}

.savings-tip__icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(123, 93, 231, 0.12);
    color: var(--accent);
    display: grid;
    place-items: center;
}

.savings-tip p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
}

.savings-tip p strong {
    color: var(--accent-strong);
}

.goal-list {
    display: grid;
    gap: 18px;
    margin-top: 4px;
}

.goal-item__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.goal-item__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.goal-item__name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    min-width: 0;
}

.goal-item__amounts {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
}

.goal-item__amounts strong {
    color: var(--text);
    font-weight: 700;
}

.goal-item__pct {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: right;
    margin-top: 4px;
}

.goal-list__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--muted);
}

.goal-list__footer strong {
    color: var(--text);
    font-weight: 700;
}

.color-picker-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.color-swatch-label {
    position: relative;
    cursor: pointer;
}

.color-swatch-label input[type=radio] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-swatch {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 120ms ease, transform 120ms ease;
}

.color-swatch-label input[type=radio]:checked + .color-swatch {
    border-color: var(--text);
    transform: scale(1.15);
}

.activity-item__amount--income {
    color: var(--success);
    font-weight: 700;
}

.activity-item__amount--expense {
    color: var(--danger);
    font-weight: 700;
}

@media (max-width: 720px) {
    .goal-item__header {
        flex-wrap: wrap;
    }

    .savings-tip {
        align-items: flex-start;
    }
}

.customers-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 18px;
}

.customers-list-card,
.customer-detail-card {
    padding: 24px;
}

.customers-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.customer-list-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(123, 93, 231, 0.1);
    background: rgba(123, 93, 231, 0.04);
    color: inherit;
    text-decoration: none;
}

.customer-list-item.is-active {
    border-color: rgba(123, 93, 231, 0.26);
    background: rgba(123, 93, 231, 0.1);
}

.customer-list-item__avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(123, 93, 231, 0.24), rgba(123, 93, 231, 0.1));
    color: var(--accent-strong);
    font-weight: 700;
}

.customer-list-item__body,
.customer-list-item__meta {
    min-width: 0;
}

.customer-list-item__body strong,
.customer-list-item__meta strong {
    display: block;
    color: var(--text);
}

.customer-list-item__body p,
.customer-list-item__meta span {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.customer-list-item__meta {
    text-align: right;
}

.customer-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.customer-profile-card {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(123, 93, 231, 0.05);
    border: 1px solid rgba(123, 93, 231, 0.08);
}

.customer-profile-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.78rem;
}

.customer-profile-card strong {
    color: var(--text);
    font-size: 0.94rem;
    line-height: 1.4;
}

.customer-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.customer-detail-card__history-header {
    margin-top: 8px;
}

.button--tiny {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.76rem;
    gap: 8px;
}

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

@media (max-width: 720px) {
    .customer-profile-grid,
    .customer-summary-strip {
        grid-template-columns: 1fr;
    }

    .customer-list-item {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .customer-list-item__meta {
        grid-column: 2;
        text-align: left;
    }
}

.profit-pos {
    color: var(--success);
    font-weight: 700;
}

.profit-neg {
    color: var(--danger);
    font-weight: 700;
}

.profit-warn {
    color: var(--warning);
    font-weight: 600;
}

.margin-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.margin-badge--good {
    background: var(--success-soft);
    color: var(--success);
}

.margin-badge--ok {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.margin-badge--low {
    background: var(--danger-soft);
    color: var(--danger);
}

.profit-product-link {
    font-weight: 600;
    color: var(--accent-strong);
    text-decoration: none;
}

.profit-product-link:hover {
    text-decoration: underline;
}

.is-selected-row td {
    background: rgba(123, 93, 231, 0.05);
}

.profit-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 14px 0 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.profit-summary-item {
    flex: 1 1 120px;
    padding: 14px 18px;
    border-right: 1px solid var(--border);
}

.profit-summary-item:last-child {
    border-right: none;
}

.profit-summary-item span {
    display: block;
    font-size: 0.76rem;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.profit-summary-item strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.text-right {
    text-align: right !important;
}

@media (max-width: 900px) {
    .profit-summary-strip {
        flex-direction: column;
    }

    .profit-summary-item {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .profit-summary-item:last-child {
        border-bottom: none;
    }
}
