:root {
    --color-dark-green: #0B4B3A;
    --color-medium-green: #57935B;
    --color-warm-yellow: #F2C464;
    --color-pale-yellow: #F5F0A6;
    --color-near-black: #061510;
    --bg-main: #f6f7ef;
    --bg-card: #ffffff;
    --bg-card-soft: #fbf9dd;
    --text-main: #13241d;
    --text-muted: #66746c;
    --border-color: #dfe5d7;
    --btn-primary-bg: var(--color-medium-green);
    --btn-primary-hover: #467849;
    --accent-soft: rgba(245, 240, 166, 0.54);
    --accent-border: rgba(242, 196, 100, 0.48);
    --app-bg: var(--bg-main);
    --app-surface: var(--bg-card);
    --app-surface-soft: var(--bg-card-soft);
    --app-border: var(--border-color);
    --app-text: var(--text-main);
    --app-muted: var(--text-muted);
    --app-primary: var(--color-dark-green);
    --app-primary-soft: var(--accent-soft);
    --app-accent: var(--color-warm-yellow);
    --input-bg: #ffffff;
    --input-text: var(--text-main);
    --input-disabled-bg: #edf0e4;
    --nav-link-bg: rgba(255, 255, 255, 0.72);
    --nav-link-active-bg: var(--accent-soft);
    --brand-text-muted: rgba(255, 255, 255, 0.8);
    --app-shadow: 0 10px 28px rgba(11, 75, 58, 0.09);
    --radius-lg: 8px;
    --radius-md: 8px;
    --radius-sm: 8px;
}

:root[data-theme="dark"] {
    --bg-main: #061510;
    --bg-card: #0B4B3A;
    --bg-card-soft: #0f3f33;
    --text-main: #f6f8df;
    --text-muted: #c4d2bd;
    --border-color: rgba(245, 240, 166, 0.2);
    --btn-primary-bg: var(--color-medium-green);
    --btn-primary-hover: #6aa86d;
    --accent-soft: rgba(245, 240, 166, 0.12);
    --accent-border: rgba(242, 196, 100, 0.38);
    --app-bg: var(--bg-main);
    --app-surface: var(--bg-card);
    --app-surface-soft: var(--bg-card-soft);
    --app-border: var(--border-color);
    --app-text: var(--text-main);
    --app-muted: var(--text-muted);
    --app-primary: #b7e3b8;
    --app-primary-soft: var(--accent-soft);
    --app-accent: var(--color-warm-yellow);
    --input-bg: #09271f;
    --input-text: var(--text-main);
    --input-disabled-bg: rgba(255, 255, 255, 0.08);
    --nav-link-bg: rgba(6, 21, 16, 0.38);
    --nav-link-active-bg: rgba(242, 196, 100, 0.16);
    --brand-text-muted: rgba(245, 240, 166, 0.8);
    --app-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    color-scheme: dark;
}

html {
    font-size: 15px;
}

body.app-body {
    min-height: 100vh;
    margin: 0;
    color: var(--app-text);
    background: var(--app-bg);
    font-family: "Segoe UI Variable", "Segoe UI", Tahoma, sans-serif;
}

a {
    color: var(--app-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-medium-green);
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(250px, 280px) minmax(0, 1fr);
    gap: 1.5rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem;
}

.app-sidebar {
    position: sticky;
    top: 1.75rem;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.app-sidebar-content {
    display: grid;
    gap: 1.25rem;
}

.sidebar-toggle {
    display: none;
    min-height: 42px;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    background: var(--app-surface);
    color: var(--app-primary);
    font-weight: 700;
}

.brand-panel,
.sidebar-card,
.page-card,
.form-card,
.table-card,
.metric-card,
.filter-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--app-shadow);
}

.brand-panel {
    padding: 1.4rem;
    background: var(--color-dark-green);
    color: #fff;
}

.brand-kicker,
.page-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--brand-text-muted);
}

.brand-title {
    display: block;
    margin-top: 0.65rem;
    font-size: 1.55rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.brand-description {
    margin: 0.75rem 0 0;
    color: var(--brand-text-muted);
    line-height: 1.55;
}

.app-nav {
    display: grid;
    gap: 0.55rem;
}

.app-nav-link {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0.72rem 0.9rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--nav-link-bg);
    color: var(--app-text);
    font-weight: 600;
    transition: 0.2s ease;
}

.app-nav-link:hover,
.app-nav-link.active {
    background: var(--app-primary-soft);
    border-color: var(--accent-border);
    color: var(--app-primary);
}

.sidebar-card {
    padding: 1.25rem;
}

.sidebar-card-label {
    font-size: 0.82rem;
    color: var(--app-muted);
    text-transform: uppercase;
    letter-spacing: 0;
}

.sidebar-card-value {
    margin-top: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.sidebar-card-note {
    margin-top: 0.55rem;
    color: var(--app-muted);
    line-height: 1.5;
}

.app-main {
    min-width: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-eyebrow {
    color: var(--app-muted);
}

.page-title {
    margin: 0.3rem 0 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.theme-toggle {
    min-height: 40px;
    padding: 0.48rem 0.85rem;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    background: var(--app-surface);
    color: var(--app-primary);
    font-weight: 700;
    transition: 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus {
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.content-area {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.app-alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--app-shadow);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.metric-card {
    padding: 1.2rem 1.25rem;
}

.metric-label {
    display: block;
    color: var(--app-muted);
    font-size: 0.9rem;
}

.metric-value {
    display: block;
    margin-top: 0.55rem;
    font-size: 2rem;
    font-weight: 700;
}

.dashboard-grid,
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.62fr) minmax(340px, 1fr);
    gap: 1.25rem;
}

.dashboard-grid > :last-child {
    grid-column: 1 / -1;
}

.dashboard-grid > *,
.detail-grid > *,
.dashboard-summary-grid > * {
    min-width: 0;
}

.page-card,
.form-card,
.table-card,
.filter-card {
    padding: 1.25rem;
}

.page-card-nested {
    padding: 1.15rem 1.2rem;
    background: var(--app-surface-soft);
}

.page-card-accent {
    background: var(--accent-soft);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading h2,
.section-heading h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
}

.section-heading-compact {
    margin-bottom: 0.85rem;
}

.section-link {
    font-size: 0.92rem;
    font-weight: 600;
}

.table-responsive {
    border-radius: var(--radius-md);
}

.app-table {
    margin-bottom: 0;
    vertical-align: middle;
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-text);
    --bs-table-border-color: var(--app-border);
    --bs-table-hover-bg: var(--app-surface-soft);
    color: var(--app-text);
}

.app-table thead th {
    padding: 0.9rem 0.95rem;
    color: var(--app-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0;
    border-bottom-width: 1px;
}

.app-table tbody td {
    padding: 0.95rem;
    border-color: var(--app-border);
}

.asset-list-card {
    max-width: 100%;
    overflow: hidden;
}

.asset-list-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.asset-list-table {
    width: 100%;
    min-width: 800px;
    table-layout: fixed;
}

.asset-list-table .asset-list-primary-column {
    width: 18%;
}

.asset-list-table .asset-list-category-column {
    width: 13%;
}

.asset-list-table .asset-list-serial-column,
.asset-list-table .asset-list-invoice-column {
    width: 11%;
}

.asset-list-table .asset-list-personnel-column {
    width: 15%;
}

.asset-list-table .asset-list-status-column {
    width: 12%;
}

.asset-list-table .asset-list-actions-column,
.asset-list-table .asset-list-actions {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
}

.asset-list-table-owned .asset-list-primary-column {
    width: 24%;
}

.asset-list-table-owned .asset-list-category-column {
    width: 17%;
}

.asset-list-table-owned .asset-list-serial-column,
.asset-list-table-owned .asset-list-invoice-column {
    width: 14%;
}

.asset-list-table-owned .asset-list-date-column {
    width: 11%;
}

.asset-list-table .asset-list-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    padding-right: 0.55rem;
    padding-left: 0.55rem;
    background: var(--app-surface);
    box-shadow: -1px 0 0 var(--app-border);
}

.asset-list-table thead .asset-list-actions {
    z-index: 3;
}

.asset-list-table tbody tr:hover > .asset-list-actions {
    background: var(--app-surface-soft);
}

.asset-list-table .asset-list-actions .list-inline-actions {
    flex-wrap: nowrap;
    gap: 0.25rem;
}

.asset-list-table .asset-list-actions .compact-action-button {
    min-height: 34px;
    padding-right: 0.4rem;
    padding-left: 0.4rem;
}

.asset-list-primary-cell,
.asset-list-wrap {
    min-width: 0;
    overflow-wrap: anywhere;
}

.asset-list-reference,
.asset-list-clamp {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-list-primary-cell .table-identifier {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-list-table .status-pill {
    max-width: 100%;
    justify-content: center;
    padding: 0.35rem 0.45rem;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

.asset-list-action-note {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-identifier {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

.timeline-list,
.stack-list {
    display: grid;
    gap: 0.85rem;
}

.timeline-item,
.stack-item {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 1rem;
    padding: 0.95rem 0;
    border-top: 1px solid var(--app-border);
}

.timeline-item:first-child,
.stack-item:first-child {
    border-top: none;
    padding-top: 0;
}

.timeline-time,
.stack-meta {
    color: var(--app-muted);
    font-size: 0.9rem;
}

.timeline-title,
.stack-title {
    display: inline-block;
    font-weight: 700;
}

.timeline-note,
.stack-subtitle {
    margin-top: 0.18rem;
    font-weight: 600;
}

.timeline-subnote {
    margin-top: 0.25rem;
    color: var(--app-muted);
}

.empty-state {
    padding: 1.5rem;
    text-align: center;
    color: var(--app-muted);
    background: var(--app-surface-soft);
    border-radius: var(--radius-md);
}

.filter-card {
    padding-bottom: 0.5rem;
}

.filter-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }

.form-label {
    font-weight: 600;
    color: var(--app-text);
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: var(--app-border);
    border-radius: var(--radius-sm);
    background-color: var(--input-bg);
    color: var(--input-text);
}

.form-control::placeholder {
    color: var(--app-muted);
    opacity: 0.72;
}

.form-check-input {
    border-color: var(--app-border);
    background-color: var(--input-bg);
}

.form-check-input:checked {
    background-color: var(--btn-primary-bg);
    border-color: var(--btn-primary-bg);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-medium-green);
    box-shadow: 0 0 0 0.2rem rgba(87, 147, 91, 0.18);
    background-color: var(--input-bg);
    color: var(--input-text);
}

textarea.form-control {
    min-height: 120px;
}

.form-actions,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.toolbar {
    justify-content: space-between;
    align-items: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-instock {
    color: var(--color-dark-green);
    background: rgba(87, 147, 91, 0.18);
}

.status-assigned {
    color: var(--color-dark-green);
    background: rgba(245, 240, 166, 0.62);
}

.status-inservice {
    color: #6f4b00;
    background: rgba(242, 196, 100, 0.42);
}

.status-retired {
    color: #6e392b;
    background: rgba(242, 196, 100, 0.22);
}

:root[data-theme="dark"] .status-pill {
    color: var(--text-main);
}

:root[data-theme="dark"] .status-instock {
    background: rgba(87, 147, 91, 0.34);
}

:root[data-theme="dark"] .status-assigned {
    background: rgba(245, 240, 166, 0.18);
}

:root[data-theme="dark"] .status-inservice,
:root[data-theme="dark"] .status-retired {
    background: rgba(242, 196, 100, 0.24);
}

.value-grid {
    display: grid;
    gap: 0.85rem;
}

.value-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--app-border);
}

.value-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.value-label {
    color: var(--app-muted);
    font-weight: 600;
}

.value-content {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.action-grid {
    display: grid;
    gap: 0.75rem;
}

.qr-box {
    display: grid;
    justify-items: center;
    gap: 0.85rem;
    padding: 1.15rem;
    background: var(--app-surface-soft);
    border-radius: var(--radius-md);
}

.qr-box img {
    width: 190px;
    height: 190px;
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 0.6rem;
    border: 1px solid var(--app-border);
}

.qr-code-text {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.86rem;
    color: var(--app-muted);
    text-align: center;
    word-break: break-all;
}

.subtle-note {
    color: var(--app-muted);
    font-size: 0.92rem;
}

.badge-soft {
    display: inline-flex;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-weight: 600;
}

.list-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.personnel-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px var(--accent-border);
}

.personnel-chip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: var(--accent-soft);
    font-size: 0.75rem;
    font-weight: 800;
}

.color-preview {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.color-swatch {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    box-shadow: inset 0 0 0 2px var(--accent-soft);
}

.toggle-card {
    min-height: 48px;
    padding: 0.95rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-md);
    background: var(--app-surface-soft);
}

.metric-card-primary {
    color: #fff;
    background: linear-gradient(145deg, var(--color-dark-green), #12644e);
    border-color: transparent;
}

.metric-card-primary .metric-label,
.metric-card-primary .metric-caption {
    color: rgba(255, 255, 255, 0.78);
}

.metric-caption,
.section-meta,
.section-kicker {
    display: block;
    color: var(--app-muted);
    font-size: 0.78rem;
}

.metric-caption {
    margin-top: 0.25rem;
}

.section-kicker {
    margin-bottom: 0.2rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-summary-grid,
.attention-stat-grid,
.archive-stat-grid,
.management-toggle-grid,
.disposition-summary {
    display: grid;
    gap: 1rem;
}

.dashboard-summary-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr);
}

.dashboard-reminder-grid > :last-child {
    grid-column: auto;
}

.archive-stat-grid,
.attention-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-total {
    font-size: 2rem;
    color: var(--app-primary);
}

.archive-stat,
.attention-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-md);
    color: var(--app-text);
    background: var(--app-surface-soft);
}

.archive-stat strong,
.attention-stat strong {
    font-size: 1.35rem;
}

.archive-stat-sold,
.attention-warning {
    border-color: rgba(242, 196, 100, 0.68);
}

.archive-stat-danger,
.attention-critical {
    border-color: rgba(180, 63, 45, 0.52);
}

.archive-stat-muted {
    color: var(--app-muted);
}

.reminder-list,
.category-distribution-list {
    display: grid;
    gap: 0.7rem;
}

.reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0;
    color: var(--app-text);
    border-top: 1px solid var(--app-border);
}

.reminder-item:first-child {
    padding-top: 0;
    border-top: 0;
}

.reminder-item > span:first-child,
.operation-identity {
    display: grid;
    gap: 0.15rem;
}

.reminder-item small {
    color: var(--app-muted);
}

.reminder-pill,
.disposition-badge,
.personnel-badge,
.timeline-event-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.36rem 0.68rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.reminder-pill {
    color: var(--color-dark-green);
    background: rgba(87, 147, 91, 0.18);
}

.reminder-pill-warning {
    color: #6f4b00;
    background: rgba(242, 196, 100, 0.35);
}

.reminder-pill-danger {
    color: #802f24;
    background: rgba(180, 63, 45, 0.15);
}

.category-distribution-card {
    margin-top: 0;
}

.category-distribution-item > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.35rem;
}

.distribution-track {
    height: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--app-surface-soft);
}

.distribution-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-medium-green), var(--color-warm-yellow));
}

.disposition-badge {
    color: #fff;
    background: #4f5d57;
}

.disposition-depotstored {
    color: var(--color-dark-green);
    background: rgba(87, 147, 91, 0.24);
}

.disposition-sold {
    color: #624200;
    background: rgba(242, 196, 100, 0.46);
}

.disposition-disappeared {
    color: #fff;
    background: #8c3b31;
}

.personnel-active {
    color: var(--color-dark-green);
    background: rgba(87, 147, 91, 0.22);
}

.personnel-passive {
    color: var(--app-muted);
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
}

.disposition-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 1rem;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    background: var(--app-surface-soft);
}

.disposition-summary > div {
    display: grid;
    gap: 0.25rem;
}

.disposition-summary p {
    grid-column: 1 / -1;
    margin: 0;
}

.operation-identity {
    padding: 1rem;
    border-left: 4px solid var(--color-medium-green);
    border-radius: var(--radius-md);
    background: var(--app-surface-soft);
}

.danger-surface {
    border-left: 4px solid #8c3b31;
}

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

.management-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-md);
    background: var(--app-surface-soft);
}

.asset-timeline {
    position: relative;
    display: grid;
    gap: 1rem;
    padding-left: 1.35rem;
}

.asset-timeline::before {
    position: absolute;
    top: 0.7rem;
    bottom: 0.7rem;
    left: 0.35rem;
    width: 2px;
    content: "";
    background: var(--app-border);
}

.asset-timeline-item {
    position: relative;
}

.asset-timeline-marker {
    position: absolute;
    top: 1rem;
    left: -1.35rem;
    z-index: 1;
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid var(--app-surface);
    border-radius: 999px;
    background: var(--color-medium-green);
    box-shadow: 0 0 0 2px var(--color-medium-green);
}

.timeline-type-sold .asset-timeline-marker,
.timeline-type-disappeared .asset-timeline-marker {
    background: #8c3b31;
    box-shadow: 0 0 0 2px #8c3b31;
}

.asset-timeline-card {
    display: grid;
    gap: 0.65rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-md);
    background: var(--app-surface-soft);
}

.asset-timeline-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.asset-timeline-header > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.timeline-event-badge {
    color: var(--app-primary);
    background: var(--app-primary-soft);
}

.asset-timeline time,
.timeline-actor,
.timeline-context {
    color: var(--app-muted);
    font-size: 0.85rem;
}

.timeline-personnel-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    background: var(--app-surface);
}

.timeline-personnel-flow span:last-child {
    text-align: right;
}

.asset-timeline-card p {
    margin: 0;
}

:root[data-theme="dark"] .disposition-depotstored,
:root[data-theme="dark"] .disposition-sold,
:root[data-theme="dark"] .personnel-active,
:root[data-theme="dark"] .reminder-pill,
:root[data-theme="dark"] .reminder-pill-warning,
:root[data-theme="dark"] .reminder-pill-danger {
    color: var(--text-main);
}

.btn {
    min-height: 40px;
    padding: 0.48rem 0.95rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-sm {
    min-height: 32px;
    padding: 0.32rem 0.65rem;
}

.btn-primary {
    background-color: var(--btn-primary-bg);
    border-color: var(--btn-primary-bg);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--btn-primary-hover);
    border-color: var(--btn-primary-hover);
    color: #fff;
}

.btn-outline-primary {
    color: var(--app-primary);
    border-color: var(--accent-border);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--app-primary-soft);
    color: var(--app-primary);
    border-color: var(--app-primary);
}

.btn-outline-danger {
    color: #9f3c2d;
    border-color: rgba(159, 60, 45, 0.36);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    color: #fff;
    background-color: #9f3c2d;
    border-color: #9f3c2d;
}

:root[data-theme="dark"] .btn-outline-danger {
    color: #ffb9ad;
    border-color: rgba(255, 185, 173, 0.52);
}

:root[data-theme="dark"] .btn-outline-danger:hover,
:root[data-theme="dark"] .btn-outline-danger:focus {
    color: #20100d;
    background-color: #ffb9ad;
    border-color: #ffb9ad;
}

.summary-panel {
    display: grid;
    gap: 1rem;
}

.form-hint {
    color: var(--app-muted);
    font-size: 0.88rem;
}

.border-dashed {
    border: 1px dashed var(--accent-border);
    border-radius: var(--radius-md);
}

.content-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    gap: 1.25rem;
}

.content-stack > * {
    min-width: 0;
}

.asset-scan-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 0.85rem 1rem;
    align-items: end;
}

.asset-scan-input {
    min-width: 0;
}

.asset-scan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.asset-scan-meta {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    color: var(--app-muted);
    font-weight: 600;
}

.asset-scan-message {
    min-height: 1.25rem;
}

.asset-scan-results .empty-state {
    border-top: 1px solid var(--app-border);
    border-radius: 0;
    background: transparent;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-card {
    width: min(100%, 420px);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--app-shadow);
    padding: 1.5rem;
}

.auth-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.form-section {
    padding: 1rem;
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: var(--radius-md);
}

.form-section-title {
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--app-border);
    font-size: 1rem;
    font-weight: 700;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--app-border);
}

.readonly-field,
.readonly-field:disabled {
    color: var(--app-muted);
    background-color: var(--input-disabled-bg);
    border-color: var(--app-border);
    opacity: 1;
    font-weight: 600;
}

.field-with-action {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.field-with-action .form-select,
.field-with-action .form-control {
    min-width: 0;
    flex: 1 1 auto;
}

.compact-action-button {
    min-height: 34px;
    padding-inline: 0.65rem;
    white-space: nowrap;
}

.label-print-toolbar {
    margin-bottom: 1rem;
}

@media print {
    body.app-body {
        background: #fff !important;
    }

    .app-sidebar,
    .page-header,
    .label-print-toolbar,
    .app-alert {
        display: none !important;
    }

    .app-shell,
    .app-main,
    .content-area {
        display: block !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .asset-label {
        color: #000;
    }

    .asset-scan-page .filter-card {
        display: none !important;
    }
}

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

    .dashboard-grid,
    .detail-grid,
    .dashboard-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: static;
    }

    .sidebar-toggle {
        display: block;
        width: 100%;
    }

    .app-sidebar-content {
        display: none;
    }

    .app-sidebar.is-open .app-sidebar-content {
        display: grid;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .span-3,
    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8 {
        grid-column: span 3;
    }
}

@media (max-width: 767.98px) {
    .app-shell {
        padding: 1rem;
    }

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

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

    .asset-scan-actions .btn {
        flex: 1 1 auto;
    }

    .filter-grid,
    .form-grid,
    .value-row,
    .timeline-item,
    .stack-item,
    .archive-stat-grid,
    .attention-stat-grid,
    .management-toggle-grid,
    .disposition-summary {
        grid-template-columns: 1fr;
    }

    .management-toggle-card,
    .asset-timeline-header,
    .reminder-item {
        align-items: stretch;
        flex-direction: column;
    }

    .management-toggle-card .btn {
        width: 100%;
    }

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

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

    .toolbar .form-actions .btn {
        flex: 1 1 140px;
    }

    .disposition-summary p {
        grid-column: 1;
    }

    .timeline-personnel-flow {
        grid-template-columns: 1fr;
    }

    .timeline-personnel-flow span:last-child {
        text-align: left;
    }

    .span-3,
    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8,
    .span-12 {
        grid-column: 1 / -1;
    }

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

    .action-bar .btn,
    .field-with-action {
        width: 100%;
    }
}
