: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;
    cursor: pointer;
}

.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 1fr;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 16px;
}

.metric-icon {
    display: grid;
    place-items: center;
    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 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;
}

@media (min-width: 1481px) {
    .content-grid > aside.detail-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);
}

.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 (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: anywhere;
    }
}

@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;
    }

    .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;
    }
}
