:root {
    --ink: #29323a;
    --muted: #68737d;
    --line: #dfe5ea;
    --soft-line: #edf1f4;
    --panel: #ffffff;
    --surface: #f5f7f9;
    --sidebar: #f3f3f4;
    --topbar: #263038;
    --topbar-active: #151a1f;
    --accent: #3f86ff;
    --accent-2: #16a1cf;
    --hotel: #79c552;
    --danger: #d94f54;
    --warn: #f1a531;
    --ok: #2fbf71;
    --radius: 8px;
    --shadow: 0 12px 30px rgba(28, 37, 44, .08);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    font-size: 14px;
    line-height: 1.45;
}

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

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    min-height: 38px;
    padding: 8px 10px;
    outline: none;
}

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

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(63, 134, 255, .12);
}

.search-select {
    position: relative;
    width: 100%;
}

.search-select__native {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    min-height: 1px;
    opacity: 0;
    pointer-events: none;
}

.search-select__input {
    padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, #7d8891 50%), linear-gradient(135deg, #7d8891 50%, transparent 50%);
    background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.search-select.invalid .search-select__input {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(217, 79, 84, .14);
}

.search-select__list {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 4px;
}

.search-select__option {
    display: block;
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    padding: 7px 9px;
    text-align: left;
    cursor: pointer;
}

.search-select__option:hover,
.search-select__option.active {
    background: #eaf3ff;
    color: #174e9c;
}

.search-select__option.selected {
    background: #edf7ea;
    color: #1f6f3d;
    font-weight: 700;
}

.search-select__empty {
    padding: 10px;
    color: var(--muted);
}

.table-search {
    position: relative;
    display: block;
    flex: 1 1 260px;
    width: min(340px, 100%);
    max-width: 420px;
    min-width: 220px;
    color: var(--muted);
    font-weight: 500;
}

.table-search input {
    width: 100%;
    min-width: 0;
    padding-left: 36px;
    padding-right: 12px;
}

.table-search svg {
    position: absolute;
    left: 11px;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    color: #87929b;
    pointer-events: none;
}

.panel-head > .table-search {
    margin-left: auto;
}

.search-empty-row td {
    background: #fff !important;
}

.search-empty-row[hidden] {
    display: none !important;
}

.category-icon-chip,
.icon-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.category-icon-chip svg {
    width: 18px;
    height: 18px;
    color: var(--accent-2);
}

.icon-picker {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    width: 100%;
}

.icon-picker__preview {
    display: grid;
    place-items: center;
    width: 42px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f7fafc;
    color: var(--accent);
}

.icon-picker__preview svg {
    width: 21px;
    height: 21px;
}

label {
    display: grid;
    gap: 6px;
    color: #4b555e;
    font-weight: 600;
}

label span {
    color: var(--muted);
    font-weight: 500;
}

code {
    background: #edf2f6;
    border: 1px solid #dce4ea;
    border-radius: 4px;
    padding: 2px 5px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    height: 64px;
    background: var(--topbar);
    color: #eef3f5;
    box-shadow: 0 1px 7px rgba(0, 0, 0, .22);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 64px;
    padding: 0 18px;
    font-size: 19px;
    white-space: nowrap;
    min-width: 0;
}

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

.brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    object-position: center;
    background: #fff;
    border-radius: 6px;
    padding: 4px;
}

.menu-button {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #c7d0d6;
    cursor: pointer;
}

.menu-button:hover,
.menu-button:focus-visible {
    background: rgba(255, 255, 255, .1);
    outline: none;
}

.brand .menu-icon {
    width: 25px;
    color: #c7d0d6;
}

.topnav {
    display: flex;
    align-items: stretch;
    height: 64px;
    overflow-x: auto;
    min-width: 0;
    scrollbar-width: thin;
}

.topnav a {
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 0 13px;
    border-bottom: 4px solid transparent;
    color: #b8c1c7;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.topnav a.active {
    background: var(--topbar-active);
    color: #fff;
    border-bottom-color: var(--danger);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    min-width: 0;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #e9eef1;
    cursor: pointer;
}

.icon-button:hover {
    background: rgba(255, 255, 255, .1);
}

.icon-button svg,
.side-link svg,
.side-title svg,
.metric-icon svg,
.button svg {
    width: 18px;
    height: 18px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 106px;
}

.user-chip span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #f8fbfd;
    color: var(--topbar);
    font-weight: 800;
}

.user-chip small {
    color: #d8e0e5;
    white-space: nowrap;
}

.app-frame {
    display: grid;
    grid-template-columns: 274px minmax(0, 1fr);
    min-height: calc(100vh - 64px);
    max-width: 100%;
}

.sidebar {
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: var(--sidebar);
    padding: 12px 10px;
}

.sidebar-search {
    position: relative;
    display: block;
    margin-bottom: 18px;
}

.sidebar-search input {
    padding-right: 36px;
}

.sidebar-search svg {
    position: absolute;
    right: 10px;
    top: 9px;
    color: #8e989f;
}

.side-section {
    padding: 0 6px 10px;
}

.side-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #4f5962;
    font-size: 15px;
}

.side-title svg {
    color: #ffb52e;
    fill: #ffb52e;
}

.side-nav {
    display: grid;
    gap: 4px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 6px;
    color: #40484f;
    font-size: 15px;
}

.side-link:hover,
.side-link.active {
    background: #fff;
    color: #1d2730;
    box-shadow: inset 3px 0 0 var(--accent);
}

.side-footer {
    border-top: 1px dashed #cdd4da;
    display: grid;
    gap: 3px;
    margin-top: 16px;
    padding: 14px 10px;
    color: var(--muted);
}

.side-footer strong {
    color: var(--ink);
}

.workspace {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    padding: 18px 22px 36px;
}

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

.crumbs {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.page-head h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 650;
    letter-spacing: 0;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    color: #34404a;
    padding: 8px 13px;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
}

.button svg,
.icon-button svg,
.menu-button svg {
    flex: 0 0 auto;
}

.button.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.button.danger {
    border-color: #f1c2c4;
    background: #fff6f6;
    color: #b8393e;
}

.button.ghost {
    background: transparent;
}

.button.slim {
    min-height: 32px;
    padding: 5px 10px;
}

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

.metric-card,
.asset-card,
.panel,
.split-panel,
.detail-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.metric-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 16px;
}

.metric-icon {
    display: grid;
    place-items: center;
    align-self: center;
    justify-self: start;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #eaf3ff;
    color: var(--accent);
}

.metric-card:nth-child(2) .metric-icon {
    background: #eaf8ee;
    color: var(--ok);
}

.metric-card:nth-child(3) .metric-icon {
    background: #fff5df;
    color: var(--warn);
}

.metric-card:nth-child(4) .metric-icon {
    background: #fff0f1;
    color: var(--danger);
}

.metric-card strong {
    display: block;
    font-size: 25px;
}

.metric-card > div {
    min-width: 0;
}

.metric-card > div > span {
    color: var(--muted);
}

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

.scanner-shell {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.scanner-panel {
    position: sticky;
    top: 82px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 14px;
    box-shadow: var(--shadow);
}

.scanner-video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #111820;
    object-fit: cover;
}

.scanner-actions,
.scanner-search {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

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

.scanner-status {
    min-height: 34px;
    margin-top: 12px;
    border: 1px solid #d9e8f8;
    border-radius: 6px;
    background: #f4f9ff;
    color: #265b9f;
    padding: 8px 10px;
    font-weight: 650;
}

.scanner-results {
    display: grid;
    gap: 14px;
}

.scanner-result-card .panel-body {
    display: grid;
    gap: 10px;
}

.scanner-empty {
    min-height: 360px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.asset-card {
    min-height: 186px;
    padding: 16px;
}

.asset-card h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 650;
}

.asset-card-body {
    display: grid;
    grid-template-columns: 112px 1fr;
    align-items: center;
    gap: 18px;
}

.asset-illustration {
    display: grid;
    place-items: center;
    height: 106px;
    border-right: 1px solid var(--line);
    color: var(--accent-2);
}

.asset-illustration svg {
    width: 62px;
    height: 62px;
    stroke-width: 1.7;
}

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

.status-list div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.status-list a,
.status-list strong {
    color: var(--accent);
    font-weight: 700;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.panel {
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
}

.panel-head h2,
.detail-panel h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 650;
}

.panel-body {
    padding: 16px;
}

.table-wrap {
    max-width: 100%;
    max-height: min(72vh, 720px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    background: #fff;
}

.assets-table {
    min-width: 1120px;
}

.data-table th,
.data-table td {
    min-height: 46px;
    border-bottom: 1px solid var(--soft-line);
    padding: 11px 12px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f2f5f7;
    color: #55616b;
    font-weight: 700;
}

.data-table td.wrap {
    white-space: normal;
    min-width: 220px;
}

.data-table tr:hover td {
    background: #fbfdff;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 700;
}

.badge.ok {
    background: #eaf8ee;
    color: #1d824c;
}

.badge.info {
    background: #eaf3ff;
    color: #2865bd;
}

.badge.warn {
    background: #fff3d9;
    color: #9d650d;
}

.badge.danger {
    background: #fff0f1;
    color: #b8393e;
}

.badge.neutral {
    background: #edf1f4;
    color: #56616a;
}

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

.form-grid > *,
.line-row > *,
.panel-head > *,
.toolbar > *,
.page-actions > * {
    min-width: 0;
}

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

.form-grid .wide,
.wide {
    grid-column: 1 / -1;
}

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

.inline-form select,
.inline-form input {
    width: auto;
    min-width: 128px;
}

.inline-form .search-select {
    width: auto;
    min-width: 150px;
}

.line-items {
    display: grid;
    gap: 8px;
}

.line-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 90px 100px;
    gap: 8px;
}

.line-row.requisition {
    grid-template-columns: minmax(210px, 1.2fr) minmax(190px, 1fr) 88px 78px 88px;
}

.line-row.four {
    grid-template-columns: minmax(220px, 1fr) 80px 90px minmax(160px, 1fr);
}

.line-row.two {
    grid-template-columns: minmax(220px, 1fr) 120px;
}

.line-row.expense {
    grid-template-columns: minmax(180px, 1.1fr) minmax(150px, 1fr) minmax(180px, 1.1fr) 120px;
}

.detail-panel {
    padding: 18px;
}

.content-grid.has-form-modal-panel {
    grid-template-columns: minmax(0, 1fr);
}

.detail-panel.form-modal-panel {
    display: none;
}

.form-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    border: 0;
    background: rgba(27, 37, 45, .48);
    cursor: default;
}

body.form-modal-active {
    overflow: hidden;
}

body.form-modal-active .form-modal-backdrop {
    display: block;
}

.detail-panel.form-modal-panel.form-modal-open {
    position: fixed;
    top: 76px;
    bottom: 22px;
    left: 50%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: min(1120px, calc(100vw - 34px));
    max-height: calc(100dvh - 98px);
    padding: 0;
    overflow: hidden;
    transform: translateX(-50%);
    box-shadow: 0 28px 70px rgba(20, 31, 40, .28);
}

.detail-panel.form-modal-panel.form-modal-open > .panel-head {
    position: sticky;
    top: 0;
    z-index: 2;
    flex: 0 0 auto;
    margin-bottom: 0 !important;
    padding: 16px 66px 16px 18px !important;
    border-bottom: 1px solid var(--line) !important;
    background: #fff;
}

.detail-panel.form-modal-panel.form-modal-open > :not(.panel-head) {
    margin-top: 0 !important;
}

.detail-panel.form-modal-panel.form-modal-open > form,
.detail-panel.form-modal-panel.form-modal-open > .panel-body,
.detail-panel.form-modal-panel.form-modal-open > .attachment-list,
.detail-panel.form-modal-panel.form-modal-open > .detail-list,
.detail-panel.form-modal-panel.form-modal-open > hr,
.detail-panel.form-modal-panel.form-modal-open > h2 {
    padding-left: 20px;
    padding-right: 20px;
}

.detail-panel.form-modal-panel.form-modal-open > form,
.detail-panel.form-modal-panel.form-modal-open > .panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-top: 18px;
    padding-bottom: 22px;
    -webkit-overflow-scrolling: touch;
}

.detail-panel.form-modal-panel.form-modal-open .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.detail-panel.form-modal-panel.form-modal-open .form-grid > label,
.detail-panel.form-modal-panel.form-modal-open .form-grid > .wide {
    min-width: 0;
}

.detail-panel.form-modal-panel.form-modal-open input,
.detail-panel.form-modal-panel.form-modal-open select,
.detail-panel.form-modal-panel.form-modal-open textarea {
    min-height: 42px;
}

.detail-panel.form-modal-panel.form-modal-open textarea {
    min-height: 96px;
}

.detail-panel.form-modal-panel.form-modal-open .line-items {
    gap: 10px;
}

.detail-panel.form-modal-panel.form-modal-open .line-row {
    gap: 10px;
}

.detail-panel.form-modal-panel.form-modal-open .line-row.requisition {
    grid-template-columns: minmax(230px, 1.35fr) minmax(230px, 1.1fr) minmax(88px, .45fr) minmax(76px, .38fr) minmax(94px, .45fr);
}

.detail-panel.form-modal-panel.form-modal-open .line-row.expense {
    grid-template-columns: minmax(210px, 1.1fr) minmax(180px, .9fr) minmax(210px, 1.1fr) minmax(110px, .45fr);
}

.detail-panel.form-modal-panel.form-modal-open .line-row.four {
    grid-template-columns: minmax(260px, 1.2fr) minmax(90px, .35fr) minmax(100px, .4fr) minmax(190px, .8fr);
}

.modal-close-button {
    position: absolute;
    top: 13px;
    right: 16px;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: #4d5963;
    cursor: pointer;
}

.modal-close-button:hover,
.modal-close-button:focus-visible {
    border-color: #cad3da;
    background: #f3f6f8;
    outline: none;
}

.modal-close-button svg {
    width: 18px;
    height: 18px;
}

@media (min-width: 1481px) {
    .content-grid > aside.detail-panel:not(.form-modal-panel) {
        position: sticky;
        top: 82px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}

@media (max-width: 1480px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

.detail-list {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px 14px;
}

.detail-list span {
    color: var(--muted);
}

.detail-list strong {
    font-weight: 650;
}

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

.attachment-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    padding: 7px 9px;
    color: #34404a;
    font-weight: 650;
}

.attachment-list svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.contract-detail-panel {
    display: grid;
    gap: 16px;
}

.contract-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
}

.contract-detail-header > div {
    min-width: 0;
}

.contract-detail-header .button {
    flex: 0 0 auto;
}

.contract-detail-section {
    display: grid;
    gap: 12px;
}

.contract-detail-section + .contract-detail-section {
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.contract-section-title,
.form-section-heading {
    color: #46525d;
    font-size: 13px;
    font-weight: 750;
}

.contract-empty-detail {
    display: grid;
    gap: 10px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fbfdff;
    padding: 16px;
}

.contract-empty-detail p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.contract-form-grid .form-section-heading {
    border-top: 1px solid var(--soft-line);
    margin-top: 4px;
    padding-top: 14px;
}

.contract-form-grid .form-section-heading:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.contract-current-files {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
    padding: 12px;
}

.form-action-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid var(--soft-line);
    padding-top: 14px;
}

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

.permission-grid label {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 10px;
    gap: 3px;
}

.permission-grid small {
    color: var(--muted);
    padding-left: 26px;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    margin: 14px 0;
}

.tabs a {
    padding: 10px 0;
    border-bottom: 3px solid transparent;
    font-weight: 650;
}

.tabs a.active {
    color: var(--danger);
    border-bottom-color: var(--danger);
}

.alert {
    border-radius: 6px;
    margin-bottom: 14px;
    padding: 11px 13px;
    font-weight: 650;
}

.alert.success {
    background: #eaf8ee;
    color: #1d824c;
}

.alert.danger {
    background: #fff0f1;
    color: #b8393e;
}

.alert.info {
    background: #eaf3ff;
    color: #2865bd;
}

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

.empty-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    color: var(--muted);
}

.login-body,
.setup-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #eef5f8 0%, #f7f9fb 48%, #eef7ec 100%);
    padding: 24px;
}

.login-shell {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 380px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.login-visual {
    min-height: 430px;
    display: grid;
    align-content: end;
    gap: 24px;
    padding: 34px;
    background: #263038;
    color: #fff;
}

.login-visual img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    object-position: center;
    background: #fff;
    border-radius: 8px;
    padding: 8px;
}

.login-visual h1 {
    margin: 0;
    max-width: 560px;
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0 0 8px;
    color: #b7dca7;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.login-card,
.setup-panel {
    padding: 34px;
}

.login-card h2,
.setup-panel h1 {
    margin: 0 0 18px;
}

.login-card form {
    display: grid;
    gap: 15px;
}

.setup-panel {
    width: min(620px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.setup-logo {
    width: 84px;
    height: 84px;
    object-fit: contain;
    object-position: center;
}

.setup-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 18px;
}

.print-body {
    background: #e8edf1;
    padding: 24px;
}

.print-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 920px;
    margin: 0 auto 14px;
}

.print-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.print-options label {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    padding: 5px 9px;
    color: #34404a;
    font-size: 12px;
    font-weight: 700;
}

.print-options input {
    width: 16px;
    height: 16px;
    min-height: 16px;
}

.print-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
    padding: 12mm;
    color: #111;
}

.print-half {
    min-height: 132mm;
    border-bottom: 1px dashed #999;
    padding-bottom: 8mm;
    margin-bottom: 8mm;
}

.print-half:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}

.form-title {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    margin-bottom: 10px;
    padding: 0 104px;
    text-align: center;
}

.form-title img {
    position: absolute;
    left: 0;
    top: 0;
    width: 86px;
    height: 86px;
    object-fit: contain;
    object-position: center;
}

.form-title h1 {
    margin: 0;
    text-align: center;
    font-size: 22px;
    letter-spacing: .08em;
}

.form-title p {
    margin: 2px 0 0;
    text-align: center;
    font-size: 12px;
}

.print-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
    margin: 10px 0;
}

.print-line {
    border-bottom: 1px dotted #111;
    min-height: 20px;
    display: inline-block;
    min-width: 130px;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.print-table th,
.print-table td {
    border: 1px solid #111;
    padding: 6px;
    font-size: 12px;
}

.print-table th {
    text-align: center;
}

.signature-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 44px;
    text-align: center;
}

.signature-row span {
    display: block;
    border-top: 1px solid #111;
    padding-top: 8px;
    min-height: 34px;
}

.print-attachments {
    margin-top: 18px;
    margin-bottom: 10px;
    border: 1px solid #111;
    padding: 8px;
    font-size: 12px;
}

p.print-money-row {
    margin: 12px 0 24px;
}

.print-attachments strong {
    display: block;
    margin-bottom: 5px;
}

.print-attachments ul {
    margin: 0;
    padding-left: 18px;
}

.hide-print-cost .print-col-cost,
.hide-print-cost .print-money-row,
.hide-print-stock .print-col-stock,
.hide-print-notes .print-col-notes,
.hide-print-notes .print-note,
.hide-print-attachments .print-section-attachments,
.hide-print-signatures .print-section-signatures {
    display: none !important;
}

.leave-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr .8fr 1.4fr;
}

@media screen {
    :root {
        --ink: #0f172a;
        --muted: #64748b;
        --line: #d8e2ef;
        --soft-line: #edf2f7;
        --panel: #ffffff;
        --surface: #f8fafc;
        --sidebar: #ffffff;
        --topbar: #ffffff;
        --topbar-active: #0f6bff;
        --accent: #0f6bff;
        --accent-2: #14b8a6;
        --hotel: #22c55e;
        --danger: #ef4444;
        --warn: #f97316;
        --ok: #16a34a;
        --shadow: 0 14px 30px rgba(15, 23, 42, .07);
    }

    body {
        background: var(--surface);
        color: var(--ink);
    }

    input,
    select,
    textarea {
        min-height: 42px;
        border-color: var(--line);
        border-radius: 8px;
        background: #fff;
        color: #172033;
        padding: 9px 12px;
        transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
    }

    input::placeholder,
    textarea::placeholder {
        color: #8a98aa;
    }

    input:focus,
    select:focus,
    textarea:focus {
        border-color: #74a8ff;
        box-shadow: 0 0 0 4px rgba(15, 107, 255, .12);
    }

    label {
        color: #22314a;
    }

    code {
        border-color: #d9e4f2;
        background: #f3f7fb;
        color: #243550;
    }

    .topbar {
        grid-template-columns: minmax(220px, 286px) minmax(0, 1fr) auto;
        column-gap: 0;
        height: 68px;
        border-bottom: 1px solid #e5edf6;
        background: var(--topbar);
        color: var(--ink);
        box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
    }

    .brand {
        height: 68px;
        padding: 0 16px;
        border-right: 1px solid #e8eef6;
        color: #0c1b33;
        font-size: 18px;
        font-weight: 800;
    }

    .brand-link {
        gap: 11px;
        min-width: 0;
    }

    .brand strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand img {
        width: 42px;
        height: 42px;
        border: 1px solid #e4ecf6;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 8px 18px rgba(15, 107, 255, .12);
        padding: 3px;
    }

    .menu-button {
        width: 40px;
        height: 40px;
        border: 1px solid transparent;
        border-radius: 8px;
        color: #263b5a;
    }

    .menu-button:hover,
    .menu-button:focus-visible {
        border-color: #d8e2ef;
        background: #f3f7fb;
        color: #0f6bff;
    }

    .brand .menu-icon {
        color: currentColor;
    }

    .topnav {
        display: none;
    }

    .top-search {
        position: relative;
        display: block;
        justify-self: start;
        width: 100%;
        max-width: 760px;
        margin: 0 18px;
        color: var(--muted);
    }

    .top-search input {
        min-height: 44px;
        border-radius: 8px;
        background: #fbfdff;
        padding-left: 44px;
        box-shadow: inset 0 1px 0 rgba(15, 23, 42, .03);
    }

    .top-search svg {
        position: absolute;
        left: 15px;
        top: 50%;
        width: 18px;
        height: 18px;
        transform: translateY(-50%);
        color: #7a8aa0;
        pointer-events: none;
    }

    .top-actions {
        gap: 8px;
        padding: 0 18px 0 0;
        flex: 0 0 auto;
    }

    .top-actions [data-action="focus-search"] {
        display: none;
    }

    .icon-button {
        flex: 0 0 auto;
        width: 40px;
        height: 40px;
        border: 1px solid transparent;
        border-radius: 8px;
        background: #fff;
        color: #21314c;
        transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
    }

    .icon-button:hover {
        border-color: #d8e2ef;
        background: #f3f7fb;
        color: var(--accent);
        transform: translateY(-1px);
    }

    .user-chip {
        flex: 0 0 auto;
        min-width: 132px;
        max-width: 164px;
        gap: 10px;
        border: 1px solid transparent;
        border-radius: 8px;
        padding: 5px 8px;
        color: #172033;
    }

    .user-chip:hover {
        border-color: #d8e2ef;
        background: #f8fbff;
    }

    .user-chip span {
        width: 38px;
        height: 38px;
        background: linear-gradient(135deg, #0f6bff, #14b8a6);
        color: #fff;
        box-shadow: 0 8px 18px rgba(15, 107, 255, .24);
    }

    .user-chip small {
        color: #475569;
        font-weight: 750;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-frame {
        grid-template-columns: 286px minmax(0, 1fr);
        min-height: calc(100vh - 68px);
    }

    .sidebar {
        top: 68px;
        height: calc(100vh - 68px);
        border-right-color: #e5edf6;
        background: var(--sidebar);
        padding: 16px 14px;
    }

    .sidebar-search {
        margin-bottom: 18px;
    }

    .sidebar-search input {
        min-height: 44px;
        border-radius: 8px;
        background: #f8fbff;
        padding-left: 13px;
        padding-right: 40px;
    }

    .sidebar-search svg {
        top: 12px;
        right: 13px;
        color: #7a8aa0;
    }

    .side-section {
        padding: 0 4px 10px;
    }

    .side-title {
        color: #6b778b;
        font-size: 13px;
        font-weight: 750;
    }

    .side-nav {
        gap: 6px;
    }

    .side-link {
        min-height: 44px;
        border-radius: 8px;
        padding: 10px 12px;
        color: #27364f;
        font-size: 14px;
        font-weight: 700;
        transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
    }

    .side-link:hover {
        background: #f1f6ff;
        color: #0f3f8c;
        box-shadow: none;
    }

    .side-link.active {
        background: linear-gradient(135deg, #0f6bff, #075ce6);
        color: #fff;
        box-shadow: 0 10px 22px rgba(15, 107, 255, .25);
        transform: translateY(-1px);
    }

    .side-link.active svg {
        color: #fff;
    }

    .side-footer {
        margin-top: 18px;
        border: 1px solid #dfe8f4;
        border-radius: 8px;
        background: #f8fbff;
        padding: 12px;
    }

    .workspace {
        padding: 24px 28px 40px;
        background:
            radial-gradient(circle at 92% 0%, rgba(15, 107, 255, .05), transparent 28rem),
            var(--surface);
    }

    .page-head {
        align-items: center;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }

    .page-head > div {
        min-width: 0;
    }

    .crumbs {
        color: #66758a;
        font-weight: 650;
    }

    .page-head h1 {
        color: #0c1729;
        font-size: 26px;
        font-weight: 800;
        overflow-wrap: break-word;
    }

    .page-actions,
    .toolbar {
        gap: 10px;
        min-width: 0;
    }

    .button {
        min-height: 42px;
        border-color: var(--line);
        border-radius: 8px;
        background: #fff;
        color: #172033;
        max-width: 100%;
        box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
        transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
    }

    .button:hover {
        border-color: #b9c9dd;
        background: #f8fbff;
        color: #0f3f8c;
        box-shadow: 0 8px 16px rgba(15, 23, 42, .06);
        transform: translateY(-1px);
    }

    .button.primary {
        border-color: var(--accent);
        background: linear-gradient(135deg, #0f6bff, #075ce6);
        color: #fff;
        box-shadow: 0 10px 20px rgba(15, 107, 255, .25);
    }

    .button.primary:hover {
        color: #fff;
    }

    .button.danger {
        border-color: #fecaca;
        background: #fff7f7;
        color: #c62828;
    }

    .button.ghost {
        background: #f8fbff;
    }

    .metrics-grid {
        gap: 16px;
        margin-bottom: 20px;
    }

    .metric-card,
    .asset-card,
    .panel,
    .split-panel,
    .detail-panel,
    .scanner-panel {
        border-color: #dfe8f4;
        border-radius: 8px;
        background: #fff;
        box-shadow: var(--shadow);
    }

    .metric-card {
        grid-template-columns: 58px minmax(0, 1fr);
        min-height: 108px;
        padding: 18px;
    }

    .metric-icon {
        display: grid;
        place-items: center;
        align-self: center;
        justify-self: start;
        flex: 0 0 auto;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: #e8f1ff;
        color: var(--accent);
        margin-top: 0;
    }

    .metric-icon svg {
        width: 20px;
        height: 20px;
        stroke-width: 2;
    }

    .metric-card:nth-child(2) .metric-icon {
        background: #dcfce7;
        color: #16a34a;
    }

    .metric-card:nth-child(3) .metric-icon {
        background: #f3e8ff;
        color: #7c3aed;
    }

    .metric-card:nth-child(4) .metric-icon {
        background: #ffedd5;
        color: #f97316;
    }

    .metric-card strong {
        color: #0f172a;
        font-size: 30px;
        line-height: 1.08;
        letter-spacing: 0;
        overflow-wrap: break-word;
    }

    .metric-card > div {
        min-width: 0;
    }

    .metric-card > div > span {
        display: block;
        margin-top: 4px;
        color: #607086;
        font-size: 13px;
    }

    .asset-grid {
        gap: 18px;
    }

    .asset-card {
        min-height: 184px;
        padding: 18px;
        transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    }

    .asset-card:hover {
        border-color: #c8d7eb;
        box-shadow: 0 18px 32px rgba(15, 23, 42, .09);
        transform: translateY(-2px);
    }

    .asset-card h3 {
        color: #172033;
        font-size: 17px;
        font-weight: 800;
        min-width: 0;
    }

    .asset-card h3 > span {
        min-width: 0;
        overflow-wrap: break-word;
    }

    .asset-illustration {
        border-right-color: #e5edf6;
        color: var(--accent);
    }

    .status-list div {
        color: #475569;
    }

    .status-list a,
    .status-list strong {
        color: var(--accent);
    }

    .content-grid {
        gap: 20px;
    }

    .panel {
        overflow: hidden;
    }

    .panel-head {
        gap: 12px;
        border-bottom-color: #e7edf5;
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
        padding: 16px 18px;
    }

    .panel-head h2,
    .detail-panel h2 {
        color: #101828;
        font-size: 17px;
        font-weight: 800;
        min-width: 0;
        overflow-wrap: break-word;
    }

    .panel-body {
        padding: 18px;
    }

    .table-search {
        width: min(360px, 100%);
        max-width: 420px;
        color: #64748b;
    }

    .table-search input {
        min-height: 40px;
        border-radius: 8px;
        background: #fbfdff;
        padding-left: 38px;
    }

    .table-search svg {
        left: 13px;
        color: #7a8aa0;
    }

    .table-wrap {
        max-height: min(74vh, 760px);
        overflow-x: hidden;
        overflow-y: auto;
        background: #fff;
    }

    .data-table,
    .assets-table {
        min-width: 0;
        table-layout: fixed;
    }

    .data-table th,
    .data-table td {
        border-bottom-color: var(--soft-line);
        color: #21314c;
        padding: 12px 13px;
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
        max-width: 280px;
    }

    .data-table th {
        background: #f8fafc;
        color: #526176;
        font-size: 12px;
        letter-spacing: 0;
        text-transform: none;
        white-space: nowrap;
        overflow-wrap: normal;
    }

    .data-table th:last-child,
    .data-table .badge,
    .data-table .button {
        white-space: nowrap;
        overflow-wrap: normal;
    }

    .data-table th:last-child {
        width: 180px;
    }

    .data-table td:last-child {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
        width: 180px;
        max-width: none;
        white-space: normal;
    }

    .data-table .button.slim {
        min-width: 76px;
    }

    .data-table td:last-child .button.slim {
        min-width: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

    .data-table td:last-child .inline-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        flex: 1 1 100%;
        gap: 6px;
        width: 100%;
    }

    .data-table td:last-child .inline-form select,
    .data-table td:last-child .inline-form input {
        width: 100%;
        min-width: 0;
    }

    .data-table tr:hover td {
        background: #f8fbff;
    }

    .badge {
        min-height: 25px;
        border-radius: 999px;
        padding: 3px 10px;
        font-weight: 800;
    }

    .badge.ok {
        background: #dcfce7;
        color: #15803d;
    }

    .badge.info {
        background: #e8f1ff;
        color: #0f5ed7;
    }

    .badge.warn {
        background: #ffedd5;
        color: #c2410c;
    }

    .badge.danger {
        background: #fee2e2;
        color: #b91c1c;
    }

    .badge.neutral {
        background: #eef2f7;
        color: #475569;
    }

    .detail-panel {
        padding: 20px;
    }

    .detail-list {
        gap: 13px 16px;
    }

    .attachment-list a,
    .permission-grid label {
        border-color: #dfe8f4;
        border-radius: 8px;
        background: #fbfdff;
    }

    .tabs {
        gap: 24px;
        border-bottom-color: #dfe8f4;
    }

    .tabs a {
        color: #526176;
    }

    .tabs a.active {
        color: var(--accent);
        border-bottom-color: var(--accent);
    }

    .alert {
        border-radius: 8px;
        box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
    }

    .search-select__input {
        background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
    }

    .search-select__list {
        border-color: #d8e2ef;
        border-radius: 8px;
        box-shadow: 0 18px 34px rgba(15, 23, 42, .14);
    }

    .search-select__option {
        min-height: 38px;
        border-radius: 6px;
    }

    .search-select__option:hover,
    .search-select__option.active {
        background: #e8f1ff;
        color: #0f4fb5;
    }

    .search-select__option.selected {
        background: #dcfce7;
        color: #15803d;
    }

    .detail-panel.form-modal-panel.form-modal-open {
        top: 84px;
        bottom: 24px;
        border: 1px solid #dfe8f4;
        border-radius: 8px;
        box-shadow: 0 30px 80px rgba(15, 23, 42, .24);
    }

    .detail-panel.form-modal-panel.form-modal-open > .panel-head {
        background: #fff;
        padding: 17px 66px 17px 18px !important;
    }

    .form-modal-backdrop {
        background: rgba(15, 23, 42, .42);
        backdrop-filter: blur(2px);
    }

    .modal-close-button {
        border-color: #d8e2ef;
        border-radius: 8px;
        color: #334155;
    }

    .modal-close-button:hover,
    .modal-close-button:focus-visible {
        border-color: #b9c9dd;
        background: #f8fbff;
        color: var(--accent);
    }

    .scanner-status {
        border-color: #bfdbfe;
        background: #eff6ff;
        color: #1d4ed8;
    }

    .scanner-empty {
        border-color: #cbd5e1;
        background: #fbfdff;
    }

    .login-shell,
    .setup-panel {
        border-color: #dfe8f4;
        box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
    }

    .login-visual {
        background: linear-gradient(135deg, #0f3f8c, #0f6bff 52%, #14b8a6);
    }

    .eyebrow {
        color: #dff7ec;
    }
}

@media screen and (max-width: 1240px) {
    .topbar {
        grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) auto;
    }

    .top-search {
        max-width: 560px;
        margin: 0 12px;
    }

    .top-actions {
        gap: 4px;
    }

    .user-chip {
        min-width: auto;
        max-width: none;
    }

    .user-chip small {
        display: none;
    }
}

@media screen and (max-width: 1100px) {
    .topbar {
        grid-template-areas: "brand actions";
        grid-template-columns: 1fr auto;
        height: 58px;
    }

    .top-search {
        display: none;
    }

    .top-actions [data-action="focus-search"] {
        display: inline-grid;
    }

    .brand {
        height: 58px;
        border-right: 0;
    }

    .app-frame {
        min-height: calc(100vh - 58px);
    }

    .sidebar {
        top: 58px;
        height: auto;
    }

    .workspace {
        padding: 14px 12px 28px;
    }
}

@media (max-width: 1240px) {
    .topnav {
        display: none;
    }

    .topnav a {
        min-width: 92px;
        padding: 0 12px;
        font-size: 15px;
    }

    .user-chip {
        min-width: auto;
    }

    .user-chip small {
        display: none;
    }

    .metrics-grid,
    .asset-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

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

@media (min-width: 1101px) {
    .assets-table {
        min-width: 0;
    }

    .assets-table th,
    .assets-table td {
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
    }

    .assets-table th {
        white-space: nowrap;
        overflow-wrap: normal;
    }

    .assets-table .badge,
    .assets-table .button {
        white-space: nowrap;
        overflow-wrap: normal;
    }
}

@media (max-width: 1100px) {
    .topbar {
        grid-template-areas:
            "brand actions";
        grid-template-columns: 1fr auto;
        height: 58px;
    }

    .brand {
        grid-area: brand;
        height: 58px;
        padding: 0 12px;
        gap: 9px;
        font-size: 17px;
    }

    .brand img {
        width: 34px;
        height: 34px;
    }

    .top-actions {
        grid-area: actions;
        gap: 3px;
        padding: 0 8px 0 0;
    }

    .icon-button {
        width: 34px;
        height: 34px;
    }

    .topnav {
        display: none;
    }

    .app-frame {
        display: block;
        min-height: calc(100vh - 58px);
    }

    .app-frame::before {
        content: "";
        position: fixed;
        inset: 58px 0 0;
        z-index: 28;
        background: rgba(20, 28, 35, .36);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .app-frame::before {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 58px;
        bottom: 0;
        left: 0;
        z-index: 30;
        width: min(320px, calc(100vw - 52px));
        height: auto;
        max-height: none;
        overflow-y: auto;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        box-shadow: 18px 0 35px rgba(22, 31, 39, .22);
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

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

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

    .side-link {
        min-height: 36px;
        padding: 7px 8px;
        font-size: 13px;
    }

    .side-footer {
        display: none;
    }

    .workspace {
        padding: 14px 12px 28px;
    }

    .content-grid {
        gap: 14px;
    }

    .metrics-grid,
    .asset-grid,
    .form-grid,
    .form-grid.three {
        grid-template-columns: 1fr;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .page-actions,
    .toolbar,
    .inline-form {
        width: 100%;
    }

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

    .inline-form select,
    .inline-form input,
    .inline-form .search-select,
    .table-search {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .button {
        min-height: 42px;
    }

    .button.slim {
        min-height: 36px;
    }

    .panel-head {
        align-items: flex-start;
    }

    .detail-panel {
        padding: 14px;
        max-height: none;
        overflow: visible;
    }

    .detail-panel.form-modal-panel.form-modal-open {
        inset: 0;
        width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
        transform: none;
        left: 0;
        bottom: auto;
        top: 0;
    }

    .detail-panel.form-modal-panel.form-modal-open > .panel-head {
        padding: 12px 58px 12px 12px !important;
    }

    .detail-panel.form-modal-panel.form-modal-open > form,
    .detail-panel.form-modal-panel.form-modal-open > .panel-body {
        padding: 14px 12px 22px;
    }

    .detail-panel.form-modal-panel.form-modal-open .form-grid,
    .detail-panel.form-modal-panel.form-modal-open .form-grid.three,
    .detail-panel.form-modal-panel.form-modal-open .line-row,
    .detail-panel.form-modal-panel.form-modal-open .line-row.requisition,
    .detail-panel.form-modal-panel.form-modal-open .line-row.expense,
    .detail-panel.form-modal-panel.form-modal-open .line-row.four,
    .detail-panel.form-modal-panel.form-modal-open .line-row.two {
        grid-template-columns: 1fr;
    }

    .form-action-row {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-action-row .button {
        width: 100%;
        justify-content: center;
    }

    .table-wrap {
        max-height: min(68vh, 620px);
        overflow-x: hidden;
        overflow-y: auto;
    }

    .data-table,
    .assets-table {
        width: 100%;
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 10px;
        background: transparent;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        overflow: hidden;
    }

    .data-table td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        min-height: auto;
        border-bottom: 1px solid var(--soft-line);
        padding: 9px 10px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .data-table td:last-child {
        border-bottom: 0;
    }

    .data-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 700;
    }

    .data-table td[colspan] {
        display: block;
    }

    .data-table td[colspan]::before {
        display: none;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 260px;
    }

    .line-row.requisition {
        grid-template-columns: 1fr;
    }

    .line-row.expense {
        grid-template-columns: 1fr;
    }

    .line-row,
    .line-row.four,
    .line-row.two {
        grid-template-columns: 1fr;
    }

    .scanner-shell {
        grid-template-columns: 1fr;
    }

    .scanner-panel {
        position: static;
    }

    .scanner-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .brand strong {
        display: none;
    }

    .top-actions .icon-button:nth-child(2),
    .top-actions .icon-button:nth-child(4) {
        display: none;
    }

    .user-chip span {
        width: 34px;
        height: 34px;
    }

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

    .metrics-grid,
    .asset-grid {
        grid-template-columns: 1fr;
    }

    .print-body {
        overflow-x: auto;
        padding: 10px;
    }
}

@media print {
    body,
    .print-body {
        background: #fff;
        padding: 0;
    }

    .print-toolbar {
        display: none;
    }

    .print-page {
        width: auto;
        min-height: auto;
        margin: 0;
        box-shadow: none;
        padding: 0;
    }
}
