:root {
    color-scheme: light;
    --bg: #f4f3ee;
    --surface: #ffffff;
    --surface-2: #edf3ee;
    --surface-3: #faf8f1;
    --line: #d7d2c3;
    --line-strong: #b9b199;
    --text: #10231f;
    --muted: #667068;
    --blue: #1d5b72;
    --green: #2f6f44;
    --green-dark: #12352c;
    --amber: #c08324;
    --red: #a33a2a;
    --cream: #fbfaf5;
    --panel: #fcfbf6;
    --shadow: 0 16px 34px rgba(16, 35, 31, 0.09);
}

.crm-mail-card {
    background: linear-gradient(135deg, rgba(32, 88, 69, 0.05), rgba(180, 117, 31, 0.06));
}

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

.crm-mail-compose-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
    gap: 14px;
}

.crm-mail-compose-grid section {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 253, 248, 0.82);
}

.crm-mail-compose-grid h4,
.crm-mail-history h4 {
    margin: 0;
}

.crm-mail-picker-empty,
.crm-mail-product-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.crm-mail-product-tools input {
    min-width: 0;
    flex: 1;
}

.crm-mail-product-list,
.crm-mail-file-list,
.crm-mail-history {
    display: grid;
    gap: 8px;
}

.crm-mail-product-option,
.crm-mail-file-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid rgba(214, 205, 188, 0.9);
    border-radius: 12px;
    background: #fffdf8;
}

.crm-mail-product-option strong,
.crm-mail-product-option small,
.crm-mail-file-option span {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.crm-mail-history {
    margin-top: 4px;
}

.crm-mail-history-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--amber);
    border-radius: 14px;
    background: #fffdf8;
}

.crm-mail-history-item.is-sent {
    border-left-color: var(--green);
}

.crm-mail-actions {
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
}

@media (max-width: 900px) {
    .crm-mail-compose-grid {
        grid-template-columns: 1fr;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(rgba(16, 35, 31, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 35, 31, 0.025) 1px, transparent 1px),
        var(--bg);
    background-size: 34px 34px;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

button,
.logout {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--cream);
    color: var(--text);
    cursor: pointer;
    min-height: 38px;
    padding: 0 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

button:hover,
.logout:hover {
    border-color: var(--line-strong);
    background: #fffdf7;
}

button[data-send-order-fortnox-blocked="1"] {
    border-style: dashed;
    background: rgba(244, 239, 229, 0.92);
    color: var(--muted);
    cursor: help;
}

button[data-send-order-fortnox-blocked="1"]:hover {
    border-color: var(--line-strong);
    background: #fffaf1;
}

button[type="submit"],
#refreshBtn {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: #fff;
}

button.danger {
    border-color: rgba(163, 58, 42, 0.25);
    background: rgba(163, 58, 42, 0.08);
    color: var(--red);
}

button.warning {
    border-color: rgba(198, 126, 22, 0.3);
    background: rgba(198, 126, 22, 0.1);
    color: var(--orange);
}

.icon-button {
    width: 38px;
    min-width: 38px;
    padding: 0;
}

.icon-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

input,
select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--text);
    padding: 0 11px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.logout:focus-visible {
    outline: 3px solid rgba(47, 111, 68, 0.2);
    outline-offset: 2px;
}

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

body.app-booting {
    overflow: hidden;
}

html.delivery-note-modal-open,
body.delivery-note-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

html.intranet-editor-modal-open,
body.intranet-editor-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

html.work-card-modal-open,
body.work-card-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

html.assignment-editor-modal-open,
body.assignment-editor-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

html.tradera-overview-modal-open,
body.tradera-overview-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

html.reconciliation-credit-import-modal-open,
body.reconciliation-credit-import-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

body.app-booting .app-shell {
    visibility: hidden;
}

.app-bootstrap-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(255, 194, 92, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(20, 64, 49, 0.96), rgba(13, 48, 37, 0.98)),
        var(--green-dark);
}

body.app-booting .app-bootstrap-overlay {
    display: flex;
}

.app-bootstrap-card {
    width: min(520px, 100%);
    padding: 34px 36px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 70px rgba(6, 25, 19, 0.32);
    color: #fff;
    backdrop-filter: blur(12px);
}

.app-bootstrap-kicker {
    margin-bottom: 12px;
    color: rgba(255, 194, 92, 0.92);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.app-bootstrap-card h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 42px);
    line-height: 1.02;
}

.app-bootstrap-card p {
    margin: 14px 0 0;
    max-width: 34ch;
    color: rgba(255, 255, 255, 0.82);
    font-size: 16px;
    line-height: 1.6;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(90deg, rgba(47, 111, 68, 0.18), transparent 42%),
        var(--green-dark);
    backdrop-filter: blur(10px);
    color: #fff;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
}

.brand-section {
    min-width: 0;
    flex: 1 1 auto;
}

.brand-mark {
    display: block;
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
    background: url("/assets/favicon.ico") center / contain no-repeat;
    color: transparent;
    font-size: 0;
    line-height: 0;
    object-fit: contain;
    flex: 0 0 auto;
}

.top-logo {
    display: none !important;
}

#headerSectionSelect {
    margin-top: 0;
    width: 100%;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
}

#headerSectionSelect:focus {
    outline: 2px solid rgba(255, 255, 255, 0.34);
    outline-offset: 2px;
}

#headerSectionSelect option {
    color: var(--text);
    background: #fff;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab {
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.82);
    gap: 5px;
}

.tab.is-active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: inset 0 -2px 0 #f3b647;
}

.page-inline-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 14px;
}

.page-inline-tab {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(47, 111, 68, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--green-dark);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.page-inline-tab:hover {
    border-color: rgba(47, 111, 68, 0.3);
    background: rgba(255, 255, 255, 0.96);
}

.page-inline-tab.is-active {
    border-color: rgba(235, 122, 89, 0.3);
    background: linear-gradient(135deg, #f58e75, #e36d56);
    color: #fff;
    box-shadow: 0 12px 26px rgba(227, 109, 86, 0.18);
}

.nav-alert {
    color: #f3b647;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.nav-alert[hidden] {
    display: none;
}

.attention-strip {
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: auto repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
    margin: 0 0 12px;
    border-color: rgba(192, 131, 36, 0.28);
    background: rgba(243, 182, 71, 0.1);
    color: var(--text);
    text-align: left;
    white-space: normal;
    padding: 10px;
}

.attention-strip[hidden] {
    display: none;
}

.attention-strip-title {
    display: inline-flex;
    align-items: center;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.attention-strip-title::before {
    content: "*";
    margin-right: 6px;
    color: var(--amber);
    font-size: 21px;
    line-height: 1;
}

.attention-strip-item {
    min-width: 0;
    border-left: 3px solid var(--amber);
    background: rgba(255, 253, 248, 0.76);
    border-radius: 6px;
    padding: 8px 10px;
}

.attention-strip-item strong,
.attention-strip-item small {
    display: block;
    overflow-wrap: anywhere;
}

.attention-strip-item strong {
    color: var(--green-dark);
    font-size: 13px;
}

.attention-strip-item small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.top-work-queue {
    padding: 0 0 18px;
}

.top-work-queue[hidden] {
    display: none;
}

.top-work-queue-inner {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.top-work-queue-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(47, 111, 68, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 22px rgba(16, 35, 31, 0.05);
}

.top-work-queue-kicker {
    color: var(--amber);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.top-work-queue-intro strong {
    font-size: 15px;
    color: var(--green-dark);
}

.top-work-queue-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.top-work-queue-chip {
    min-height: 0;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-color: rgba(163, 58, 42, 0.14);
    border-radius: 14px;
    background: rgba(255, 236, 239, 0.84);
    text-align: left;
    white-space: normal;
    box-shadow: 0 10px 18px rgba(16, 35, 31, 0.04);
}

.top-work-queue-chip:hover {
    background: rgba(255, 242, 244, 0.96);
}

.top-work-queue-count {
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(163, 58, 42, 0.1);
    color: var(--red);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    flex: 0 0 auto;
}

.top-work-queue-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.top-work-queue-copy strong {
    color: var(--green-dark);
    font-size: 14px;
}

.top-work-queue-copy small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.topbar-search,
.topbar-notices {
    position: relative;
}

.topbar-search {
    width: min(520px, 44vw);
    min-width: min(360px, calc(100vw - 32px));
}

.topbar-search input {
    width: 100%;
    min-height: 40px;
    padding: 0 38px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.topbar-search input::placeholder {
    color: rgba(255, 255, 255, 0.72);
}

.topbar-search input:focus {
    outline: 2px solid rgba(255, 255, 255, 0.34);
    outline-offset: 2px;
}

.topbar-search input::-webkit-search-cancel-button {
    display: none;
}

.topbar-search-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
}

.topbar-search-clear:hover {
    background: rgba(255, 255, 255, 0.12);
}

.topbar-notices summary {
    list-style: none;
}

.topbar-notices summary::-webkit-details-marker {
    display: none;
}

.topbar-notice-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    user-select: none;
}

.topbar-notice-button .nav-alert {
    min-width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #f3b647;
    color: #143725;
    font-size: 12px;
    font-weight: 800;
}

.topbar-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    border: 1px solid rgba(16, 43, 31, 0.12);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(10, 32, 22, 0.18);
    color: var(--text);
}

.topbar-search-results {
    right: 0;
    width: min(640px, calc(100vw - 32px));
    max-height: min(72vh, 640px);
    overflow-x: hidden;
    overflow-y: auto;
}

.topbar-notice-panel {
    width: min(420px, calc(100vw - 32px));
    padding: 12px;
}

.topbar-search-empty,
.topbar-search-meta,
.topbar-notice-empty {
    color: var(--muted);
    font-size: 13px;
}

.topbar-search-empty,
.topbar-notice-empty {
    padding: 14px;
}

.topbar-search-group + .topbar-search-group {
    border-top: 1px solid var(--line);
}

.topbar-search-group-label {
    display: block;
    padding: 10px 14px 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.topbar-search-result {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 10px 14px;
    border: 0;
    border-top: 1px solid rgba(16, 43, 31, 0.06);
    background: transparent;
    color: inherit;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.topbar-search-result:first-of-type {
    border-top: 0;
}

.topbar-search-result:hover {
    background: #f4f8f3;
}

.topbar-search-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-search-meta {
    display: -webkit-box;
    min-width: 0;
    margin-top: 0;
    overflow: hidden;
    line-height: 1.35;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.topbar-notice-list,
.home-waiting-list {
    display: grid;
    gap: 10px;
}

.topbar-notice-item,
.home-waiting-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar-notice-copy,
.home-waiting-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.topbar-notice-copy strong,
.home-waiting-copy strong {
    display: block;
}

.topbar-notice-copy small,
.home-waiting-copy small {
    color: var(--muted);
}

.topbar-notice-link,
.home-waiting-link {
    flex: 0 0 auto;
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    max-width: min(240px, 32vw);
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    white-space: nowrap;
}

.topbar-user-label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
}

.topbar-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
}

.topbar .logout {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.topbar .logout:hover {
    background: rgba(255, 255, 255, 0.16);
}

main {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.view {
    display: none;
}

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

.view.is-active[hidden] {
    display: block !important;
}

.view-diagnostic-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid rgba(192, 131, 36, 0.45);
    border-left: 5px solid var(--amber);
    border-radius: 8px;
    background: #fff8e8;
    color: var(--text);
    box-shadow: 0 10px 18px rgba(16, 35, 31, 0.08);
}

.view-diagnostic-panel strong {
    flex: 1 1 100%;
}

.view-diagnostic-panel span {
    font-size: 13px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 18px;
}

.page-heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.page-heading h1 {
    margin: 2px 0 0;
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1.08;
    color: var(--green-dark);
}

.eyebrow {
    color: var(--amber);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0;
    text-transform: uppercase;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

#negotiations .negotiation-kpi-grid {
    margin-bottom: 0;
}

#negotiations .negotiation-kpi-card {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 239, 0.94));
}

#negotiations .negotiation-kpi-card span {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#negotiations .negotiation-kpi-card strong {
    font-size: 28px;
    line-height: 1;
    color: var(--green-dark);
}

#negotiations .negotiation-kpi-card small {
    color: var(--muted);
}

#returns .returns-kpi-grid,
#pickup-reminders .returns-kpi-grid {
    margin-bottom: 14px;
}

#returns .returns-kpi-card,
#pickup-reminders .returns-kpi-card {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 239, 0.94));
}

#returns .returns-kpi-card span,
#pickup-reminders .returns-kpi-card span {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#returns .returns-kpi-card strong,
#pickup-reminders .returns-kpi-card strong {
    font-size: 28px;
    line-height: 1;
    color: var(--green-dark);
}

#returns .returns-kpi-card small,
#pickup-reminders .returns-kpi-card small {
    color: var(--muted);
}

#returns .returns-form,
#returns .returns-create-grid,
#returns .returns-field-grid,
#returns .returns-groups,
#returns .returns-group-section,
#returns .returns-metric-grid,
#pickup-reminders .returns-form,
#pickup-reminders .returns-create-grid,
#pickup-reminders .returns-field-grid,
#pickup-reminders .returns-groups,
#pickup-reminders .returns-group-section,
#pickup-reminders .returns-metric-grid {
    display: grid;
    gap: 12px;
}

#returns .returns-create-grid,
#pickup-reminders .returns-create-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

#returns .returns-field-grid,
#pickup-reminders .returns-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#returns .returns-field,
#returns .returns-field-wide,
#pickup-reminders .returns-field,
#pickup-reminders .returns-field-wide {
    display: grid;
    gap: 6px;
}

#returns .returns-field-wide,
#pickup-reminders .returns-field-wide {
    grid-column: 1 / -1;
}

#returns .returns-field span,
#pickup-reminders .returns-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

#returns .returns-form input,
#returns .returns-form select,
#returns .returns-form textarea,
#returns .order-card-body input,
#returns .order-card-body select,
#returns .order-card-body textarea,
#pickup-reminders .returns-form input,
#pickup-reminders .returns-form select,
#pickup-reminders .returns-form textarea,
#pickup-reminders .order-card-body input,
#pickup-reminders .order-card-body select,
#pickup-reminders .order-card-body textarea {
    width: 100%;
}

#returns .returns-group-section + .returns-group-section,
#pickup-reminders .returns-group-section + .returns-group-section {
    margin-top: 6px;
}

#returns .returns-group-section-head,
#pickup-reminders .returns-group-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

#returns .returns-group-section-head h3,
#pickup-reminders .returns-group-section-head h3 {
    margin: 0;
}

#returns .returns-toolbar,
#pickup-reminders .returns-toolbar {
    margin-top: 8px;
}

#returns .returns-toolbar input[type="search"],
#pickup-reminders .returns-toolbar input[type="search"] {
    min-width: 280px;
}

#returns .returns-row-list,
#pickup-reminders .returns-row-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

#returns .returns-list-row,
#pickup-reminders .returns-list-row {
    appearance: none;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 18px;
    align-items: start;
    padding: 16px 18px;
    border: 1px solid rgba(14, 52, 43, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 245, 239, 0.94));
    box-shadow: 0 14px 28px rgba(7, 22, 18, 0.06);
    text-align: left;
    white-space: normal;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

#returns .returns-list-row:hover,
#pickup-reminders .returns-list-row:hover {
    transform: translateY(-1px);
    border-color: rgba(27, 92, 72, 0.22);
    box-shadow: 0 18px 30px rgba(7, 22, 18, 0.1);
}

#returns .returns-list-row:focus-visible,
#pickup-reminders .returns-list-row:focus-visible {
    outline: 2px solid rgba(27, 92, 72, 0.28);
    outline-offset: 3px;
}

#returns .returns-list-row.is-actionable,
#pickup-reminders .returns-list-row.is-actionable {
    border-color: rgba(27, 92, 72, 0.18);
}

#returns .returns-list-row.is-owned,
#pickup-reminders .returns-list-row.is-owned {
    border-color: rgba(184, 53, 53, 0.22);
    background: linear-gradient(180deg, rgba(255, 248, 248, 0.98), rgba(255, 239, 239, 0.94));
}

#returns .returns-list-row.is-completed,
#pickup-reminders .returns-list-row.is-completed {
    border-color: rgba(47, 111, 68, 0.16);
    background: linear-gradient(180deg, rgba(249, 255, 251, 0.98), rgba(242, 249, 244, 0.94));
}

#returns .returns-list-row.is-urgent,
#pickup-reminders .returns-list-row.is-urgent {
    border-color: rgba(184, 53, 53, 0.28);
    box-shadow: 0 18px 34px rgba(184, 53, 53, 0.12);
}

#returns .returns-list-row-main,
#returns .returns-list-row-side,
#pickup-reminders .returns-list-row-main,
#pickup-reminders .returns-list-row-side {
    display: grid;
    gap: 8px;
    min-width: 0;
}

#returns .returns-list-row-title-line,
#pickup-reminders .returns-list-row-title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

#returns .returns-list-row-title-line strong,
#pickup-reminders .returns-list-row-title-line strong {
    font-size: 18px;
    line-height: 1.2;
    color: var(--green-dark);
}

#returns .returns-list-row-meta,
#returns .returns-list-row-preview,
#returns .returns-list-row-side small,
#pickup-reminders .returns-list-row-meta,
#pickup-reminders .returns-list-row-preview,
#pickup-reminders .returns-list-row-side small {
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

#returns .returns-list-row-preview,
#pickup-reminders .returns-list-row-preview {
    line-height: 1.5;
}

#returns .returns-list-row-side,
#pickup-reminders .returns-list-row-side {
    justify-items: start;
    align-content: start;
    padding-left: 12px;
    border-left: 1px solid rgba(14, 52, 43, 0.1);
}

#returns .returns-list-row-next-label,
#pickup-reminders .returns-list-row-next-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#returns .returns-list-row-side strong,
#pickup-reminders .returns-list-row-side strong {
    font-size: 18px;
    line-height: 1.2;
}

#returns .returns-metric-grid,
#pickup-reminders .returns-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 6px;
}

#returns .returns-metric,
#pickup-reminders .returns-metric {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(214, 197, 168, 0.52);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
}

#returns .returns-metric span,
#pickup-reminders .returns-metric span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#returns .returns-metric strong,
#pickup-reminders .returns-metric strong {
    font-size: 24px;
    line-height: 1.1;
}

#returns .returns-metric small,
#pickup-reminders .returns-metric small {
    color: var(--muted);
}

#returns .returns-row-actions,
#pickup-reminders .returns-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

#returns .returns-process-note,
#pickup-reminders .returns-process-note {
    margin: 2px 0 0;
}

#returns .returns-contact-log,
#pickup-reminders .returns-contact-log {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

#returns .returns-contact-log li,
#pickup-reminders .returns-contact-log li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(214, 197, 168, 0.52);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
}

#returns .returns-contact-log li div,
#pickup-reminders .returns-contact-log li div {
    display: grid;
    gap: 2px;
}

#returns .returns-contact-log li span,
#returns .returns-contact-log li time,
#pickup-reminders .returns-contact-log li span,
#pickup-reminders .returns-contact-log li time {
    color: var(--muted);
    font-size: 12px;
}

#returns .returns-empty,
#pickup-reminders .returns-empty {
    margin: 0;
}

#returnModal .returns-editor-modal,
#pickupReminderModal .returns-editor-modal {
    width: min(1080px, 100%);
    max-height: min(92vh, 980px);
}

#returnModal .returns-modal-intro,
#pickupReminderModal .returns-modal-intro {
    display: grid;
    gap: 8px;
}

#returnModal .returns-modal-intro .muted,
#pickupReminderModal .returns-modal-intro .muted {
    margin: 0;
}

#returnModal .returns-modal-statusline,
#pickupReminderModal .returns-modal-statusline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#returnModal .returns-modal-form,
#pickupReminderModal .returns-modal-form {
    display: grid;
    gap: 16px;
}

#returnModal .returns-form input,
#returnModal .returns-form select,
#returnModal .returns-form textarea,
#pickupReminderModal .returns-form input,
#pickupReminderModal .returns-form select,
#pickupReminderModal .returns-form textarea {
    width: 100%;
}

#returnModal .returns-modal-grid,
#pickupReminderModal .returns-modal-grid {
    gap: 18px;
}

#returnModal .returns-modal-actions,
#pickupReminderModal .returns-modal-actions {
    align-items: center;
}

#returnModal .returns-modal-updated,
#pickupReminderModal .returns-modal-updated {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

#negotiations .negotiation-groups {
    display: grid;
    gap: 16px;
}

#negotiations .negotiation-group-section {
    display: grid;
    gap: 12px;
}

#negotiations .negotiation-group-section + .negotiation-group-section {
    margin-top: 8px;
}

#negotiations .negotiation-group-section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

#negotiations .negotiation-group-section-head h3 {
    margin: 0 0 4px;
    font-size: 18px;
    color: var(--green-dark);
}

#negotiations .negotiation-group-section-head p {
    margin: 0;
}

#negotiations .negotiation-group-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    overflow: hidden;
}

#negotiations .negotiation-group-card.is-unmailed {
    border-color: rgba(173, 66, 66, 0.22);
    background: linear-gradient(180deg, rgba(255, 242, 242, 0.98), rgba(255, 247, 247, 0.96));
}

#negotiations .negotiation-group-card.is-completed {
    border-color: rgba(30, 125, 84, 0.24);
    background: linear-gradient(180deg, rgba(239, 251, 244, 0.98), rgba(247, 253, 249, 0.96));
}

#negotiations .negotiation-group-card.is-opened {
    border-color: rgba(214, 197, 168, 0.9);
}

#negotiations .negotiation-group-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(214, 197, 168, 0.45);
}

#negotiations .negotiation-group-card.is-unmailed .negotiation-group-head {
    background: rgba(214, 72, 72, 0.06);
    border-bottom-color: rgba(173, 66, 66, 0.18);
}

#negotiations .negotiation-group-card.is-completed .negotiation-group-head {
    background: rgba(30, 125, 84, 0.06);
    border-bottom-color: rgba(30, 125, 84, 0.18);
}

#negotiations .negotiation-group-head strong {
    display: block;
    font-size: 18px;
    color: var(--green-dark);
    margin-bottom: 4px;
}

#negotiations .negotiation-group-head p {
    margin: 0;
}

#negotiations .negotiation-group-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

#negotiations input[data-negotiation-edit] {
    min-width: 108px;
    text-align: right;
}

#negotiations .status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
    background: #f4efe3;
    color: var(--green-dark);
}

#negotiations .status-pill.good {
    background: rgba(30, 125, 84, 0.12);
    border-color: rgba(30, 125, 84, 0.32);
    color: #175f42;
}

#negotiations .status-pill.warn {
    background: rgba(208, 140, 22, 0.13);
    border-color: rgba(208, 140, 22, 0.3);
    color: #8b5b0e;
}

#negotiations .status-pill.neutral {
    background: rgba(11, 67, 84, 0.1);
    border-color: rgba(11, 67, 84, 0.2);
    color: #0b4354;
}

.overview-period-toolbar {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.overview-period-controls {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 10px;
    align-items: end;
}

.stats-period-controls {
    grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.overview-period-field {
    display: grid;
    gap: 4px;
}

.overview-period-field span {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.accrued-manual-panel {
    margin-bottom: 18px;
}

.accrued-manual-grid {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(160px, auto);
    gap: 12px 16px;
    align-items: end;
    padding: 0 16px 16px;
}

.accrued-manual-actions {
    display: grid;
    gap: 8px;
    justify-items: start;
}

.accrued-manual-actions small {
    color: var(--muted);
}

.overview-period-label {
    margin: 0;
    font-size: 13px;
}

.kpi {
    min-height: 116px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(47, 111, 68, 0.055), transparent 62%),
        var(--surface);
    padding: 16px;
    box-shadow: 0 1px 0 rgba(23, 32, 42, 0.04);
}

.kpi::before {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: var(--amber);
    margin-bottom: 12px;
}

.kpi span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.kpi strong {
    display: block;
    margin-top: 12px;
    font-size: clamp(22px, 2.4vw, 31px);
    line-height: 1;
    overflow-wrap: anywhere;
}

.kpi small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.kpi-compare {
    display: block;
    margin-top: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.kpi-compare.is-up {
    color: var(--green);
}

.kpi-compare.is-down {
    color: var(--red);
}

.overview-waterfall-panel {
    margin: 0 0 12px;
}

.waterfall {
    padding: 14px 16px 16px;
    display: grid;
    gap: 12px;
}

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

.waterfall-summary-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px 12px;
    min-height: 78px;
}

.waterfall-summary-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.waterfall-summary-item strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.waterfall-summary-item.is-positive strong {
    color: var(--green);
}

.waterfall-summary-item.is-negative strong {
    color: var(--red);
}

.waterfall-rows {
    display: grid;
    gap: 10px;
}

.waterfall-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(220px, 2fr) minmax(100px, auto);
    align-items: center;
    gap: 10px;
}

.waterfall-meta {
    min-width: 0;
}

.waterfall-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--green-dark);
}

.waterfall-meta small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

.waterfall-bar-track {
    height: 16px;
    border-radius: 999px;
    background: #ebe6d7;
    overflow: hidden;
}

.waterfall-bar {
    display: block;
    height: 100%;
    min-width: 8px;
    border-radius: inherit;
    background: var(--green);
}

.waterfall-row.is-negative .waterfall-bar {
    background: var(--red);
}

.waterfall-row.is-total .waterfall-bar {
    background: var(--blue);
}

.waterfall-value {
    text-align: right;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.waterfall-row.is-negative .waterfall-value {
    color: var(--red);
}

.waterfall-row.is-total .waterfall-value {
    color: var(--blue);
}

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

.ranking-list {
    margin: 0;
    padding: 12px 16px 14px 34px;
    display: grid;
    gap: 10px;
}

.ranking-list li {
    min-height: 34px;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 8px;
}

.ranking-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.ranking-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.ranking-main strong {
    font-size: 14px;
    overflow-wrap: anywhere;
}

.ranking-main span {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ranking-sub {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
    gap: 18px;
    align-items: start;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 0 rgba(23, 32, 42, 0.04);
    min-width: 0;
}

.panel-header {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-3);
}

.panel-header h2 {
    margin: 0;
    font-size: 16px;
    color: var(--green-dark);
}

.panel-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.panel-header-actions #orderStatusFilter {
    width: 170px;
}

.panel-note {
    margin: 0;
    padding: 10px 16px 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.panel-note-danger {
    color: #9f3a2b;
}

.import-guide {
    margin-bottom: 12px;
}

.import-guide-collapsible details,
.auction-paused-collapsible details,
.assignment-archive-collapsible details {
    display: block;
}

.import-guide-collapsible .guide-summary,
.auction-paused-collapsible .guide-summary,
.assignment-archive-collapsible .guide-summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.import-guide-collapsible .guide-summary::-webkit-details-marker,
.auction-paused-collapsible .guide-summary::-webkit-details-marker,
.assignment-archive-collapsible .guide-summary::-webkit-details-marker {
    display: none;
}

.guide-summary-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.guide-summary::after,
.delivery-note-group-summary::after,
.delivery-note-delivery-summary::after,
summary.subsection-title::after,
.order-card-summary::after {
    content: "Öppna";
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
}

details[open] > .guide-summary::after,
details[open] > .delivery-note-group-summary::after,
details[open] > .delivery-note-delivery-summary::after,
details[open] > summary.subsection-title::after,
details[open] > .order-card-summary::after {
    content: "Stäng";
    border-color: rgba(47, 111, 68, 0.28);
    background: rgba(233, 243, 236, 0.92);
}

.guide-chevron {
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    transition: transform 0.16s ease;
}

.import-guide-collapsible details[open] .guide-chevron,
.auction-paused-collapsible details[open] .guide-chevron,
.assignment-archive-collapsible details[open] .guide-chevron {
    transform: rotate(180deg);
}

.guide-channel {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.guide-content {
    padding: 12px 16px 14px;
    display: grid;
    gap: 8px;
}

.guide-content p,
.guide-content ul,
.guide-content li {
    margin: 0;
    color: var(--text);
    line-height: 1.35;
}

.guide-content ul {
    padding-left: 20px;
    display: grid;
    gap: 4px;
}

.guide-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    background: #f1eee2;
    border-radius: 4px;
    padding: 1px 5px;
}

.guide-content textarea {
    width: 100%;
    min-height: 116px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--text);
    padding: 10px;
    resize: vertical;
}

.guide-actions {
    display: flex;
    justify-content: flex-end;
}

.section-space {
  margin-top: 18px;
}

.wide-input {
  width: 100%;
  max-width: 760px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.accounting-monthly-grid {
    display: grid;
    gap: 12px;
    padding-top: 2px;
}

.accounting-monthly-stack,
.accounting-sales-stack {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.accounting-month-panel {
    margin: 0;
}

.accounting-month-table {
    min-width: 0;
}

.accounting-month-table th,
.accounting-month-table td {
    vertical-align: top;
}

.accounting-month-table .numeric {
    white-space: normal;
}

.accounting-month-table .cell-main {
    max-width: none;
    white-space: nowrap;
}

.accounting-month-table .cell-sub {
    max-width: none;
    white-space: normal;
}

.accounting-compare {
    font-size: 11px;
    font-weight: 700;
}

.accounting-compare.is-up {
    color: var(--green);
}

.accounting-compare.is-down {
    color: var(--red);
}

.accounting-month-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 253, 248, 0.96);
    overflow: hidden;
}

.accounting-month-card-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: #f7f5ec;
}

.accounting-month-card-head strong {
    display: block;
    color: #486257;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.accounting-month-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 16px 16px;
}

.accounting-month-metric {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.accounting-month-metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.accounting-month-metric strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.accounting-empty {
    margin: 0;
    padding: 8px 16px 0;
}

.panel-subheader {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px 8px;
}

.panel-subheader h3 {
    margin: 0;
    font-size: 15px;
}

.category-complete-check {
    white-space: nowrap;
}

.is-muted-row {
    opacity: 0.72;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1180px;
}

#suppliers table {
    min-width: 1320px;
}

#overview table {
    table-layout: fixed;
    min-width: 1520px;
}

#overview th:nth-child(1),
#overview td:nth-child(1) {
    width: 31%;
}

#overview th:nth-child(2),
#overview td:nth-child(2) {
    width: 16%;
}

#overview th:nth-child(3),
#overview td:nth-child(3) {
    width: 8%;
}

#overview th:nth-child(4),
#overview td:nth-child(4) {
    width: 11%;
}

#overview th:nth-child(5),
#overview td:nth-child(5) {
    width: 11%;
}

#overview th:nth-child(6),
#overview td:nth-child(6) {
    width: 11%;
}

#overview th:nth-child(7),
#overview td:nth-child(7) {
    width: 12%;
}

#overview th .table-sort {
    white-space: nowrap;
}

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

th {
    color: #486257;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    background: #f7f5ec;
}

th .table-sort {
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-transform: inherit;
    justify-content: flex-start;
    gap: 6px;
}

th .table-sort:hover {
    border: 0;
    background: transparent;
    color: var(--green-dark);
}

th.numeric-head {
    text-align: right;
}

th.numeric-head .table-sort {
    width: 100%;
    justify-content: flex-end;
}

.sort-indicator {
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
}

.sort-indicator.is-active {
    color: var(--green-dark);
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr.is-selected td {
    background: rgba(47, 111, 68, 0.08);
    box-shadow: inset 3px 0 0 var(--green);
}

.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

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

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
    background: #ebe6d7;
    color: var(--text);
    white-space: nowrap;
}

.pill.good {
    background: rgba(47, 111, 68, 0.14);
    color: var(--green);
}

.pill.warn {
    background: rgba(192, 131, 36, 0.18);
    color: var(--amber);
}

.pill.bad {
    background: rgba(163, 58, 42, 0.13);
    color: var(--red);
}

.watch-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid transparent;
}

.watch-pill.good {
    color: var(--green);
    background: rgba(47, 111, 68, 0.12);
    border-color: rgba(47, 111, 68, 0.28);
}

.watch-pill.warn {
    color: #8a5a12;
    background: rgba(192, 131, 36, 0.16);
    border-color: rgba(192, 131, 36, 0.34);
}

.watch-pill.bad {
    color: var(--red);
    background: rgba(163, 58, 42, 0.14);
    border-color: rgba(163, 58, 42, 0.36);
}

.watch-pill.neutral {
    color: var(--muted);
    background: rgba(102, 112, 104, 0.12);
    border-color: rgba(102, 112, 104, 0.28);
}

.mode-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    border: 1px solid transparent;
    white-space: nowrap;
}

.mode-pill.owned_stock {
    color: var(--green);
    background: rgba(47, 111, 68, 0.12);
    border-color: rgba(47, 111, 68, 0.28);
}

.mode-pill.commission_only {
    color: var(--blue);
    background: rgba(29, 91, 114, 0.12);
    border-color: rgba(29, 91, 114, 0.28);
}

.mode-pill.unset {
    color: #9a5a21;
    background: rgba(214, 125, 47, 0.14);
    border-color: rgba(214, 125, 47, 0.36);
}

.toolbar,
.upload-form,
.inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-filters select {
    width: 180px;
}

.crm-toolbar {
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 14px 0 10px;
}

.crm-toolbar .inline-filters {
    flex-wrap: wrap;
}

.crm-toolbar input[type="search"] {
    min-width: 260px;
}

.crm-quick-button.is-active {
    background: rgba(47, 111, 68, 0.12);
    border-color: rgba(47, 111, 68, 0.35);
    color: var(--green-dark);
}

.crm-expand-row td {
    padding: 0;
    background: linear-gradient(180deg, #fffefb, var(--surface-2));
}

.crm-detail {
    padding: 16px;
}

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

.crm-detail-panel-wide {
    grid-column: 1 / -1;
}

.crm-detail-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.9);
}

.crm-detail-header {
    padding: 0;
}

.crm-note-list,
.crm-file-list {
    display: grid;
    gap: 10px;
}

.crm-note-item,
.crm-file-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
}

.crm-note-copy,
.crm-file-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.crm-note-copy p {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.crm-note-form {
    display: grid;
    gap: 10px;
}

.crm-note-form textarea {
    width: 100%;
    min-height: 88px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--text);
    padding: 10px 11px;
    resize: vertical;
}

.crm-file-form {
    justify-content: start;
    flex-wrap: wrap;
}

.crm-file-form input[type="file"] {
    width: min(360px, 100%);
}

.crm-type-fields {
    display: grid;
    gap: 12px;
}

.crm-type-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 10px;
}

.crm-type-field {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.crm-type-field input {
    width: 100%;
}

.crm-list-row {
    cursor: pointer;
}

.crm-list-row:hover {
    background: rgba(47, 111, 68, 0.045);
}

.crm-pipeline-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.crm-pipeline-heading span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.crm-pipeline {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 520px;
}

.crm-status-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 560px;
}

.crm-status-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.82);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.crm-status-check:hover {
    border-color: rgba(47, 111, 68, 0.26);
    background: rgba(47, 111, 68, 0.05);
}

.crm-status-check:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(204, 133, 24, 0.18);
}

.crm-status-check-box {
    position: relative;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 1.5px solid currentColor;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
}

.crm-status-check.is-checked {
    border-color: rgba(47, 111, 68, 0.24);
    background: rgba(47, 111, 68, 0.09);
    color: var(--green-dark);
}

.crm-status-check.is-checked .crm-status-check-box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.crm-status-check.is-current {
    border-color: rgba(204, 133, 24, 0.48);
    background: rgba(204, 133, 24, 0.15);
    color: #805413;
}

.crm-status-check.is-current .crm-status-check-box {
    background: rgba(255, 250, 240, 0.94);
}

.crm-status-check-label {
    display: inline-flex;
    align-items: center;
}

.crm-pipeline-step {
    display: inline-flex;
    align-items: center;
    max-width: 130px;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.8);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-pipeline-step.is-done {
    border-color: rgba(47, 111, 68, 0.24);
    background: rgba(47, 111, 68, 0.09);
    color: var(--green-dark);
}

.crm-pipeline-step.is-current {
    border-color: rgba(204, 133, 24, 0.48);
    background: rgba(204, 133, 24, 0.15);
    color: #805413;
}

.crm-editor-backdrop {
    position: fixed;
    inset: 0;
    z-index: 86;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 22, 17, 0.66);
    backdrop-filter: blur(5px) saturate(0.92);
    -webkit-backdrop-filter: blur(5px) saturate(0.92);
}

.crm-editor-modal {
    width: min(1080px, 96vw);
    max-height: min(88vh, 920px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.99), rgba(249, 247, 238, 0.99));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
    overflow: hidden;
}

.crm-editor-header,
.crm-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.crm-editor-header h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.05;
}

.crm-editor-close {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
}

.crm-editor-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 14px;
    padding: 16px;
    overflow: auto;
}

.crm-editor-card {
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 253, 248, 0.9);
}

.crm-editor-card-wide {
    grid-column: 1 / -1;
}

.crm-editor-card h3 {
    margin: 0;
}

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

.crm-editor-grid label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.crm-editor-grid label.wide {
    grid-column: 1 / -1;
}

.crm-role-flags {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.crm-role-flags label {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    font-size: 13px;
}

.crm-editor-grid textarea {
    width: 100%;
    min-height: 86px;
    resize: vertical;
}

.crm-editor-source-card {
    align-content: start;
}

.crm-source-meta-list {
    display: grid;
    gap: 10px;
}

.crm-source-meta-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(24, 85, 72, 0.12);
    border-radius: 12px;
    background: rgba(228, 241, 236, 0.55);
}

.crm-source-meta-item span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crm-source-meta-item strong,
.crm-source-meta-link {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.crm-system-locked-note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.crm-editor-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(255, 253, 248, 0.96);
}

.crm-editor-actions .primary {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: #fff;
}

@media (max-width: 860px) {
    .crm-editor-body,
    .crm-editor-grid,
    .crm-type-group {
        grid-template-columns: 1fr;
    }
}

.case-form,
.user-form {
    display: grid;
    gap: 10px;
    padding: 16px;
    align-items: start;
}

.case-form {
    grid-template-columns: 1.1fr 180px 180px 1.5fr minmax(180px, 1fr) auto;
}

.user-form {
    grid-template-columns: 1.2fr 1.2fr 170px 210px 1.6fr auto;
}

#userForm {
    grid-template-columns: minmax(180px, 1.15fr) minmax(180px, 1.15fr) 150px 150px 88px minmax(210px, 1fr) auto;
}

.user-form-hours-input {
    max-width: 88px;
    text-align: center;
}

.buyer-user-form {
    grid-template-columns: 1.1fr 1.1fr 1.7fr 1.5fr auto;
}

.buyer-user-form select {
    width: 100%;
}

#buyerCompanySelect,
#buyerUsersTable select {
    width: 100%;
}

.user-integration-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fffdf8;
}

.user-integration-card h3 {
    margin: 0;
}

.user-integration-card code {
    font-size: 12px;
    word-break: break-all;
}

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

.integration-overview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border: 1px solid rgba(16, 54, 43, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, #fffefb 0%, #f7f1e5 100%);
    box-shadow: 0 8px 24px rgba(16, 54, 43, 0.05);
}

.integration-overview-copy {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.integration-overview-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.integration-overview-head h3 {
    margin: 0;
    font-size: 19px;
    color: var(--green-dark);
}

.integration-overview-summary,
.integration-overview-note {
    margin: 0;
}

.integration-overview-summary {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.integration-overview-note {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.integration-overview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.integration-overview-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(16, 54, 43, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.integration-overview-actions,
.integration-modal-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.integration-overview-actions {
    justify-content: flex-end;
}

.integration-overview-modal {
    width: min(920px, 100%);
}

.reconciliation-credit-import-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.reconciliation-credit-import-form input[type="file"] {
    max-width: 100%;
}

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

.integration-detail-card {
    display: grid;
    gap: 7px;
    padding: 14px 15px;
    border: 1px solid rgba(16, 54, 43, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
}

.integration-detail-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.integration-detail-card strong,
.integration-detail-card code {
    font-size: 15px;
    line-height: 1.4;
    color: var(--green-dark);
}

.integration-detail-card code {
    word-break: break-all;
}

.integration-detail-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.integration-modal-section {
    display: grid;
    gap: 8px;
}

.integration-modal-section h3,
.integration-modal-section p {
    margin: 0;
}

.integration-modal-section h3 {
    font-size: 15px;
    color: var(--green-dark);
}

.integration-modal-section p {
    font-size: 14px;
    line-height: 1.55;
}

@media (max-width: 900px) {
    .integration-overview-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .integration-overview-actions {
        justify-content: flex-start;
    }

    .integration-detail-grid {
        grid-template-columns: 1fr;
    }

    .integration-overview-modal .system-meta-modal-header,
    .integration-overview-modal .system-meta-modal-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

.label-print-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.label-print-settings-field {
    display: grid;
    gap: 6px;
}

.label-print-settings-field span {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.label-print-settings-field input {
    width: 100%;
}

.settings-field-stack {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.settings-field-stack > span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.settings-field-stack textarea,
.settings-field-stack input,
.settings-field-stack select {
    width: 100%;
}

.label-print-settings-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.packflow-shipper-preference-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.packflow-shipper-preference-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.packflow-shipper-preference-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.packflow-shipper-preference-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.packflow-shipper-preference-copy strong,
.packflow-shipper-preference-copy span {
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .packflow-shipper-preference-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .packflow-shipper-preference-row button {
        width: 100%;
    }
}

.case-form textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--text);
    padding: 9px 11px;
    resize: vertical;
    font: inherit;
}

#caseForm button[type="submit"] {
    min-width: 132px;
    padding-inline: 16px;
}

.clock-shell {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.clock-status {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.clock-status strong {
    display: block;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.clock-status span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.clock-status.is-checked-in strong {
    color: var(--green);
}

.clock-status.is-checked-out strong {
    color: var(--red);
}

.clock-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.clock-controls input {
    min-width: 260px;
    flex: 1 1 260px;
}

.time-monthly-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 10px;
    padding: 12px 16px 4px;
}

.time-summary-kpi {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--surface);
}

.time-summary-kpi span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.time-summary-kpi strong {
    display: block;
    margin-top: 6px;
    font-size: 20px;
    line-height: 1.1;
}

.time-summary-kpi.is-positive strong,
.value-positive {
    color: var(--green);
}

.time-summary-kpi.is-negative strong,
.value-negative {
    color: var(--red);
}

#timeMonthlyTable input[data-time-vacation-hours] {
    width: 110px;
    margin-left: auto;
}

#cases table {
    min-width: 1520px;
}

@keyframes case-priority-alert-pulse {
    0%,
    100% {
        border-color: rgba(184, 53, 53, 0.72);
        box-shadow: 0 0 0 0 rgba(184, 53, 53, 0.18);
    }
    50% {
        border-color: rgba(184, 53, 53, 1);
        box-shadow: 0 0 0 4px rgba(184, 53, 53, 0.18);
    }
}

#caseStatusFilter,
#caseOwnerFilter {
    display: none;
}

.case-filter-stack {
    display: grid;
    gap: 6px;
    justify-items: end;
}

.case-filter-checks {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.case-filter-checks span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-owner-filter-checks {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 560px;
    justify-content: flex-end;
}

.case-assignee-picker {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    padding: 6px 8px;
}

.case-assignee-picker summary,
.work-plan-assignee-picker summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-assignee-checks,
.work-plan-assignee-checks {
    margin-top: 8px;
    display: grid;
    gap: 6px;
}

.work-plan-assignee-picker {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    padding: 6px 8px;
}

#workPlansTable .work-plan-assignee-picker {
    min-width: 180px;
}

#workPlansTable .work-plan-assignee-picker summary {
    overflow-wrap: anywhere;
}

#workPlanFormAssignees {
    min-height: 38px;
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 10px;
}

.work-plan-form-assignee-pickers {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 10px;
}

#categoryQueueFormAssignees {
    grid-template-columns: 1fr;
}

.work-plan-form-assignee-section {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fffdf8;
    padding: 8px 10px;
    display: grid;
    gap: 8px;
    min-width: 0;
}

.work-plan-action-heading,
.work-plan-action-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.work-plan-action-heading {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.work-plan-action-heading svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#workPlansTable td:nth-child(3) {
    width: 430px;
}

#workPlansTable td:nth-child(4) {
    width: 150px;
}

.work-plan-action-stack {
    display: grid;
    gap: 8px;
    min-width: 390px;
}

.work-plan-action-assignment {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.work-plan-action-picker {
    display: grid;
    gap: 4px;
    min-width: 0;
}

#workPlansTable .work-plan-assignee-picker {
    min-width: 0;
}

.work-flag-button {
    min-width: 34px;
    width: 34px;
    height: 34px;
}

.work-flag-button.is-on {
    border-color: #2f8f4e;
    background: #e6f6eb;
    color: #1f6f3b;
}

.work-plan-move-arrow {
    min-width: 34px;
    width: 34px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

.case-description-drop {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    padding: 6px 8px;
}

.case-description-drop summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-description-summary-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.case-read-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.case-read-badge.is-read {
    background: rgba(47, 111, 68, 0.12);
    color: #1f6f3b;
}

.case-read-badge.is-unread {
    background: rgba(139, 93, 23, 0.12);
    color: #8b5d17;
}

.case-description-drop textarea {
    width: 100%;
    margin-top: 8px;
    min-height: 92px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    color: var(--text);
    padding: 8px 10px;
    resize: vertical;
    font: inherit;
}

.case-description-history {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.case-current-description {
    margin-top: 8px;
    display: grid;
    gap: 6px;
    border: 1px solid rgba(134, 120, 82, 0.24);
    border-radius: 10px;
    background: linear-gradient(180deg, #fffefb, #f7f3e8);
    padding: 8px 10px;
}

.case-current-description.is-empty {
    background: #fffdf8;
}

.case-current-description-head {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-current-description-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.45;
}

.case-current-description-body .case-text-link,
.case-history-text .case-text-link {
    color: var(--blue);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.case-description-composer {
    margin-top: 0;
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(134, 120, 82, 0.24);
    border-radius: 10px;
    background: #ffffff;
}

.case-description-composer-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-description-composer textarea {
    width: 100%;
    min-height: 78px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    padding: 8px 10px;
    resize: vertical;
    font: inherit;
}

.case-description-composer-actions {
    display: flex;
    justify-content: flex-end;
}

.case-create-files {
    display: grid;
    gap: 6px;
}

.case-create-files span,
.case-create-files small {
    color: var(--muted);
}

.case-create-files span {
    font-size: 12px;
    font-weight: 700;
}

.case-create-files small {
    font-size: 12px;
}

.case-description-composer-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #f2ede0);
    color: var(--text);
    padding: 7px 12px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.case-description-composer-button:hover {
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.case-description-history-empty {
    margin-top: 10px;
}

.case-read-log {
    margin-top: 10px;
    display: grid;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(134, 120, 82, 0.28);
}

.case-read-log-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-read-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
}

.case-read-timeline-item {
    border: 1px solid rgba(134, 120, 82, 0.24);
    border-radius: 10px;
    background: linear-gradient(180deg, #fffefb, #f7f3e8);
    padding: 8px 10px;
    display: grid;
    gap: 4px;
}

.case-read-timeline-item span,
.case-read-timeline-item small {
    color: var(--muted);
}

.case-read-timeline-item span {
    font-size: 12px;
    font-weight: 700;
}

.case-read-timeline-item strong {
    font-size: 13px;
}

.case-read-timeline-item small {
    font-size: 12px;
}

.case-read-log-list {
    display: grid;
    gap: 8px;
}

.case-read-item {
    border: 1px solid rgba(134, 120, 82, 0.24);
    border-radius: 10px;
    background: linear-gradient(180deg, #fffefb, #f7f3e8);
    padding: 8px 10px;
    display: grid;
    gap: 4px;
}

.case-read-item.is-read {
    border-color: rgba(47, 111, 68, 0.24);
    background: linear-gradient(180deg, #fbfffc, #edf8f0);
}

.case-read-item-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.case-read-state {
    font-size: 12px;
    font-weight: 700;
    color: #8b5d17;
}

.case-read-item.is-read .case-read-state {
    color: #1f6f3b;
}

.case-read-item small {
    color: var(--muted);
}

.case-file-block {
    margin-top: 10px;
    display: grid;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed rgba(134, 120, 82, 0.28);
}

.case-file-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-file-list {
    display: grid;
    gap: 8px;
}

.case-file-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid rgba(134, 120, 82, 0.24);
    border-radius: 10px;
    background: linear-gradient(180deg, #fffefb, #f7f3e8);
    padding: 8px 10px;
}

.case-file-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.case-file-copy strong,
.case-file-copy small {
    overflow-wrap: anywhere;
}

.case-file-copy small {
    color: var(--muted);
}

.case-file-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.case-file-form input[type="file"] {
    flex: 1 1 220px;
    min-width: 0;
}

.case-description-history-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-description-history-list {
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
    padding-right: 2px;
}

.case-history-item {
    border: 1px solid rgba(134, 120, 82, 0.24);
    border-radius: 10px;
    background: linear-gradient(180deg, #fffefb, #f7f3e8);
    padding: 8px 10px;
    display: grid;
    gap: 6px;
}

.case-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-history-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.45;
}

.case-routing-cell {
    min-width: 220px;
    display: grid;
    gap: 8px;
}

.case-routing-lines {
    display: grid;
    gap: 6px;
}

.case-forward-control {
    display: grid;
    gap: 4px;
}

.case-forward-control span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-forward-select.is-forwarded {
    border-color: rgba(163, 58, 42, 0.38);
    background: rgba(163, 58, 42, 0.06);
    color: var(--red);
}

#cases tbody tr.case-row-forwarded td {
    background: rgba(163, 58, 42, 0.04);
}

#cases tbody tr.case-row-high-priority td.case-priority-cell {
    background: rgba(184, 53, 53, 0.05);
}

#cases .case-priority-select.is-high,
#caseForm .case-priority-select.is-high,
#caseForm select[name="priority"].is-high {
    border-color: rgba(184, 53, 53, 0.92);
    background: linear-gradient(180deg, #fff8f8, #fff0f0);
    color: #8c1f1f;
    font-weight: 800;
    animation: case-priority-alert-pulse 1.15s ease-in-out infinite;
}

#cases .case-priority-cell.is-high,
#caseForm select[name="priority"].is-high {
    border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
    #cases .case-priority-select.is-high,
    #caseForm .case-priority-select.is-high,
    #caseForm select[name="priority"].is-high {
        animation: none;
    }
}

#timeclock table {
    min-width: 1120px;
}

#timeclock td input[type="datetime-local"] {
    min-width: 190px;
}

#timeclock td [data-time-note] {
    min-width: 170px;
}

#users table {
    min-width: 1560px;
}

#users [data-user-active] {
    width: 18px;
    height: 18px;
    min-height: 18px;
}

.toolbar {
    justify-content: space-between;
    margin-bottom: 12px;
}

.sales-focus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    border: 1px solid rgba(29, 91, 114, 0.25);
    border-radius: 8px;
    background: rgba(29, 91, 114, 0.08);
    padding: 9px 11px;
}

.sales-focus[hidden] {
    display: none;
}

.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    flex-wrap: wrap;
}

.bulk-toolbar select {
    width: 190px;
}

.bulk-toolbar input:not([type="checkbox"]) {
    width: 210px;
}

.bulk-count {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    min-width: 86px;
}

.bulk-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
}

.bulk-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
}

.products-bulk-toolbar #productBulkCategory,
.products-bulk-toolbar #productBulkSupplier,
.products-bulk-toolbar #productBulkStorageLocation,
.products-bulk-toolbar #productBulkNumberValue {
    min-width: 210px;
}

.select-col {
    width: 42px;
    min-width: 42px;
    text-align: center;
}

.select-col input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
}

.toolbar input[type="search"] {
    max-width: 420px;
}

.sales-toolbar-secondary {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

.sales-toolbar-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    white-space: nowrap;
}

.sales-toolbar-field span {
    font-size: 13px;
    font-weight: 700;
}

.sales-toolbar-field select,
.sales-toolbar-field input {
    width: auto;
    min-width: 150px;
}

.sales-pager {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

.sales-pager[hidden] {
    display: none;
}

.sales-pager button {
    min-width: 40px;
}

.sales-pager-status {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.checkline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: var(--muted);
}

.checkline input {
    width: 18px;
    height: 18px;
    min-height: 18px;
}

.inline-form {
    flex-wrap: wrap;
    justify-content: end;
}

.inline-form input {
    width: 190px;
}

.supplier-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
    padding: 16px;
}

.supplier-form .wide {
    grid-column: span 2;
}

.supplier-form button {
    justify-self: start;
}

.manufacturer-form {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.manufacturer-logo-cell {
    width: 74px;
}

.manufacturer-logo-thumb,
.product-editor-manufacturer-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.manufacturer-logo-fallback,
.product-editor-manufacturer-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    background: rgba(38, 75, 63, 0.08);
    color: var(--green-dark);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.manufacturer-logo-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.manufacturer-logo-form input[type="file"] {
    max-width: 210px;
    font-size: 12px;
}

#manufacturers table {
    min-width: 1500px;
}

.auction-plan-form {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

#auction-planning table {
    min-width: 1500px;
}

#auction-planning th,
#auction-planning td {
    padding: 8px 10px;
}

#auction-planning td {
    font-size: 13px;
}

#auction-planning .auction-plan-date-cell {
    width: 130px;
}

#auction-planning .auction-plan-name-cell {
    width: 190px;
}

#auction-planning .auction-plan-start-cell {
    width: 280px;
}

#auction-planning .auction-plan-comment-cell {
    width: 300px;
}

#auction-planning .auction-plan-reserve-cell {
    width: 620px;
}

#auction-planning [data-auction-plan-date],
#auction-planning [data-auction-plan-name],
#auction-planning [data-auction-plan-pause],
#auction-planning [data-auction-plan-url],
#auction-planning [data-auction-plan-comments],
#auction-planning .auction-plan-reserve-value {
    min-height: 32px;
    padding: 0 6px;
    font-size: 13px;
}

#auction-planning .row-actions {
    gap: 6px;
}

#auction-planning .row-actions .icon-button,
#auction-planning .auction-start-link-wrap .icon-button,
#auction-planning .auction-start-edit .icon-button {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
}

#work-planning table {
    min-width: 920px;
}

#inbound-deliveries table {
    min-width: 980px;
}

#inboundDeliveryForm {
    grid-template-columns: minmax(240px, 2.1fr) minmax(190px, 1.35fr) minmax(120px, 0.8fr) minmax(170px, 1fr) minmax(210px, 1.2fr) auto;
    align-items: end;
}

#inboundDeliveryForm .wide {
    grid-column: auto;
}

#inbound-deliveries [data-inbound-delivery-uses-note] {
    min-width: 190px;
}

#inbound-deliveries th,
#inbound-deliveries td {
    padding: 6px;
    vertical-align: middle;
}

#inboundDeliveriesTable td[colspan],
#inboundDeliveriesCompletedTable td[colspan] {
    padding: 14px 12px;
    color: var(--muted);
}

#delivery-notes table {
    min-width: 1220px;
}

#delivery-notes th,
#delivery-notes td {
    padding: 6px;
    vertical-align: middle;
}

#deliveryNoteImportForm select {
    min-width: 280px;
}

#deliveryNoteImportForm input[list="supplierOptions"] {
    min-width: 260px;
}

#packflow table {
    min-width: 2110px;
}

#packflow th,
#packflow td {
    padding: 6px 7px;
}

#packflow .packflow-batch-list {
    display: grid;
    gap: 14px;
    margin-top: 8px;
}

#packflow .packflow-current-batch {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fffefb, var(--surface-2));
}

#packflow .packflow-current-batch.is-inline {
    margin-top: 2px;
    padding: 12px 0 0;
    border: 0;
    border-top: 1px solid rgba(16, 35, 31, 0.1);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#packflow .packflow-current-batch.is-active {
    border-color: rgba(176, 84, 108, 0.34);
    background: linear-gradient(180deg, #fff7fa, #fff1f5);
    box-shadow: 0 0 0 1px rgba(176, 84, 108, 0.08);
}

#packflow .packflow-current-batch.is-completed {
    border-color: rgba(198, 148, 61, 0.34);
    box-shadow: 0 0 0 1px rgba(198, 148, 61, 0.08);
}

#packflow .packflow-current-batch-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

#packflow .packflow-current-batch-head.is-inline {
    align-items: center;
}

#packflow .packflow-batch-title-line {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

#packflow .packflow-current-batch-title-line {
    display: flex;
}

#packflow .packflow-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(24, 49, 42, 0.14);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 auto;
}

#packflow .packflow-source-badge.is-compact {
    padding: 4px 8px;
}

#packflow .packflow-source-badge img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex: 0 0 auto;
}

#packflow .packflow-source-badge--ps {
    border-color: rgba(27, 92, 72, 0.18);
    background: rgba(27, 92, 72, 0.08);
    color: var(--green-dark);
}

#packflow .packflow-source-badge--tradera {
    border-color: rgba(194, 152, 25, 0.28);
    background: rgba(251, 232, 137, 0.28);
    color: #6e5200;
}

#packflow .packflow-import-launchers {
    padding-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

#packflow .packflow-import-launcher {
    appearance: none;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: min(540px, 100%);
    padding: 16px 18px;
    border: 1px solid rgba(27, 92, 72, 0.16);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(27, 92, 72, 0.07), rgba(255, 255, 255, 0.98));
    box-shadow: 0 18px 34px rgba(7, 22, 18, 0.08);
    text-align: left;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

#packflow .packflow-import-launcher:hover {
    transform: translateY(-1px);
    border-color: rgba(27, 92, 72, 0.28);
    box-shadow: 0 20px 36px rgba(7, 22, 18, 0.1);
}

#packflow .packflow-import-launcher:focus-visible {
    outline: 2px solid rgba(27, 92, 72, 0.32);
    outline-offset: 3px;
}

#packflow .packflow-import-launcher .packflow-source-badge {
    margin-top: 2px;
}

#packflow .packflow-import-launcher-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

#packflow .packflow-import-launcher-copy strong {
    color: var(--green-dark);
    font-size: 15px;
}

#packflow .packflow-import-launcher-copy small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.packflow-import-backdrop {
    position: fixed;
    inset: 0;
    z-index: 125;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(7, 22, 18, 0.58);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.packflow-import-backdrop[hidden] {
    display: none;
}

.packflow-import-modal {
    width: min(760px, 100%);
    max-height: min(90vh, 920px);
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1px solid rgba(14, 52, 43, 0.16);
    border-radius: 24px;
    background: #fffdfa;
    box-shadow: 0 28px 70px rgba(7, 22, 18, 0.22);
    overflow: hidden;
}

.packflow-import-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.packflow-import-modal-header h3 {
    margin: 2px 0 0;
    font-size: 32px;
    line-height: 1.02;
    color: var(--green-dark);
}

.packflow-import-modal-close {
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 999px;
}

.packflow-import-modal-body {
    overflow: auto;
    padding: 22px;
    display: grid;
    gap: 18px;
}

#packflow .packflow-import-intro {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(27, 92, 72, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(247, 252, 249, 0.94), rgba(255, 255, 255, 0.98));
}

#packflow .packflow-import-intro .muted {
    margin: 0;
}

#packflow .packflow-import-form {
    align-items: center;
}

#packflow .packflow-import-form input[type="file"] {
    width: 100%;
    max-width: none;
}

#packflow .packflow-import-help {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
}

#packflow .packflow-import-help p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

#packflow .packflow-import-help p strong {
    color: var(--green-dark);
    font-size: 14px;
}

#packflow .packflow-import-help-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#packflow .packflow-import-help-links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(27, 92, 72, 0.16);
    border-radius: 999px;
    background: rgba(27, 92, 72, 0.06);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

#packflow .packflow-import-help-links a:hover {
    background: rgba(27, 92, 72, 0.1);
}

#packflow .packflow-current-batch-kicker {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#packflow .packflow-current-batch h3 {
    margin: 0;
    font-size: 18px;
}

#packflow .packflow-current-batch-head.is-inline strong {
    font-size: 14px;
    color: var(--ink);
}

#packflow .packflow-current-batch.is-inline p.muted {
    margin-top: 8px;
}

#packflow .packflow-current-batch p {
    margin: 10px 0 0;
}

#packflow .packflow-current-batch-status {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(47, 111, 68, 0.12);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 700;
}

#packflow .packflow-current-batch.is-active .packflow-current-batch-status {
    background: rgba(176, 84, 108, 0.14);
    color: #8f3e55;
}

#packflow .packflow-preview-head {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

#packflow .packflow-current-batch.is-inline .packflow-preview-head {
    margin-top: 8px;
    justify-content: flex-end;
}

#packflow .packflow-preview-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

#packflow .packflow-preview-card {
    padding: 12px;
    border: 1px solid rgba(20, 64, 52, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    display: grid;
    gap: 6px;
}

#packflow .packflow-preview-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#packflow .packflow-preview-card strong {
    font-size: 28px;
    line-height: 1;
}

#packflow .packflow-preview-card small {
    color: var(--muted);
    font-size: 12px;
}

#packflow .packflow-preview-issues {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(176, 84, 108, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    display: grid;
    gap: 10px;
}

#packflow .packflow-preview-issues.is-ready {
    border-color: rgba(47, 111, 68, 0.18);
}

#packflow .packflow-preview-issues strong {
    font-size: 13px;
}

#packflow .packflow-preview-issues p {
    margin: 0;
}

#packflow .packflow-preview-issue-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

#packflow .packflow-preview-issue-list li.is-warn {
    color: #8b5d17;
}

#packflow .packflow-preview-issue-list li.is-error {
    color: #9e3c46;
}

#packflow .packflow-preview-error-samples {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

#packflow .packflow-preview-error-samples > div {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(176, 84, 108, 0.08);
}

#packflow .packflow-batch-groups {
    display: grid;
    gap: 16px;
}

#packflow .packflow-batch-group {
    display: grid;
    gap: 10px;
}

#packflow .packflow-batch-group-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

#packflow .packflow-batch-group-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
}

#packflow .packflow-batch-group-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #fffefb, var(--surface-2));
    color: inherit;
    text-align: left;
    cursor: pointer;
}

#packflow .packflow-batch-group-toggle::after {
    content: "▾";
    margin-left: auto;
    color: var(--muted);
    transition: transform 160ms ease;
}

#packflow .packflow-batch-group-toggle[aria-expanded="false"]::after {
    transform: rotate(-90deg);
}

#packflow .packflow-batch-group-title {
    font-size: 15px;
    font-weight: 800;
}

#packflow .packflow-batch-group-toolbar {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

#packflow .packflow-batch-group-toolbar .packflow-batch-group-toggle {
    flex: 1 1 auto;
    width: auto;
}

#packflow .packflow-batch-group-head {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

#packflow .packflow-batch-group-toggle::after {
    content: none;
}

#packflow .packflow-batch-group-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(47, 111, 68, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
}

#packflow .packflow-batch-group-action-icon {
    color: var(--muted);
    font-size: 13px;
}

#packflow .packflow-batch-group-toggle[aria-expanded="true"] .packflow-batch-group-action {
    background: rgba(233, 243, 236, 0.92);
}

#packflow .packflow-batch-group-toggle[aria-expanded="true"] .packflow-batch-group-action-icon {
    color: var(--green-dark);
}

#packflow .packflow-batch-items {
    display: grid;
    gap: 10px;
}

#packflow .packflow-batch-items[hidden] {
    display: none;
}

#packflow .packflow-batch-card {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #fffefb, var(--surface-2));
    padding: 10px 12px;
}

#packflow .packflow-batch-card.is-active {
    border-color: rgba(176, 84, 108, 0.28);
    background: linear-gradient(180deg, #fff7fa, #fff1f5);
}

#packflow .packflow-batch-card.is-selected {
    border-color: rgba(47, 111, 68, 0.46);
    box-shadow: 0 0 0 1px rgba(47, 111, 68, 0.08);
}

#packflow .packflow-batch-card.is-completed {
    opacity: 0.92;
    background: linear-gradient(180deg, #fffefb, #f7f4eb);
}

#packflow .packflow-batch-main {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: inherit;
    cursor: pointer;
}

#packflow .packflow-batch-main strong {
    font-size: 14px;
    margin-right: 0;
}

#packflow .packflow-batch-main span {
    font-size: 12px;
    color: var(--muted);
}

#packflow .packflow-batch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#packflow .packflow-batch-inline-rows {
    margin-top: 6px;
    border-top: 1px solid rgba(38, 75, 63, 0.12);
    padding-top: 10px;
}

#packflow .packflow-inline-table-wrap {
    margin: 0;
    max-height: none;
}

#packflow .packflow-batch-actions .mini-move.is-selected {
    border-color: rgba(47, 111, 68, 0.34);
    background: rgba(47, 111, 68, 0.08);
    color: var(--green-dark);
}

#packflow [data-packflow-input] {
    min-width: 120px;
}

#packflow [data-packflow-field="source_import_id"],
#packflow [data-packflow-field="storage_location"],
#packflow [data-packflow-field="postal_code"] {
    min-width: 90px;
}

#packflow [data-packflow-field="shipper_alias"] {
    width: 76px;
    min-width: 76px;
}

#packflow [data-packflow-field="quantity"] {
    width: 56px;
    min-width: 56px;
    text-align: center;
}

#packflow [data-packflow-field="item_name"] {
    min-width: 300px;
}

#packflow [data-packflow-field="bidder_name"] {
    min-width: 220px;
}

#packflow [data-packflow-field="address1"] {
    min-width: 180px;
}

#packflow [data-packflow-field="address2"] {
    width: 96px;
    min-width: 96px;
}

#packflow [data-packflow-field="country"] {
    width: 84px;
    min-width: 84px;
}

#packflow [data-packflow-field="weight_grams"] {
    width: 68px;
    min-width: 68px;
}

#packflow .packflow-source-address {
    min-width: 280px;
    max-width: 380px;
    white-space: normal;
}

#packflow .packflow-row-invalid {
    background: rgba(153, 27, 27, 0.04);
}

#packflow .packflow-row-sent {
    background: rgba(47, 111, 68, 0.05);
}

#packflow .packflow-row-error {
    background: rgba(153, 27, 27, 0.06);
}

#packflow .packflow-row-required-invalid {
    background: rgba(192, 131, 36, 0.05);
}

#packflow .packflow-settings-section {
    margin-top: 16px;
}

#packflow .packflow-settings-card {
    display: block;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}

#cases #packflowSettingsSection {
    display: none;
}

#packflow .packflow-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

#packflow .packflow-settings-head .panel-note {
    margin: 6px 0 0;
}

#packflow .packflow-settings-head > div > strong {
    display: none;
}

#packflow #packflowSettingsCard {
    display: grid;
    gap: 12px;
}

#packflow #packflowSettingsCard .mini-move {
    white-space: nowrap;
}

#packflow .packflow-shipper-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

#packflow .packflow-shipper-select.is-forced select {
    border-color: rgba(192, 131, 36, 0.48);
    background: rgba(192, 131, 36, 0.08);
    color: var(--text);
}

#packflow .packflow-shipper-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--amber);
    font-size: 14px;
    line-height: 1;
    cursor: help;
}

#packflow .packflow-shipper-note {
    display: grid;
    gap: 6px;
}

#packflow .packflow-shipper-note strong {
    color: inherit;
}

#packflow .packflow-shipper-note button {
    justify-self: flex-start;
}

#packflowExceptionModal .system-meta-modal {
    width: min(940px, 100%);
}

#packflowExceptionModal .system-meta-modal-body {
    gap: 16px;
}

.packflow-exception-modal-summary {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid rgba(14, 52, 43, 0.12);
    border-radius: 14px;
    background: rgba(244, 239, 227, 0.55);
}

.packflow-exception-modal-summary p {
    margin: 0;
}

.packflow-exception-editor-list {
    display: grid;
    gap: 14px;
}

.packflow-exception-editor-row {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(14, 52, 43, 0.12);
    border-radius: 16px;
    background: #ffffff;
}

.packflow-exception-editor-row.is-highlighted {
    border-color: rgba(192, 131, 36, 0.42);
    box-shadow: inset 0 0 0 1px rgba(192, 131, 36, 0.18);
    background: rgba(255, 249, 238, 0.95);
}

.packflow-exception-editor-row-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.packflow-exception-editor-row-head p {
    margin: 4px 0 0;
}

.packflow-exception-editor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.packflow-exception-editor-field {
    display: grid;
    gap: 6px;
}

.packflow-exception-editor-field.is-wide {
    grid-column: 1 / -1;
}

.packflow-exception-editor-field span {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.packflow-exception-editor-field textarea {
    min-height: 92px;
    resize: vertical;
}

.packflow-exception-editor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.packflow-exception-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .packflow-exception-editor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .packflow-exception-editor-grid {
        grid-template-columns: 1fr;
    }
}

#packflow [data-packflow-input][aria-invalid="true"] {
    border-color: rgba(192, 131, 36, 0.55);
    background: rgba(192, 131, 36, 0.07);
}

#packflow .packflow-postal-cell-invalid input {
    border-color: rgba(153, 27, 27, 0.38);
    background: rgba(153, 27, 27, 0.06);
}

#packflow .packflow-field-note {
    margin-top: 4px;
    min-width: 170px;
    color: var(--red);
    font-size: 12px;
    line-height: 1.3;
    white-space: normal;
}

#packflow .packflow-required-note {
    color: var(--amber);
}

#packflow .packflow-shipper-note {
    color: var(--amber);
}

#packflow .packflow-send-note {
    color: var(--muted);
}

#packflow .packflow-send-note.is-sent {
    color: var(--green-dark);
}

#packflow .packflow-send-note.is-error {
    color: var(--red);
}

#packflow .packflow-sync-note {
    color: var(--muted);
}

#packflow .packflow-sync-note.is-synced,
#packflow .packflow-sync-message.is-synced {
    color: var(--green-dark);
}

#packflow .packflow-sync-note.is-pending,
#packflow .packflow-sync-message.is-pending {
    color: var(--amber);
}

#packflow .packflow-sync-note.is-error,
#packflow .packflow-sync-message.is-error {
    color: var(--red);
}

#packflow .packflow-sync-note a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

#packflow .packflow-postal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

#packflow .packflow-postal-override {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
}

#packflow .packflow-postal-add {
    min-width: 32px;
    padding-inline: 10px;
}

#packflowExportLink.is-disabled {
    pointer-events: none;
    opacity: 0.55;
}

.delivery-note-help {
    position: relative;
}

.delivery-note-help-button {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    list-style: none;
    font-weight: 800;
    user-select: none;
}

.delivery-note-help-button::-webkit-details-marker {
    display: none;
}

.delivery-note-help-card {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(440px, 78vw);
    padding: 14px 40px 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    z-index: 5;
}

.delivery-note-help-card.help-card-wide {
    width: min(560px, 84vw);
}

.sales-help-card {
    width: min(760px, 92vw);
    max-height: min(80vh, 900px);
    overflow: auto;
}

.delivery-note-help-card p {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.45;
}

.delivery-note-help-card p:last-child {
    margin-bottom: 0;
}

.delivery-note-help-card strong {
    font-size: 14px;
}

.delivery-note-help-card-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    min-width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--green-dark);
    font-size: 18px;
    line-height: 1;
}

.delivery-note-help[open] .delivery-note-help-button {
    border-color: rgba(47, 111, 68, 0.36);
    color: var(--green);
}

.delivery-note-groups {
    display: grid;
    gap: 12px;
}

.delivery-note-workspace-list,
.delivery-note-switcher {
    display: grid;
    gap: 10px;
}

.delivery-note-switcher-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    text-align: left;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.delivery-note-switcher-button:hover {
    transform: translateY(-1px);
    border-color: rgba(47, 111, 68, 0.28);
}

.delivery-note-switcher-button.is-active {
    border-color: rgba(47, 111, 68, 0.34);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: inset 4px 0 0 var(--green);
}

.delivery-note-switcher-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.delivery-note-switcher-copy {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    min-width: 0;
}

.delivery-note-switcher-copy strong {
    font-size: 14px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.delivery-note-switcher-copy span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.delivery-note-switcher-meta,
.delivery-note-switcher-status {
    white-space: nowrap;
}

.delivery-note-switcher-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(47, 111, 68, 0.08);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.delivery-note-switcher-status.is-pending {
    background: rgba(201, 134, 30, 0.12);
    color: #8a5c00;
}

.delivery-note-switcher-status.is-complete {
    background: rgba(47, 111, 68, 0.12);
    color: var(--green-dark);
}

.delivery-note-switcher-progress {
    flex-shrink: 0;
    min-width: 48px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(47, 111, 68, 0.12);
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.delivery-note-switcher-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.delivery-note-switcher-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(47, 111, 68, 0.08);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.delivery-note-switcher-badge.is-pending {
    background: rgba(201, 134, 30, 0.12);
    color: #8a5c00;
}

@media (max-width: 1100px) {
    .delivery-note-switcher-button {
        align-items: flex-start;
    }

    .delivery-note-switcher-top {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .delivery-note-switcher-copy {
        width: 100%;
    }
}

.delivery-note-switcher-badge.is-complete {
    background: rgba(47, 111, 68, 0.14);
    color: var(--green);
}

.delivery-note-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 88;
    display: grid;
    place-items: center;
    padding: 8px;
    background: rgba(7, 22, 17, 0.6);
    backdrop-filter: blur(6px) saturate(0.92);
    -webkit-backdrop-filter: blur(6px) saturate(0.92);
    overscroll-behavior: contain;
}

.delivery-note-modal-backdrop[hidden] {
    display: none;
}

.delivery-note-modal {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.995), rgba(249, 247, 238, 0.995));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
}

.delivery-note-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.delivery-note-modal-copy {
    display: grid;
    gap: 6px;
}

.delivery-note-modal-copy h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.05;
}

.delivery-note-modal-copy p {
    margin: 0;
    color: var(--muted);
}

.delivery-note-modal-body {
    overflow: auto;
    padding: 12px 12px 14px;
    overscroll-behavior: contain;
}

.delivery-note-modal-body .delivery-note-delivery {
    border-radius: 18px;
}

.delivery-note-modal-body .delivery-note-delivery-summary {
    cursor: default;
    pointer-events: none;
}

.delivery-note-modal-body .delivery-note-delivery-summary .guide-chevron {
    display: none;
}

.delivery-note-modal-body .table-wrap {
    position: relative;
}

#deliveryNoteModal table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f7f5ec;
    box-shadow: inset 0 -1px 0 var(--line);
}

.delivery-note-delivery,
.delivery-note-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.delivery-note-delivery-summary,
.delivery-note-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.delivery-note-delivery-summary::-webkit-details-marker,
.delivery-note-group-summary::-webkit-details-marker {
    display: none;
}

.delivery-note-delivery-summary {
    padding: 14px 16px;
}

.delivery-note-delivery-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.delivery-note-progress {
    --delivery-progress: 0%;
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background:
        conic-gradient(var(--green) var(--delivery-progress), rgba(163, 58, 42, 0.22) 0);
}

.delivery-note-progress::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--surface);
}

.delivery-note-progress span {
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: 800;
}

.delivery-note-delivery-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.delivery-note-delivery-copy strong {
    font-size: 16px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.delivery-note-delivery-meta {
    color: var(--muted);
    font-size: 13px;
}

.delivery-note-delivery-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.delivery-note-stat {
    display: grid;
    gap: 2px;
    min-width: 92px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.delivery-note-stat strong {
    font-size: 14px;
    line-height: 1.1;
}

.delivery-note-stat small {
    color: var(--muted);
    font-size: 11px;
}

.delivery-note-stat.is-good strong {
    color: var(--green);
}

.delivery-note-stat.is-bad strong {
    color: var(--red);
}

.delivery-note-delivery[open] > .delivery-note-delivery-summary .guide-chevron {
    transform: rotate(180deg);
}

.delivery-note-delivery-body {
    display: grid;
    gap: 10px;
    padding: 0 16px 16px;
}

.delivery-note-section-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
}

.delivery-note-group-summary {
    padding: 12px 14px;
}

.delivery-note-group .table-wrap {
    border-top: 1px solid var(--line);
}

#inboundDeliveriesCompletedSection .table-wrap {
    border-top: 1px solid var(--line);
}

.inbound-delivery-completed-row td {
    vertical-align: top;
}

.inbound-delivery-completed-row strong,
.inbound-delivery-completed-row small {
    display: block;
}

.delivery-note-bulk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px 0;
}

.delivery-note-bulk-toolbar .checkline {
    gap: 10px;
}

.delivery-note-bulk-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ps-reservation-summary {
    padding: 0 16px 16px;
}

.ps-reservation-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ps-reservation-summary-card {
    display: grid;
    gap: 6px;
    padding: 12px 13px;
    border: 1px solid rgba(204, 194, 174, 0.8);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
}

.ps-reservation-summary-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ps-reservation-summary-card strong {
    font-size: 24px;
    line-height: 1.05;
}

.ps-reservation-summary-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.ps-reservation-summary-card.is-action {
    border-color: rgba(163, 58, 42, 0.32);
    background: linear-gradient(180deg, rgba(163, 58, 42, 0.08), rgba(255, 255, 255, 0.94));
}

.ps-reservation-summary-card.is-action strong {
    color: var(--red);
}

.ps-reservation-summary-card.is-active {
    border-color: rgba(192, 131, 36, 0.3);
    background: linear-gradient(180deg, rgba(192, 131, 36, 0.08), rgba(255, 255, 255, 0.94));
}

.ps-reservation-summary-card.is-active strong {
    color: #9b6516;
}

.ps-reservation-summary-card.is-free {
    border-color: rgba(47, 111, 68, 0.28);
    background: linear-gradient(180deg, rgba(47, 111, 68, 0.08), rgba(255, 255, 255, 0.94));
}

.ps-reservation-summary-card.is-free strong {
    color: var(--green-dark);
}

#psReservationsPagePanel {
    --ps-reservation-sticky-select-width: 42px;
}

#psReservationsPagePanel .table-wrap {
    position: relative;
    border-top: 1px solid var(--line);
}

#psReservationsPagePanel table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f7f5ec;
    box-shadow: inset 0 -1px 0 var(--line);
}

#psReservationsPagePanel .ps-reservation-sticky-select,
#psReservationsPagePanel .ps-reservation-sticky-name {
    position: sticky;
    background: rgba(255, 253, 248, 0.98);
    background-clip: padding-box;
}

#psReservationsPagePanel .ps-reservation-sticky-select {
    left: 0;
    z-index: 5;
}

#psReservationsPagePanel .ps-reservation-sticky-name {
    left: var(--ps-reservation-sticky-select-width);
    z-index: 4;
    box-shadow: 1px 0 0 var(--line);
}

#psReservationsPagePanel table thead .ps-reservation-sticky-select,
#psReservationsPagePanel table thead .ps-reservation-sticky-name {
    background: #f7f5ec;
}

#psReservationsPagePanel table thead .ps-reservation-sticky-select {
    z-index: 7;
}

#psReservationsPagePanel table thead .ps-reservation-sticky-name {
    z-index: 6;
}

#traderaStockPagePanel .table-wrap {
    position: relative;
    border-top: 1px solid var(--line);
}

#traderaStockPagePanel table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f7f5ec;
    box-shadow: inset 0 -1px 0 var(--line);
}

#psReservationsPagePanel input[data-ps-reservation-quantity] {
    width: 96px;
}

.ps-reservation-delivery-cell,
.ps-reservation-product-cell,
.ps-reservation-status {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.ps-reservation-delivery-cell strong,
.ps-reservation-product-cell .cell-main {
    overflow-wrap: anywhere;
}

.ps-reservation-status small {
    color: var(--muted);
    line-height: 1.4;
}

.ps-reservation-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ps-reservation-pill.is-action,
.ps-reservation-pill.is-shortage {
    background: rgba(163, 58, 42, 0.12);
    color: var(--red);
}

.ps-reservation-pill.is-active {
    background: rgba(192, 131, 36, 0.14);
    color: #8a5d16;
}

.ps-reservation-pill.is-free {
    background: rgba(47, 111, 68, 0.12);
    color: var(--green-dark);
}

.ps-reservation-pill.is-muted {
    background: rgba(120, 129, 122, 0.14);
    color: var(--muted);
}

#psReservationsPagePanel .ps-reservation-row.is-action {
    background: linear-gradient(90deg, rgba(163, 58, 42, 0.1), rgba(255, 255, 255, 0));
}

#psReservationsPagePanel .ps-reservation-row.is-action .ps-reservation-sticky-select,
#psReservationsPagePanel .ps-reservation-row.is-action .ps-reservation-sticky-name {
    background: rgba(255, 242, 239, 0.98);
}

#psReservationsPagePanel .ps-reservation-row.is-shortage {
    background: linear-gradient(90deg, rgba(163, 58, 42, 0.07), rgba(255, 255, 255, 0));
}

#psReservationsPagePanel .ps-reservation-row.is-shortage .ps-reservation-sticky-select,
#psReservationsPagePanel .ps-reservation-row.is-shortage .ps-reservation-sticky-name {
    background: rgba(255, 245, 243, 0.98);
}

#psReservationsPagePanel .ps-reservation-row.is-active {
    background: linear-gradient(90deg, rgba(192, 131, 36, 0.08), rgba(255, 255, 255, 0));
}

#psReservationsPagePanel .ps-reservation-row.is-active .ps-reservation-sticky-select,
#psReservationsPagePanel .ps-reservation-row.is-active .ps-reservation-sticky-name {
    background: rgba(255, 249, 240, 0.98);
}

#psReservationsPagePanel .ps-reservation-row.is-free {
    background: linear-gradient(90deg, rgba(47, 111, 68, 0.06), rgba(255, 255, 255, 0));
}

#psReservationsPagePanel .ps-reservation-row.is-free .ps-reservation-sticky-select,
#psReservationsPagePanel .ps-reservation-row.is-free .ps-reservation-sticky-name {
    background: rgba(246, 251, 247, 0.98);
}

@media (max-width: 900px) {
    .ps-reservation-summary-grid {
        grid-template-columns: 1fr;
    }
}

.delivery-note-owner-grid {
    min-width: 180px;
}

#delivery-notes [data-inbound-item-owner-name] {
    width: 180px;
    text-align: left;
}

#delivery-notes [data-inbound-item-receive] {
    width: 64px;
    text-align: left;
}

#delivery-notes .delivery-note-receive-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    overflow: visible;
    min-width: 0;
}

#delivery-notes .delivery-note-receive-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

#delivery-notes .delivery-note-receive-eye {
    width: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 999px;
    flex: 0 0 auto;
}

#delivery-notes .delivery-note-receive-eye svg {
    width: 14px;
    height: 14px;
}

#delivery-notes .delivery-note-receive-preview {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    min-width: 210px;
    max-width: 260px;
    max-height: 320px;
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 253, 248, 0.98);
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
}

#delivery-notes .delivery-note-receive-preview[hidden] {
    display: none !important;
}

#delivery-notes .delivery-note-receive-preview-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    font-size: 12px;
    line-height: 1.3;
}

#delivery-notes .delivery-note-receive-preview-row span {
    color: var(--muted);
    font-weight: 600;
}

#delivery-notes .delivery-note-receive-preview-row strong {
    text-align: right;
    white-space: nowrap;
}

#delivery-notes .delivery-note-deviation-report {
    margin-bottom: 14px;
    overflow: hidden;
}

#delivery-notes .delivery-note-deviation-summary {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: var(--surface-3);
    border-bottom: 1px solid transparent;
    font-weight: 700;
    color: var(--green-dark);
}

#delivery-notes .delivery-note-deviation-summary::-webkit-details-marker {
    display: none;
}

#delivery-notes .delivery-note-deviation-summary .muted {
    font-weight: 600;
}

#delivery-notes .delivery-note-deviation-report[open] .delivery-note-deviation-summary {
    border-bottom-color: var(--line);
}

#delivery-notes .delivery-note-report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px 0;
}

#delivery-notes .delivery-note-deviation-cell {
    display: grid;
    gap: 4px;
    min-width: 112px;
}

#delivery-notes .delivery-note-deviation-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

#delivery-notes .delivery-note-deviation-meta {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
}

#delivery-notes .delivery-note-product-cell {
    display: grid;
    gap: 3px;
    min-width: 140px;
    max-width: 160px;
    align-items: start;
    justify-items: start;
    text-align: left;
}

#delivery-notes .delivery-note-product-cell .product-status-row {
    margin-top: 0;
}

#delivery-notes .delivery-note-product-cell .cell-main,
#delivery-notes .delivery-note-product-cell .cell-sub {
    max-width: none;
}

#delivery-notes .delivery-note-receive-log-block {
    display: grid;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

#delivery-notes .delivery-note-receive-log-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--green);
}

#delivery-notes .delivery-note-receive-log-list {
    display: grid;
    gap: 6px;
}

#delivery-notes .delivery-note-receive-log-entry {
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

#delivery-notes .delivery-note-receive-log-top,
#delivery-notes .delivery-note-receive-log-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
    font-size: 12px;
    line-height: 1.25;
}

#delivery-notes .delivery-note-receive-log-top strong {
    font-size: 13px;
}

#delivery-notes .delivery-note-receive-log-top span,
#delivery-notes .delivery-note-receive-log-meta span {
    color: var(--muted);
}

#delivery-notes .delivery-note-receive-empty {
    margin: 0;
    font-size: 12px;
}

#delivery-notes [data-inbound-item-storage-location] {
    width: 68px;
    min-width: 68px;
    text-align: left;
}

#delivery-notes [data-inbound-item-ps-reserved] {
    width: 56px;
    min-width: 56px;
    text-align: left;
}

#delivery-notes [data-inbound-item-comments] {
    width: 106px;
    min-width: 106px;
    text-align: left;
}

#delivery-notes th:first-child,
#delivery-notes td:first-child {
    width: 44px;
    max-width: 44px;
}

#delivery-notes [data-inbound-item-supplier-input] {
    width: 102px;
    min-width: 102px;
    text-overflow: ellipsis;
    text-align: left;
}

#delivery-notes .delivery-note-listed-head {
    display: inline-flex;
    width: 100%;
    justify-content: flex-start;
}

#delivery-notes .delivery-note-shortage-toggle {
    padding: 5px 7px;
    font-size: 11px;
}

#delivery-notes .delivery-note-item-row {
    box-shadow: inset 3px 0 0 rgba(47, 125, 190, 0.55);
}

#delivery-notes .delivery-note-item-row.is-active {
    background: rgba(228, 241, 253, 0.36);
}

#delivery-notes .delivery-note-item-row.is-completed {
    background: rgba(232, 246, 238, 0.46);
    box-shadow: inset 3px 0 0 rgba(47, 129, 84, 0.55);
}

#delivery-notes .delivery-note-item-row.has-deviation {
    background: rgba(255, 247, 225, 0.7);
    box-shadow: inset 3px 0 0 rgba(201, 134, 30, 0.82);
}

#delivery-notes table th:nth-child(3),
#delivery-notes table td:nth-child(3) {
    width: 114px;
    max-width: 114px;
}

#delivery-notes table th:nth-child(4),
#delivery-notes table td:nth-child(4) {
    width: 168px;
    max-width: 168px;
}

#delivery-notes table th:nth-child(9),
#delivery-notes table td:nth-child(9) {
    width: 128px;
    max-width: 128px;
}

#delivery-notes table th:nth-child(11),
#delivery-notes table td:nth-child(11) {
    width: 82px;
    max-width: 82px;
}

#delivery-notes table th:nth-child(14),
#delivery-notes table td:nth-child(14) {
    width: 72px;
    max-width: 72px;
}

#delivery-notes table th:nth-child(16),
#delivery-notes table td:nth-child(16) {
    width: 108px;
    max-width: 108px;
}

.delivery-note-received-value {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
}

.inline-platform-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: -3px;
}

.auction-start-link-wrap {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.auction-plan-reserve-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 620px;
    white-space: nowrap;
}

.auction-plan-reserve-toggle-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.auction-plan-reserve-value {
    flex: 0 0 calc(2ch + 16px);
    width: calc(2ch + 16px);
    min-width: calc(2ch + 16px);
    min-height: 32px;
    padding: 0 6px;
    text-align: center;
}

.auction-plan-inline-actions {
    margin-left: auto;
    flex: 0 0 auto;
}

.auction-plan-comment-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.auction-plan-comment-inline > *:first-child {
    flex: 1 1 0;
    min-width: 0;
}

.auction-plan-comment-inline [data-auction-plan-pause] {
    flex: 0 0 132px;
    width: 132px;
}

.auction-plan-date-display[disabled] {
    opacity: 0.7;
    background: var(--surface-3);
    color: var(--muted);
    cursor: not-allowed;
}

.auction-plan-reserve-hint {
    display: block;
    font-size: 11px;
    line-height: 1.15;
}

.auction-plan-reserve-hint.is-muted {
    color: var(--muted);
}

.auction-plan-reserve-hint.is-suggested {
    color: var(--green);
    font-weight: 700;
}

.auction-start-link {
    display: block;
    max-width: 240px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.auction-start-edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

#auction-planning .no-reserve-toggle,
#auction-planning .auction-plan-reserve-preset {
    width: auto;
    max-width: none;
    min-height: 32px;
    padding: 4px 10px;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    text-align: center;
    justify-self: auto;
}

.upload-form input[type="file"] {
    width: min(360px, 44vw);
    padding: 7px 9px;
}

.channel-picker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-picker select {
    width: 190px;
}

.new-channel-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-channel-wrap input {
    width: 180px;
}

.new-channel-wrap[hidden] {
    display: none;
}

.cell-main,
.cell-sub {
    display: block;
}

.cell-main {
    max-width: 280px;
    overflow-wrap: anywhere;
}

.cell-main.is-invalid {
    color: #a32020;
    font-weight: 600;
}

.cell-sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
    max-width: 280px;
    overflow-wrap: anywhere;
}

.table-sort-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-align: inherit;
    text-transform: inherit;
}

.table-sort-button span {
    color: var(--muted);
    font-size: 10px;
    margin-left: 3px;
}

.table-sort-button.is-active {
    color: var(--green-dark);
}

.preliminary-medals {
    display: inline-flex;
    gap: 3px;
    margin-left: 7px;
    vertical-align: middle;
}

.preliminary-medal {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 10px;
    font-weight: 900;
    height: 17px;
    justify-content: center;
    line-height: 1;
    min-width: 17px;
    padding: 0 5px;
}

.preliminary-medal.is-green {
    background: #dbeee1;
    color: #1f6b3a;
}

.preliminary-medal.is-yellow {
    background: #fff0bf;
    color: #8a6100;
}

.assignment-row--incomplete td {
    background: #fff7f2;
}

.assignment-row--stale-reporting td:first-child {
    box-shadow: inset 4px 0 0 #c08324;
}

.assignment-row--excluded td {
    background: #f5f4f2;
}

.assignment-row--archived td {
    background: #edf3f8;
}

.missing-cell {
    background: #fff1e6 !important;
}

.missing-field {
    border-color: #d67d2f !important;
    box-shadow: 0 0 0 1px rgba(214, 125, 47, 0.35);
}

.assignment-status-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.handler-name {
    display: block;
    min-width: 130px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.manual-entry {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    gap: 8px;
}

.row-actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.mini-move {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.mini-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
}

.mini-link:hover {
    background: var(--surface-2);
}

.work-card-launchers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.work-card-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: 14px;
    align-items: start;
}

.work-card-column {
    display: grid;
    grid-template-rows: auto minmax(160px, 1fr);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 252, 245, 0.9);
    overflow: hidden;
}

.work-card-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(16, 43, 31, 0.08);
    background: rgba(47, 111, 68, 0.06);
}

.work-card-column-header h3 {
    margin: 0;
    font-size: 15px;
}

.work-card-column-header span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.work-card-column-body {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 12px;
}

.work-card-empty {
    min-height: 120px;
    display: grid;
    place-items: center;
    padding: 18px 12px;
    border: 1px dashed rgba(16, 43, 31, 0.12);
    border-radius: 10px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.work-card-item {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(16, 43, 31, 0.1);
    border-left: 4px solid rgba(47, 111, 68, 0.26);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 14px rgba(16, 43, 31, 0.05);
}

.work-card-item.is-new {
    border-left-color: rgba(44, 114, 130, 0.38);
}

.work-card-item.is-accepted {
    border-left-color: rgba(180, 133, 47, 0.42);
}

.work-card-item.is-in-progress {
    border-left-color: rgba(47, 111, 68, 0.44);
}

.work-card-item.is-waiting {
    border-left-color: rgba(124, 101, 62, 0.4);
}

.work-card-item.is-done {
    border-left-color: rgba(95, 125, 104, 0.38);
    background: rgba(248, 251, 247, 0.96);
}

.work-card-item-title {
    display: grid;
    gap: 8px;
}

.work-card-item-title strong {
    font-size: 15px;
    line-height: 1.35;
}

.work-card-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.work-card-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(16, 43, 31, 0.12);
    border-radius: 999px;
    background: rgba(255, 252, 245, 0.92);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.work-card-badge-type {
    color: var(--green-dark);
}

.work-card-badge-priority {
    color: #805413;
    background: rgba(204, 133, 24, 0.12);
    border-color: rgba(204, 133, 24, 0.2);
}

.work-card-item-description {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.work-card-item-waiting {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.work-card-checklist-preview {
    display: grid;
    gap: 8px;
}

.work-card-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(16, 43, 31, 0.08);
    border-radius: 10px;
    background: rgba(255, 252, 245, 0.72);
    color: var(--text);
    font-size: 12px;
    line-height: 1.45;
}

.work-card-checklist-item input[type="checkbox"] {
    margin-top: 2px;
}

.work-card-checklist-item.is-done {
    color: var(--muted);
    text-decoration: line-through;
}

.work-card-item-meta,
.work-card-item-timeline {
    display: grid;
    gap: 5px;
}

.work-card-item-meta span,
.work-card-item-timeline span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.work-card-item-actions {
    display: grid;
    gap: 10px;
}

.work-card-item-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-card-item-actions .row-actions {
    flex-wrap: wrap;
}

.work-card-linked-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.work-card-linked-product-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(18, 71, 52, 0.1);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.work-card-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 22, 17, 0.68);
    backdrop-filter: blur(5px) saturate(0.92);
    -webkit-backdrop-filter: blur(5px) saturate(0.92);
}

.work-card-modal-backdrop[hidden] {
    display: none;
}

.work-card-modal {
    width: min(960px, 96vw);
    max-height: min(88vh, 920px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.99), rgba(249, 247, 238, 0.99));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
    overflow: hidden;
}

.work-card-modal-header,
.work-card-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
}

.work-card-modal-header {
    border-bottom: 1px solid var(--line);
}

.work-card-modal-copy {
    display: grid;
    gap: 6px;
}

.work-card-modal-copy h2,
.work-card-modal-copy p {
    margin: 0;
}

.work-card-modal-close {
    width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 999px;
    font-size: 24px;
    line-height: 1;
}

.work-card-modal-body {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
}

.work-card-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px;
    padding: 16px;
    overflow: auto;
}

.work-card-form-grid label,
.work-card-form-grid .wide {
    display: grid;
    gap: 6px;
}

.work-card-form-grid label span,
.work-card-assignee-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.work-card-form-grid label.wide,
.work-card-form-grid .wide {
    grid-column: 1 / -1;
}

.work-card-form-grid textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
}

.work-card-checklist-editor {
    display: grid;
    gap: 8px;
}

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

.work-card-checklist-editor-row input[type="text"] {
    min-width: 0;
}

.work-card-checklist-actions {
    display: flex;
    justify-content: flex-start;
}

.work-card-inline-flags {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.work-card-assignee-checks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: start;
    justify-items: start;
    min-height: 42px;
    padding: 12px;
    border: 1px solid rgba(16, 43, 31, 0.08);
    border-radius: 12px;
    background: rgba(255, 252, 245, 0.7);
}

.work-card-form-grid .work-card-assignee-checks .checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    white-space: normal;
}

.work-card-modal-meta {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.work-card-modal .case-current-description,
.work-card-modal .case-description-composer,
.work-card-modal .case-read-log,
.work-card-modal .case-description-history {
    margin-top: 0;
}

.work-card-modal .case-read-log {
    padding-top: 0;
    border-top: 0;
}

.work-card-modal .case-description-history-list {
    max-height: 220px;
}

.work-card-modal-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
}

.work-card-modal-actions .danger {
    margin-right: auto;
}

@media (max-width: 1280px) {
    .work-card-board {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }
}

@media (max-width: 920px) {
    .work-card-board {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

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

@media (max-width: 640px) {
    .work-card-board {
        grid-template-columns: 1fr;
    }

    .work-card-modal {
        width: min(100vw - 20px, 960px);
        max-height: calc(100vh - 20px);
    }

    .work-card-modal-header,
    .work-card-modal-actions {
        padding: 14px;
    }

    .work-card-form-grid {
        padding: 14px;
    }
}

.product-mobile-intro-panel {
    display: grid;
    gap: 18px;
}

.product-mobile-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.product-mobile-feature-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid rgba(204, 194, 174, 0.7);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 252, 244, 0.96), rgba(247, 243, 235, 0.94));
}

.product-mobile-feature-card strong {
    font-size: 15px;
}

.product-mobile-feature-card p,
.product-mobile-steps p {
    margin: 0;
}

.product-mobile-steps {
    display: grid;
    gap: 10px;
}

.ps-object-link {
    text-decoration: none;
}

.auction-plan-filter-btn {
    min-width: 190px;
}

.auction-plan-filter-btn.is-on {
    border-color: #2f8f4e;
    background: #e6f6eb;
    color: #1f6f3b;
    font-weight: 700;
}

.delivery-note-shortage-toggle.is-on {
    border-color: #2f8f4e;
    background: #e6f6eb;
    color: #1f6f3b;
    font-weight: 700;
}

.no-reserve-toggle.is-on,
.auction-plan-reserve-preset.is-on {
    border-color: #2f8f4e;
    background: #e6f6eb;
    color: #1f6f3b;
    font-weight: 700;
}

.no-reserve-toggle.auction-plan-reserve-mode-no-reserve.is-on {
    border-color: rgba(192, 131, 36, 0.55);
    background: rgba(192, 131, 36, 0.16);
    color: #8a5d16;
}

.auction-plan-reserve-preset.auction-plan-reserve-mode-by-submitter.is-on {
    border-color: rgba(29, 91, 114, 0.5);
    background: rgba(29, 91, 114, 0.12);
    color: var(--blue);
}

.auction-plan-reserve-preset.auction-plan-reserve-mode-percent.is-on {
    border-color: #2f8f4e;
    background: #e6f6eb;
    color: #1f6f3b;
}

.inbound-received-toggle.is-on {
    border-color: #2f8f4e;
    background: #e6f6eb;
    color: #1f6f3b;
    font-weight: 700;
}

.assignment-expand-row td {
    padding: 0;
    background: linear-gradient(180deg, #fffefb, var(--surface-2));
}

.product-row {
    cursor: pointer;
}

.product-expand-row td {
    padding: 0;
    background: linear-gradient(180deg, #fffefb, var(--surface-2));
}

.product-detail {
    padding: 16px;
}

.product-supplier-cell {
    display: grid;
    gap: 4px;
}

.product-supplier-cell .mode-pill {
    width: max-content;
}

.product-status-stack {
    display: grid;
    gap: 4px;
    margin-top: 4px;
}

.product-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin-top: 0;
}

.product-status-row.is-compact {
    gap: 4px;
}

.product-status-row.is-secondary {
    width: 100%;
}

.product-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    max-width: 100%;
    padding: 0 8px;
    border: 1px solid rgba(204, 194, 174, 0.75);
    border-radius: 999px;
    background: rgba(255, 253, 247, 0.95);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.product-status-indicator > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-status-indicator.is-compact {
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    padding: 0 7px;
}

.product-status-indicator svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.product-status-indicator.is-compact svg {
    width: 13px;
    height: 13px;
}

.product-status-indicator.is-good {
    border-color: rgba(27, 92, 72, 0.28);
    background: rgba(27, 92, 72, 0.1);
    color: var(--green-dark);
}

.product-status-indicator.is-bad {
    border-color: rgba(176, 84, 108, 0.3);
    background: rgba(176, 84, 108, 0.1);
    color: #8f3e55;
}

.product-status-indicator.is-warn {
    border-color: rgba(184, 138, 27, 0.36);
    background: rgba(184, 138, 27, 0.12);
    color: #8a6111;
}

.product-status-indicator.is-category {
    flex: 0 1 auto;
    max-width: 100%;
    justify-content: flex-start;
}

.product-channel-head {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.product-channel-head img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex: 0 0 auto;
}

.product-channel-head-free {
    gap: 8px;
}

.product-channel-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(27, 92, 72, 0.12);
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.product-portal-quick {
    display: grid;
    gap: 4px;
    min-width: 64px;
    justify-items: end;
    text-align: right;
}

.tradera-prolister-panel .panel-header {
    align-items: flex-start;
}

.external-platform-link {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--cream);
    color: var(--text);
    cursor: pointer;
    min-height: 38px;
    padding: 0 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.external-platform-link-icon-only {
    width: 38px;
    min-width: 38px;
    padding: 0;
}

.external-platform-link:hover {
    border-color: var(--line-strong);
    background: #fffdf7;
}

.external-platform-link:focus-visible {
    outline: 3px solid rgba(47, 111, 68, 0.2);
    outline-offset: 2px;
}

.external-platform-mark {
    width: 20px;
    height: 20px;
    display: block;
    border-radius: 5px;
    object-fit: contain;
    flex: 0 0 20px;
}

.tradera-prolister-settings {
    display: grid;
    grid-template-columns: minmax(280px, 2.2fr) repeat(3, minmax(120px, 0.8fr));
    gap: 12px;
    margin: 14px 0 10px;
}

.tradera-prolister-settings[hidden] {
    display: none !important;
}

.tradera-prolister-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tradera-prolister-popover .delivery-note-help-card {
    width: min(720px, 92vw);
    padding-right: 14px;
}

.tradera-prolister-popover-card .tradera-prolister-settings {
    margin: 12px 0;
}

.tradera-prolister-popover-button {
    font-size: 0;
}

.tradera-prolister-popover-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tradera-prolister-popover-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.tradera-prolister-settings[hidden] + .panel-note {
    display: none;
}

.tradera-prolister-settings label {
    display: grid;
    gap: 6px;
}

.tradera-prolister-settings label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.tradera-prolister-row-warning {
    background: rgba(176, 84, 108, 0.08);
}

.tradera-category-chip-list,
.tradera-suggestion-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tradera-category-chip,
.tradera-suggestion-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(47, 111, 68, 0.22);
    background: rgba(47, 111, 68, 0.06);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.tradera-category-chip:hover,
.tradera-suggestion-chip:hover {
    background: rgba(47, 111, 68, 0.12);
    border-color: rgba(47, 111, 68, 0.35);
}

.tradera-suggestion-groups {
    display: grid;
    gap: 14px;
}

.tradera-suggestion-group {
    display: grid;
    gap: 6px;
}

.tradera-suggestion-group strong {
    font-size: 13px;
}

.tradera-truncate {
    display: block;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

.tradera-overview-card {
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 16px 18px;
    border: 1px solid rgba(204, 194, 174, 0.8);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 245, 236, 0.92));
    box-shadow: 0 16px 34px rgba(7, 22, 18, 0.06);
}

.tradera-overview-card.is-attention {
    border-color: rgba(192, 131, 36, 0.34);
    background: linear-gradient(180deg, rgba(192, 131, 36, 0.11), rgba(255, 255, 255, 0.96));
}

.tradera-overview-card.is-open {
    border-color: rgba(47, 111, 68, 0.28);
    background: linear-gradient(180deg, rgba(47, 111, 68, 0.1), rgba(255, 255, 255, 0.96));
}

.tradera-overview-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.tradera-overview-card h3 {
    margin: 0;
    font-size: 21px;
    line-height: 1.08;
}

.tradera-overview-card .panel-note {
    margin: 0;
}

.tradera-overview-card-summary {
    min-height: 0;
}

.tradera-overview-card button {
    justify-self: start;
}

.tradera-overview-card-count {
    font-size: 32px;
    line-height: 1;
    color: var(--green-dark);
}

.tradera-overview-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.tradera-overview-summary.is-compact {
    gap: 8px;
}

.tradera-overview-summary-item {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(204, 194, 174, 0.72);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.84);
}

.tradera-overview-summary.is-compact .tradera-overview-summary-item {
    padding: 8px 10px;
}

.tradera-overview-summary-item span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tradera-overview-summary-item strong {
    font-size: 16px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.tradera-overview-summary.is-compact .tradera-overview-summary-item strong {
    font-size: 14px;
}

.tradera-overview-modal {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
}

.tradera-overview-modal .system-meta-modal-header {
    align-items: flex-start;
}

.tradera-overview-modal .system-meta-modal-body {
    gap: 14px;
    padding-top: 18px;
}

.tradera-overview-modal table {
    min-width: 0;
}

.tradera-overview-modal th,
.tradera-overview-modal td {
    padding: 10px 12px;
    vertical-align: top;
}

.tradera-overview-modal .cell-main,
.tradera-overview-modal .cell-sub {
    max-width: none;
}

.tradera-overview-modal .tradera-history-table th:first-child,
.tradera-overview-modal .tradera-history-table td:first-child {
    min-width: 220px;
}

.tradera-overview-modal-meta {
    display: grid;
    gap: 12px;
    justify-items: end;
}

.tradera-overview-modal-count {
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tradera-overview-modal .table-wrap,
.tradera-overview-modal .bulk-toolbar {
    margin: 0;
}

.tradera-overview-modal .table-wrap {
    height: 100%;
}

.tradera-history-product-cell {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.tradera-history-product-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
    padding: 0;
}

.tradera-history-product-copy {
    min-width: 0;
}

.tradera-history-table-wrap {
    position: relative;
}

.tradera-history-table th:first-child,
.tradera-history-table td:first-child {
    position: sticky;
    left: 0;
    min-width: 280px;
    background: rgba(255, 253, 248, 0.98);
    background-clip: padding-box;
    box-shadow: 1px 0 0 var(--line);
}

.tradera-history-table th:first-child {
    z-index: 3;
    background: #f7f5ec;
}

.tradera-history-table td:first-child {
    z-index: 2;
}

.tradera-order-items {
    display: block;
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subsection-title {
    margin: 14px 0 10px;
    font-size: 0.92rem;
    color: var(--green-dark);
    letter-spacing: 0.02em;
}

summary.subsection-title {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

summary.subsection-title::-webkit-details-marker {
    display: none;
}

#packflow #packflowCurrentBatch + .panel-note,
#packflow #packflowCurrentBatch + .panel-note + .panel-note,
#packflow #packflowCurrentBatch + .panel-note + .panel-note + .panel-note {
    display: none;
}

.products-toolbar {
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 10px 0 12px;
}

.products-toolbar > input[type="search"] {
    min-width: 260px;
    flex: 1 1 260px;
}

.products-toolbar .inline-filters {
    flex-wrap: wrap;
}

.products-toolbar .inline-filters select {
    width: 190px;
}

.product-edit-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 10px;
    align-items: end;
}

.product-edit-grid label {
    display: grid;
    gap: 6px;
}

.product-edit-grid label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

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

.product-ean-missing-button {
    white-space: nowrap;
}

.product-ean-missing-button.is-active {
    border-color: rgba(176, 84, 108, 0.38);
    background: rgba(176, 84, 108, 0.12);
    color: #8f3e55;
}

.product-edit-actions {
    justify-content: flex-start;
}

.product-editor-linked-panel {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 253, 248, 0.92);
}

.product-editor-linked-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.product-editor-manufacturer-panel {
    display: grid;
    gap: 12px;
}

.product-editor-manufacturer-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 12px 0 0;
}

.product-editor-manufacturer-logo-wrap {
    width: 78px;
    height: 78px;
    border: 1px solid rgba(204, 194, 174, 0.82);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.product-editor-manufacturer-logo-wrap.is-empty {
    background: linear-gradient(180deg, rgba(240, 247, 243, 0.96), rgba(228, 240, 233, 0.98));
}

.product-editor-manufacturer-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.product-editor-manufacturer-copy strong {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.25;
}

.product-editor-manufacturer-copy small {
    color: var(--muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.product-editor-manufacturer-copy a {
    color: var(--green-dark);
    font-weight: 700;
    text-decoration: underline;
}

.product-editor-linked-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(204, 194, 174, 0.8);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.product-editor-allocation-panel {
    display: grid;
    gap: 12px;
}

.product-editor-allocation-list {
    display: grid;
    gap: 10px;
}

.product-editor-allocation-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border: 1px solid rgba(204, 194, 174, 0.78);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.84);
}

.product-editor-allocation-row.is-action {
    border-color: rgba(163, 58, 42, 0.32);
    background: linear-gradient(180deg, rgba(163, 58, 42, 0.08), rgba(255, 255, 255, 0.94));
}

.product-editor-allocation-row.is-active {
    border-color: rgba(192, 131, 36, 0.3);
    background: linear-gradient(180deg, rgba(192, 131, 36, 0.08), rgba(255, 255, 255, 0.94));
}

.product-editor-allocation-row.is-free {
    border-color: rgba(47, 111, 68, 0.28);
    background: linear-gradient(180deg, rgba(47, 111, 68, 0.08), rgba(255, 255, 255, 0.94));
}

.product-editor-allocation-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.product-editor-allocation-main strong {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.3;
}

.product-editor-allocation-main small {
    color: var(--muted);
    line-height: 1.4;
}

.product-title-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-title-cell .cell-main {
    flex: 1 1 auto;
    min-width: 0;
}

.product-title-cell .icon-button {
    width: 30px;
    min-width: 30px;
}

#products table th:nth-child(2),
#products table td:nth-child(2) {
    width: 120px;
}

#products table td:nth-child(2) .cell-main {
    white-space: nowrap;
}

#products table th:nth-child(3),
#products table td:nth-child(3) {
    width: 34%;
}

.product-editor-backdrop {
    position: fixed;
    inset: 0;
    z-index: 125;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(7, 22, 17, 0.72);
    backdrop-filter: blur(6px) saturate(0.92);
    -webkit-backdrop-filter: blur(6px) saturate(0.92);
}

.product-editor-backdrop[hidden] {
    display: none;
}

.manual-inbound-item-backdrop {
    position: fixed;
    inset: 0;
    z-index: 86;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(7, 22, 17, 0.48);
    backdrop-filter: blur(4px) saturate(0.9);
    -webkit-backdrop-filter: blur(4px) saturate(0.9);
}

.manual-inbound-item-backdrop[hidden] {
    display: none;
}

.manual-inbound-item-modal {
    width: min(620px, 94vw);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.995), rgba(249, 247, 238, 0.995));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.manual-inbound-item-header,
.manual-inbound-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.manual-inbound-item-header h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.05;
}

.manual-inbound-item-body {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.manual-inbound-item-body label {
    display: grid;
    gap: 6px;
}

.manual-inbound-item-body label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.manual-inbound-item-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

.manual-inbound-item-actions .primary {
    background: var(--green-dark);
    color: #fff;
}

.product-editor-modal {
    width: min(980px, 96vw);
    max-height: min(88vh, 960px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.995), rgba(249, 247, 238, 0.995));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.product-editor-modal-header,
.product-editor-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.product-editor-modal-header h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.05;
}

.product-editor-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.product-editor-manufacturer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 6px;
    border: 1px solid rgba(204, 194, 174, 0.86);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    width: fit-content;
    max-width: 100%;
}

.product-editor-manufacturer-badge-logo-wrap {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(204, 194, 174, 0.82);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.product-editor-manufacturer-badge-logo-wrap.is-empty {
    background: linear-gradient(180deg, rgba(240, 247, 243, 0.96), rgba(228, 240, 233, 0.98));
}

.product-editor-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.product-editor-header-actions .primary {
    white-space: nowrap;
}

.product-editor-modal-body {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.product-editor-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 12px;
}

.product-editor-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.product-editor-summary-grid article {
    display: grid;
    gap: 6px;
    padding: 12px 13px;
    border: 1px solid rgba(204, 194, 174, 0.7);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
}

.product-editor-summary-grid article span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.product-editor-summary-grid article strong {
    font-size: 24px;
    line-height: 1.05;
    color: var(--green-dark);
}

.product-editor-summary-grid article small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

@media (max-width: 1100px) {
    .tradera-prolister-settings {
        grid-template-columns: 1fr 1fr;
    }

    .tradera-prolister-tools {
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .tradera-prolister-settings {
        grid-template-columns: 1fr;
    }
}

.product-editor-grid label,
.product-editor-description-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.product-editor-grid label span,
.product-editor-description-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.product-editor-category-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.product-editor-category-field {
    grid-column: span 2;
}

.product-editor-category-picker {
    position: relative;
    display: grid;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.product-editor-category-trigger {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid rgba(191, 176, 146, 0.9);
    border-radius: 12px;
    background: rgba(255, 252, 244, 0.96);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.product-editor-category-trigger::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(64, 69, 62, 0.7);
    border-bottom: 2px solid rgba(64, 69, 62, 0.7);
    transform: rotate(45deg);
    margin-top: -4px;
    flex: 0 0 auto;
}

.product-editor-category-trigger[aria-expanded="true"]::after {
    transform: rotate(225deg);
    margin-top: 4px;
}

.product-editor-category-trigger:disabled {
    cursor: wait;
    color: var(--muted);
    background: rgba(244, 239, 229, 0.88);
}

.product-editor-category-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 35;
    width: max(100%, 340px);
    max-width: min(520px, calc(100vw - 64px));
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(191, 176, 146, 0.9);
    border-radius: 14px;
    background: rgba(255, 252, 244, 0.98);
    box-shadow: 0 20px 48px rgba(17, 41, 34, 0.16);
}

.product-editor-category-dropdown[hidden] {
    display: none !important;
}

.product-editor-category-search-row input {
    width: 100%;
}

.product-editor-category-results {
    max-height: 280px;
    overflow: auto;
    display: grid;
    gap: 6px;
}

.product-editor-category-option {
    width: 100%;
    display: grid;
    gap: 4px;
    padding: 9px 12px;
    border: 1px solid rgba(204, 194, 174, 0.78);
    border-radius: 12px;
    background: rgba(255, 252, 244, 0.92);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.product-editor-category-option:hover,
.product-editor-category-option:focus-visible {
    border-color: rgba(30, 104, 72, 0.5);
    background: rgba(241, 248, 243, 0.96);
}

.product-editor-category-option.is-selected {
    border-color: rgba(30, 104, 72, 0.75);
    background: rgba(228, 244, 234, 0.98);
    color: var(--pine);
}

.product-editor-category-option-label {
    display: block;
    line-height: 1.4;
}

.product-editor-category-empty {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(244, 239, 229, 0.72);
    color: var(--muted);
    font-size: 13px;
}

.product-editor-description-field textarea {
    min-height: 140px;
    resize: vertical;
}

.product-editor-format-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-editor-description-preview {
    display: grid;
    gap: 10px;
    padding: 0;
    border: 1px solid rgba(204, 194, 174, 0.65);
    border-radius: 14px;
    background: rgba(255, 252, 244, 0.72);
    overflow: hidden;
}

.product-editor-preview-list {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.product-editor-preview-card {
    display: grid;
    gap: 10px;
}

.product-editor-preview-card + .product-editor-preview-card {
    padding-top: 12px;
    border-top: 1px solid rgba(204, 194, 174, 0.55);
}

.product-editor-preview-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.product-editor-preview-card-head strong {
    color: var(--ink);
    font-size: 14px;
}

.product-editor-preview-name {
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.product-editor-preview-richtext {
    padding: 12px 14px;
    border: 1px solid rgba(204, 194, 174, 0.55);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
}

.formatted-richtext {
    color: var(--ink);
    line-height: 1.6;
}

.formatted-richtext > *:first-child {
    margin-top: 0;
}

.formatted-richtext > *:last-child {
    margin-bottom: 0;
}

.formatted-richtext p,
.formatted-richtext ul,
.formatted-richtext ol,
.formatted-richtext h3,
.formatted-richtext h4,
.formatted-richtext h5 {
    margin: 0 0 12px;
}

.formatted-richtext ul,
.formatted-richtext ol {
    padding-left: 22px;
}

.formatted-richtext li + li {
    margin-top: 4px;
}

.product-editor-images-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(204, 194, 174, 0.65);
    border-radius: 14px;
    background: rgba(255, 252, 244, 0.72);
}

.product-editor-images-panel .panel-header {
    margin: 0;
    padding: 0;
}

.product-editor-upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.product-editor-upload-form input[type="file"] {
    flex: 1 1 280px;
    min-width: 220px;
}

.product-image-crop-backdrop,
.product-camera-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(13, 27, 23, 0.62);
    backdrop-filter: blur(4px);
}

.product-image-crop-backdrop[hidden],
.product-camera-backdrop[hidden] {
    display: none !important;
}

.product-image-crop-modal {
    width: min(1080px, 100%);
    max-height: calc(100vh - 40px);
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1px solid rgba(204, 194, 174, 0.7);
    border-radius: 22px;
    background: #fffdf8;
    box-shadow: 0 24px 54px rgba(18, 32, 28, 0.24);
    overflow: hidden;
}

.product-camera-modal {
    width: min(820px, 100%);
    max-height: calc(100vh - 40px);
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1px solid rgba(204, 194, 174, 0.7);
    border-radius: 22px;
    background: #fffdf8;
    box-shadow: 0 24px 54px rgba(18, 32, 28, 0.24);
    overflow: hidden;
}

.product-image-crop-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.product-image-crop-header h2 {
    margin: 0;
}

.product-image-crop-header .muted {
    margin: 6px 0 0;
}

.product-image-crop-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 20px 22px 22px;
    overflow: auto;
}

.product-image-crop-stage-wrap {
    display: grid;
    place-items: center;
    min-height: 360px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(204, 194, 174, 0.7);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(248, 244, 235, 0.94), rgba(236, 230, 217, 0.9)),
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.45) 0,
            rgba(255, 255, 255, 0.45) 18px,
            rgba(231, 224, 210, 0.45) 18px,
            rgba(231, 224, 210, 0.45) 36px
        );
}

.product-image-crop-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
}

.product-image-crop-stage img {
    display: block;
    max-width: min(100%, 82vw);
    max-height: min(74vh, 820px);
    border-radius: 16px;
    box-shadow: 0 10px 26px rgba(24, 33, 30, 0.16);
}

.product-image-crop-selection {
    position: absolute;
    border: 2px solid #fff;
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(17, 29, 25, 0.58);
    cursor: move;
    touch-action: none;
}

.product-image-crop-selection::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    border: 1px solid rgba(27, 92, 72, 0.72);
    background-image:
        linear-gradient(to right, transparent 33%, rgba(255, 255, 255, 0.28) 33%, rgba(255, 255, 255, 0.28) 34%, transparent 34%, transparent 66%, rgba(255, 255, 255, 0.28) 66%, rgba(255, 255, 255, 0.28) 67%, transparent 67%),
        linear-gradient(to bottom, transparent 33%, rgba(255, 255, 255, 0.28) 33%, rgba(255, 255, 255, 0.28) 34%, transparent 34%, transparent 66%, rgba(255, 255, 255, 0.28) 66%, rgba(255, 255, 255, 0.28) 67%, transparent 67%);
    pointer-events: none;
}

.product-image-crop-size {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(13, 27, 23, 0.78);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.product-image-crop-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 2px solid var(--green-dark);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(17, 29, 25, 0.18);
}

.product-image-crop-handle.is-nw {
    top: -10px;
    left: -10px;
    cursor: nwse-resize;
}

.product-image-crop-handle.is-ne {
    top: -10px;
    right: -10px;
    cursor: nesw-resize;
}

.product-image-crop-handle.is-sw {
    bottom: -10px;
    left: -10px;
    cursor: nesw-resize;
}

.product-image-crop-handle.is-se {
    right: -10px;
    bottom: -10px;
    cursor: nwse-resize;
}

.product-image-crop-sidebar {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(204, 194, 174, 0.7);
    border-radius: 18px;
    background: rgba(255, 252, 244, 0.8);
}

.product-image-crop-meta {
    display: grid;
    gap: 4px;
}

.product-image-crop-meta strong,
.product-image-crop-meta span {
    overflow-wrap: anywhere;
}

.product-image-crop-meta span {
    color: var(--muted);
}

.product-image-crop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-image-crop-actions--footer {
    justify-content: flex-end;
    align-items: center;
}

.product-image-crop-actions .primary {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: #fff;
}

.product-camera-body {
    display: grid;
    gap: 14px;
    padding: 20px 22px 22px;
    overflow: auto;
}

.product-camera-stage-wrap {
    display: grid;
    place-items: center;
    min-height: 360px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(204, 194, 174, 0.7);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(248, 244, 235, 0.94), rgba(236, 230, 217, 0.9)),
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.45) 0,
            rgba(255, 255, 255, 0.45) 18px,
            rgba(231, 224, 210, 0.45) 18px,
            rgba(231, 224, 210, 0.45) 36px
        );
}

.product-camera-stage {
    position: relative;
    width: min(100%, 540px);
    aspect-ratio: 3 / 4;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(18, 32, 28, 0.96), rgba(10, 20, 18, 0.96));
    box-shadow: 0 18px 40px rgba(18, 32, 28, 0.24);
}

.product-camera-stage video,
.product-camera-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.product-camera-stage video {
    object-fit: cover;
    background: #111;
    opacity: 0.01;
    pointer-events: none;
}

.product-camera-stage canvas {
    background: #111;
}

.product-camera-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 54%),
        rgba(11, 22, 19, 0.92);
}

.product-camera-placeholder.is-soft {
    color: rgba(255, 255, 255, 0.82);
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 54%),
        rgba(11, 22, 19, 0.34);
}

.product-camera-meta {
    display: grid;
    gap: 8px;
}

.product-camera-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-camera-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(27, 92, 72, 0.18);
    border-radius: 999px;
    background: rgba(27, 92, 72, 0.08);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.product-editor-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.product-editor-image-card {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border: 1px solid rgba(204, 194, 174, 0.65);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
}

.product-editor-image-card.is-primary {
    border-color: rgba(27, 92, 72, 0.45);
    box-shadow: 0 0 0 1px rgba(27, 92, 72, 0.12);
}

.product-editor-image-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(204, 194, 174, 0.55);
    background: rgba(230, 225, 214, 0.35);
}

.product-editor-image-card figcaption {
    display: grid;
    gap: 8px;
}

.product-editor-image-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.product-editor-image-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(27, 92, 72, 0.12);
    color: var(--green-dark);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.product-editor-image-card figcaption span {
    font-size: 12px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.product-editor-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-editor-modal-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

.product-editor-modal-actions .primary {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: #fff;
}

.product-editor-close {
    width: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
}

@media (max-width: 900px) {
    .product-image-crop-backdrop,
    .product-camera-backdrop {
        padding: 12px;
    }

    .product-editor-modal-header {
        align-items: flex-start;
    }

    .product-editor-header-actions {
        width: 100%;
    }

    .product-image-crop-modal {
        max-height: calc(100vh - 24px);
    }

    .product-camera-modal {
        max-height: calc(100vh - 24px);
    }

    .product-image-crop-body {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .product-camera-body {
        padding: 14px;
    }

    .product-image-crop-stage-wrap {
        min-height: 0;
        padding: 10px;
    }

    .product-camera-stage-wrap {
        min-height: 0;
        padding: 10px;
    }

    .product-image-crop-stage img {
        max-width: 100%;
        max-height: 68vh;
    }

    .product-camera-stage {
        width: 100%;
        max-height: 68vh;
    }

    .product-image-crop-actions--footer {
        justify-content: stretch;
    }

    .product-image-crop-actions--footer > * {
        flex: 1 1 160px;
    }
}

#inventory .inventory-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

#inventory .inventory-session-controls select {
    min-width: 320px;
    max-width: 100%;
}

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

#inventory .inventory-summary-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(204, 194, 174, 0.65);
    border-radius: 14px;
    background: rgba(255, 252, 244, 0.76);
}

#inventory .inventory-summary-card span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-dark);
}

#inventory .inventory-summary-card strong {
    font-size: 28px;
    line-height: 1.05;
    color: var(--green-dark);
}

#inventory .inventory-summary-card small {
    color: var(--muted);
}

#inventory .inventory-toolbar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(204, 194, 174, 0.5);
    border-radius: 14px;
    background: rgba(252, 251, 246, 0.96);
    backdrop-filter: blur(10px);
}

#inventory .inventory-scan-wrap,
#inventory .inventory-search-wrap {
    display: grid;
    gap: 6px;
}

#inventory .inventory-scan-wrap label,
#inventory .inventory-search-wrap label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-dark);
}

#inventory .inventory-scan-wrap small {
    color: var(--muted);
}

#inventory .inventory-table input {
    width: 100%;
    min-width: 0;
}

#inventory .inventory-row.has-difference {
    background: rgba(190, 68, 52, 0.08);
}

#inventory .inventory-diff {
    font-weight: 700;
    color: #9f3328;
}

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

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

    #inventory .inventory-table thead {
        display: none;
    }

    #inventory .inventory-table,
    #inventory .inventory-table tbody,
    #inventory .inventory-table tr,
    #inventory .inventory-table td {
        display: block;
        width: 100%;
    }

    #inventory .inventory-table tr {
        margin-bottom: 12px;
        border: 1px solid rgba(204, 194, 174, 0.6);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.9);
        overflow: hidden;
    }

    #inventory .inventory-table td {
        display: grid;
        gap: 6px;
        padding: 10px 12px;
        border-bottom: 1px solid rgba(222, 215, 201, 0.7);
    }

    #inventory .inventory-table td:last-child {
        border-bottom: 0;
    }

    #inventory .inventory-table td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--gold-dark);
    }

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

    .product-editor-category-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    #inventory .inventory-summary-grid {
        grid-template-columns: 1fr;
    }

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

    .product-editor-category-row {
        grid-template-columns: 1fr;
    }

    .product-editor-category-dropdown {
        width: 100%;
        max-width: none;
    }

    .product-editor-allocation-row {
        grid-template-columns: 1fr;
        align-items: start;
    }
}

.assignment-detail {
    padding: 16px;
}

#assignments .page-heading {
    align-items: stretch;
    flex-direction: column;
}

#assignments .table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 2px;
}

#assignments table {
    min-width: 1620px;
}

#assignments th:last-child,
#assignments td:last-child {
    white-space: nowrap;
}

#assignments td .pill {
    white-space: nowrap;
}

#assignments .row-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
}

#assignments .panel-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

#assignments > .panel {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

#assignments > .panel > .panel:last-of-type {
    display: none;
}

.assignment-editor-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 22, 17, 0.68);
    backdrop-filter: blur(5px) saturate(0.92);
    -webkit-backdrop-filter: blur(5px) saturate(0.92);
}

.assignment-editor-modal-backdrop[hidden] {
    display: none;
}

.assignment-editor-modal {
    width: min(1120px, 96vw);
    max-height: min(90vh, 960px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.995), rgba(249, 247, 238, 0.995));
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.assignment-editor-modal-header,
.assignment-editor-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
}

.assignment-editor-modal-header {
    border-bottom: 1px solid var(--line);
}

.assignment-editor-modal-copy {
    display: grid;
    gap: 6px;
}

.assignment-editor-modal-copy h2,
.assignment-editor-modal-copy p {
    margin: 0;
}

.assignment-editor-modal-close {
    width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 999px;
    font-size: 24px;
    line-height: 1;
}

.assignment-editor-modal-body {
    overflow: auto;
    padding: 18px;
    display: grid;
    gap: 18px;
}

.assignment-editor-modal-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px;
}

.assignment-editor-modal-form label,
.assignment-editor-modal-form .wide {
    display: grid;
    gap: 6px;
}

.assignment-editor-modal-form .wide {
    grid-column: 1 / -1;
}

.assignment-editor-modal-form label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.assignment-editor-modal-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.assignment-editor-modal-note {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.assignment-editor-modal-actions {
    border-top: 1px solid var(--line);
}

.assignment-editor-modal-actions .danger {
    margin-right: auto;
}

.assignment-editor-modal-actions .muted {
    margin-right: auto;
}

@media (max-width: 900px) {
    .assignment-editor-modal {
        width: min(100vw - 20px, 96vw);
        max-height: calc(100vh - 20px);
    }

    .assignment-editor-modal-header,
    .assignment-editor-modal-actions {
        flex-wrap: wrap;
    }

    .assignment-editor-modal-form {
        grid-template-columns: 1fr;
    }
}

.detail-title {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.detail-title h3 {
    margin: 0;
    font-size: 19px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.product-origin {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
}

.product-origin strong {
    font-size: 14px;
}

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

.detail-grid article {
    min-height: 86px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: linear-gradient(180deg, #fffdf8, var(--surface-2));
}

.detail-grid span,
.detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.detail-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
    overflow-wrap: anywhere;
}

.detail-grid small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.detail-list {
    display: grid;
    gap: 8px;
    margin: 14px 0 0;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.detail-list dd {
    margin: 0;
    font-weight: 700;
}

.risk-list {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
    display: grid;
    gap: 8px;
}

.risk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.risk-header h4 {
    margin: 0;
    color: var(--green-dark);
    font-size: 14px;
}

.risk-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fffdf8;
}

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

.risk-item small {
    color: var(--muted);
    margin-top: 3px;
}

.attention-list {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.attention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-left: 4px solid var(--green);
    background: linear-gradient(90deg, rgba(47, 111, 68, 0.08), var(--surface-2));
    border-radius: 6px;
    padding: 12px;
}

.attention-item strong,
.attention-item span {
    display: block;
}

.attention-item span {
    color: var(--muted);
    margin-top: 4px;
    font-size: 13px;
}

.bar-list {
    display: grid;
    gap: 12px;
    padding: 16px;
}

#statsTrendBars {
    padding: 0;
    max-height: none;
    overflow: visible;
    display: block;
}

.bar-row {
    display: grid;
    gap: 7px;
}

.bar-row-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.bar-track {
    height: 10px;
    border-radius: 999px;
    background: #e6e0cf;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    min-width: 3px;
    border-radius: inherit;
    background: var(--blue);
}

.bar-fill.green {
    background: var(--green);
}

.stats-trend-shell {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.stats-trend-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.stats-trend-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(29, 91, 114, 0.08), rgba(29, 91, 114, 0.02)),
        var(--surface);
}

.stats-trend-card span,
.stats-trend-card small {
    color: var(--muted);
}

.stats-trend-card strong {
    font-size: 24px;
    line-height: 1.1;
    color: var(--green-dark);
}

.stats-delivery-shell {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.stats-delivery-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.stats-delivery-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(192, 131, 36, 0.09), rgba(47, 111, 68, 0.04)),
        var(--surface);
}

.stats-delivery-card span,
.stats-delivery-card small {
    color: var(--muted);
}

.stats-delivery-card strong {
    font-size: 24px;
    line-height: 1.1;
    color: var(--green-dark);
}

.stats-delivery-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: 14px;
}

.stats-delivery-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.stats-delivery-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.stats-delivery-dot.is-shipped {
    background: var(--green);
}

.stats-delivery-dot.is-picked {
    background: var(--amber);
}

.stats-delivery-table td:first-child strong,
.stats-delivery-table td:first-child small {
    display: block;
}

.stats-delivery-table td:first-child small {
    margin-top: 4px;
}

.stats-delivery-flow {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.stats-delivery-bar {
    display: flex;
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid rgba(16, 35, 31, 0.08);
    background: rgba(16, 35, 31, 0.08);
}

.stats-delivery-bar-segment {
    display: block;
    height: 100%;
}

.stats-delivery-bar-segment.is-shipped {
    background: linear-gradient(90deg, rgba(47, 111, 68, 0.98), rgba(47, 111, 68, 0.72));
}

.stats-delivery-bar-segment.is-picked {
    background: linear-gradient(90deg, rgba(192, 131, 36, 0.98), rgba(192, 131, 36, 0.76));
}

.stats-trend-chart {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px 10px 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(251, 250, 245, 0.96)),
        var(--surface);
    overflow-x: auto;
}

.stats-trend-svg {
    display: block;
    width: 100%;
    min-width: 640px;
    height: auto;
}

.stats-trend-chart.is-condensed .stats-trend-svg {
    min-width: 600px;
}

.stats-trend-chart.is-compact {
    padding: 12px 8px 8px;
}

.stats-trend-chart.is-compact .stats-trend-svg {
    width: min(100%, 520px);
    min-width: 0;
    margin: 0 auto;
}

.stats-trend-chart.is-single {
    padding: 10px 8px 6px;
}

.stats-trend-chart.is-single .stats-trend-svg {
    width: min(100%, 420px);
}

@media (max-width: 900px) {
    .stats-delivery-flow {
        min-width: 160px;
    }
}

.stats-trend-grid line {
    stroke: rgba(185, 177, 153, 0.55);
    stroke-dasharray: 4 6;
}

.stats-trend-grid text,
.stats-trend-x-label {
    fill: var(--muted);
    font-size: 11px;
}

.stats-trend-zero-line {
    stroke: rgba(16, 35, 31, 0.22);
    stroke-width: 1.25;
}

.stats-trend-area {
    fill: url(#statsTrendAreaGradient);
}

.stats-trend-line {
    fill: none;
    stroke: var(--blue);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stats-trend-point circle {
    fill: var(--blue);
    stroke: #fff;
    stroke-width: 2;
}

.stats-trend-point.is-peak circle {
    fill: var(--green);
}

.stats-trend-point.is-negative circle {
    fill: var(--red);
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 130;
    max-width: min(640px, calc(100vw - 36px));
    border-radius: 8px;
    background: var(--green-dark);
    color: #fff;
    padding: 13px 15px;
    box-shadow: var(--shadow);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.login-shell {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(18, 53, 44, 0.92), rgba(18, 53, 44, 0.76)),
        linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        var(--bg);
    background-size: auto, 34px 34px, 34px 34px, auto;
}

.login-panel {
    width: min(430px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.98);
    box-shadow: var(--shadow);
    padding: 28px;
}

.login-panel h1 {
    margin: 4px 0 20px;
    color: var(--green-dark);
}

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

.login-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 14px;
}

.login-form button {
    margin-top: 6px;
}

.error {
    border: 1px solid rgba(153, 27, 27, 0.2);
    border-radius: 8px;
    color: var(--red);
    background: rgba(153, 27, 27, 0.08);
    padding: 10px 12px;
}

@media (max-width: 1080px) {
    .topbar {
        grid-template-columns: 1fr auto;
    }

    .attention-strip {
        grid-template-columns: 1fr;
    }

    .tabs {
        grid-column: 1 / -1;
        order: 3;
    }

    .tab-group {
        border-right: 0;
        padding-right: 0;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .overview-period-controls {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .stats-period-controls {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

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

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

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

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

    .supplier-form {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    #inboundDeliveryForm {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    #inboundDeliveryForm .wide {
        grid-column: span 2;
    }

    #workPlanFormAssignees,
    .work-plan-form-assignee-pickers {
        grid-template-columns: 1fr;
    }

    .auction-plan-form {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .time-monthly-summary {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .user-form {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar {
        padding: 12px;
        gap: 12px;
    }

    main {
        padding: 16px 12px;
    }

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

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

    .accrued-manual-grid {
        grid-template-columns: 1fr;
    }

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

    .stats-period-controls {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .sales-toolbar-secondary,
    .bulk-toolbar,
    .upload-form,
    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .attention-item {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar input[type="search"],
    .sales-toolbar-field select,
    .sales-toolbar-field input,
    .bulk-toolbar select,
    .bulk-toolbar input,
    .channel-picker select,
    .new-channel-wrap input,
    .upload-form input[type="file"],
    .inline-form input {
        width: 100%;
        max-width: none;
    }

    .channel-picker,
    .new-channel-wrap {
        width: 100%;
        flex-direction: column;
    }

    .sales-toolbar-field {
        align-items: stretch;
        flex-direction: column;
        white-space: normal;
    }

    .sales-pager {
        align-items: stretch;
    }

    #headerSectionSelect {
        width: 100%;
    }

    .case-form,
    .user-form {
        grid-template-columns: 1fr;
    }

    .inline-filters {
        width: 100%;
        flex-direction: column;
    }

    .inline-filters select,
    .clock-controls input {
        width: 100%;
        min-width: 0;
    }

    .top-work-queue {
        padding: 0 0 14px;
    }

    .top-work-queue-inner {
        grid-template-columns: 1fr;
    }

    #packflow .packflow-preview-head {
        align-items: stretch;
        flex-direction: column;
    }

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

    #packflow .packflow-import-launcher {
        width: 100%;
        flex-direction: column;
    }

    .packflow-import-backdrop {
        padding: 14px;
    }

    .packflow-import-modal {
        width: 100%;
        max-height: min(92vh, 920px);
    }

    .packflow-import-modal-header,
    .packflow-import-modal-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .packflow-import-modal-header h3 {
        font-size: 24px;
    }

    #packflow .packflow-import-help-links {
        flex-direction: column;
    }

    .logout {
        min-width: 86px;
    }

    .sales-focus,
    .risk-header,
    .risk-item {
        align-items: stretch;
        flex-direction: column;
    }

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

    #inboundDeliveryForm {
        grid-template-columns: 1fr;
    }

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

    .supplier-form .wide {
        grid-column: auto;
    }

    .work-plan-action-stack {
        min-width: 320px;
    }

    .waterfall-row {
        grid-template-columns: 1fr;
    }

    .waterfall-value {
        text-align: left;
    }

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

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

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

    .product-editor-manufacturer-logo-wrap {
        width: 68px;
        height: 68px;
    }

    #timeMonthlyTable input[data-time-vacation-hours] {
        width: 100%;
    }
}

/* Left-sidebar layout */
.app-layout {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    align-items: start;
    min-height: calc(100vh - 72px);
}

.topbar {
    grid-template-columns: auto 1fr auto;
    gap: 14px;
}

.topbar-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.topbar-title strong {
    display: block;
    font-size: 16px;
    line-height: 1.1;
}

.menu-toggle {
    display: none;
    min-width: 98px;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.26);
    color: #fff;
    font-weight: 700;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
}

.sidebar {
    position: sticky;
    top: 72px;
    align-self: start;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 72px);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 18%),
        #0f3f35;
    color: #fff;
    overflow-y: auto;
}

.sidebar-head {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 16px 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-head strong {
    font-size: 15px;
    line-height: 1.2;
}

.sidebar-head .brand-mark,
.sidebar-head strong {
    display: none;
}

.sidebar-close {
    display: none;
    margin-left: auto;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-tabs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 10px 20px;
    overflow: visible;
}

.sidebar #traderaOrdersMeta {
    display: none;
}

.sidebar-meta {
    margin-top: auto;
    padding: 0 10px 14px;
}

.sidebar-meta-button {
    width: 100%;
    display: grid;
    gap: 4px;
    text-align: left;
    padding: 12px 12px 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-meta-button:hover {
    border-color: rgba(243, 182, 71, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-meta-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.sidebar-meta-button strong {
    font-size: 14px;
    line-height: 1.2;
}

.sidebar-meta-button small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.sidebar-tabs .tab-group {
    display: grid;
    gap: 4px;
    align-items: stretch;
}

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

.sidebar-section[data-sidebar-section="direct"] {
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-tabs > .sidebar-section:not(.sidebar-section-new):not([data-sidebar-section="direct"]) {
    display: none !important;
}

.sidebar-section[hidden] {
    display: none;
}

.sidebar-section + .sidebar-section {
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-section[data-sidebar-section="recent"] .sidebar-section-title {
    text-transform: none;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.94);
}

.sidebar-section[data-sidebar-section="recent"] .sidebar-section-body {
    padding: 8px;
    border: 1px solid rgba(132, 181, 149, 0.3);
    border-radius: 0;
    background: rgba(212, 226, 217, 0.92);
    box-shadow: none;
}

.sidebar-section-title {
    margin: 0;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.sidebar-section-new > summary.sidebar-section-title {
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.94);
}

.sidebar-section-channel > summary.sidebar-section-title {
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.96);
}

.sidebar-channel-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.sidebar-channel-logo {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.sidebar-channel-logo--tradera {
    width: 17px;
    height: 17px;
}

.sidebar-channel-text {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: none;
}

.sidebar-section > summary.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.sidebar-section > summary.sidebar-section-title::-webkit-details-marker {
    display: none;
}

.sidebar-section > summary.sidebar-section-title::after {
    content: "▾";
    margin-left: auto;
    font-size: 12px;
    line-height: 1;
    opacity: 0.75;
    transform: translateY(-1px);
}

.sidebar-section:not([open]) > summary.sidebar-section-title::after {
    transform: rotate(-90deg) translateX(1px);
}

.sidebar-section-body {
    display: grid;
    gap: 6px;
    padding: 4px 0 0;
}

.sidebar-section[open] > .sidebar-section-body {
    margin-top: 2px;
    padding: 8px;
    border: 1px solid rgba(132, 181, 149, 0.3);
    border-radius: 0;
    background: rgba(212, 226, 217, 0.92);
    box-shadow: none;
}

.sidebar-tabs .tab {
    justify-content: flex-start;
    width: 100%;
    min-height: 40px;
    border-radius: 0;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    font-weight: 600;
    padding: 0 10px;
}

.sidebar-tabs .tab[data-nav-channel] {
    gap: 8px;
}

.sidebar-tabs .tab[data-nav-channel="ps"]::before {
    content: "";
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    background: url("/assets/ps-auction-icon-32.png") center / contain no-repeat;
}

.sidebar-section[data-sidebar-section="recent"] .tab,
.sidebar-section[open] .sidebar-section-body .tab {
    border-color: rgba(47, 111, 68, 0.1);
    color: var(--green-dark);
    background: rgba(255, 255, 255, 0.16);
}

.sidebar-tabs .tab:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.09);
}

.sidebar-section[data-sidebar-section="recent"] .tab:hover,
.sidebar-section[open] .sidebar-section-body .tab:hover {
    border-color: rgba(47, 111, 68, 0.22);
    background: rgba(255, 255, 255, 0.28);
}

.sidebar-tabs .tab.is-active {
    border-color: rgba(243, 182, 71, 0.62);
    background: rgba(243, 182, 71, 0.2);
    color: #fff;
    box-shadow: none;
}

.sidebar-section[data-sidebar-section="recent"] .tab.is-active,
.sidebar-section[open] .sidebar-section-body .tab.is-active {
    border-color: rgba(47, 111, 68, 0.28);
    background: rgba(47, 111, 68, 0.16);
    color: var(--green-dark);
}

.sidebar-tabs .nav-alert {
    margin-left: auto;
}

main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px;
}

.home-split {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.home-kpi-grid {
    margin-bottom: 0;
}

.home-alert-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

#home .home-alert-grid .home-panel {
    margin-top: 0;
}

#home .home-alert-grid .panel-header {
    min-height: 44px;
    padding: 0 12px;
}

#home .home-alert-grid .panel-header h2 {
    font-size: 14px;
}

#home .home-alert-grid .panel-header-actions {
    gap: 6px;
}

#home .home-alert-grid .panel-header-actions .muted {
    font-size: 12px;
}

#home .home-alert-grid .panel-header-actions button {
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
}

#home .home-panel {
    border-left-width: 6px;
    border-left-style: solid;
    background: #fff;
    box-shadow: 0 10px 22px rgba(16, 35, 31, 0.06);
}

#home .home-panel .panel-header {
    background: rgba(255, 255, 255, 0.92);
}

#homeSalesPanel {
    border-left-color: #1d5b72;
    background: linear-gradient(180deg, rgba(29, 91, 114, 0.07), #fff 28%);
}

#homeClockPanel {
    border-left-color: #2f6f44;
    background: linear-gradient(180deg, rgba(47, 111, 68, 0.07), #fff 28%);
}

#homeAuctionAttentionPanel {
    border-left-color: #c08324;
    background: linear-gradient(180deg, rgba(192, 131, 36, 0.1), #fff 30%);
}

#homeInboundPanel {
    border-left-color: #1f8a70;
    background: linear-gradient(180deg, rgba(31, 138, 112, 0.1), #fff 30%);
}

#homeWorkPlanningPanel {
    border-left-color: #2c7282;
    background: linear-gradient(180deg, rgba(44, 114, 130, 0.09), #fff 30%);
}

#homeTradePanel {
    border-left-color: #7a4f18;
    background: linear-gradient(180deg, rgba(122, 79, 24, 0.1), #fff 32%);
}

#homePsMonthPanel {
    border-left-color: #b6532d;
    background: linear-gradient(180deg, rgba(182, 83, 45, 0.12), #fff 32%);
}

#homeTraderaPanel {
    border-left-color: #1e63d4;
    background: linear-gradient(180deg, rgba(30, 99, 212, 0.1), #fff 32%);
}

#homePsMonthPanel .home-trade-hero,
#homeTradePanel .home-trade-hero,
#homeTraderaPanel .home-trade-hero {
    display: grid;
    grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
    gap: 12px;
    padding: 14px 14px 14px;
}

#homePsMonthPanel .home-trade-hero-copy,
#homeTradePanel .home-trade-hero-copy,
#homeTraderaPanel .home-trade-hero-copy {
    display: grid;
    gap: 8px;
    align-content: start;
    padding: 16px 18px;
    border-radius: 16px;
    color: #fff;
    box-shadow: 0 12px 24px rgba(16, 35, 31, 0.1);
}

#homePsMonthPanel .home-trade-hero-copy {
    border: 1px solid rgba(182, 83, 45, 0.22);
    background:
        radial-gradient(circle at top left, rgba(255, 196, 146, 0.28), transparent 44%),
        linear-gradient(135deg, rgba(92, 40, 26, 0.98), rgba(156, 74, 44, 0.95));
}

#homeTradePanel .home-trade-hero-copy {
    border: 1px solid rgba(122, 79, 24, 0.16);
    background:
        radial-gradient(circle at top left, rgba(247, 205, 134, 0.25), transparent 44%),
        linear-gradient(135deg, rgba(18, 52, 40, 0.96), rgba(39, 82, 61, 0.96));
}

#homeTraderaPanel .home-trade-hero-copy {
    border: 1px solid rgba(30, 99, 212, 0.18);
    background:
        radial-gradient(circle at top left, rgba(153, 201, 255, 0.26), transparent 44%),
        linear-gradient(135deg, rgba(14, 45, 92, 0.97), rgba(31, 94, 181, 0.95));
}

#homePsMonthPanel .home-trade-hero-copy h3,
#homeTradePanel .home-trade-hero-copy h3,
#homeTraderaPanel .home-trade-hero-copy h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.12;
}

#homePsMonthPanel .home-trade-hero-copy p:last-child,
#homeTradePanel .home-trade-hero-copy p:last-child,
#homeTraderaPanel .home-trade-hero-copy p:last-child {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.45;
    font-size: 13px;
}

#homePsMonthPanel .home-trade-hero-stats,
#homeTradePanel .home-trade-hero-stats,
#homeTraderaPanel .home-trade-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#homePsMonthPanel .home-trade-stat,
#homeTradePanel .home-trade-stat,
#homeTraderaPanel .home-trade-stat {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: 0 6px 14px rgba(16, 35, 31, 0.05);
}

#homePsMonthPanel .home-trade-stat {
    border: 1px solid rgba(182, 83, 45, 0.18);
    background: linear-gradient(180deg, #fff7f2, #fff);
}

#homeTradePanel .home-trade-stat {
    border: 1px solid rgba(122, 79, 24, 0.16);
    background: linear-gradient(180deg, #fffdfa, #fff);
}

#homeTraderaPanel .home-trade-stat {
    border: 1px solid rgba(30, 99, 212, 0.16);
    background: linear-gradient(180deg, #f8fbff, #fff);
}

#homePsMonthPanel .home-trade-stat span,
#homeTradePanel .home-trade-stat span,
#homeTraderaPanel .home-trade-stat span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

#homePsMonthPanel .home-trade-stat strong,
#homeTradePanel .home-trade-stat strong,
#homeTraderaPanel .home-trade-stat strong {
    font-size: 20px;
    line-height: 1.08;
}

#homePsMonthPanel .home-trade-stat small,
#homeTradePanel .home-trade-stat small {
    color: var(--muted);
    line-height: 1.35;
    font-size: 12px;
}

#homeCasesPanel {
    border-left-color: #5a6f7e;
    background: linear-gradient(180deg, rgba(90, 111, 126, 0.08), #fff 30%);
}

#homeIntranetPanel {
    border-left-color: #1f8a70;
    background: linear-gradient(180deg, rgba(31, 138, 112, 0.11), #fff 32%);
}

#homeIntranetPanel .home-intranet-list {
    display: grid;
    gap: 10px;
    padding: 0 16px 16px;
}

#homeIntranetPanel .home-intranet-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: start;
    padding: 10px 12px;
    border: 1px solid rgba(31, 138, 112, 0.18);
    border-radius: 12px;
    background: linear-gradient(180deg, #f6fffc, #fff);
    box-shadow: 0 4px 10px rgba(16, 35, 31, 0.04);
}

#homeIntranetPanel .home-intranet-feature,
#homeIntranetPanel .home-intranet-item {
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

#homeIntranetPanel .home-intranet-feature:hover,
#homeIntranetPanel .home-intranet-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(16, 35, 31, 0.08);
}

#homeIntranetPanel .home-intranet-item.is-pinned {
    border-color: rgba(192, 131, 36, 0.34);
    background: linear-gradient(180deg, #fff9ed, #fff);
}

#homeIntranetPanel .home-intranet-item strong {
    display: block;
    font-size: 14px;
    line-height: 1.25;
    margin-bottom: 4px;
}

#homeIntranetPanel .home-intranet-item small {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
}

#homeIntranetPanel .home-intranet-item p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
}

#homeIntranetPanel .home-intranet-item button {
    align-self: start;
    min-height: 32px;
    padding: 0 11px;
    font-size: 12px;
}

#homeIntranetPanel .home-intranet-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.95fr);
    overflow: hidden;
    min-height: 286px;
    border: 1px solid rgba(31, 138, 112, 0.2);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(17, 44, 39, 0.96), rgba(31, 138, 112, 0.88));
    box-shadow: 0 18px 34px rgba(16, 35, 31, 0.14);
}

#homeIntranetPanel .home-intranet-feature.is-unread {
    box-shadow:
        0 0 0 1px rgba(192, 131, 36, 0.14),
        0 18px 34px rgba(16, 35, 31, 0.14);
}

#homeIntranetPanel .home-intranet-feature-media {
    position: relative;
    min-height: 100%;
    background-color: #12352c;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

#homeIntranetPanel .home-intranet-feature-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 24, 20, 0.12), rgba(10, 24, 20, 0.62)),
        linear-gradient(135deg, rgba(17, 44, 39, 0.15), rgba(47, 111, 68, 0.18));
}

#homeIntranetPanel .home-intranet-feature-copy {
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 22px 22px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), #fff);
    color: var(--text);
}

#homeIntranetPanel .home-intranet-feature-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

#homeIntranetPanel .home-intranet-feature-head strong {
    font-size: 22px;
    line-height: 1.08;
}

#homeIntranetPanel .home-intranet-feature-copy p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
}

#homeIntranetPanel .home-intranet-feature-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

#homeIntranetPanel .home-intranet-feature-actions button {
    min-height: 36px;
    padding: 0 12px;
}

#intranet {
    gap: 18px;
}

#intranet.view.is-active {
    display: grid;
}

#intranet .panel {
    border-left: 5px solid #1f8a70;
    background: linear-gradient(180deg, rgba(31, 138, 112, 0.06), #fff 28%);
    box-shadow: 0 10px 22px rgba(16, 35, 31, 0.05);
}

#intranet .panel-header {
    background: rgba(255, 255, 255, 0.94);
}

#intranet .panel-note {
    max-width: 980px;
}

#intranet .intranet-public-panel {
    border-left-width: 5px;
    border-left-color: #1f8a70;
    background: linear-gradient(180deg, rgba(31, 138, 112, 0.06), #fff 28%);
    box-shadow: 0 10px 22px rgba(16, 35, 31, 0.05);
}

#intranet .intranet-public-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
    padding: 0 16px 16px;
}

#intranet .intranet-public-news-column,
#intranet .intranet-public-sidebar {
    min-width: 0;
}

#intranet .intranet-public-news {
    display: grid;
    gap: 14px;
}

#intranet .intranet-public-story-grid {
    display: grid;
    gap: 14px;
}

#intranet .intranet-public-story-list {
    display: grid;
    gap: 12px;
}

#intranet .intranet-public-card {
    display: grid;
    grid-template-columns: minmax(220px, 0.95fr) minmax(0, 1.05fr);
    overflow: hidden;
    min-height: 260px;
    border: 1px solid rgba(31, 138, 112, 0.16);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(17, 44, 39, 0.96), rgba(31, 138, 112, 0.88));
    box-shadow: 0 18px 34px rgba(16, 35, 31, 0.12);
}

#intranet .intranet-public-card.is-compact {
    min-height: 180px;
}

#intranet .intranet-public-card.is-pinned {
    border-color: rgba(192, 131, 36, 0.28);
}

#intranet .intranet-public-card-media {
    min-height: 100%;
    background-color: #12352c;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

#intranet .intranet-public-card-media.has-image {
    position: relative;
}

#intranet .intranet-public-card-media.has-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 24, 20, 0.12), rgba(10, 24, 20, 0.62)),
        linear-gradient(135deg, rgba(17, 44, 39, 0.15), rgba(47, 111, 68, 0.18));
}

#intranet .intranet-public-card-copy {
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 22px 22px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), #fff);
    color: var(--text);
}

#intranet .intranet-public-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

#intranet .intranet-public-card-head h3 {
    margin: 2px 0 0;
    font-size: 24px;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

#intranet .intranet-public-card.is-compact .intranet-public-card-head h3 {
    font-size: 18px;
}

#intranet .intranet-public-card-copy p {
    margin: 0;
    font-size: 14px;
    line-height: 1.58;
}

#intranet .intranet-public-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: auto;
}

#intranet .intranet-public-card-actions button {
    min-height: 36px;
    padding: 0 12px;
}

#intranet .intranet-public-sidebar {
    display: grid;
    gap: 12px;
    position: sticky;
    top: 96px;
    align-self: start;
}

#intranet .intranet-public-sidebar-header {
    padding: 0 12px;
}

#intranet .intranet-public-guide-list {
    display: grid;
    gap: 12px;
}

#intranet .intranet-public-contact-list {
    display: grid;
    gap: 12px;
}

#intranet .intranet-public-guide-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(31, 138, 112, 0.14);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f7fbf9);
    box-shadow: 0 6px 14px rgba(16, 35, 31, 0.04);
}

#intranet .intranet-public-guide-head h3 {
    margin: 2px 0 0;
    font-size: 18px;
    line-height: 1.16;
}

#intranet .intranet-public-guide-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

#intranet .intranet-public-guide-actions {
    display: flex;
    justify-content: flex-end;
}

#intranet .intranet-public-guide-actions .mini-link {
    min-height: 32px;
}

#intranet .intranet-public-contact-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(31, 138, 112, 0.14);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f8fbfa);
    box-shadow: 0 6px 14px rgba(16, 35, 31, 0.04);
}

#intranet .intranet-public-contact-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

#intranet .intranet-public-contact-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#intranet .intranet-public-contact-actions .mini-link {
    min-height: 32px;
}

#intranet .intranet-editor-shell {
    display: grid;
    gap: 18px;
}

#intranet .intranet-editor-intro-panel .panel-header {
    align-items: start;
}

#intranet .intranet-editor-jump-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 16px 16px;
}

#intranet .intranet-launch-button {
    cursor: pointer;
    border-color: rgba(31, 138, 112, 0.24);
    background: linear-gradient(180deg, rgba(232, 249, 242, 0.95), rgba(255, 255, 255, 0.98));
}

#intranet .intranet-launch-button:hover {
    background: linear-gradient(180deg, rgba(220, 244, 236, 0.98), #fff);
}

#intranet .intranet-create-banner {
    display: grid;
    gap: 4px;
    margin: 0 16px;
    padding: 14px 16px;
    border: 1px solid rgba(31, 138, 112, 0.2);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(232, 249, 242, 0.95), rgba(255, 255, 255, 0.98));
}

#intranet .intranet-create-banner strong {
    font-size: 15px;
    color: var(--ink);
}

#intranet .intranet-create-banner p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

#intranet .intranet-editor-shell[hidden] {
    display: none;
}

#intranet .intranet-form {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(248, 253, 251, 0.9), #fff 40%);
}

#intranet .intranet-message-form,
#intranet .intranet-guide-form {
    grid-template-columns: minmax(0, 1fr);
}

#intranet .intranet-form input,
#intranet .intranet-form textarea,
#intranet .intranet-form select {
    width: 100%;
}

#intranet .intranet-field-stack {
    display: grid;
    gap: 6px;
}

#intranet .intranet-field-stack > span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

#intranet .intranet-contact-card input[type="number"],
#intranet #intranetContactForm input[type="number"] {
    width: 88px;
}

#intranet .intranet-guide-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1.25fr);
    gap: 10px;
}

#intranet .intranet-contact-grid {
    display: grid;
    gap: 10px;
}

#intranet .intranet-contact-grid-top {
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.75fr) minmax(180px, 1fr);
}

#intranet .intranet-contact-grid-middle {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
}

#intranet .intranet-guide-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#intranet .intranet-guide-file-row input[type="file"] {
    width: min(420px, 100%);
    padding: 7px 9px;
}

#intranet .intranet-guide-file-meta {
    min-width: 180px;
    color: var(--muted);
    font-size: 13px;
}

#intranet .intranet-list {
    display: grid;
    gap: 12px;
    padding: 16px;
}

#intranet .intranet-existing-header {
    padding: 14px 16px 0;
}

#intranet .intranet-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #fffef8, #fff);
    box-shadow: 0 6px 14px rgba(16, 35, 31, 0.05);
}

#intranet .intranet-card.is-pinned {
    border-color: rgba(192, 131, 36, 0.36);
    background: linear-gradient(180deg, #fff8e9, #fff);
}

#intranet .intranet-card.is-active {
    border-color: rgba(31, 138, 112, 0.28);
}

#intranet .intranet-card-main {
    display: grid;
    gap: 10px;
    min-width: 0;
}

#intranet .intranet-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#intranet .intranet-card-actions {
    display: flex;
    align-items: start;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

#intranet .intranet-card-actions button {
    min-width: 88px;
}

#intranet .intranet-card-actions .mini-link {
    min-width: 88px;
}

#intranet .mini-link {
    width: fit-content;
}

#intranet .intranet-card textarea {
    min-height: 112px;
}

#intranet .intranet-editor-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
}

#intranet .intranet-editor-row-main {
    display: grid;
    gap: 6px;
    min-width: 0;
}

#intranet .intranet-editor-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#intranet .intranet-editor-row-copy {
    min-width: 0;
}

#intranet .intranet-editor-row-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

#intranet .intranet-editor-row-meta {
    display: flex;
    align-items: center;
    gap: 6px 10px;
    flex-wrap: wrap;
    min-width: 0;
}

#intranet .intranet-editor-row-meta .muted,
#intranet .intranet-editor-row-summary {
    font-size: 12px;
    line-height: 1.4;
}

#intranet .intranet-editor-row-summary {
    min-width: 0;
    max-width: min(420px, 100%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

#intranet .intranet-editor-row-actions {
    align-items: center;
}

#intranet .intranet-editor-row-actions button,
#intranet .intranet-editor-row-actions .mini-link {
    min-width: 82px;
}

#intranet .intranet-editor-card {
    gap: 14px;
}

#intranet .intranet-editor-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

#intranet .intranet-editor-card-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

#intranet .intranet-editor-card-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

#intranet .intranet-editor-card-preview {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

#intranet .intranet-message-card {
    border-left-width: 5px;
    border-left-style: solid;
    border-left-color: rgba(31, 138, 112, 0.26);
}

#intranet .intranet-contact-card.is-active {
    border-left: 5px solid rgba(31, 138, 112, 0.26);
}

#intranet .intranet-message-card.is-upcoming {
    border-left-color: var(--amber);
}

#intranet .intranet-message-card.is-draft {
    border-left-color: rgba(90, 111, 126, 0.32);
}

#intranet .intranet-message-card.is-archived {
    opacity: 0.88;
    background: linear-gradient(180deg, rgba(244, 241, 232, 0.95), #fff);
}

#intranet .intranet-message-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

#intranet .intranet-message-head input {
    min-height: 48px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

#intranet .intranet-message-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.message-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.message-pill-is-active {
    border-color: rgba(47, 111, 68, 0.18);
    background: rgba(47, 111, 68, 0.12);
    color: var(--green);
}

.message-pill-is-upcoming {
    border-color: rgba(192, 131, 36, 0.22);
    background: rgba(192, 131, 36, 0.12);
    color: var(--amber);
}

.message-pill-is-archived {
    border-color: rgba(90, 111, 126, 0.2);
    background: rgba(90, 111, 126, 0.12);
    color: #51616f;
}

.message-pill-is-draft {
    border-color: rgba(90, 111, 126, 0.16);
    background: rgba(90, 111, 126, 0.08);
    color: #5a6f7e;
}

.message-pill-home {
    border-color: rgba(29, 91, 114, 0.18);
    background: rgba(29, 91, 114, 0.1);
    color: var(--blue);
}

.message-pill-read {
    border-color: rgba(47, 111, 68, 0.16);
    background: rgba(47, 111, 68, 0.08);
    color: var(--green);
}

.message-pill-unread {
    border-color: rgba(163, 58, 42, 0.16);
    background: rgba(163, 58, 42, 0.08);
    color: var(--red);
}

#intranet .intranet-message-banner-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
    gap: 12px;
    align-items: stretch;
}

#intranet .intranet-message-banner-preview {
    min-height: 190px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(31, 138, 112, 0.16), rgba(192, 131, 36, 0.15)),
        linear-gradient(180deg, #fff, #f7fbf9);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

#intranet .intranet-message-banner-preview.has-image {
    position: relative;
}

#intranet .intranet-message-banner-fields {
    display: grid;
    gap: 8px;
    align-content: start;
    padding: 4px 0;
}

#intranet .intranet-message-banner-fields .field-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

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

#intranet .intranet-schedule-box {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f8fbf9);
}

#intranet .intranet-schedule-box strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#intranet .intranet-schedule-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

#intranet .intranet-audience-details {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f7fbf9);
}

#intranet .intranet-audience-details summary {
    cursor: pointer;
    font-weight: 800;
}

#intranet .intranet-audience-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

#intranet .intranet-audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 12px;
    margin-top: 12px;
    max-height: 200px;
    overflow: auto;
    padding-right: 4px;
}

#intranet .intranet-message-footer {
    margin: 0;
    font-size: 12px;
}

#intranetEditorModal .intranet-form {
    display: grid;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(180deg, rgba(248, 253, 251, 0.94), #fff 38%);
}

#intranetEditorModal .intranet-form input,
#intranetEditorModal .intranet-form textarea,
#intranetEditorModal .intranet-form select {
    width: 100%;
}

#intranetEditorModal .intranet-field-stack {
    display: grid;
    gap: 6px;
}

#intranetEditorModal .intranet-field-stack > span,
#intranetEditorModal .intranet-message-banner-fields .field-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

#intranetEditorModal .intranet-guide-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1.25fr);
    gap: 10px;
}

#intranetEditorModal .intranet-contact-grid {
    display: grid;
    gap: 10px;
}

#intranetEditorModal .intranet-contact-grid-top {
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.75fr) minmax(180px, 1fr);
}

#intranetEditorModal .intranet-contact-grid-middle {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
}

#intranetEditorModal .intranet-guide-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#intranetEditorModal .intranet-guide-file-meta {
    min-width: 180px;
    color: var(--muted);
    font-size: 13px;
}

#intranetEditorModal .intranet-message-banner-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
    gap: 12px;
    align-items: stretch;
}

#intranetEditorModal .intranet-message-banner-preview {
    min-height: 190px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(31, 138, 112, 0.16), rgba(192, 131, 36, 0.15)),
        linear-gradient(180deg, #fff, #f7fbf9);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

#intranetEditorModal .intranet-message-banner-fields {
    display: grid;
    gap: 8px;
    align-content: start;
    padding: 4px 0;
}

#intranetEditorModal .intranet-message-schedule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

#intranetEditorModal .intranet-schedule-box {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f8fbf9);
}

#intranetEditorModal .intranet-schedule-box strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#intranetEditorModal .intranet-schedule-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

#intranetEditorModal .intranet-audience-details {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f7fbf9);
}

#intranetEditorModal .intranet-audience-details summary {
    cursor: pointer;
    font-weight: 800;
}

#intranetEditorModal .intranet-audience-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

#intranetEditorModal .intranet-audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 12px;
    margin-top: 12px;
    max-height: 220px;
    overflow: auto;
    padding-right: 4px;
}

#intranetEditorModal .intranet-audience-empty {
    margin: 0;
    color: var(--muted);
}

#intranetEditorModal .intranet-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#intranetEditorModal .intranet-message-footer {
    margin: 0;
    font-size: 12px;
}

#intranetEditorModal .intranet-editor-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 6px;
}

#intranetEditorModal .intranet-editor-modal-actions .primary {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: #fff;
}

#intranet .intranet-read-receipts,
.intranet-read-receipts {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(31, 138, 112, 0.16);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(31, 138, 112, 0.06), rgba(255, 255, 255, 0.96));
}

#intranet .intranet-read-receipts-summary,
.intranet-read-receipts-summary {
    display: grid;
    gap: 4px;
}

#intranet .intranet-read-receipts-summary strong,
.intranet-read-receipts-summary strong {
    font-size: 13px;
    color: var(--green-dark);
}

#intranet .intranet-read-receipts-summary span,
.intranet-read-receipts-summary span {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}

#intranet .intranet-read-receipts-details,
.intranet-read-receipts-details {
    border-top: 1px dashed rgba(31, 138, 112, 0.18);
    padding-top: 8px;
}

#intranet .intranet-read-receipts-details summary,
.intranet-read-receipts-details summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
    list-style: none;
}

#intranet .intranet-read-receipts-details summary::-webkit-details-marker,
.intranet-read-receipts-details summary::-webkit-details-marker {
    display: none;
}

#intranet .intranet-read-receipts-list,
.intranet-read-receipts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

#intranet .intranet-read-receipt-chip,
.intranet-read-receipt-chip {
    display: grid;
    gap: 2px;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid rgba(31, 138, 112, 0.14);
    border-radius: 12px;
    background: #fff;
}

#intranet .intranet-read-receipt-chip strong,
.intranet-read-receipt-chip strong {
    font-size: 13px;
}

#intranet .intranet-read-receipt-chip small,
.intranet-read-receipt-chip small {
    font-size: 11px;
    color: var(--muted);
}

#intranet .intranet-message-card .row-actions {
    align-self: stretch;
}

#intranet .intranet-message-card .row-actions button {
    min-width: 96px;
}

.intranet-read-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 22, 17, 0.72);
    backdrop-filter: blur(6px) saturate(0.92);
    -webkit-backdrop-filter: blur(6px) saturate(0.92);
}

.intranet-read-modal-backdrop[hidden] {
    display: none;
}

.intranet-read-modal {
    width: min(980px, 96vw);
    height: min(90vh, 900px);
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    grid-template-rows: minmax(0, 1fr) auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.99), rgba(249, 247, 238, 0.99));
    box-shadow: 0 34px 80px rgba(0, 0, 0, 0.46);
}

.intranet-read-hero {
    grid-column: 1;
    grid-row: 1 / span 2;
    position: relative;
    min-width: 0;
    min-height: 0;
    background:
        linear-gradient(180deg, rgba(10, 24, 20, 0.12), rgba(10, 24, 20, 0.65)),
        linear-gradient(135deg, rgba(17, 44, 39, 0.86), rgba(31, 138, 112, 0.72));
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.intranet-read-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 24, 20, 0.08), rgba(10, 24, 20, 0.42));
}

.intranet-read-content {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    gap: 14px;
    padding: 24px;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.intranet-read-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.intranet-read-header h2 {
    margin: 4px 0 0;
    font-size: 30px;
    line-height: 1.05;
}

.intranet-read-close {
    width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
    flex: 0 0 auto;
}

.intranet-read-body {
    padding: 16px;
    border: 1px solid rgba(31, 138, 112, 0.15);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #f7fbf9);
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 15px;
}

.intranet-read-confirm {
    padding: 14px 16px;
    border: 1px solid rgba(192, 131, 36, 0.2);
    border-radius: 16px;
    background: rgba(243, 182, 71, 0.08);
}

.intranet-read-actions {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 24px;
}

.intranet-read-actions .primary {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: #fff;
}

.intranet-editor-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 91;
    display: grid;
    place-items: center;
    padding: 12px;
    background: rgba(7, 22, 17, 0.66);
    backdrop-filter: blur(6px) saturate(0.92);
    -webkit-backdrop-filter: blur(6px) saturate(0.92);
    overscroll-behavior: contain;
}

.intranet-editor-modal-backdrop[hidden] {
    display: none;
}

.intranet-editor-modal {
    width: min(1120px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.995), rgba(249, 247, 238, 0.995));
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.4);
}

.intranet-editor-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 18px;
    border-bottom: 1px solid var(--line);
}

.intranet-editor-modal-copy {
    display: grid;
    gap: 6px;
}

.intranet-editor-modal-copy h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.04;
}

.intranet-editor-modal-copy p:last-child {
    margin: 0;
    color: var(--muted);
}

.intranet-editor-modal-body {
    overflow: auto;
    overscroll-behavior: contain;
}

@media (max-width: 980px) {
    #homeIntranetPanel .home-intranet-feature,
    #intranet .intranet-card,
    #homeIntranetPanel .home-intranet-item {
        grid-template-columns: 1fr;
    }

    #homeIntranetPanel .home-intranet-feature {
        min-height: 0;
    }

    #intranet .intranet-card-actions,
    #homeIntranetPanel .home-intranet-item button {
        justify-self: start;
    }

    #intranet .intranet-editor-row-top {
        align-items: flex-start;
        flex-direction: column;
    }

    #homeIntranetPanel .home-intranet-feature-head {
        align-items: flex-start;
        flex-direction: column;
    }

    #intranet .intranet-public-layout {
        grid-template-columns: 1fr;
    }

    #intranet .intranet-public-sidebar {
        position: static;
        top: auto;
    }

    #intranet .intranet-public-card,
    #intranet .intranet-public-card.is-compact {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    #intranet .intranet-public-card-media {
        min-height: 220px;
    }

    #intranet .intranet-message-banner-row,
    #intranetEditorModal .intranet-message-banner-row,
    #intranet .intranet-message-schedule-grid,
    #intranetEditorModal .intranet-message-schedule-grid,
    .intranet-read-modal {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .intranet-read-modal {
        width: min(100%, 96vw);
        height: min(92vh, 920px);
    }

    .intranet-read-hero,
    .intranet-read-content,
    .intranet-read-actions {
        grid-column: 1;
        grid-row: auto;
    }

    .intranet-read-hero {
        min-height: 220px;
    }

    .intranet-read-actions {
        padding: 0 24px 24px;
    }

    .intranet-editor-modal {
        width: min(100%, calc(100vw - 16px));
        max-height: calc(100vh - 16px);
    }

    .intranet-editor-modal-header {
        padding: 18px 18px 16px;
    }

    .intranet-editor-modal-copy h2 {
        font-size: 26px;
    }

    #intranet .intranet-guide-grid,
    #intranetEditorModal .intranet-guide-grid {
        grid-template-columns: 1fr;
    }

    #intranet .intranet-contact-grid-top,
    #intranet .intranet-contact-grid-middle,
    #intranetEditorModal .intranet-contact-grid-top,
    #intranetEditorModal .intranet-contact-grid-middle {
        grid-template-columns: 1fr;
    }

    #intranetEditorModal .intranet-form {
        padding: 16px;
    }
}

#home #homeKpis .home-kpi {
    border-left-width: 5px;
    border-left-style: solid;
    border-radius: 10px;
}

#home #homeKpis .home-kpi::before {
    width: 100%;
    height: 3px;
    margin-bottom: 10px;
}

#home #homeKpis .home-kpi-sales {
    border-left-color: #1d5b72;
    background: linear-gradient(180deg, rgba(29, 91, 114, 0.12), #fff 58%);
}

#home #homeKpis .home-kpi-sales::before {
    background: #1d5b72;
}

#home #homeKpis .home-kpi-objects {
    border-left-color: #2f6f44;
    background: linear-gradient(180deg, rgba(47, 111, 68, 0.12), #fff 58%);
}

#home #homeKpis .home-kpi-objects::before {
    background: #2f6f44;
}

#home #homeKpis .home-kpi-revenue {
    border-left-color: #c08324;
    background: linear-gradient(180deg, rgba(192, 131, 36, 0.12), #fff 58%);
}

#home #homeKpis .home-kpi-revenue::before {
    background: #c08324;
}

#home #homeKpis .home-kpi-accrued {
    border-left-color: #8a5a9f;
    background: linear-gradient(180deg, rgba(138, 90, 159, 0.12), #fff 58%);
}

#home #homeKpis .home-kpi-accrued::before {
    background: #8a5a9f;
}

#home #homeKpis .home-kpi-attention {
    border-left-color: #a33a2a;
    background: linear-gradient(180deg, rgba(163, 58, 42, 0.13), #fff 58%);
}

#home #homeKpis .home-kpi-attention::before {
    background: #a33a2a;
}

#home #homeKpis .home-kpi-pickup {
    border-left-color: #1f8a70;
    background: linear-gradient(180deg, rgba(31, 138, 112, 0.12), #fff 58%);
}

#home #homeKpis .home-kpi-pickup::before {
    background: #1f8a70;
}

#home #homeKpis .home-kpi-shipping {
    border-left-color: #4b63d1;
    background: linear-gradient(180deg, rgba(75, 99, 209, 0.12), #fff 58%);
}

#home #homeKpis .home-kpi-shipping::before {
    background: #4b63d1;
}

#home #homeKpis .home-kpi-reservation-with {
    border-left-color: #3b6b57;
    background: linear-gradient(180deg, rgba(59, 107, 87, 0.12), #fff 58%);
}

#home #homeKpis .home-kpi-reservation-with::before {
    background: #3b6b57;
}

#home #homeKpis .home-kpi-reservation-without {
    border-left-color: #6f6f6f;
    background: linear-gradient(180deg, rgba(111, 111, 111, 0.1), #fff 58%);
}

#home #homeKpis .home-kpi-reservation-without::before {
    background: #6f6f6f;
}

#home #homeKpis .home-kpi-reservation-over {
    border-left-color: #a46a1f;
    background: linear-gradient(180deg, rgba(164, 106, 31, 0.12), #fff 58%);
}

#home #homeKpis .home-kpi-reservation-over::before {
    background: #a46a1f;
}

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

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

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

.home-work-planning-list {
    display: grid;
    gap: 10px;
}

.home-waiting-item {
    border-color: rgba(192, 131, 36, 0.28);
    background: #fffaf0;
}

.home-case-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-auction-item {
    border: 1px solid rgba(192, 131, 36, 0.35);
    border-radius: 8px;
    background: #fff9ee;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.is-search-target {
    outline: 2px solid rgba(47, 111, 68, 0.34);
    outline-offset: -2px;
    background: rgba(231, 243, 233, 0.9);
}

.home-inbound-item {
    border: 1px solid rgba(15, 94, 70, 0.25);
    border-radius: 8px;
    background: #f4fcf9;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-work-planning-item {
    border: 1px solid rgba(44, 114, 130, 0.25);
    border-radius: 8px;
    background: #f3fbfd;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#home .home-alert-grid .home-auction-item,
#home .home-alert-grid .home-inbound-item {
    padding: 8px 10px;
}

#home .home-alert-grid .home-auction-item button,
#home .home-alert-grid .home-inbound-item button {
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
}

.home-case-item strong {
    display: block;
}

.home-auction-item strong {
    display: block;
}

.home-work-planning-item strong {
    display: block;
}

.home-inbound-item strong {
    display: block;
}

.home-case-item small,
.home-auction-item small,
.home-inbound-item small {
    display: block;
    margin-top: 4px;
}

.home-clock-shell .clock-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.home-clock-shell .clock-controls input {
    flex: 1 1 220px;
    min-width: 180px;
}

.clock-duration {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 700;
}

.user-permissions-cell {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    min-width: 230px;
}

.user-permission-summary {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.permission-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 14px;
    background: rgba(7, 22, 17, 0.68);
    backdrop-filter: blur(5px) saturate(0.92);
    -webkit-backdrop-filter: blur(5px) saturate(0.92);
}

.permission-modal-backdrop[hidden] {
    display: none;
}

.permission-modal {
    width: min(720px, 96vw);
    max-height: min(82vh, 820px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.99), rgba(249, 247, 238, 0.99));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.permission-modal.user-settings-modal {
    width: min(980px, 96vw);
    max-height: min(88vh, 920px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}

.permission-modal-header,
.permission-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.permission-modal-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

.permission-modal-actions .primary {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: #fff;
}

.permission-modal-header h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
}

.user-settings-meta {
    margin: 6px 0 0;
    font-size: 12px;
}

.permission-modal-close {
    width: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
}

.permission-radio-head,
.permission-radio-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) repeat(3, minmax(66px, 82px));
    gap: 6px;
    align-items: center;
}

.permission-radio-head {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.user-settings-modal-body {
    padding: 16px;
    overflow: auto;
    display: grid;
    gap: 16px;
}

.user-settings-helper {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid rgba(204, 194, 174, 0.65);
    border-radius: 14px;
    background: rgba(255, 252, 244, 0.7);
}

.user-settings-helper p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

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

.user-settings-password {
    grid-column: 1 / -1;
}

.user-settings-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px 14px;
    border: 1px solid rgba(204, 194, 174, 0.65);
    border-radius: 14px;
    background: rgba(255, 252, 244, 0.7);
}

.user-setting-check {
    min-height: 32px;
}

.user-settings-section {
    display: grid;
    gap: 12px;
}

.user-settings-section-title {
    margin: 0;
    font-size: 15px;
}

.permission-radio-grid {
    display: grid;
    gap: 0;
}

.permission-radio-row {
    padding: 8px 16px;
    border-bottom: 1px solid rgba(204, 194, 174, 0.55);
}

.permission-radio-row strong {
    font-size: 12px;
}

.permission-radio-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 28px;
    padding: 3px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 252, 244, 0.78);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
}

.permission-radio-option input {
    width: 15px;
    height: 15px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--green);
}

.permission-radio-option:has(input:checked) {
    border-color: var(--green);
    background: rgba(28, 111, 76, 0.12);
    color: var(--green);
    font-weight: 800;
}

.user-permission-note {
    margin: 12px 16px 0;
    font-size: 12px;
    line-height: 1.35;
}

.permission-modal-actions button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.auction-lock-backdrop {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 22, 18, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.auction-lock-backdrop[hidden] {
    display: none;
}

.auction-lock-modal {
    width: min(540px, 96vw);
    border: 1px solid rgba(14, 52, 43, 0.18);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 254, 250, 0.99), rgba(248, 244, 234, 0.99));
    box-shadow: 0 28px 72px rgba(7, 22, 18, 0.3);
    overflow: hidden;
}

.auction-lock-header,
.auction-lock-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
}

.auction-lock-header {
    border-bottom: 1px solid var(--line);
}

.auction-lock-actions {
    border-top: 1px solid var(--line);
    justify-content: flex-end;
}

.auction-lock-body {
    display: grid;
    gap: 12px;
    padding: 20px 22px;
}

.auction-lock-body p {
    margin: 0;
}

.auction-lock-count {
    font-weight: 700;
}

.auction-lock-plan-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.auction-lock-close {
    width: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
}

.system-meta-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(7, 22, 18, 0.58);
    backdrop-filter: blur(6px);
}

.system-meta-backdrop[hidden] {
    display: none;
}

#traderaOverviewModal {
    padding: 12px;
}

.system-meta-modal {
    width: min(760px, 100%);
    max-height: min(88vh, 920px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    border: 1px solid rgba(14, 52, 43, 0.16);
    border-radius: 24px;
    background: #fffdfa;
    box-shadow: 0 28px 70px rgba(7, 22, 18, 0.22);
    overflow: hidden;
}

.system-meta-modal-header,
.system-meta-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.system-meta-modal-actions {
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

.system-meta-modal-header h2 {
    margin: 2px 0 0;
    font-size: 32px;
    line-height: 1.02;
}

.system-meta-modal-close {
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 999px;
}

.system-meta-modal-body {
    overflow: auto;
    padding: 22px;
    display: grid;
    gap: 18px;
}

.system-meta-modal.tradera-overview-modal {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
}

.system-meta-modal.tradera-overview-modal .system-meta-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow: hidden;
    padding-top: 18px;
}

.system-meta-modal.tradera-overview-modal .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.system-meta-modal.reconciliation-credit-import-modal {
    width: min(1080px, 100%);
    max-height: calc(100vh - 24px);
}

.system-meta-modal.reconciliation-credit-import-modal .system-meta-modal-body {
    padding-top: 18px;
}

.system-meta-modal.reconciliation-credit-import-modal .panel-note {
    padding: 0;
}

.system-meta-intro {
    display: grid;
    gap: 6px;
}

.system-meta-current-version {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(47, 111, 68, 0.1);
    color: var(--green-dark);
    font-weight: 800;
}

.system-meta-entry {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fffefb, var(--surface-2));
}

.system-meta-entry-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.system-meta-entry-head h3 {
    margin: 0;
    font-size: 18px;
}

.system-meta-entry-version {
    white-space: nowrap;
    color: var(--green-dark);
    font-weight: 700;
}

.system-meta-entry-date {
    color: var(--muted);
    font-size: 13px;
}

.system-meta-entry ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text);
}

.sidebar-backdrop {
    display: none;
}

body.portal-mode .menu-toggle,
body.portal-mode .sidebar,
body.portal-mode .sidebar-backdrop {
    display: none !important;
}

body.portal-mode .app-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100vh - 72px);
}

body.portal-mode .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
}

body.portal-mode .topbar-search,
body.portal-mode .topbar-notices {
    display: none;
}

body.portal-mode .topbar-title {
    min-width: 0;
}

body.portal-mode main {
    padding-top: 20px;
}

body.portal-mode #portal {
    gap: 18px;
}

body.portal-mode #portal .page-heading {
    align-items: center;
}

body.portal-mode .portal-page-heading,
body.portal-mode .portal-toolbar {
    gap: 10px;
}

body.portal-mode .portal-page-actions,
body.portal-mode .portal-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

body.portal-mode .portal-page-actions {
    justify-content: flex-end;
}

body.portal-mode .portal-toolbar input {
    flex: 1 1 320px;
}

body.portal-mode .portal-panel .table-wrap {
    overflow: auto;
}

body.portal-mode .portal-table {
    min-width: 960px;
    table-layout: fixed;
}

body.portal-mode .portal-table th,
body.portal-mode .portal-table td {
    vertical-align: middle;
}

body.portal-mode .portal-table th.select-col,
body.portal-mode .portal-table td.select-col {
    width: 44px;
}

body.portal-mode .portal-table .portal-col-image {
    width: 96px;
}

body.portal-mode .portal-table .portal-col-article {
    width: 150px;
}

body.portal-mode .portal-table .portal-col-price {
    width: 120px;
}

body.portal-mode .portal-table .portal-col-remaining {
    width: 110px;
}

body.portal-mode .portal-table .portal-col-info {
    width: 96px;
}

body.portal-mode .portal-table .portal-col-quantity {
    width: 72px;
}

body.portal-mode .portal-table .portal-col-action {
    width: 156px;
}

body.portal-mode .portal-table .portal-col-name {
    overflow-wrap: anywhere;
}

body.portal-mode .portal-table td.portal-col-info,
body.portal-mode .portal-table td.portal-col-action {
    text-align: center;
}

body.portal-mode .portal-table .portal-cell-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

body.portal-mode .portal-table .portal-cell-action button {
    margin: 0;
}

body.portal-mode .portal-table .portal-cell-action-stack {
    display: grid;
    gap: 0.35rem;
    justify-items: center;
}

body.portal-mode .portal-table .portal-cell-action-stack button {
    margin: 0;
}

.portal-product-thumb {
    width: 68px;
    height: 68px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fffef8, #f3eee2);
    display: grid;
    place-items: center;
}

.portal-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portal-product-thumb.is-placeholder {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    padding: 8px;
}

.portal-product-thumb.is-large {
    width: min(100%, 320px);
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

.portal-product-info-backdrop {
    position: fixed;
    inset: 0;
    z-index: 88;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 22, 17, 0.68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.portal-product-info-backdrop[hidden] {
    display: none;
}

.portal-product-info-modal {
    position: relative;
    width: min(900px, 96vw);
    max-height: min(88vh, 920px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.995), rgba(249, 247, 238, 0.995));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    padding: 24px;
}

.portal-product-info-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 999px;
    font-size: 28px;
    line-height: 1;
}

.portal-product-info-grid {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.portal-product-info-media {
    display: grid;
    gap: 10px;
}

.portal-product-info-content {
    display: grid;
    gap: 16px;
}

.portal-product-info-content h2 {
    margin: 0;
    font-size: 34px;
    line-height: 1.02;
}

.portal-product-info-brand {
    display: grid;
    gap: 8px;
}

.portal-product-info-brand > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-product-info-brand-card {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
}

.portal-product-info-brand-logo-wrap {
    width: 68px;
    height: 68px;
    border: 1px solid rgba(204, 194, 174, 0.82);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.portal-product-info-brand-logo-wrap.is-empty {
    background: linear-gradient(180deg, rgba(240, 247, 243, 0.96), rgba(228, 240, 233, 0.98));
}

.portal-product-info-brand-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.portal-product-info-brand-copy strong {
    color: var(--ink);
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.portal-product-info-brand-copy a {
    color: var(--green-dark);
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.portal-product-info-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.portal-product-info-meta div,
.portal-product-info-copy {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.76);
    padding: 14px;
}

.portal-product-info-meta span,
.portal-product-info-copy span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-product-info-meta strong {
    display: block;
    margin-top: 8px;
    font-size: 18px;
    overflow-wrap: anywhere;
}

.portal-product-info-copy p,
.portal-product-info-copy .formatted-richtext {
    margin: 10px 0 0;
    line-height: 1.6;
}

.portal-catalog-layout {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    margin-bottom: 18px;
}

.portal-catalog-layout.is-single-column {
    grid-template-columns: minmax(0, 1fr);
}

.portal-catalog-main {
    min-width: 0;
    padding-left: 6px;
}

.portal-catalog-layout.is-single-column .portal-catalog-main {
    padding-left: 0;
}

.portal-category-panel {
    position: sticky;
    top: 90px;
    min-width: 0;
}

.portal-category-tree,
.portal-category-group,
.portal-category-children {
    display: grid;
    gap: 8px;
}

.portal-category-children {
    margin-left: 14px;
    padding-left: 12px;
    border-left: 1px solid rgba(16, 35, 31, 0.12);
}

.portal-category-button {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    text-align: left;
    background: rgba(255, 255, 255, 0.82);
    align-items: flex-start;
    white-space: normal;
}

.portal-category-button span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.portal-category-button strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    flex: 0 0 auto;
    padding-top: 2px;
}

.portal-category-button.is-child {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 14px;
}

.portal-category-button.is-active {
    border-color: rgba(18, 53, 44, 0.45);
    background: rgba(47, 111, 68, 0.12);
    color: var(--green-dark);
}

.portal-category-button.is-active strong,
.portal-category-group.is-branch-selected > .portal-category-button strong {
    color: var(--green-dark);
}

.portal-summary-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(520px, 2fr);
    gap: 16px;
    margin-bottom: 18px;
}

.order-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.order-card-stack {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.order-card-grid--footer {
    margin-bottom: 0;
}

.portal-customer-summary,
.portal-order-items,
.portal-cart-footer,
.order-card-block {
    display: grid;
    gap: 10px;
}

.order-card-block--customer {
    gap: 8px;
}

.order-card-block--rows {
    gap: 12px;
}

.portal-order-customer-hero {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(214, 197, 168, 0.55);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.portal-order-customer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.portal-order-customer-field {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid rgba(214, 197, 168, 0.5);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.66);
    min-width: 0;
}

.portal-order-customer-field--wide {
    grid-column: span 2;
}

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

.portal-order-customer-field > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-order-customer-field > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.portal-order-customer-field > div p {
    margin: 0;
}

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

.portal-customer-form label {
    display: grid;
    gap: 5px;
}

.portal-customer-form label:first-child,
.portal-customer-form label:nth-child(6),
.portal-customer-actions {
    grid-column: 1 / -1;
}

.portal-customer-form span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.portal-customer-form input {
    width: 100%;
    min-width: 0;
}

.portal-staff-customer-field select {
    width: 100%;
    min-width: 0;
}

.portal-customer-actions {
    display: flex;
    justify-content: flex-end;
}

.portal-customer-summary strong,
.portal-order-card strong,
.order-card-block h3 {
    margin: 0;
}

.portal-staff-selected-customer span {
    color: var(--muted);
}

.portal-cart-footer {
    margin-top: 14px;
}

.portal-cart-totals,
.portal-order-card-header,
.portal-order-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.portal-note-field,
.order-card-block label {
    display: grid;
    gap: 6px;
}

.portal-note-field span,
.order-card-block label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.portal-order-list,
.order-list {
    display: grid;
    gap: 14px;
}

.portal-order-card,
.order-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #fffef9, var(--surface-2));
    padding: 16px;
}

.order-card-details {
    padding: 0;
    overflow: hidden;
}

.order-card-details.is-actionable {
    border-color: rgba(176, 84, 108, 0.34);
    background: linear-gradient(180deg, rgba(255, 245, 246, 0.96), rgba(255, 250, 249, 0.96));
}

.order-card-details.is-completed {
    border-color: rgba(47, 111, 68, 0.34);
    background: linear-gradient(180deg, rgba(244, 252, 247, 0.96), rgba(252, 255, 253, 0.96));
}

.order-card-details.is-owned {
    border-color: rgba(192, 131, 36, 0.34);
    background: linear-gradient(180deg, rgba(255, 251, 240, 0.96), rgba(255, 248, 236, 0.96));
}

.order-card-details.is-cancelled {
    border-color: rgba(90, 111, 126, 0.28);
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.96), rgba(255, 255, 255, 0.96));
}

.order-card-summary {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

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

.order-card-summary-main,
.order-card-summary-side {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.order-card-summary-main {
    flex: 1 1 auto;
}

.order-card-summary-side {
    flex: 0 0 auto;
}

.order-card-summary-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.order-card-summary-copy strong {
    font-size: 16px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.order-card-summary-meta {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.order-card-details[open] > .order-card-summary .guide-chevron {
    transform: rotate(180deg);
}

.order-card-body {
    padding: 0 16px 16px;
    border-top: 1px solid rgba(214, 197, 168, 0.45);
}

.portal-order-items {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.portal-order-items > div {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.7);
    display: grid;
    gap: 4px;
}

.portal-cart-actions {
    display: flex;
    justify-content: flex-end;
}

.portal-terms-box {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
}

.portal-terms-status {
    display: grid;
    gap: 4px;
}

.portal-terms-status strong {
    font-size: 15px;
}

.portal-terms-status span {
    color: var(--muted);
    line-height: 1.5;
}

.portal-terms-status.is-accepted strong {
    color: var(--ok, #2f7a4f);
}

.portal-terms-backdrop {
    position: fixed;
    inset: 0;
    z-index: 89;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(7, 22, 17, 0.68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.portal-terms-backdrop[hidden] {
    display: none;
}

.portal-terms-modal {
    position: relative;
    width: min(720px, 96vw);
    max-height: min(88vh, 880px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 252, 0.995), rgba(249, 247, 238, 0.995));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    padding: 24px;
}

.portal-terms-content {
    display: grid;
    gap: 16px;
}

.portal-terms-content h2 {
    margin: 0;
    font-size: 34px;
    line-height: 1.02;
}

.portal-terms-summary,
.portal-terms-check {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.76);
    padding: 14px;
}

.portal-terms-summary {
    display: grid;
    gap: 8px;
}

.portal-terms-summary span {
    color: var(--muted);
}

.portal-terms-check {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
}

.portal-terms-check input {
    margin-top: 3px;
}

.portal-terms-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.portal-cart-table input,
.portal-table-buyer input,
.order-card-block input,
.order-card-block textarea,
.order-card-block select {
    width: 100%;
}

.portal-table-buyer input {
    max-width: 84px;
    margin-left: auto;
}

.portal-table-buyer input[data-portal-quantity] {
    width: 5.5ch;
    min-width: 5.5ch;
    max-width: 5.5ch;
    padding-left: 8px;
    padding-right: 8px;
    text-align: center;
}

.portal-cart-table input[data-portal-cart-qty] {
    width: 5.5ch;
    min-width: 5.5ch;
    max-width: 5.5ch;
    padding-left: 8px;
    padding-right: 8px;
    text-align: center;
}

.portal-cart-table th,
.portal-cart-table td {
    padding: 8px 10px;
}

.portal-cart-table th:last-child,
.portal-cart-table td.row-actions {
    width: 44px;
    padding-left: 4px;
    padding-right: 4px;
    text-align: center;
}

.portal-cart-table td.row-actions {
    justify-content: center;
    gap: 0;
}

.portal-table td .portal-product-thumb {
    margin: 0 auto;
}

.order-card-block .table-wrap {
    margin-top: 0;
}

.order-items-table input {
    min-width: 110px;
}

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

.order-metric {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
}

.order-metric span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.order-metric strong {
    font-size: 24px;
    line-height: 1.05;
}

.order-metric small {
    color: var(--muted);
    line-height: 1.4;
}

.order-card-actions {
    margin-top: 12px;
}

.order-action-hint {
    margin-top: 8px;
}

@media (max-width: 980px) {
    .portal-catalog-layout,
    .portal-summary-grid,
    .order-card-grid,
    .order-metric-grid,
    #returns .returns-create-grid,
    #returns .returns-field-grid,
    #returns .returns-metric-grid,
    #returns .returns-list-row,
    #pickup-reminders .returns-create-grid,
    #pickup-reminders .returns-field-grid,
    #pickup-reminders .returns-metric-grid,
    #pickup-reminders .returns-list-row {
        grid-template-columns: 1fr;
    }

    .order-card-summary {
        align-items: flex-start;
    }

    .order-card-summary,
    .order-card-summary-main,
    .order-card-summary-side {
        flex-direction: column;
        align-items: stretch;
    }

    .order-card-summary-side .panel-header-actions {
        justify-content: flex-start;
    }

    #returns .returns-list-row-side,
    #pickup-reminders .returns-list-row-side {
        padding-left: 0;
        padding-top: 12px;
        border-left: 0;
        border-top: 1px solid rgba(14, 52, 43, 0.1);
    }

    #returnModal .returns-modal-actions,
    #pickupReminderModal .returns-modal-actions {
        align-items: stretch;
    }

    #returnModal .returns-modal-actions .page-heading-actions,
    #pickupReminderModal .returns-modal-actions .page-heading-actions {
        width: 100%;
        justify-content: stretch;
    }

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

    .portal-order-customer-field--wide,
    .portal-order-customer-field--full {
        grid-column: 1 / -1;
    }

    .portal-product-info-grid,
    .portal-product-info-meta {
        grid-template-columns: 1fr;
    }

    .portal-product-info-modal {
        padding: 18px;
    }

    .portal-terms-modal {
        padding: 18px;
    }
}

@media (max-width: 1120px) {
    #homePsMonthPanel .home-trade-hero,
    #homePsMonthPanel .home-trade-hero-stats,
    #homeTradePanel .home-trade-hero,
    #homeTradePanel .home-trade-hero-stats,
    #homeTraderaPanel .home-trade-hero,
    #homeTraderaPanel .home-trade-hero-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1360px) {
    .home-kpi-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 1080px) {
    .menu-toggle {
        display: inline-flex;
    }

    .topbar-title strong {
        font-size: 15px;
    }

    .app-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(86vw, 320px);
        height: 100dvh;
        z-index: 40;
        transform: translateX(-104%);
        transition: transform 180ms ease;
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
        overflow: hidden;
    }

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

    .sidebar-head {
        display: flex;
        justify-content: flex-end;
        padding: 10px;
        order: 1;
    }

    .sidebar-tabs {
        order: 2;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding-bottom: 14px;
    }

    .sidebar-meta {
        order: 3;
        margin-top: auto;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
        flex: 0 0 auto;
        background: #0f3f35;
    }

    .sidebar-close {
        display: inline-flex;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        border: 0;
        background: rgba(11, 24, 20, 0.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    main {
        padding: 18px 14px;
    }

    .home-split {
        grid-template-columns: 1fr;
    }

    .home-alert-grid {
        grid-template-columns: 1fr;
    }

    .home-clock-shell .clock-controls {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .portal-order-customer-grid {
        grid-template-columns: 1fr;
    }

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

    .top-actions {
        gap: 8px;
    }

    .topbar-notices {
        display: none;
    }

    .topbar-title {
        gap: 8px;
    }

    .topbar-title strong {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-user-label {
        display: none;
    }

    .topbar-user {
        max-width: 28vw;
        padding: 0 8px;
    }

    .topbar .logout {
        min-width: 0;
        padding: 0 10px;
        font-size: 13px;
    }

    .home-case-item,
    .home-auction-item,
    .home-inbound-item {
        flex-direction: column;
        align-items: stretch;
    }
}

.crm-call-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid rgba(47, 111, 68, 0.28);
    border-radius: 999px;
    background: rgba(47, 111, 68, 0.1);
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.crm-call-button:hover {
    border-color: rgba(47, 111, 68, 0.44);
    background: rgba(47, 111, 68, 0.16);
}

@media (max-width: 720px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-shell,
    .app-layout,
    main,
    .view,
    .panel,
    .table-wrap,
    .toolbar,
    .bulk-toolbar,
    .page-heading {
        max-width: 100%;
        min-width: 0;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

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

    .tradera-overview-summary,
    .tradera-overview-summary.is-compact {
        grid-template-columns: 1fr;
    }

    .reconciliation-credit-import-form {
        align-items: stretch;
    }

    .reconciliation-credit-import-form input[type="file"],
    .reconciliation-credit-import-form button {
        width: 100%;
    }

    .reconciliation-credit-import-modal .system-meta-modal-header,
    .reconciliation-credit-import-modal .system-meta-modal-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .tradera-overview-card {
        padding: 14px;
    }

    .tradera-overview-card-top,
    .tradera-overview-modal .system-meta-modal-header,
    .tradera-overview-modal .system-meta-modal-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    #traderaOverviewModal {
        padding: 6px;
    }

    .system-meta-modal.tradera-overview-modal {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        height: calc(100vh - 12px);
        max-height: calc(100vh - 12px);
        border-radius: 20px;
    }

    .tradera-overview-modal-meta {
        width: 100%;
        justify-items: start;
    }

    .tradera-history-table th:first-child,
    .tradera-history-table td:first-child {
        min-width: 220px;
    }

    .app-bootstrap-overlay {
        align-items: stretch;
        padding: 18px;
    }

    .app-bootstrap-card {
        align-self: center;
        width: 100%;
        padding: 26px 24px;
        border-radius: 20px;
    }

    .app-bootstrap-card h1 {
        font-size: clamp(28px, 11vw, 40px);
    }

    .app-bootstrap-card p {
        max-width: none;
        font-size: 15px;
    }

    .topbar {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .topbar-search {
        grid-column: 1 / -1;
        order: 4;
        width: 100%;
        min-width: 0;
    }

    .topbar-search-results,
    .topbar-popover {
        left: 0;
        right: 0;
        width: min(100%, calc(100vw - 24px));
    }

    #home .panel-header {
        align-items: stretch;
        flex-direction: column;
        height: auto;
        min-height: 0;
        padding: 12px;
    }

    #home .panel-header-actions {
        justify-content: space-between;
        width: 100%;
    }

    #homeKpis {
        gap: 10px;
    }

    #home #homeKpis .home-kpi {
        min-width: 0;
        padding: 14px;
    }

    #homePsMonthPanel .home-trade-hero,
    #homeTradePanel .home-trade-hero,
    #homeTraderaPanel .home-trade-hero {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    #homePsMonthPanel .home-trade-hero-stats,
    #homeTradePanel .home-trade-hero-stats,
    #homeTraderaPanel .home-trade-hero-stats {
        grid-template-columns: 1fr;
    }

    .home-waiting-item,
    .topbar-notice-item {
        align-items: stretch;
        flex-direction: column;
    }

    #crm .crm-toolbar,
    #crm .crm-toolbar .inline-filters {
        align-items: stretch;
        width: 100%;
    }

    #crm .crm-toolbar input[type="search"],
    #crm .crm-toolbar select {
        min-width: 0;
        width: 100%;
    }

    #crm table,
    #crm thead,
    #crm tbody,
    #crm tr,
    #crm th,
    #crm td {
        display: block;
        width: 100%;
    }

    #crm thead {
        display: none;
    }

    #crm .crm-list-row {
        margin: 0 0 12px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fffdf8;
        box-shadow: 0 8px 18px rgba(16, 35, 31, 0.06);
    }

    #crm .crm-list-row td {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
        border: 0;
    }

    #crm .crm-list-row td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    #crm .crm-list-row .row-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #crm .crm-list-row .row-actions::before {
        display: none;
    }

    #crm .row-actions .icon-button,
    #crm .row-actions .crm-call-button {
        width: 100%;
        min-width: 0;
    }

    #crm .crm-pipeline {
        max-width: 100%;
    }

    #crm .crm-status-checklist {
        max-width: 100%;
    }

    #crm .crm-status-check {
        width: 100%;
        justify-content: flex-start;
    }

    #crm .crm-pipeline-step {
        max-width: 100%;
    }

    .crm-editor-backdrop {
        padding: 8px;
        align-items: stretch;
    }

    .crm-editor-modal {
        width: 100%;
        max-height: 96dvh;
        border-radius: 16px;
    }

    .crm-editor-header,
    .crm-editor-actions {
        padding: 12px;
    }

    .crm-editor-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .crm-editor-actions button {
        width: 100%;
    }
}
