@import url("./print.css");
:root {
    --primary: #005674;
    --dark: #003e54;
    --pale: #e8f2f6;
    --ink: #17313b;
    --muted: #637985;
    --line: #dfe9ee;
    --bg: #f5f8fa;
    --white: #fff;
    --amber: #a96925;
    --red: #ac3737;
}
* {
    box-sizing: border-box;
}
[hidden] {
    display: none !important;
}
dialog.modal {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 26px;
    width: min(640px, calc(100% - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    color: var(--ink);
    box-shadow: 0 20px 70px #003e5430;
}
dialog.modal::backdrop {
    background: #17313b66;
}
.modal-error {
    white-space: pre-line;
}
.add-product {
    padding-left: 0;
    margin-top: 5px;
}
#partner-address-preview {
    margin-top: 8px;
    overflow-wrap: anywhere;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font:
        14px/1.55 Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}
a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
button,
input,
select,
textarea {
    font: inherit;
}
button,
.button {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    padding: 11px 17px;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.45;
}
button:hover,
.button:hover {
    filter: brightness(0.94);
    text-decoration: none;
}
button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.secondary {
    background: white;
    color: var(--ink);
    border-color: #d7e3e9;
}
.danger {
    background: var(--red);
    border-color: var(--red);
}
.text-button {
    border: 0;
    background: none;
    color: var(--primary);
    padding: 5px 8px;
    font-size: 12px;
}
.danger-text {
    color: var(--red);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid #87bdcf;
    outline-offset: 3px;
}
input,
select,
textarea {
    border: 1px solid #d4e1e7;
    border-radius: 6px;
    background: white;
    color: var(--ink);
    padding: 10px 12px;
    width: 100%;
    min-width: 0;
}
input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
}
textarea {
    resize: vertical;
}
input.input-error {
    border-color: var(--red);
    background: #fff7f7;
    box-shadow: 0 0 0 1px #ac373729;
}
input.input-error:focus-visible {
    outline-color: #c77c7c;
}
.field-error {
    display: block;
    color: var(--red);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.field-error a {
    display: block;
    margin-top: 3px;
    font-weight: 600;
}
label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 550;
}
label small {
    font-weight: 400;
    color: var(--muted);
}
label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 9px;
    font-weight: 400;
}
h1,
h2,
h3,
p {
    margin-top: 0;
}
h1 {
    font-size: 29px;
    line-height: 1.25;
    letter-spacing: -0.8px;
    margin-bottom: 9px;
    font-weight: 650;
}
h2 {
    font-size: 17px;
    letter-spacing: -0.2px;
    margin-bottom: 6px;
    font-weight: 650;
}
h3 {
    font-size: 16px;
    margin-bottom: 6px;
}
p {
    margin-bottom: 12px;
}
.muted {
    color: var(--muted);
}
.small,
small {
    font-size: 12px;
}
small {
    display: block;
    color: var(--muted);
}
.strong,
strong {
    font-weight: 600;
}
.eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.65px;
    color: var(--primary);
    margin-bottom: 12px;
}
.grow {
    flex: 1;
    min-width: 0;
}
.sidebar {
    width: 236px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 30px 18px;
    z-index: 20;
    overflow-y: auto;
}
.sidebar > * {
    flex-shrink: 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    color: var(--dark);
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 0 10px;
}
.brand:hover {
    text-decoration: none;
}
.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--dark);
    color: #fff;
    border-radius: 12px 12px 12px 2px;
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -2px;
    font-family: Georgia, serif;
}
.brand-logo { display: block; width: 118px; height: auto; max-width: 100%; object-fit: contain; }
.sidebar .brand-logo { width: 76px; }
.brand-logo-text { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.brand-logo-text .brand-sub { margin: 0; font-size: 9px; letter-spacing: 3px; }
.sidebar .brand { padding: 0 12px; }
.login-card .brand-logo { width: 150px; }
.brand-sub {
    display: block;
    font-size: 8px;
    letter-spacing: 2.5px;
    font-weight: 600;
    margin-top: -4px;
}
.workspace-label {
    font-size: 9px;
    letter-spacing: 1.8px;
    color: #698390;
    font-weight: 700;
    margin: 38px 16px 13px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: #536d7a;
    border-radius: 7px;
    margin-bottom: 5px;
    font-size: 13px;
}
.nav-link:hover {
    background: #f0f6f9;
    text-decoration: none;
}
.nav-link.active {
    color: var(--primary);
    background: var(--pale);
    font-weight: 650;
}
.nav-icon {
    font-size: 20px;
    width: 20px;
    flex-shrink: 0;
    line-height: 1;
    text-align: center;
}
.sidebar-bottom {
    margin-top: auto;
    font-size: 10px;
    padding: 15px 9px 0;
    color: #4f6b79;
    border-top: 1px solid var(--line);
}
.sidebar-bottom small {
    font-size: 9px;
    margin-top: 6px;
}
.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #57a36c;
    margin-right: 4px;
}
.shell {
    margin-left: 236px;
}
.topbar {
    height: 83px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: #fff;
}
.breadcrumb {
    font-size: 11px;
    color: #536e7c;
}
.breadcrumb span {
    color: #b8cbd4;
    margin: 0 13px;
}
.account {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
}
.account small {
    font-size: 9px;
}
.account form {
    margin-left: 13px;
}
.avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    width: 33px;
    height: 33px;
    background: #e8f2f6;
    color: #005674;
    font-size: 12px;
}
.mobile-toggle {
    display: none;
}
main#main {
    padding: 35px 40px 40px;
    min-height: calc(100vh - 144px);
    max-width: 1700px;
    margin: auto;
}
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 29px;
}
.page-heading a + h1 {
    margin-top: 14px;
}
.page-heading p:last-child {
    margin-bottom: 0;
}
.date-chip {
    font-size: 11px;
    color: #637985;
    border: 1px solid #dce7ec;
    border-radius: 6px;
    padding: 9px 13px;
    background: #fff;
}
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}
.stats.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 22px;
    position: relative;
    overflow: hidden;
}
.stat > span:first-child {
    font-size: 11px;
    color: #617a87;
}
.stat strong {
    display: block;
    font-size: 33px;
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1.5;
    margin: 9px 0 4px;
}
.stat strong.price {
    font-size: 27px;
}
.stat small {
    font-size: 9px;
    color: #6b818e;
}
.stat-icon {
    position: absolute;
    right: 19px;
    top: 17px;
    color: #005674;
    font-size: 17px;
}
.stat.attention {
    background: #fffdf8;
    border-color: #eae4d6;
}
.stat.attention strong,
.stat.attention .stat-icon {
    color: var(--amber);
}
.quick-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: #e8f2f6;
    border: 1px solid #cfe2eb;
    border-radius: 10px;
    padding: 23px 27px;
    margin-bottom: 28px;
}
.quick-actions .eyebrow {
    font-size: 9px;
    margin-bottom: 5px;
}
.quick-actions h2 {
    margin: 0;
    font-size: 16px;
}
.actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.quick-actions .button {
    font-size: 11px;
    padding: 10px 15px;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 23px;
    align-items: start;
}
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}
.card-heading {
    padding: 23px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}
.card-heading h2 {
    font-size: 15px;
}
.card-heading p {
    margin: 4px 0 0;
    font-size: 10px;
}
.card-heading > a {
    font-size: 10px;
    white-space: nowrap;
}
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th {
    background: #f4f8fa;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: #647e8c;
    font-weight: 600;
    padding: 13px 22px;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}
td {
    padding: 17px 22px;
    border-bottom: 1px solid #eaf0f4;
    font-size: 12px;
    vertical-align: top;
}
td small {
    font-size: 10px;
    margin-top: 4px;
}
tbody tr:last-child td {
    border-bottom: 0;
}
tbody tr:hover {
    background: #f7fafc;
}
.striped-table tbody tr:nth-child(odd) {
    background: linear-gradient(90deg, #ffffff, #f2f8fb);
}
.striped-table tbody tr:nth-child(even) {
    background: linear-gradient(90deg, #e8f2f8, #f3f8fb);
}
.partner-table {
    table-layout: fixed;
}
.partner-table th:first-child {
    width: 55%;
}
.partner-table td {
    overflow-wrap: anywhere;
}
.partner-table details > summary {
    white-space: nowrap;
}
.stock-change.positive {
    color: #287149;
}
.stock-change.negative {
    color: var(--red);
}
.stock-count-link {
    display: block;
    white-space: nowrap;
}
.field-rows {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 22px 0;
}
.field-row {
    display: grid;
    grid-template-columns: minmax(100px, 160px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}
.field-row > label {
    padding-top: 10px;
}
.field-control {
    min-width: 0;
}
.field-control small {
    margin-top: 6px;
}
@media (max-width: 480px) {
    .field-row {
        grid-template-columns: 95px minmax(0, 1fr);
        gap: 10px;
    }
    .partner-table th:first-child {
        width: 45%;
    }
}
.badge {
    display: inline-block;
    border-radius: 4px;
    padding: 4px 9px;
    font-size: 10px;
    white-space: nowrap;
    font-weight: 500;
}
.green {
    background: #eaf3eb;
    color: #528361;
}
.amber {
    background: #fbf0db;
    color: #ac873c;
}
.grey {
    background: #eff3f6;
    color: #677e8c;
}
.stock-list {
    padding: 0 20px;
}
.stock-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 17px 0;
    border-bottom: 1px solid #eaf0f4;
    color: var(--ink);
}
.stock-item:hover {
    text-decoration: none;
}
.stock-item:last-child {
    border: 0;
}
.stock-item strong {
    font-size: 11px;
}
.stock-item small {
    font-size: 9px;
}
.stock-value {
    font-size: 12px;
    text-align: right;
    color: var(--amber);
    font-weight: 600;
}
.product-placeholder,
.thumb {
    width: 38px;
    height: 38px;
    background: #e8f2f6;
    color: #47788e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    flex-shrink: 0;
    object-fit: cover;
}
.opname-note {
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 17px;
    border: 1px dashed #cadde6;
    padding: 20px 23px;
    border-radius: 8px;
}
.note-icon {
    font-size: 24px;
    color: #4f849b;
}
.opname-note strong {
    font-size: 12px;
}
.opname-note p {
    font-size: 10px;
    color: #617f8f;
    margin: 5px 0 0;
}
.opname-note > a {
    margin-left: auto;
    white-space: nowrap;
    font-size: 11px;
}
.app-footer {
    border-top: 1px solid var(--line);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #6b8390;
}
.empty-state {
    padding: 35px 20px;
    text-align: center;
    color: var(--muted);
}
.empty-state > span {
    display: block;
    font-size: 30px;
    color: #80a8bb;
    margin-bottom: 10px;
}
.empty-state p {
    font-size: 11px;
    max-width: 300px;
    margin: 6px auto;
}
.empty-state h3 {
    color: #476b7d;
    font-size: 14px;
}
.item-cell {
    display: flex;
    gap: 12px;
    align-items: center;
}
.filter-bar {
    display: flex;
    align-items: end;
    gap: 15px;
    padding: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
}
.filter-bar label {
    font-size: 11px;
}
.filter-bar input[type="search"] {
    min-width: 160px;
}
.filter-bar .checkbox {
    padding-bottom: 10px;
}
.filter-bar > a {
    align-self: center;
    font-size: 12px;
}
.warning-text {
    color: var(--amber);
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px;
    font-size: 11px;
    border-top: 1px solid var(--line);
}
.pagination div {
    display: flex;
    gap: 20px;
}
.form-card {
    padding: 30px;
    max-width: 1050px;
}
#document-form.card,
#production-form.card {
    overflow: visible;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin: 22px 0;
}
.form-grid .full {
    grid-column: 1/-1;
}
.setting-row {
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
}
.setting-row p {
    margin: 5px 0 0;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}
.padded {
    padding: 25px;
}
.section-gap {
    margin-top: 25px;
}
.stack {
    display: flex;
    flex-direction: column;
    gap: 17px;
}
.stack > button {
    align-self: flex-start;
}
.details {
    display: grid;
    grid-template-columns: 155px 1fr;
    gap: 10px 20px;
    font-size: 12px;
}
.details dt {
    color: var(--muted);
}
.details dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.preserve-lines {
    white-space: pre-line;
}
.notice {
    border: 1px solid #cfe2eb;
    border-radius: 8px;
    padding: 15px 19px;
    background: #edf5f9;
    color: #356378;
    margin-bottom: 22px;
    font-size: 12px;
}
.notice.error {
    background: #fff3f2;
    color: #9c4a45;
    border-color: #f0d5d0;
}
.notice.success {
    background: #edf7ef;
    color: #3e7651;
    border-color: #d9eadd;
}
.notice ul {
    margin: 7px 0 0;
    padding-left: 18px;
}
.photos {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 20px 0;
}
.photos article {
    width: 150px;
}
.photos img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 8px;
}
.photo-actions {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}
.photo-actions button {
    font-size: 10px;
    padding: 3px;
}
.upload-form {
    border-top: 1px solid var(--line);
    padding-top: 20px;
}
.inline-form {
    margin-top: 20px;
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}
.inline-form label {
    flex: 1;
}
.document-line {
    display: flex;
    align-items: start;
    gap: 18px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}
.document-line > label:not(.grow) {
    width: 145px;
}
.document-line > .remove-line {
    margin-top: 28px;
}
.stock-hint {
    font-size: 11px;
}
.flush {
    padding: 20px 0;
    border: 0;
}
.print-page .print-toolbar {
    max-width: 850px;
    margin: 20px auto;
    display: flex;
    justify-content: space-between;
}
.paper {
    background: white;
    max-width: 850px;
    padding: 55px;
    margin: 20px auto;
    color: #17313b;
}
.print-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #003e54;
    margin-bottom: 30px;
    padding-bottom: 20px;
}
.print-heading h2 {
    font-size: 16px;
}
.print-heading p {
    font-size: 11px;
    margin: 0;
}
.paper h1 {
    font-size: 21px;
    text-align: center;
}
.document-number {
    text-align: center;
    font-size: 14px;
}
.paper table {
    margin: 25px 0;
}
.print-warning {
    text-align: center;
    font-weight: bold;
    border: 2px solid #a95342;
    padding: 12px;
    color: #a95342;
    margin: 20px 0;
}
.signatures {
    display: flex;
    justify-content: space-between;
    gap: 25px;
    margin-top: 45px;
    font-size: 12px;
    text-align: center;
    break-inside: avoid;
}
.signatures span {
    display: block;
    margin-top: 80px;
}
.paper footer {
    font-size: 9px;
    color: #777;
    border-top: 1px solid #ddd;
    margin-top: 35px;
    padding-top: 15px;
}
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(ellipse at top right, #cbe4ee, transparent 55%), #f3f8fb;
    padding: 30px;
}
.login-card {
    background: white;
    border: 1px solid #dae7ee;
    box-shadow: 0 20px 70px #003e5410;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    padding: 42px;
}
.login-card .brand {
    margin-bottom: 40px;
    padding: 0;
}
.login-card h1 {
    font-size: 26px;
}
.login-card > .muted {
    margin-bottom: 27px;
    font-size: 13px;
}
.login-card .stack {
    gap: 20px;
}
.login-card button {
    width: 100%;
    justify-content: space-between;
}
.login-card > .small {
    margin-top: 25px;
    margin-bottom: 0;
    font-size: 11px;
}
.login-footer {
    font-size: 11px;
    color: #627f8e;
    margin-top: 26px;
}
hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 22px 0;
}
summary {
    cursor: pointer;
    font-weight: 600;
}
pre {
    max-width: 450px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 10px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute;
    left: 250px;
    top: -80px;
    background: white;
    padding: 10px;
    z-index: 100;
}
.skip-link:focus {
    top: 10px;
}
@media (min-width: 1500px) {
    main#main {
        padding: 45px 55px;
    }
    .stat {
        padding: 28px;
    }
    .stat strong {
        font-size: 38px;
    }
    .dashboard-grid {
        grid-template-columns: 1.8fr 1fr;
    }
}
@media (max-width: 1150px) {
    .sidebar {
        width: 205px;
        padding-left: 12px;
        padding-right: 12px;
    }
    .shell {
        margin-left: 205px;
    }
    .topbar {
        padding: 0 24px;
    }
    main#main {
        padding: 28px 24px;
    }
    .stats {
        gap: 12px;
    }
    .stat {
        padding: 16px;
    }
    .stat > span:first-child {
        font-size: 10px;
    }
    .stat-icon {
        display: none;
    }
    .stat small {
        font-size: 9px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .quick-actions {
        align-items: flex-start;
        flex-direction: column;
    }
    .quick-actions .actions {
        width: 100%;
    }
    .date-chip {
        display: none;
    }
    .page-heading h1 {
        font-size: 26px;
    }
}
@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s;
        width: 236px;
        box-shadow: 10px 0 30px #0001;
        top: 68px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .shell {
        margin: 0;
    }
    .topbar {
        height: 68px;
        padding: 0 16px;
        position: sticky;
        top: 0;
        z-index: 30;
    }
    .mobile-toggle {
        display: inline-flex;
        padding: 7px 11px;
    }
    .breadcrumb {
        display: none;
    }
    .account {
        gap: 8px;
    }
    .account form {
        margin-left: 2px;
    }
    main#main {
        padding: 25px 16px;
    }
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 17px;
        margin-bottom: 22px;
    }
    h1,
    .page-heading h1 {
        font-size: 25px;
    }
    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 18px;
    }
    .stats.three {
        grid-template-columns: 1fr;
    }
    .stat {
        padding: 17px;
    }
    .stat strong {
        font-size: 29px;
    }
    .quick-actions {
        padding: 20px;
        margin-bottom: 20px;
    }
    .actions {
        gap: 8px;
    }
    .actions .button {
        font-size: 11px;
    }
    .card-heading {
        padding: 18px;
    }
    .card-heading > a {
        font-size: 9px;
    }
    td,
    th {
        padding: 13px 16px;
    }
    .opname-note {
        flex-wrap: wrap;
        padding: 18px;
    }
    .opname-note div {
        flex: 1;
    }
    .opname-note > a {
        margin-left: 41px;
    }
    .app-footer {
        padding: 18px 16px;
        font-size: 8px;
    }
    .form-card,
    .padded {
        padding: 20px;
    }
    .form-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .setting-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .document-line {
        flex-wrap: wrap;
        gap: 8px;
    }
    .document-line .grow {
        flex-basis: 100%;
    }
    .document-line > .remove-line {
        margin-top: 30px;
    }
    .details {
        grid-template-columns: 100px 1fr;
        gap: 12px;
    }
    .pagination {
        flex-wrap: wrap;
        padding: 15px;
    }
    .photos article,
    .photos img {
        width: 120px;
    }
    .photos img {
        height: 120px;
    }
    .login-card {
        padding: 30px 25px;
    }
    .paper {
        padding: 22px;
        margin: 10px;
    }
    .print-page .print-toolbar {
        padding: 0 15px;
    }
    .filter-bar {
        gap: 12px;
    }
    .filter-bar .grow {
        flex-basis: 100%;
    }
    .form-actions {
        flex-wrap: wrap;
    }
}

.nav-icon svg,
.stat-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}
.note-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.category-editor { min-width: 320px; }
.filter-bar select { max-width: 280px; }

.document-line.with-line-notes {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 145px minmax(140px, 190px) auto;
}
.document-line.with-line-notes > label { width: auto; }
.document-line .grow { min-width: 0; }
.line-note-cell { overflow-wrap: anywhere; max-width: 260px; }
@media (max-width: 760px) {
    .document-line.with-line-notes { grid-template-columns: 125px minmax(0, 1fr) auto; }
    .document-line.with-line-notes > .grow { grid-column: 1 / -1; }
}

.quantity-with-unit { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.quantity-with-unit:focus-within { outline: 2px solid #93c5fd; border-color: #2563eb; }
.quantity-with-unit input { width: 100%; min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
.quantity-with-unit input:focus { outline: 0; box-shadow: none; }
.quantity-unit { padding: 0 10px 0 4px; color: #56708a; font-size: 12px; white-space: nowrap; font-weight: 500; }
.product-picker { position: relative; }
.product-picker .product-search { padding-right: 38px; }
.product-picker-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 36px; padding: 0; background: transparent; color: #456783; border: 0; box-shadow: none; }
.product-picker-toggle:hover { background: #eff6ff; color: #1d4ed8; }
.product-options { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 30; max-height: 290px; overflow-y: auto; background: #fff; border: 1px solid #b9d2ee; border-radius: 9px; box-shadow: 0 10px 28px #153d6829; }
.product-option { padding: 11px 13px; cursor: pointer; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; color: #203f5d; }
.product-option:hover, .product-option.active { background: #eaf3ff; color: #164da2; }
.product-option-add { position: sticky; bottom: 0; background: #f3f8ff; border-top: 1px solid #dce8f5; color: #1d5bbb; font-weight: 600; }
.product-no-results { padding: 13px; color: #66788b; font-size: 13px; }
.product-picker-grouped .product-option-raw-start { border-top: 3px solid #d5e0eb; margin-top: 4px; padding-top: 13px; }
.document-activity { min-width: 190px; }
.document-activity small { white-space: nowrap; }
.document-table th, .document-table td { padding-left: 16px; padding-right: 16px; }
.product-detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.production-line .stock-hint { line-height: 1.5; }
.product-detail-grid > .card { min-width: 0; }
.product-stats .stat { min-width: 0; }
.product-stats .stat small { line-height: 1.5; }
.product-detail-grid [data-photo-picker] { align-self: flex-start; }
@media (max-width: 760px) {
    .product-detail-grid { grid-template-columns: 1fr; }
    .stats.three.product-stats { grid-template-columns: 1fr; }
}

/* Keep transaction rows aligned with the label/control columns of master forms. */
.document-line.entry-row { display: grid; grid-template-columns: minmax(100px, 160px) minmax(0, 1fr); gap: 16px; padding: 20px 0; }
#document-lines > .document-line:last-child { border-bottom: 0; }
.document-line.entry-row > .item-label { width: auto; padding-top: 10px; font-weight: 600; }
.line-fields { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.line-fields .stock-hint { margin-top: 7px; line-height: 1.5; }
.line-inputs { display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.line-inputs.with-measurement { grid-template-columns: minmax(100px, 140px) minmax(130px, 160px) minmax(0, 1fr) auto; }
.line-inputs.without-notes { grid-template-columns: minmax(120px, 200px) auto; }
.line-inputs.finish-inputs { grid-template-columns: minmax(120px, 160px) minmax(0, 1fr); }
.line-inputs.finish-inputs.with-measurement { grid-template-columns: minmax(100px, 140px) minmax(130px, 160px) minmax(0, 1fr); }
.line-inputs > label { width: auto; min-width: 0; }
.line-inputs .remove-line { margin-top: 27px; justify-self: end; }
.partner-editor { min-width: 0; }
.partner-editor .field-row { grid-template-columns: minmax(85px, 110px) minmax(0, 1fr); gap: 12px; }
.partner-editor .form-actions { margin-top: 18px; }
.employee-form { max-width: 990px; }
@media (max-width: 1100px) {
    .line-inputs.with-measurement, .line-inputs.finish-inputs.with-measurement { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .line-inputs.with-measurement > label:last-of-type { grid-column: 1 / -1; }
    .line-inputs.with-measurement .remove-line { grid-column: 2; margin-top: 0; }
}
@media (max-width: 600px) {
    .line-inputs, .line-inputs.with-measurement, .line-inputs.finish-inputs, .line-inputs.finish-inputs.with-measurement, .line-inputs.without-notes { grid-template-columns: minmax(0, 1fr); }
    .line-inputs .remove-line, .line-inputs.with-measurement .remove-line { grid-column: 1; margin-top: 0; }
}
@media (max-width: 480px) {
    .document-line.entry-row { grid-template-columns: 95px minmax(0, 1fr); gap: 10px; }
    .partner-editor .field-row { grid-template-columns: 75px minmax(0, 1fr); gap: 8px; }
}

.product-stock-table .product-row-regular { background: #fff; }
.product-stock-table .product-row-holder { background: #f4f8fa; }
.product-stock-table .product-row-child { background: #fafcfd; }
.product-stock-table .product-row-holder > td:first-child { box-shadow: inset 2px 0 #c7dae3; }
.product-stock-table .product-row-child .item-cell { margin-left: 26px; padding-left: 13px; border-left: 2px solid #e0e9ee; }
.product-stock-table .product-row-regular:hover { background: #f9fbfc; }
.product-stock-table .product-row-holder:hover { background: #eef4f7; }
.product-stock-table .product-row-child:hover { background: #f4f8fa; }

.line-fields.transaction-line-fields { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(110px, .65fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.line-fields.count-line-fields { grid-template-columns: minmax(0, 1fr) minmax(120px, 180px); }
.line-fields.sub-item-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, .65fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.sub-item-fields > label, .sub-item-fields > .sub-sku-field { min-width: 0; }
.sub-sku-field .field-error { margin-top: 6px; }
.sub-item-fields textarea { min-height: 44px; }
#sub-items-lines > .sub-item-line:last-child { border-bottom: 0; }
.line-field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.transaction-line-fields > label { min-width: 0; }
.line-aside .item-label { padding-top: 30px; display: block; }
.line-aside .remove-line { display: block; padding: 4px 0; margin: 8px 0 0; font-size: 11px; }
@media (max-width: 1100px) {
    .line-fields.transaction-line-fields { grid-template-columns: minmax(0, 1fr) 125px; }
    .transaction-line-fields > .line-notes { grid-column: 1 / -1; }
    .line-fields.sub-item-fields { grid-template-columns: minmax(0, 1fr) 125px; }
    .sub-item-fields > label:last-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .line-fields.transaction-line-fields { grid-template-columns: minmax(0, 1fr); }
    .line-fields.sub-item-fields { grid-template-columns: minmax(0, 1fr); }
}
