:root {
    --purple: #a64d79;
    --orange: #e69138;
    --ready-red: #cc3f4b;
    --surface-raised: #1a1a20;
}

body {
    overflow: hidden;
}

.app-sidebar {
    overflow-y: auto;
}

.app-sidebar__footer form {
    margin: 0;
}

.sidebar-logout {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.app-content {
    scroll-behavior: smooth;
}

.login-subtitle {
    margin: -12px 0 24px;
    color: #9a9ab0;
    font-size: 12px;
    text-align: center;
}

.install-card {
    width: min(720px, calc(100vw - 28px));
    max-height: calc(100vh - 32px);
    margin: auto;
    overflow-y: auto;
}

.install-card h1,
.install-card > p {
    text-align: center;
}

.form-divider {
    width: 100%;
    height: 1px;
    margin: 5px 0;
    border: 0;
    background: var(--gold-border);
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.page-actions__right,
.form-actions,
.filter-actions,
.sticky-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.division-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--gold-soft);
    border-radius: 12px;
    background: #111115;
}

.division-tabs a {
    padding: 8px 13px;
    border-radius: 8px;
    color: #a7a7b8;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.division-tabs a:hover,
.division-tabs a.is-active {
    background: var(--gold-soft);
    color: var(--gold-light);
}

.dashboard-metrics a {
    color: inherit;
    text-decoration: none;
}

.dashboard-focus {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.dashboard-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    flex: 1;
    max-width: 1250px;
    gap: 8px;
}

.dashboard-summary__item {
    display: flex;
    min-width: 0;
    min-height: 64px;
    padding: 10px 13px;
    border: 1px solid var(--gold-soft);
    border-radius: 12px;
    background: var(--surface-raised);
    flex-direction: column;
    justify-content: center;
}

.dashboard-summary__item span {
    color: #9a9ab0;
    font-size: 10px;
}

.dashboard-summary__item strong {
    margin-top: 4px;
    color: var(--gold-light);
    font-size: 18px;
}

.dashboard-summary__item small {
    margin-top: 2px;
    color: #9292a3;
    font-size: 9px;
}

.dashboard-summary__item--attention {
    border-left: 4px solid var(--orange);
}

.dashboard-summary__item--attention strong {
    color: #fff;
}

.dashboard-summary__item--unpaid {
    border-left: 4px solid var(--red);
}

.dashboard-summary__item--unpaid strong {
    color: #ff8c82;
}

.dashboard-summary__item--net {
    border-left: 4px solid var(--green);
}

.dashboard-summary__item--net strong {
    color: #77dda1;
}

.dashboard-worklist {
    margin-bottom: 0;
}

.dashboard-work-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.dashboard-work-area > * {
    min-width: 0;
}

.production-quick-panel {
    position: static;
    max-height: none;
    overflow: visible;
}

.production-quick-panel__count {
    display: grid;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    place-items: center;
    border-radius: 99px;
    background: rgba(230, 145, 56, .17);
    color: #ffc077;
    font-size: 12px;
}

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

.production-division {
    display: grid;
    gap: 8px;
}

.production-division[hidden],
.settlement-division[hidden] {
    display: none !important;
}

.production-division + .production-division {
    margin-top: 5px;
    padding-top: 12px;
    border-top: 2px solid rgba(212, 175, 55, .26);
}

.production-division > h3,
.settlement-division > h4 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--text);
    font-size: 11px;
}

.production-division > h3 span,
.settlement-division > h4 span {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 7px;
    background: rgba(212, 175, 55, .18);
    color: var(--gold-light);
    font-size: 10px;
}

.production-quick-panel__body {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(290px, 1fr);
    align-items: start;
    gap: 18px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.production-product-group[hidden],
.production-quick-item[hidden],
.production-quick-list .empty-state[hidden] {
    display: none !important;
}

.production-product-group {
    overflow: hidden;
    border: 1px solid rgba(230, 145, 56, .28);
    border-radius: 11px;
    background: rgba(230, 145, 56, .06);
}

.production-product-group__header {
    padding: 9px 10px;
    background: rgba(230, 145, 56, .09);
}

.production-product-group__header strong {
    display: block;
    color: var(--gold-light);
    font-size: 12px;
    line-height: 1.35;
}

.production-product-orders {
    border-top: 1px solid rgba(230, 145, 56, .18);
}

.production-quick-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
}

.production-quick-item + .production-quick-item {
    border-top: 1px solid rgba(230, 145, 56, .14);
}

.production-quick-item > span,
.production-quick-item strong,
.production-quick-item small {
    display: block;
    min-width: 0;
}

.production-quick-item strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-quick-item small {
    margin-top: 2px;
    overflow: hidden;
    color: #9292a3;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-quick-item > em {
    color: var(--gold);
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.production-settlement {
    margin-top: 0;
    padding-top: 0;
    padding-left: 18px;
    border-top: 0;
    border-left: 1px solid rgba(230, 184, 0, .2);
}

.production-settlement__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.production-settlement__header h3,
.production-settlement__header p {
    margin: 0;
}

.production-settlement__header h3 {
    color: var(--text);
    font-size: 13px;
}

.production-settlement__header p {
    margin-top: 2px;
    color: #9292a3;
    font-size: 9px;
}

.production-settlement__header > strong {
    display: grid;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    place-items: center;
    border-radius: 99px;
    background: rgba(46, 204, 113, .14);
    color: #78dda0;
    font-size: 11px;
}

.settlement-list {
    display: grid;
    gap: 7px;
}

.settlement-division {
    display: grid;
    gap: 7px;
}

.settlement-division + .settlement-division {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(46, 204, 113, .24);
}

.settlement-item {
    display: grid;
    gap: 8px;
    padding: 9px;
    border: 1px solid rgba(46, 204, 113, .24);
    border-radius: 10px;
    background: rgba(46, 204, 113, .06);
}

.settlement-item[hidden],
.settlement-list .empty-state[hidden] {
    display: none !important;
}

.settlement-item__info strong,
.settlement-item__info small {
    display: block;
}

.settlement-item__info strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settlement-item__info small {
    margin-top: 2px;
    overflow: hidden;
    color: #9292a3;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settlement-item__checks {
    display: grid;
    grid-template-columns: 72px minmax(105px, 1fr);
    gap: 6px;
}

.item-finance-form {
    margin: 0;
}

.item-finance-toggle {
    display: flex;
    width: 100%;
    min-height: 28px;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 7px;
    border: 1px solid #373742;
    border-radius: 8px;
    background: #111115;
    color: #aaaab8;
    font: inherit;
    font-size: 9px;
    cursor: pointer;
}

.item-finance-toggle b {
    font-size: 11px;
}

.item-finance-toggle.is-checked {
    border-color: rgba(46, 204, 113, .55);
    background: rgba(46, 204, 113, .15);
    color: #8be5ae;
}

.dashboard-month-group + .dashboard-month-group {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #292930;
}

.dashboard-division-group + .dashboard-division-group {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 3px solid rgba(212, 175, 55, .35);
}

.dashboard-division-group__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(212, 175, 55, .28);
    border-radius: 12px;
    background: rgba(212, 175, 55, .08);
}

.dashboard-division-group__header > span {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    background: rgba(212, 175, 55, .2);
    color: var(--gold-light);
    font-weight: 850;
}

.dashboard-division-group__header h3,
.dashboard-division-group__header small {
    display: block;
    margin: 0;
}

.dashboard-division-group__header h3 {
    font-size: 15px;
}

.dashboard-division-group__header small {
    margin-top: 2px;
    color: #9292a3;
    font-size: 10px;
}

.dashboard-month-group > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 2px 9px;
}

.dashboard-month-group > header div,
.dashboard-month-group > header strong,
.dashboard-month-group > header small {
    display: block;
}

.dashboard-month-group > header strong {
    font-size: 14px;
}

.dashboard-month-group > header small {
    margin-top: 2px;
    color: #9292a3;
    font-size: 10px;
}

.dashboard-month-group > header > span {
    color: var(--gold-light);
    font-size: 13px;
    font-weight: 750;
    text-align: right;
}

.dashboard-month-group > header > span b,
.dashboard-month-group > header > span small {
    display: block;
}

.dashboard-month-group > header > span small {
    margin-top: 2px;
    color: #9292a3;
    font-size: 9px;
    font-weight: 500;
}

.dashboard-more > summary,
.order-form-more > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.dashboard-more > summary::-webkit-details-marker,
.order-form-more > summary::-webkit-details-marker,
.simple-details > summary::-webkit-details-marker {
    display: none;
}

.dashboard-more > summary strong,
.dashboard-more > summary small,
.order-form-more > summary strong,
.order-form-more > summary small {
    display: block;
}

.dashboard-more > summary small,
.order-form-more > summary small {
    margin-top: 3px;
    color: #9292a3;
    font-size: 11px;
}

.dashboard-more > summary i {
    color: var(--gold);
    font-style: normal;
    transition: transform var(--transition);
}

.dashboard-more[open] > summary i {
    transform: rotate(180deg);
}

.dashboard-more__content {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #292930;
}

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

.metric-card::after {
    position: absolute;
    right: -28px;
    bottom: -42px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(212, 175, 55, .08);
    content: "";
}

.metric-card--production {
    border-left: 4px solid var(--orange);
}

.metric-card--ready {
    border-left: 4px solid var(--ready-red);
}

.metric-card--shipped {
    border-left: 4px solid var(--blue);
}

.metric-card--profit {
    border-left: 4px solid var(--green);
}

.metric-card--revenue {
    border-left: 4px solid var(--blue);
}

.metric-card--cost {
    border-left: 4px solid var(--red);
}

.dashboard-operational-metrics {
    margin-top: 12px;
}

.metric-card__value {
    position: relative;
    z-index: 1;
    overflow-wrap: anywhere;
}

.division-overview {
    display: grid;
    gap: 9px;
}

.division-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border: 1px solid var(--gold-soft);
    border-radius: 12px;
    background: #111115;
    text-decoration: none;
    transition: transform var(--transition), border-color var(--transition);
}

.division-row:hover {
    border-color: var(--gold);
    transform: translateX(2px);
}

.division-row__mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 10px;
    background: var(--gold-soft);
    color: var(--gold);
    font-weight: 800;
}

.division-row strong,
.division-row small {
    display: block;
}

.division-row strong {
    font-size: 13px;
}

.division-row small {
    margin-top: 2px;
    color: #9999aa;
    font-size: 11px;
}

.division-row__arrow {
    color: var(--gold);
    font-size: 22px;
}

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

.filters-panel {
    padding: 13px 16px;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr));
    gap: 10px;
}

.filter-search {
    grid-row: span 2;
}

.filter-actions {
    margin-top: 12px;
}

.workflow-section {
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid var(--gold-soft);
    border-radius: var(--radius-lg);
    background: rgba(17, 17, 21, .76);
    box-shadow: 0 0 18px rgba(0, 0, 0, .35);
}

.workflow-section > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #2a2a33;
    background: #15151a;
}

.workflow-section > header > div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.workflow-section > header h2 {
    margin: 0;
    font-size: 15px;
}

.workflow-section > header > strong {
    display: grid;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    place-items: center;
    border-radius: 99px;
    background: #24242a;
    font-size: 12px;
}

.workflow-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 10px currentColor;
}

.workflow-section--production .workflow-dot {
    background: var(--orange);
    color: var(--orange);
}

.workflow-section--ready .workflow-dot {
    background: var(--ready-red);
    color: var(--ready-red);
}

.workflow-section--shipped .workflow-dot {
    background: var(--blue);
    color: var(--blue);
}

.workflow-section .table-wrap {
    border: 0;
    border-radius: 0;
}

.orders-table td:first-child strong,
.orders-table td:first-child small,
.orders-table td:nth-child(2) strong,
.orders-table td:nth-child(2) small,
.orders-table td:nth-child(3) strong,
.orders-table td:nth-child(3) small,
.data-table td > small {
    display: block;
}

.orders-table td small,
.data-table td > small {
    margin-top: 2px;
    color: #9191a3;
    font-size: 10px;
}

.money-cell {
    font-weight: 700;
    color: var(--gold-light);
}

.order-work-value,
.order-work-value strong,
.order-work-value small {
    display: block;
}

.order-work-value strong {
    color: var(--gold-light);
    white-space: nowrap;
}

.order-work-value small {
    margin-top: 2px;
    color: #a4a4b3;
    font-size: 9px;
    font-weight: 550;
    white-space: nowrap;
}

.order-work-value__full {
    opacity: .78;
}

/* Całe zamówienie dziedziczy delikatne podświetlenie swojego statusu. */
body.dark .orders-table .order-row--new td {
    background: rgba(166, 77, 121, .24) !important;
}

body.dark .orders-table .order-row--to_production td {
    background: rgba(212, 175, 55, .22) !important;
}

body.dark .orders-table .order-row--in_production td {
    background: rgba(230, 126, 34, .24) !important;
}

body.dark .orders-table .order-row--ready td {
    background: rgba(231, 76, 60, .24) !important;
}

body.dark .orders-table .order-row--shipped td {
    background: rgba(59, 130, 246, .23) !important;
}

body.dark .orders-table .order-row--completed td {
    background: rgba(46, 204, 113, .21) !important;
}

body.dark .orders-table .order-row--cancelled td {
    background: rgba(150, 150, 160, .10) !important;
}

body.light .orders-table .order-row--new td {
    background: #f2d5e5 !important;
}

body.light .orders-table .order-row--to_production td {
    background: #fff0bd !important;
}

body.light .orders-table .order-row--in_production td {
    background: #ffe0c2 !important;
}

body.light .orders-table .order-row--ready td {
    background: #fbd5d0 !important;
}

body.light .orders-table .order-row--shipped td {
    background: #d7e7ff !important;
}

body.light .orders-table .order-row--completed td {
    background: #d3f0de !important;
}

body.light .orders-table .order-row--cancelled td {
    background: #efeff2 !important;
}

body.light .orders-table .order-row td,
body.light .orders-table .order-row td strong {
    color: #202126 !important;
}

body.light .orders-table .order-row td small,
body.light .orders-table .order-row .order-items-details summary small,
body.light .orders-table .order-row .order-product-single small {
    color: #656872 !important;
}

body.light .orders-table .order-row:hover td {
    filter: brightness(.975);
}

.orders-table .order-row td:first-child {
    border-left: 6px solid transparent;
}

.orders-table .order-row--new td:first-child { border-left-color: #a64d79; }
.orders-table .order-row--to_production td:first-child { border-left-color: #d4af37; }
.orders-table .order-row--in_production td:first-child { border-left-color: #e67e22; }
.orders-table .order-row--ready td:first-child { border-left-color: #e74c3c; }
.orders-table .order-row--shipped td:first-child { border-left-color: #3b82f6; }
.orders-table .order-row--completed td:first-child { border-left-color: #2ecc71; }
.orders-table .order-row--cancelled td:first-child { border-left-color: #9696a0; }

.order-products-cell {
    min-width: 245px;
    white-space: normal !important;
}

.order-product-single strong,
.order-product-single small {
    display: block;
}

.order-product-single {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.order-product-single > span {
    min-width: 0;
}

.order-product-single small {
    margin-top: 2px;
    color: #9191a3;
    font-size: 10px;
}

.order-items-details {
    min-width: 230px;
}

.order-items-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    list-style: none;
}

.order-items-details summary::-webkit-details-marker {
    display: none;
}

.order-items-details summary span,
.order-items-details summary strong,
.order-items-details summary small {
    display: block;
}

.order-items-details summary small {
    margin-top: 2px;
    color: #9191a3;
    font-size: 10px;
}

.order-items-details summary i {
    color: var(--gold);
    font-size: 16px;
    transition: transform var(--transition);
}

.order-items-details[open] summary i {
    transform: rotate(180deg);
}

.order-items-details__list {
    display: grid;
    gap: 6px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid #2a2a33;
}

.order-items-details__row {
    display: grid;
    grid-template-columns: 30px minmax(120px, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 7px;
    border-radius: 8px;
    background: rgba(212, 175, 55, .06);
}

.order-items-details__row span strong,
.order-items-details__row span small {
    display: block;
}

.order-items-details__row span small {
    margin-top: 1px;
    color: #9191a3;
    font-size: 9px;
}

.order-items-details__quantity {
    color: var(--gold-light);
    font-size: 12px;
    font-weight: 800;
}

.order-items-details__price {
    color: var(--gold-light);
    font-size: 10px;
    white-space: nowrap;
}

.order-items-details__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.item-toggle-form {
    flex: 0 0 auto;
    margin: 0;
}

.item-completion-toggle {
    display: grid;
    width: 27px;
    height: 27px;
    padding: 0;
    place-items: center;
    border: 1px solid #44444f;
    border-radius: 8px;
    background: #17171c;
    color: #a0a0ad;
    font-size: 15px;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}

.item-completion-toggle:hover {
    border-color: var(--green);
    transform: translateY(-1px);
}

.item-completion-toggle.is-checked {
    border-color: rgba(46, 204, 113, .62);
    background: rgba(46, 204, 113, .17);
    color: #8be5ae;
}

.order-product-single.is-completed > span,
.order-items-details__row.is-completed > span:not(.order-items-details__actions) {
    opacity: .58;
    text-decoration: line-through;
}

.inline-save-notice {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .16s ease, transform .16s ease;
}

.inline-save-notice.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.inline-save-notice.is-success { background: #197746; }
.inline-save-notice.is-error { background: #b42318; }

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.status--new {
    border-color: rgba(211, 103, 160, .86);
    background: rgba(166, 77, 121, .32);
    color: #eba9cc;
}

.status--production {
    border-color: rgba(240, 161, 75, .88);
    background: rgba(230, 145, 56, .31);
    color: #ffc077;
}

.status--ready {
    border-color: rgba(241, 104, 90, .9);
    background: rgba(231, 76, 60, .31);
    color: #ffaaa1;
}

.status--shipped {
    border-color: rgba(91, 151, 248, .88);
    background: rgba(59, 130, 246, .3);
    color: #a9c8ff;
}

.status--completed {
    border-color: rgba(73, 218, 135, .86);
    background: rgba(46, 204, 113, .29);
    color: #8be5ae;
}

.status--cancelled {
    border-color: rgba(150, 150, 160, .45);
    background: rgba(150, 150, 160, .15);
    color: #bdbdca;
}

.quick-toggle-form,
.status-action-form {
    margin: 0;
}

.quick-toggle {
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    border: 1px solid #34343d;
    border-radius: 8px;
    background: #111115;
    color: #6f6f7d;
    cursor: pointer;
}

.quick-toggle:hover {
    border-color: var(--gold);
}

.quick-toggle.is-checked {
    border-color: rgba(46, 204, 113, .55);
    background: rgba(46, 204, 113, .16);
    color: #8be5ae;
}

.quick-toggle.is-partial {
    border-color: rgba(224, 182, 46, .72);
    background: rgba(224, 182, 46, .14);
    color: #f0cb55;
}

.status-action-form select {
    max-width: 118px;
    min-height: 30px;
    padding: 4px 6px;
    border: 1px solid #34343d;
    border-radius: 8px;
    background: #111115;
    color: #eee;
    font-size: 10px;
}

.status-action-form--inline select {
    width: 116px;
    max-width: none;
}

.order-row--new .status-action-form select {
    border-color: rgba(213, 112, 166, .88);
    background: rgba(166, 77, 121, .3);
    color: #ffd3ea;
}

.order-row--to_production .status-action-form select {
    border-color: rgba(224, 182, 46, .9);
    background: rgba(212, 175, 55, .3);
    color: #ffe69a;
}

.order-row--in_production .status-action-form select {
    border-color: rgba(240, 145, 66, .92);
    background: rgba(230, 126, 34, .32);
    color: #ffd0a8;
}

.order-row--ready .status-action-form select {
    border-color: rgba(238, 104, 90, .9);
    background: rgba(231, 76, 60, .3);
    color: #ffd0ca;
}

.order-row--shipped .status-action-form select {
    border-color: rgba(93, 153, 248, .9);
    background: rgba(59, 130, 246, .3);
    color: #d5e5ff;
}

.order-row--completed .status-action-form select {
    border-color: rgba(77, 214, 135, .88);
    background: rgba(46, 204, 113, .28);
    color: #c9f7dc;
}

.order-row--cancelled .status-action-form select {
    border-color: rgba(170, 170, 180, .7);
    background: rgba(150, 150, 160, .22);
    color: #e0e0e5;
}

.orders-table th:last-child,
.orders-table td:last-child {
    min-width: 145px;
}

.orders-table td:last-child .order-actions {
    justify-content: flex-start;
}

.order-actions {
    flex-wrap: wrap;
}

.order-actions .status-action-form {
    min-width: 132px;
    flex: 1 1 132px;
}

.order-actions .status-action-form select {
    width: 100%;
}

.orders-mobile {
    display: none;
}

.month-subgroup {
    padding: 12px;
}

.month-subgroup + .month-subgroup {
    border-top: 1px solid #2a2a33;
}

.month-subgroup h3 {
    margin: 0 0 10px;
    color: var(--gold);
    font-size: 12px;
    text-transform: uppercase;
}

.archive-filters,
.report-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 160px auto;
    align-items: end;
    gap: 10px;
}

.archive-month .section-header {
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a33;
}

.order-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 370px);
    align-items: start;
    gap: 16px;
}

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

.order-customer-panel {
    position: sticky;
    top: 0;
}

.form-grid__wide {
    grid-column: 1 / -1;
}

.order-items-editor {
    display: grid;
    gap: 12px;
}

.order-item-editor {
    padding: 13px;
    border: 1px solid var(--gold-soft);
    border-radius: 13px;
    background: #111115;
}

.order-item-editor__header,
.order-item-editor__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.order-item-editor__header {
    margin-bottom: 12px;
}

.order-item-editor__header strong,
.order-item-editor__header small {
    display: block;
}

.order-item-editor__header strong {
    color: var(--gold-light);
    font-size: 13px;
}

.order-item-editor__header small {
    margin-top: 2px;
    color: #858596;
    font-size: 10px;
}

.order-item-editor__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.order-item-editor__grid--basic {
    grid-template-columns: minmax(210px, 2fr) repeat(3, minmax(100px, 1fr));
}

.order-item-editor__catalog,
.order-item-editor__name {
    grid-column: span 2;
}

.order-item-editor__grid--basic .order-item-editor__catalog,
.order-item-editor__grid--basic .order-item-editor__name {
    grid-column: auto;
}

.order-item-editor__notes {
    grid-column: 1 / -1;
}

.order-item-editor__total {
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid #292930;
    color: #9696a6;
    font-size: 11px;
}

.order-item-editor__total strong {
    color: var(--gold-light);
    font-size: 14px;
}

.is-hidden {
    display: none !important;
}

.simple-details {
    margin-top: 12px;
}

.simple-details > summary {
    color: var(--gold-light);
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
}

.simple-details__content,
.order-form-more__content {
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid #292930;
}

.order-form-more {
    margin-top: 14px;
}

.order-form-more > summary {
    margin: -2px 0;
}

.order-form-more__content > .field {
    margin-top: 14px;
}

.order-summary-panel .order-form-summary {
    margin-top: 0;
}

.expenses-layout {
    display: grid;
    grid-template-columns: minmax(290px, 390px) minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.expense-entry-form {
    position: sticky;
    top: 0;
}

.expense-entry-form .form-actions {
    margin-top: 16px;
}

.expense-history__header {
    align-items: flex-start;
}

.expense-history__total {
    color: var(--gold-light);
    font-size: 24px;
}

.expense-month-nav {
    display: grid;
    grid-template-columns: auto minmax(140px, 190px) auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.expense-month-nav form {
    margin: 0;
}

.expense-month-nav input {
    min-height: 32px;
}

.expense-rows {
    display: grid;
}

.expense-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 2px;
    border-bottom: 1px solid #292930;
}

.expense-row span,
.expense-row span strong,
.expense-row span small {
    display: block;
}

.expense-row span strong {
    font-size: 13px;
}

.expense-row span small {
    margin-top: 3px;
    color: #9292a3;
    font-size: 10px;
}

.expense-row > strong {
    flex: 0 0 auto;
    color: #ff7878;
}

.expense-year-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(212, 175, 55, .07);
    color: #a1a1b0;
    font-size: 11px;
}

.expense-year-total strong {
    color: var(--gold-light);
    font-size: 14px;
}

body.light .dashboard-summary__item,
body.light .expense-row {
    color: #222;
}

body.light .dashboard-summary__item {
    background: #fff;
    border-color: #dfe2e7;
    box-shadow: 0 2px 8px rgba(24, 30, 42, .06);
}

body.light .dashboard-summary__item strong,
body.light .dashboard-month-group > header > span {
    color: #8b6500;
}

body.light .dashboard-summary__item--attention strong {
    color: #202126;
}

body.light .dashboard-summary__item--unpaid strong {
    color: #b42318;
}

body.light .dashboard-summary__item--net strong {
    color: #17663a;
}

body.light .dashboard-month-group + .dashboard-month-group,
body.light .dashboard-more__content,
body.light .simple-details__content,
body.light .order-form-more__content {
    border-color: #e1e4e9;
}

.order-form-summary {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--gold-soft);
    border-radius: 12px;
    background: rgba(212, 175, 55, .05);
}

.order-form-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #a1a1b0;
    font-size: 11px;
}

.order-form-summary > div strong {
    color: #f1f1f4;
}

.order-form-summary__total {
    margin-top: 3px;
    padding-top: 9px;
    border-top: 1px solid var(--gold-border);
}

.order-form-summary__total strong {
    color: var(--gold-light) !important;
    font-size: 18px;
}

body.light .order-item-editor,
body.light .order-items-details__row {
    background: #dedede;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.check-card,
.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid var(--gold-soft);
    border-radius: 10px;
    background: rgba(212, 175, 55, .05);
    color: #d8d8e4;
    font-size: 12px;
    cursor: pointer;
}

.check-card input,
.check-row input {
    width: 17px;
    height: 17px;
    accent-color: var(--gold);
}

.sticky-actions {
    margin-top: 18px;
}

.management-layout {
    display: grid;
    grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.management-form {
    position: sticky;
    top: 0;
}

.component-editor {
    display: grid;
    gap: 6px;
    max-height: 310px;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid var(--gold-soft);
    border-radius: 12px;
    background: #111115;
}

.component-editor h3 {
    margin: 0 0 5px;
    color: var(--gold);
    font-size: 12px;
}

.component-editor label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #24242b;
    font-size: 11px;
}

.component-editor label:last-child {
    border-bottom: 0;
}

.component-editor label span,
.component-editor label small {
    display: block;
}

.component-editor label small {
    color: #808090;
    font-size: 9px;
}

.component-editor input {
    min-height: 30px;
    padding: 4px 7px;
    border: 1px solid #34343d;
    border-radius: 7px;
    background: #19191f;
    color: #fff;
}

.components-cell {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-review-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 16px;
}

.product-review-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    min-height: 92px;
    padding: 14px 16px;
    border: 1px solid #303039;
    border-radius: 14px;
    background: #15151a;
    color: #ededf3;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.product-review-card:hover {
    transform: translateY(-1px);
    border-color: rgba(212, 175, 55, .62);
}

.product-review-card.is-active {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, .13);
}

.product-review-card span {
    align-self: center;
    font-size: 12px;
    font-weight: 700;
}

.product-review-card strong {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    color: var(--gold-light);
    font-size: 28px;
    line-height: 1;
}

.product-review-card small {
    color: #8e8e9c;
    font-size: 10px;
}

.product-review-card--pending.is-active {
    border-color: #eea72a;
    background: rgba(230, 126, 34, .13);
    box-shadow: 0 0 0 2px rgba(230, 126, 34, .12);
}

.product-review-card--pending strong {
    color: #ffc568;
}

.product-review-card--verified.is-active {
    border-color: #36bd73;
    background: rgba(46, 204, 113, .11);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, .1);
}

.product-review-card--verified strong {
    color: #69dfa0;
}

.products-table {
    min-width: 1100px;
}

.products-table .product-row--pending td {
    background: rgba(230, 126, 34, .075);
}

.products-table .product-row--pending td:first-child {
    box-shadow: inset 3px 0 0 #e89a27;
}

.product-verification-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.product-verification-badge.is-pending {
    border-color: rgba(238, 167, 42, .68);
    background: rgba(230, 126, 34, .18);
    color: #ffc568;
}

.product-verification-badge.is-verified {
    border-color: rgba(54, 189, 115, .7);
    background: rgba(46, 204, 113, .16);
    color: #78e4aa;
}

.product-actions {
    min-width: 170px;
    flex-wrap: wrap;
}

.product-actions form,
.order-delete-action {
    margin: 0;
}

.product-verification-check {
    border-color: rgba(54, 189, 115, .42);
    background: rgba(46, 204, 113, .08);
}

.is-muted {
    opacity: .52;
}

.inventory-layout {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    margin-top: 16px;
}

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

.inventory-card {
    padding: 12px;
    border: 1px solid var(--gold-soft);
    border-radius: 13px;
    background: #111115;
}

.inventory-card.is-low {
    border-color: rgba(231, 76, 60, .52);
    box-shadow: inset 3px 0 0 var(--red);
}

.inventory-card__top,
.inventory-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.inventory-card__top strong,
.inventory-card__top small {
    display: block;
}

.inventory-card__top small,
.inventory-card__footer {
    color: #9292a3;
    font-size: 10px;
}

.stock-value {
    color: var(--gold-light);
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
}

.stock-value small {
    display: inline;
    font-size: 9px;
}

.stock-progress {
    height: 4px;
    margin: 10px 0;
    overflow: hidden;
    border-radius: 99px;
    background: #292930;
}

.stock-progress span,
.ranking-bar span {
    display: block;
    width: var(--stock-width, var(--bar-width, 0%));
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.inventory-card.is-low .stock-progress span {
    background: var(--red);
}

.inventory-card__footer a {
    color: var(--gold);
    text-decoration: none;
    white-space: nowrap;
}

.inventory-minimum-form,
.inventory-minimum-form label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.inventory-minimum-form input {
    width: 66px;
    min-height: 30px;
    padding: 5px 7px;
    border: 1px solid #34343d;
    border-radius: 7px;
    background: #19191f;
    color: #fff;
    font-size: 10px;
}

body.light .inventory-minimum-form input {
    border-color: #bbb;
    background: #fff;
    color: #111;
}

.stock-adjust-form {
    display: grid;
    grid-template-columns: 92px minmax(90px, 1fr) auto;
    gap: 5px;
    margin-top: 10px;
}

.stock-adjust-form input {
    min-width: 0;
    min-height: 30px;
    padding: 5px 7px;
    border: 1px solid #34343d;
    border-radius: 7px;
    background: #19191f;
    color: #fff;
    font-size: 10px;
}

.value-positive {
    color: #7ee2a7;
    font-weight: 700;
}

.value-negative {
    color: #ff9188;
    font-weight: 700;
}

.ranking-list,
.expense-list {
    display: grid;
    gap: 10px;
}

.ranking-row > div:first-child,
.expense-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ranking-row strong,
.ranking-row span,
.expense-list strong,
.expense-list small {
    display: block;
}

.ranking-row strong,
.expense-list strong {
    font-size: 11px;
}

.ranking-row span,
.expense-list small {
    color: #9292a3;
    font-size: 9px;
}

.ranking-bar {
    height: 5px;
    margin-top: 5px;
    overflow: hidden;
    border-radius: 99px;
    background: #292930;
}

.expense-list > div {
    padding-bottom: 9px;
    border-bottom: 1px solid #292930;
}

.expense-list > div:last-child {
    border-bottom: 0;
}

.report-filters {
    grid-template-columns: repeat(3, minmax(150px, 220px)) auto;
}

body.light .division-tabs,
body.light .workflow-section,
body.light .component-editor,
body.light .inventory-card,
body.light .division-row,
body.light .quick-toggle,
body.light .status-action-form select {
    background: #e1e1e1;
    color: #222;
}

body.light .workflow-section > header {
    background: #d4d4d4;
    border-bottom-color: #b8b8b8;
}

body.light .check-card,
body.light .check-row {
    color: #222;
}

/* Jasny motyw: białe powierzchnie i wysoki kontrast zamiast ciężkiej szarości. */
body.light {
    background: #f3f5f8;
    color: #202126;
}

body.light .panel,
body.light .section-card,
body.light .record-card,
body.light .card {
    border-color: #dfe2e7;
    background: #fff;
    box-shadow: 0 2px 10px rgba(24, 30, 42, .07);
}

body.light .table-wrap {
    border-color: #cfd4dc;
    background: #fff;
}

body.light .data-table {
    background: #fff;
}

body.light .data-table th {
    border-color: #cfd4dc;
    background: #f0f2f5;
    color: #202126;
}

body.light .data-table td {
    border-color: #d6dae1;
    color: #202126;
}

body.light .quick-toggle,
body.light .status-action-form select {
    border-color: #bdc3cd;
    background: #fff;
    color: #202126;
}

body.light .quick-toggle.is-checked {
    border-color: #48a971;
    background: #e7f7ed;
    color: #17663a;
}

body.light .quick-toggle.is-partial {
    border-color: #d6aa2b;
    background: #fff6d8;
    color: #8b6500;
}

body.light .order-row--new .status-action-form select {
    border-color: #b9608f;
    background: #eec8dc;
    color: #652441;
}

body.light .order-row--to_production .status-action-form select {
    border-color: #c89c14;
    background: #ffe99b;
    color: #614600;
}

body.light .order-row--in_production .status-action-form select {
    border-color: #d77828;
    background: #ffd4ae;
    color: #713306;
}

body.light .order-row--ready .status-action-form select {
    border-color: #d35e52;
    background: #f8c5bf;
    color: #72251d;
}

body.light .order-row--shipped .status-action-form select {
    border-color: #4f8ee9;
    background: #c8ddff;
    color: #123f7e;
}

body.light .order-row--completed .status-action-form select {
    border-color: #45a56d;
    background: #c5ead3;
    color: #125b32;
}

body.light .order-row--cancelled .status-action-form select {
    border-color: #92939a;
    background: #dedee2;
    color: #414249;
}

body.light .order-items-details__row {
    background: rgba(255, 255, 255, .72);
}

body.light .production-product-group {
    border-color: #ecd4af;
    background: #fff8ed;
}

body.light .dashboard-division-group + .dashboard-division-group {
    border-color: #d5bd74;
}

body.light .dashboard-division-group__header {
    border-color: #dfc77f;
    background: #fff6dc;
}

body.light .dashboard-division-group__header > span,
body.light .production-division > h3 span,
body.light .settlement-division > h4 span {
    background: #f3df9e;
    color: #654900;
}

body.light .dashboard-division-group__header small,
body.light .dashboard-month-group > header > span small {
    color: #656872;
}

body.light .production-division + .production-division {
    border-color: #dcc88f;
}

body.light .production-product-group__header {
    background: #fff1dc;
}

body.light .production-product-group__header strong {
    color: #805116;
}

body.light .production-product-orders,
body.light .production-quick-item + .production-quick-item {
    border-color: #f0dec2;
}

body.light .production-settlement {
    border-top-color: #e2d7b8;
}

body.light .production-settlement__header p,
body.light .settlement-item__info small {
    color: #656872;
}

body.light .production-settlement__header > strong {
    background: #e7f7ed;
    color: #17663a;
}

body.light .settlement-item {
    border-color: #bfe0cb;
    background: #f4fbf6;
}

body.light .item-finance-toggle {
    border-color: #bdc3cd;
    background: #fff;
    color: #656872;
}

body.light .item-finance-toggle.is-checked {
    border-color: #65b184;
    background: #e7f7ed;
    color: #17663a;
}

body.light .production-quick-panel__count {
    background: #ffead0;
    color: #7b4508;
}

body.light .production-quick-item small {
    color: #656872;
}

body.light .order-work-value strong {
    color: #765600 !important;
}

body.light .order-work-value small {
    color: #5e626c !important;
}

body.light .item-completion-toggle {
    border-color: #bdc3cd;
    background: #fff;
    color: #656872;
}

body.light .item-completion-toggle.is-checked {
    border-color: #65b184;
    background: #e7f7ed;
    color: #17663a;
}

body.light .order-items-details__list {
    border-color: rgba(65, 71, 83, .18);
}

body.light .status--new {
    border-color: #cb8daf;
    background: #f6dfeb;
    color: #7e3158;
}

body.light .status--production {
    border-color: #d89b52;
    background: #ffead0;
    color: #7b4508;
}

body.light .status--ready {
    border-color: #df897f;
    background: #fde1dd;
    color: #8a2e25;
}

body.light .status--shipped {
    border-color: #75a3e9;
    background: #dceaff;
    color: #184f9b;
}

body.light .status--completed {
    border-color: #72bf91;
    background: #ddf3e5;
    color: #17663a;
}

body.light .status--cancelled {
    border-color: #a9aab1;
    background: #e8e8eb;
    color: #50515a;
}

@media (max-width: 1280px) {
    .dashboard-work-area {
        grid-template-columns: 1fr;
    }

    .production-quick-panel {
        position: static;
        max-height: none;
    }

    .production-quick-panel__body {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

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

    .production-quick-list .empty-state {
        grid-column: 1 / -1;
    }

    .dashboard-focus {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
        order: -1;
    }

    .filter-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .filter-search {
        grid-row: auto;
    }

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

@media (max-width: 960px) {
    .order-form-layout,
    .management-layout,
    .inventory-layout,
    .expenses-layout {
        grid-template-columns: 1fr;
    }

    .order-customer-panel,
    .management-form,
    .expense-entry-form {
        position: static;
    }

    .dashboard-focus {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-summary {
        max-width: none;
        order: -1;
    }

    .orders-desktop {
        display: none;
    }

    .orders-mobile {
        display: grid;
        gap: 9px;
        padding: 10px;
    }

    .order-card {
        padding: 12px;
        border: 1px solid var(--gold-soft);
        border-radius: 13px;
        background: #111115;
    }

    .orders-mobile .order-card.order-row--new {
        border-left: 6px solid #a64d79;
        background: rgba(166, 77, 121, .24);
    }

    .orders-mobile .order-card.order-row--to_production {
        border-left: 6px solid #d4af37;
        background: rgba(212, 175, 55, .23);
    }

    .orders-mobile .order-card.order-row--in_production {
        border-left: 6px solid #e67e22;
        background: rgba(230, 126, 34, .25);
    }

    .orders-mobile .order-card.order-row--ready {
        border-left: 6px solid #e74c3c;
        background: rgba(231, 76, 60, .24);
    }

    .orders-mobile .order-card.order-row--shipped {
        border-left: 6px solid #3b82f6;
        background: rgba(59, 130, 246, .23);
    }

    .orders-mobile .order-card.order-row--completed {
        border-left: 6px solid #2ecc71;
        background: rgba(46, 204, 113, .21);
    }

    .orders-mobile .order-card.order-row--cancelled {
        border-left: 5px solid #9696a0;
        background: rgba(150, 150, 160, .11);
    }

    .order-card__top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 9px;
    }

    .order-card__top strong,
    .order-card__top small {
        display: block;
    }

    .order-card__top strong {
        font-size: 13px;
    }

    .order-card__top small {
        margin-top: 2px;
        color: #9292a3;
        font-size: 9px;
    }

    .order-card__customer {
        margin: 10px 0 7px;
        font-size: 12px;
        font-weight: 650;
    }

    .order-card > .order-product-single,
    .order-card > .order-items-details {
        margin-top: 10px;
        padding: 9px;
        border: 1px solid var(--gold-soft);
        border-radius: 9px;
        background: rgba(212, 175, 55, .04);
    }

    .order-card__meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
        color: #a5a5b5;
        font-size: 10px;
    }

    .order-card__meta strong {
        margin-left: auto;
        color: var(--gold-light);
    }

    .order-card__meta .order-work-value {
        margin-left: auto;
        text-align: right;
    }

    .order-card__meta .order-work-value strong {
        margin-left: 0;
    }

    .order-card__checks {
        display: flex;
        gap: 7px;
        margin: 10px 0;
    }

    .order-card .order-actions {
        justify-content: space-between;
    }

    body.light .order-card {
        border-color: #cfd4dc;
        background: #fff;
        color: #202126;
    }

    body.light .orders-mobile .order-card.order-row--new { background: #f2d5e5; }
    body.light .orders-mobile .order-card.order-row--to_production { background: #fff0bd; }
    body.light .orders-mobile .order-card.order-row--in_production { background: #ffe0c2; }
    body.light .orders-mobile .order-card.order-row--ready { background: #fbd5d0; }
    body.light .orders-mobile .order-card.order-row--shipped { background: #d7e7ff; }
    body.light .orders-mobile .order-card.order-row--completed { background: #d3f0de; }
    body.light .orders-mobile .order-card.order-row--cancelled { background: #efeff2; }

    body.light .order-card__top small,
    body.light .order-card__meta {
        color: #656872;
    }

    body.light .order-card__meta strong {
        color: #8b6500;
    }

    body.light .order-card > .order-product-single,
    body.light .order-card > .order-items-details {
        border-color: rgba(65, 71, 83, .18);
        background: rgba(255, 255, 255, .62);
    }
}

@media (max-width: 700px) {
    .production-quick-list {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .page-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions__right {
        justify-content: space-between;
    }

    .division-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        text-align: center;
    }

    .filter-grid,
    .archive-filters,
    .report-filters,
    .check-grid,
    .form-grid--3 {
        grid-template-columns: 1fr;
    }

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

    .dashboard-quick-actions .btn {
        flex: 1;
    }

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

    .order-item-editor__grid--basic {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-item-editor__catalog,
    .order-item-editor__name,
    .order-item-editor__notes {
        grid-column: 1 / -1;
    }

    .order-items-panel > .panel__header {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-actions {
        justify-content: stretch;
    }

    .filter-actions .btn {
        flex: 1;
    }

    .stock-adjust-form {
        grid-template-columns: 1fr 1fr;
    }

    .stock-adjust-form .btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    body {
        overflow: auto;
    }

    .app-sidebar {
        align-items: center;
    }

    .app-logo {
        flex: 0 0 auto;
    }

    .app-logo__mark {
        width: 36px;
        height: 36px;
    }

    .app-menu {
        flex: 1 0 auto;
    }

    .app-menu__item {
        min-width: 42px;
    }

    .orders-mobile {
        padding: 0;
    }

    .order-card__top {
        flex-wrap: wrap;
    }

    .order-card__top > div {
        min-width: 0;
    }

    .order-card__top > div strong {
        overflow-wrap: anywhere;
    }

    .order-card__top .status-badge {
        flex: 0 0 auto;
    }

    .order-items-details {
        width: 100%;
        min-width: 0;
    }

    .order-items-details__row {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .order-items-details__row > span:nth-child(2),
    .order-items-details__row > span:nth-child(2) strong {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .order-items-details__actions {
        grid-column: 2;
        justify-content: space-between;
    }

    .order-card .order-actions {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
    }

    .order-card .status-action-form,
    .order-card .status-action-form select {
        width: 100%;
        max-width: none;
    }

    .order-card__meta .order-work-value {
        flex: 1 0 100%;
        margin-top: 4px;
        margin-left: 0;
        text-align: left;
    }

    .dashboard-month-group > header,
    .production-quick-panel > .panel__header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .dashboard-month-group > header > span {
        margin-left: auto;
    }

    .inline-save-notice {
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
        overflow-wrap: anywhere;
        text-align: center;
    }

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

    .metric-card {
        min-height: 112px;
    }

    .metric-card__value {
        font-size: 21px;
    }

    .form-grid--2 {
        grid-template-columns: 1fr;
    }

    .order-item-editor__grid {
        grid-template-columns: 1fr;
    }

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

    .expense-month-nav form {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .order-item-editor__catalog,
    .order-item-editor__name,
    .order-item-editor__notes {
        grid-column: auto;
    }
}

/* Długi i częściowe spłaty */
.debts-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.debt-summary-card {
    min-height: 82px;
}

.debt-summary-card strong {
    font-size: 21px;
}

.debt-summary-card--outstanding {
    border-left: 4px solid #e35d6a;
}

.debt-summary-card--outstanding strong {
    color: #ff8b94;
}

.debt-summary-card--repaid {
    border-left: 4px solid #36c884;
}

.debt-summary-card--repaid strong {
    color: #70dfa7;
}

.debts-layout {
    display: grid;
    grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.debt-entry-form {
    position: sticky;
    top: 0;
}

.debt-entry-form .simple-details {
    margin-top: 14px;
}

.debt-entry-form .form-actions {
    margin-top: 16px;
}

.debt-list__header {
    align-items: flex-start;
}

.debt-list__header > strong {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(212, 175, 55, .12);
    color: var(--gold-light);
    font-size: 11px;
}

.debt-list {
    display: grid;
    gap: 10px;
}

.debt-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 245px;
    overflow: hidden;
    border: 1px solid #303039;
    border-left: 4px solid var(--gold);
    border-radius: 14px;
    background: #111115;
}

.debt-card--overdue {
    border-left-color: #e35d6a;
}

.debt-card--soon {
    border-left-color: #e69138;
}

.debt-card--paid {
    border-left-color: #36c884;
}

.debt-card__main {
    min-width: 0;
    padding: 15px;
}

.debt-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.debt-card__header > div {
    min-width: 0;
}

.debt-card__header h3 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 15px;
}

.debt-card__header p,
.debt-card__due,
.debt-card__notes {
    margin: 4px 0 0;
    color: #9292a3;
    font-size: 11px;
}

.debt-card__due strong {
    color: inherit;
}

.debt-card__notes {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    line-height: 1.45;
}

.debt-status {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid rgba(212, 175, 55, .4);
    border-radius: 999px;
    background: rgba(212, 175, 55, .1);
    color: var(--gold-light);
    font-size: 10px;
    font-weight: 800;
}

.debt-status--overdue {
    border-color: rgba(227, 93, 106, .55);
    background: rgba(227, 93, 106, .14);
    color: #ff9da5;
}

.debt-status--soon {
    border-color: rgba(230, 145, 56, .55);
    background: rgba(230, 145, 56, .14);
    color: #ffc27c;
}

.debt-status--paid {
    border-color: rgba(54, 200, 132, .55);
    background: rgba(54, 200, 132, .14);
    color: #7ae1ae;
}

.debt-card__amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 13px;
}

.debt-card__amounts span {
    min-width: 0;
    padding: 8px 9px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .035);
}

.debt-card__amounts small,
.debt-card__amounts strong {
    display: block;
}

.debt-card__amounts small {
    margin-bottom: 3px;
    color: #858596;
    font-size: 9px;
}

.debt-card__amounts strong {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.debt-card__remaining strong {
    color: #ff8b94;
}

.debt-progress {
    height: 7px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #292930;
}

.debt-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #c8951c, #56d695);
    transition: width .25s ease;
}

.debt-card__payment,
.debt-card__paid-mark {
    padding: 15px;
    border-left: 1px solid #303039;
    background: rgba(212, 175, 55, .055);
}

.debt-card__payment[hidden],
.debt-card__paid-mark[hidden],
.debt-paid-section[hidden] {
    display: none !important;
}

.debt-card__payment-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 11px;
}

.debt-card__payment-title span {
    color: var(--gold);
    font-size: 18px;
}

.debt-card__payment-title strong {
    font-size: 13px;
}

.debt-card__payment form {
    display: grid;
    gap: 9px;
}

.debt-card__payment .field {
    gap: 3px;
}

.debt-card__payment .field label {
    font-size: 10px;
}

.debt-card__payment input {
    min-width: 0;
}

.debt-payment-amount {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
}

.debt-payment-amount button {
    min-height: 38px;
    padding: 0 8px;
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    background: transparent;
    color: var(--gold-light);
    cursor: pointer;
    font-size: 10px;
}

.debt-payment-note > summary,
.debt-payment-history > summary,
.debt-paid-section > summary {
    cursor: pointer;
}

.debt-payment-note > summary {
    color: #9393a4;
    font-size: 10px;
}

.debt-payment-note input {
    width: 100%;
    min-height: 36px;
    margin-top: 7px;
    padding: 7px 9px;
    border: 1px solid #2a2a33;
    border-radius: 8px;
    outline: none;
    background: #111115;
    color: #f5f5f5;
    font-size: 12px;
}

.debt-card__payment .btn {
    width: 100%;
}

.debt-card__paid-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.debt-card__paid-mark span {
    display: grid;
    width: 40px;
    height: 40px;
    margin-bottom: 7px;
    border-radius: 50%;
    background: rgba(54, 200, 132, .16);
    color: #70dfa7;
    font-size: 22px;
    place-items: center;
}

.debt-card__paid-mark small {
    margin-top: 4px;
    color: #8d8d9d;
    font-size: 9px;
}

.debt-payment-history {
    margin-top: 10px;
    color: #9292a3;
    font-size: 10px;
}

.debt-payment-history ul {
    display: grid;
    gap: 5px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.debt-payment-history li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}

.debt-payment-history li span,
.debt-payment-history li small {
    display: block;
}

.debt-payment-history li strong {
    color: #70dfa7;
    font-size: 11px;
}

.debt-payment-history li small {
    margin-top: 2px;
    color: #858596;
    font-size: 9px;
}

.debt-payment-history li em {
    color: #aaaabb;
    font-size: 9px;
    font-style: normal;
    text-align: right;
}

.debt-payment-history__side {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-direction: column;
}

.debt-payment-history__side form {
    margin: 0;
}

.debt-payment-history__side button,
.debt-cancel-form button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #cf7780;
    cursor: pointer;
    font-size: 9px;
    text-decoration: underline;
}

.debt-payment-history__empty {
    justify-content: center !important;
}

.debt-paid-section > summary {
    font-size: 13px;
    font-weight: 700;
}

.debt-paid-section[open] > summary {
    margin-bottom: 14px;
}

.debt-list--paid .debt-card {
    opacity: .84;
}

.debt-edit-details {
    margin-top: 9px;
    color: #8d8d9d;
    font-size: 10px;
}

.debt-edit-details > summary {
    cursor: pointer;
}

.debt-edit-details > form {
    margin-top: 10px;
    padding: 11px;
    border: 1px solid #2c2c34;
    border-radius: 10px;
    background: rgba(255, 255, 255, .025);
}

.debt-edit-details .form-grid {
    gap: 9px;
}

.debt-edit-details .field {
    gap: 3px;
}

.debt-edit-details .field label {
    font-size: 9px;
}

.debt-edit-details .field input {
    min-height: 34px;
    font-size: 11px;
}

.debt-edit-details .btn {
    margin-top: 10px;
}

.debt-edit-details > .debt-cancel-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 7px;
    padding: 0;
    border: 0;
    background: transparent;
}

body.light .debt-summary-card--outstanding strong,
body.light .debt-card__remaining strong {
    color: #b42318;
}

body.light .debt-summary-card--repaid strong {
    color: #17663a;
}

body.light .debt-card {
    border-color: #d9dee7;
    background: #fff;
    color: #202126;
}

body.light .debt-card--active {
    border-left-color: #b48813;
}

body.light .debt-card--overdue {
    border-left-color: #c73745;
}

body.light .debt-card--soon {
    border-left-color: #d1771d;
}

body.light .debt-card--paid {
    border-left-color: #249b61;
}

body.light .debt-status,
body.light .debt-list__header > strong,
body.light .debt-payment-amount button {
    border-color: rgba(118, 86, 0, .35);
    background: #fff7d9;
    color: #765600;
}

body.light .debt-status--overdue {
    border-color: rgba(159, 36, 48, .35);
    background: #fde8eb;
    color: #9f2430;
}

body.light .debt-status--soon {
    border-color: rgba(138, 75, 8, .35);
    background: #fff0dd;
    color: #8a4b08;
}

body.light .debt-status--paid {
    border-color: rgba(23, 102, 58, .35);
    background: #e4f5eb;
    color: #17663a;
}

body.light .debt-card__header p,
body.light .debt-card__due,
body.light .debt-card__notes,
body.light .debt-payment-history {
    color: #656872;
}

body.light .debt-card__notes,
body.light .debt-card__amounts span,
body.light .debt-payment-history li {
    background: #f4f6f8;
}

body.light .debt-card__payment,
body.light .debt-card__paid-mark {
    border-color: #d9dee7;
    background: #f7f8fa;
}

body.light .debt-payment-note input {
    border-color: #ccd2db;
    background: #fff;
    color: #202126;
}

body.light .debt-edit-details > form {
    border-color: #d9dee7;
    background: #f7f8fa;
}

body.light .debt-payment-history__side button,
body.light .debt-cancel-form button {
    color: #9f2430;
}

body.light .debt-payment-history li strong,
body.light .debt-card__paid-mark span {
    color: #17663a;
}

body.light .debt-progress {
    background: #e1e5ea;
}

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

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

    .debt-entry-form {
        position: static;
    }
}

@media (max-width: 960px) {
    .debt-card {
        grid-template-columns: minmax(0, 1fr) 220px;
    }
}

@media (max-width: 700px) {
    .debt-card {
        grid-template-columns: 1fr;
    }

    .debt-card__payment,
    .debt-card__paid-mark {
        border-top: 1px solid #303039;
        border-left: 0;
    }

    body.light .debt-card__payment,
    body.light .debt-card__paid-mark {
        border-top-color: #d9dee7;
    }
}

@media (max-width: 620px) {
    .debts-summary {
        grid-template-columns: 1fr 1fr;
    }

    .debt-summary-card strong {
        font-size: 17px;
    }

    .debt-card__header {
        flex-wrap: wrap;
    }

    .debt-card__amounts {
        grid-template-columns: 1fr;
    }

    .debt-card__payment input,
    .debt-payment-note input,
    .debt-entry-form input,
    .debt-entry-form textarea,
    .debt-edit-details .field input {
        min-height: 44px;
        font-size: 16px;
    }

    .debt-payment-history__side button,
    .debt-cancel-form button {
        min-height: 34px;
        padding: 7px 4px;
    }
}

body.light .product-review-card {
    border-color: #d9dee7;
    background: #fff;
    color: #20232b;
    box-shadow: 0 4px 12px rgba(31, 38, 50, .05);
}

body.light .product-review-card small {
    color: #697181;
}

body.light .product-review-card--all strong {
    color: #806200;
}

body.light .product-review-card.is-active {
    border-color: #b58d0d;
    background: #fff9e7;
}

body.light .product-review-card--pending.is-active {
    border-color: #dc8a18;
    background: #fff2dd;
}

body.light .product-review-card--pending strong {
    color: #a95d00;
}

body.light .product-review-card--verified.is-active {
    border-color: #2c9f62;
    background: #eaf8f0;
}

body.light .product-review-card--verified strong {
    color: #177844;
}

body.light .products-table .product-row--pending td {
    background: #fff5e5;
}

body.light .product-verification-badge.is-pending {
    border-color: #d98b20;
    background: #ffebc9;
    color: #854700;
}

body.light .product-verification-badge.is-verified {
    border-color: #48a977;
    background: #ddf3e7;
    color: #17663a;
}

body.light .product-verification-check {
    border-color: #8cc9a7;
    background: #edf9f2;
    color: #254d37;
}

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

    .product-review-card--all {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .product-review-summary {
        grid-template-columns: 1fr;
    }

    .product-review-card--all {
        grid-column: auto;
    }

    .product-actions {
        min-width: 140px;
        align-items: stretch;
        flex-direction: column;
    }

    .product-actions .btn {
        width: 100%;
    }
}

.inventory-categories {
    display: grid;
    gap: 11px;
}

.inventory-category {
    overflow: hidden;
    border: 1px solid var(--gold-soft);
    border-radius: 13px;
    background: #111115;
}

.inventory-category > summary {
    display: flex;
    min-height: 54px;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    cursor: pointer;
    list-style: none;
}

.inventory-category > summary::-webkit-details-marker {
    display: none;
}

.inventory-category > summary strong {
    min-width: 0;
    font-size: 13px;
}

.inventory-category > summary small {
    margin-left: auto;
    color: #9292a3;
    font-size: 10px;
    text-align: right;
}

.inventory-category__icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    background: rgba(212, 175, 55, .17);
    color: var(--gold-light);
}

.inventory-category__chevron {
    color: var(--gold);
    transition: transform .2s ease;
}

.inventory-category[open] .inventory-category__chevron {
    transform: rotate(180deg);
}

.inventory-category > .inventory-grid {
    padding: 12px;
    border-top: 1px solid var(--gold-soft);
}

.inventory-card__cost {
    margin: 7px 0 8px;
    color: #9292a3;
    font-size: 10px;
}

.inventory-card__cost strong {
    color: var(--gold-light);
}

.product-cost-preview {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(212, 175, 55, .35);
    border-radius: 11px;
    background: rgba(212, 175, 55, .07);
}

.product-cost-preview span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
}

.product-cost-preview span:last-child {
    padding-top: 7px;
    border-top: 1px solid rgba(212, 175, 55, .25);
    font-weight: 800;
}

.product-cost-preview strong,
.product-cost-cell strong {
    color: var(--gold-light);
}

.product-cost-cell small {
    display: block;
    margin-top: 3px;
    color: #9292a3;
    font-size: 9px;
}

.product-bulk-panel {
    margin-top: 16px;
}

.product-bulk-form {
    display: grid;
    gap: 14px;
}

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

.product-bulk-choices {
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--gold-soft);
    border-radius: 10px;
}

.product-bulk-choices legend {
    padding: 0 5px;
    font-size: 12px;
    font-weight: 700;
}

.product-bulk-choices__list {
    display: grid;
    gap: 6px;
    max-height: 360px;
    overflow: auto;
}

.product-bulk-choices__list > label,
.product-bulk-part {
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid #303039;
    border-radius: 8px;
    background: #15151a;
    font-size: 11px;
}

.product-bulk-part {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px;
    align-items: center;
    gap: 8px;
}

.product-bulk-part label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.product-bulk-part small {
    display: block;
    color: #9292a3;
    font-size: 9px;
}

.product-bulk-part input[name^="bulk_quantities"] {
    width: 100%;
    min-height: 30px;
    padding: 4px 6px;
    border: 1px solid #454550;
    border-radius: 7px;
    background: #19191f;
    color: #fff;
}

.product-bulk-note {
    margin: 0;
    color: #aaaab8;
    font-size: 11px;
}

body.light .inventory-category,
body.light .product-bulk-choices__list > label,
body.light .product-bulk-part {
    border-color: #d9dee7;
    background: #fff;
    color: #20232b;
}

body.light .inventory-category > summary small,
body.light .inventory-card__cost,
body.light .product-cost-cell small,
body.light .product-bulk-part small,
body.light .product-bulk-note {
    color: #697181;
}

body.light .inventory-card__cost strong,
body.light .product-cost-preview strong,
body.light .product-cost-cell strong {
    color: #806200;
}

body.light .product-cost-preview {
    border-color: #ddc97b;
    background: #fffaea;
}

body.light .product-bulk-part input[name^="bulk_quantities"] {
    border-color: #cbd1dc;
    background: #fff;
    color: #20232b;
}

body.light .production-settlement {
    border-left-color: #e3d6a9;
}

@media (max-width: 1100px) {
    .production-quick-panel__body,
    .product-bulk-columns {
        grid-template-columns: 1fr;
    }

    .production-settlement {
        padding-top: 14px;
        padding-left: 0;
        border-top: 1px solid rgba(230, 184, 0, .2);
        border-left: 0;
    }
}

@media (max-width: 700px) {
    .production-quick-list {
        grid-template-columns: 1fr;
    }
}
