:root {
    --navy-950: #062714;
    --navy-900: #10271a;
    --navy-800: #183b27;
    --slate-700: #344054;
    --slate-600: #475467;
    --slate-500: #667085;
    --slate-400: #98a2b3;
    --slate-300: #d0d5dd;
    --slate-200: #e4e7ec;
    --slate-100: #f2f4f7;
    --slate-50: #f8fafc;
    --white: #ffffff;
    --blue: #087a39;
    --blue-dark: #055c2a;
    --blue-soft: #eaf7ef;
    --green: #07843d;
    --green-soft: #e9f8ef;
    --forest: #07552a;
    --mint: #35a966;
    --amber: #f79009;
    --amber-soft: #fffaeb;
    --red: #f04438;
    --red-soft: #fef3f2;
    --purple: #7a5af8;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 10px 28px rgba(16, 24, 40, .08);
    --radius: 16px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: #f4f7f4;
    color: var(--navy-900);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
img { max-width: 100%; }

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: 248px;
    flex-direction: column;
    background: linear-gradient(180deg, #06331a 0%, var(--navy-950) 100%);
    color: #d0d5dd;
    padding: 28px 18px 20px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--white); padding: 0 10px 32px; }
.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #5c86ff, #2e5ee5);
    box-shadow: 0 8px 24px rgba(53, 108, 246, .32);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand small { color: #98a2b3; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

.matrivo-emblem {
    position: relative;
    display: block;
    width: 52px;
    height: 42px;
    flex: none;
    overflow: hidden;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
}
.matrivo-emblem img {
    position: absolute;
    width: 192.4%;
    max-width: none;
    height: auto;
    transform: translate(-24.9%, -18.7%);
}
.matrivo-emblem-scan { width: 47px; height: 38px; box-shadow: 0 5px 18px rgba(16, 39, 26, .18); }

.nav-list { display: grid; gap: 7px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    padding: 11px 13px;
    color: #b4bdc9;
    font-weight: 600;
    transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: rgba(255,255,255,.055); color: white; }
.nav-item.active { background: rgba(65,190,111,.18); color: #d8f7e3; }
.nav-icon { display: grid; width: 22px; place-items: center; font-size: 19px; font-weight: 400; }
.logout-form { margin: 0; }
.logout-form .nav-item { width: 100%; border: 0; background: transparent; text-align: left; }
.logout-form .nav-item:hover { background: rgba(255,255,255,.055); }

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 20px 10px 0;
}
.workspace-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: #263752;
    color: #dce6ff;
    font-size: 12px;
    font-weight: 700;
}
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { color: white; font-size: 13px; }
.sidebar-footer small { color: #98a2b3; font-size: 11px; }
.workspace-switcher { min-width: 0; flex: 1; }
.workspace-switcher label { display: block; color: #98a2b3; font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.workspace-switcher select { width: 100%; min-height: 28px; border: 0; background: transparent; color: white; padding: 1px 16px 1px 0; font-size: 13px; font-weight: 750; }
.workspace-switcher select option { color: var(--navy-900); }

.main { min-width: 0; flex: 1; margin-left: 248px; }
.topbar {
    display: flex;
    min-height: 96px;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid var(--slate-200);
    background: rgba(255,255,255,.9);
    padding: 18px clamp(24px, 4vw, 56px);
    backdrop-filter: blur(12px);
}
.topbar h1 { margin: 0; font-size: 25px; line-height: 1.2; letter-spacing: -.03em; }
.eyebrow { margin: 0 0 3px; color: var(--slate-500); font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.topbar-action { margin-left: auto; }
.menu-button { display: none; border: 0; background: transparent; color: var(--navy-900); font-size: 24px; }
.content { width: min(1460px, 100%); margin: 0 auto; padding: 32px clamp(24px, 4vw, 56px) 56px; }

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 15px;
    font-weight: 700;
    line-height: 1.2;
    transition: transform .12s ease, background .12s ease, border .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--blue); color: white; box-shadow: 0 5px 14px rgba(8,122,57,.2); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { border-color: var(--slate-300); background: white; color: var(--slate-700); box-shadow: var(--shadow-sm); }
.button-secondary:hover { background: var(--slate-50); }
.button-light { background: white; color: var(--navy-900); }
.button-ghost-light { border-color: rgba(255,255,255,.32); color: white; }
.button-success { background: var(--green); color: white; }
.button-danger { background: var(--red); color: white; }
.button.full { width: 100%; }

.flash-stack { display: grid; gap: 8px; padding: 18px clamp(24px, 4vw, 56px) 0; }
.flash { border: 1px solid; border-radius: 10px; padding: 12px 15px; font-weight: 650; }
.flash-success { border-color: #abefc6; background: var(--green-soft); color: #067647; }
.flash-error { border-color: #fecdca; background: var(--red-soft); color: #b42318; }

.hero-panel {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 36px;
    overflow: hidden;
    border-radius: 22px;
    background:
        radial-gradient(circle at 85% 20%, rgba(118,218,150,.35), transparent 30%),
        linear-gradient(130deg, #06391c 0%, #087a39 58%, #16a052 100%);
    color: white;
    padding: 34px 38px;
    box-shadow: 0 18px 40px rgba(31,65,139,.16);
}
.hero-panel h2 { max-width: 620px; margin: 8px 0 10px; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -.045em; }
.hero-panel p { max-width: 640px; margin: 0; color: #d8e2ff; font-size: 16px; }
.hero-kicker { font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; color: #bdd0ff; }
.hero-actions { display: flex; flex: none; gap: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    background: white;
    padding: 19px;
    box-shadow: var(--shadow-sm);
    transition: border .15s ease, transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: #bfd0ff; box-shadow: var(--shadow-md); }
.stat-card small, .stat-card strong { display: block; }
.stat-card small { margin-bottom: 1px; color: var(--slate-500); font-size: 12px; font-weight: 650; }
.stat-card strong { font-size: 27px; line-height: 1.1; letter-spacing: -.035em; }
.stat-icon { display: grid; width: 46px; height: 46px; flex: none; place-items: center; border-radius: 13px; font-size: 21px; font-weight: 800; }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.red { background: var(--red-soft); color: var(--red); }

.panel { border: 1px solid var(--slate-200); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--slate-200); padding: 20px 22px; }
.panel-heading h2, .panel-heading h3 { margin: 0; letter-spacing: -.025em; }
.panel-heading h2 { font-size: 22px; }
.panel-heading h3 { font-size: 17px; }
.panel-heading p:not(.eyebrow) { margin: 6px 0 0; color: var(--slate-500); }
.count-pill { min-width: 28px; border-radius: 999px; background: var(--slate-100); padding: 4px 9px; color: var(--slate-600); text-align: center; font-size: 12px; font-weight: 800; }
.two-column-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 22px; }

.asset-list { display: grid; }
.asset-list-item { display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--slate-100); padding: 14px 20px; transition: background .12s ease; }
.asset-list-item:last-child { border-bottom: 0; }
.asset-list-item:hover { background: var(--slate-50); }
.asset-list-copy { min-width: 0; flex: 1; }
.asset-list-copy strong, .asset-list-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-list-copy strong { font-size: 14px; }
.asset-list-copy small { color: var(--slate-500); font-size: 12px; }
.asset-avatar { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border-radius: 11px; background: #eaf7ef; color: #08723a; font-size: 12px; font-weight: 800; }
.asset-avatar.large { width: 62px; height: 62px; border-radius: 16px; font-size: 18px; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-available { background: var(--green-soft); color: #067647; }
.badge-borrowed { background: var(--amber-soft); color: #b54708; }
.badge-defect, .badge-overdue { background: var(--red-soft); color: #b42318; }
.badge-maintenance { background: #f4f3ff; color: #5925dc; }

.timeline { padding: 8px 22px 20px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 13px 0; }
.timeline-item:not(:last-child)::before { position: absolute; top: 30px; bottom: -9px; left: 5px; width: 1px; background: var(--slate-200); content: ""; }
.timeline-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 5px; border: 3px solid #d6e0ff; border-radius: 50%; background: var(--blue); }
.event-issue { border-color: #fee4e2; background: var(--red); }
.event-return, .event-repair, .event-maintenance { border-color: #d1fadf; background: var(--green); }
.event-checkout { border-color: #fef0c7; background: var(--amber); }
.timeline-item strong { display: block; font-size: 13px; }
.timeline-item p { margin: 2px 0; color: var(--slate-600); font-size: 13px; }
.timeline-item small { color: var(--slate-400); font-size: 11px; }
.compact-timeline { max-height: 390px; overflow: auto; }

.quick-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; border: 1px solid #d6e0ff; border-radius: var(--radius); background: #f5f8ff; padding: 17px 20px; }
.quick-panel > div { display: flex; align-items: center; gap: 13px; }
.quick-panel strong, .quick-panel p { display: block; margin: 0; }
.quick-panel p { color: var(--slate-500); font-size: 12px; }
.qr-mini { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: white; color: var(--blue); box-shadow: var(--shadow-sm); font-size: 24px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.toolbar-copy h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.toolbar-copy p { margin: 4px 0 0; color: var(--slate-500); }
.search-form, .toolbar-actions, .inline-form { display: flex; align-items: center; gap: 9px; }
.search-form { flex: 1; }
.search-input { display: flex; max-width: 460px; min-width: 240px; flex: 1; align-items: center; gap: 9px; border: 1px solid var(--slate-300); border-radius: 10px; background: white; padding: 0 12px; box-shadow: var(--shadow-sm); }
.search-input span { color: var(--slate-400); font-size: 21px; }
.search-input input { width: 100%; border: 0; outline: 0; background: transparent; padding: 10px 0; }
select, input, textarea { border: 1px solid var(--slate-300); border-radius: 9px; background: white; color: var(--navy-900); outline: none; }
select { min-height: 42px; padding: 8px 32px 8px 11px; }
input, textarea { width: 100%; padding: 10px 12px; }
input:focus, textarea:focus, select:focus { border-color: #84a6ff; box-shadow: 0 0 0 3px rgba(53,108,246,.11); }
textarea { resize: vertical; }

.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.asset-table { width: 100%; border-collapse: collapse; }
.asset-table th { background: var(--slate-50); color: var(--slate-500); padding: 11px 16px; text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.asset-table td { border-top: 1px solid var(--slate-100); padding: 14px 16px; color: var(--slate-600); font-size: 13px; vertical-align: middle; }
.asset-table tbody tr:hover { background: #fbfcff; }
.asset-name-cell { display: flex; min-width: 250px; align-items: center; gap: 11px; color: var(--navy-900); }
.asset-name-cell strong, .asset-name-cell small { display: block; }
.asset-name-cell small, small.block { color: var(--slate-500); font-size: 11px; }
small.block { display: block; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; color: var(--blue); font-size: 19px; }
.icon-button:hover { background: var(--blue-soft); }
.mobile-asset-grid { display: none; }

.empty-state { display: grid; min-height: 320px; place-items: center; align-content: center; gap: 8px; padding: 40px; text-align: center; }
.empty-state > span { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; background: var(--slate-100); color: var(--slate-500); font-size: 24px; }
.empty-state strong { font-size: 18px; }
.empty-state p { max-width: 400px; margin: 0 0 10px; color: var(--slate-500); }
.empty-state.compact { min-height: 280px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: start; gap: 22px; }
.form-panel { overflow: hidden; }
.form-heading { align-items: flex-start; }
.asset-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 24px; }
.field { display: grid; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field label, .mini-form label { color: var(--slate-700); font-size: 12px; font-weight: 750; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--slate-100); padding-top: 20px; }
.tip-card { position: sticky; top: 22px; border-radius: var(--radius); background: var(--navy-900); color: white; padding: 25px; box-shadow: var(--shadow-md); }
.tip-card h3 { margin: 14px 0 8px; font-size: 19px; }
.tip-card ol { margin: 15px 0; padding-left: 20px; color: #d0d5dd; }
.tip-card li { margin: 7px 0; }
.tip-card p { margin: 18px 0 0; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; color: #98a2b3; font-size: 12px; }
.tip-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 13px; background: rgba(91,132,255,.2); color: #aac1ff; font-size: 25px; }

.detail-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.detail-header-actions { display: flex; align-items: center; gap: 9px; }
.detail-title { display: flex; align-items: center; gap: 16px; }
.detail-title h2 { margin: 5px 0 2px; font-size: 27px; letter-spacing: -.035em; }
.detail-title p { margin: 0; color: var(--slate-500); }
.detail-badges { display: flex; align-items: center; gap: 8px; }
.token-badge { color: var(--slate-400); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 22px; }
.detail-main { display: grid; gap: 22px; }
.detail-sidebar { display: grid; gap: 18px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 30px; margin: 0; padding: 24px; }
.info-grid div { min-width: 0; }
.info-grid dt { margin-bottom: 4px; color: var(--slate-500); font-size: 11px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.info-grid dd { margin: 0; color: var(--navy-900); font-weight: 650; overflow-wrap: anywhere; }
.info-grid .info-wide { grid-column: 1 / -1; }
.text-danger { color: var(--red) !important; }
.qr-card { display: grid; justify-items: center; border: 1px solid var(--slate-200); border-radius: var(--radius); background: white; padding: 20px; text-align: center; box-shadow: var(--shadow-sm); }
.qr-card img { width: 176px; image-rendering: pixelated; }
.qr-card strong { margin-top: 7px; }
.qr-card small { color: var(--slate-400); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.action-panel { overflow: hidden; }
.action-panel > form, .action-panel > details { margin: 0 18px 13px; }
.action-panel > form:first-of-type, .action-panel > details:first-of-type { margin-top: 16px; }
.action-panel details { border: 1px solid var(--slate-200); border-radius: 10px; background: var(--slate-50); }
.action-panel summary { padding: 11px 12px; color: var(--slate-700); font-size: 13px; font-weight: 750; cursor: pointer; }
.mini-form { display: grid; gap: 10px; border-top: 1px solid var(--slate-200); padding: 12px; }
.mini-form label { display: grid; gap: 5px; }
.danger-panel { border-color: #fecdca; overflow: hidden; }
.danger-panel .panel-heading { background: var(--red-soft); }
.danger-content { padding: 18px; }
.danger-content p { margin: 0 0 14px; color: var(--slate-600); font-size: 13px; }

.label-sheet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.qr-label { position: relative; display: flex; min-height: 145px; align-items: center; gap: 13px; border: 1px solid var(--slate-300); border-radius: 12px; background: white; padding: 12px 12px 38px; break-inside: avoid; }
.qr-label.unassigned { border-style: dashed; background: #fbfcff; }
.qr-label img { width: 112px; flex: none; image-rendering: pixelated; }
.qr-label div { display: grid; min-width: 0; gap: 3px; }
.qr-label strong { line-height: 1.25; overflow-wrap: anywhere; }
.qr-label small { color: var(--slate-500); }
.qr-label code { margin-top: 7px; color: var(--slate-400); font-size: 10px; }
.label-brand { color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.label-print-link { position: absolute; right: 11px; bottom: 9px; border-radius: 7px; background: var(--blue-soft); padding: 5px 8px; color: var(--blue); font-size: 10px; font-weight: 800; }
.print-note { margin-top: 18px; border: 1px solid #d6e0ff; border-radius: 12px; background: #f5f8ff; padding: 16px 18px; }
.print-note strong { display: block; }
.print-note p { margin: 4px 0 0; color: var(--slate-600); }
code { border-radius: 4px; background: var(--slate-100); padding: 2px 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; align-items: start; gap: 22px; }
.settings-form { display: grid; gap: 20px; padding: 24px; }
.settings-form .form-actions { margin-top: 2px; }
.profile-choice { display: grid; gap: 10px; margin: 0; border: 0; padding: 0; }
.profile-choice legend { margin-bottom: 7px; color: var(--slate-700); font-size: 12px; font-weight: 750; }
.profile-option { display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); padding: 14px; cursor: pointer; }
.profile-option:has(input:checked) { border-color: #84a6ff; background: var(--blue-soft); box-shadow: 0 0 0 2px rgba(53,108,246,.08); }
.profile-option input { width: auto; margin-top: 4px; }
.profile-option strong, .profile-option small { display: block; }
.profile-option small { margin-top: 3px; color: var(--slate-500); }
.field-help { color: var(--slate-500); font-size: 11px; }
.text-button { border: 0; background: transparent; padding: 0; color: var(--blue); font-weight: 750; text-decoration: underline; }
.settings-side { display: grid; gap: 18px; }
.stack-form { display: grid; gap: 13px; padding: 18px; }
.stack-form label { display: grid; gap: 5px; color: var(--slate-700); font-size: 12px; font-weight: 750; }
.info-card { border: 1px solid #d6e0ff; border-radius: var(--radius); background: #f5f8ff; padding: 18px; }
.info-card strong { display: block; }
.info-card p { margin: 5px 0 0; color: var(--slate-600); font-size: 13px; }

.scan-body { min-height: 100vh; background: #eef2f7; padding: max(18px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom)); }
.scan-shell { width: min(620px, 100%); margin: 0 auto; }
.scan-brand { display: flex; align-items: center; gap: 11px; padding: 2px 3px 17px; }
.scan-brand > span:last-child { min-width: 0; }
.scan-brand strong, .scan-brand small { display: block; }
.scan-brand strong { font-size: 17px; }
.scan-brand small { overflow: hidden; color: var(--slate-500); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.scan-flashes { display: grid; gap: 8px; margin-bottom: 12px; }
.scan-hero { border-radius: 21px; background: linear-gradient(135deg, #19336c, #356cf6); color: white; padding: 26px 23px; box-shadow: 0 16px 34px rgba(31,65,139,.17); }
.scan-hero.status-available { background: linear-gradient(135deg, #086645, #12b76a); }
.scan-hero.status-borrowed { background: linear-gradient(135deg, #9a3f08, #f79009); }
.scan-hero.status-defect { background: linear-gradient(135deg, #9f251d, #f04438); }
.scan-hero.status-maintenance { background: linear-gradient(135deg, #4b32a8, #7a5af8); }
.scan-status { display: inline-flex; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: rgba(255,255,255,.14); padding: 5px 10px; font-size: 11px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.scan-hero h1 { margin: 13px 0 4px; font-size: clamp(27px, 8vw, 38px); line-height: 1.08; letter-spacing: -.04em; }
.scan-hero p { margin: 0; color: rgba(255,255,255,.82); }
.scan-card { overflow: hidden; margin-top: 14px; border: 1px solid var(--slate-200); border-radius: 17px; background: white; box-shadow: var(--shadow-sm); }
.scan-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--slate-100); padding: 15px 17px; }
.scan-card-heading span { font-weight: 800; }
.scan-card-heading code { color: var(--slate-400); font-size: 10px; }
.scan-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; }
.scan-info-grid > div { min-width: 0; border-bottom: 1px solid var(--slate-100); padding: 14px 17px; }
.scan-info-grid > div:nth-child(odd):not(.scan-info-wide) { border-right: 1px solid var(--slate-100); }
.scan-info-grid dt { margin-bottom: 3px; color: var(--slate-500); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.scan-info-grid dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.scan-info-grid .scan-info-wide { grid-column: 1 / -1; }
.scan-timeline { display: grid; padding: 5px 17px 12px; }
.scan-event { display: grid; grid-template-columns: 17px 1fr; gap: 8px; border-bottom: 1px solid var(--slate-100); padding: 12px 0; }
.scan-event:last-child { border-bottom: 0; }
.scan-event strong { font-size: 13px; }
.scan-event p { margin: 2px 0; color: var(--slate-600); font-size: 13px; }
.scan-event small, .scan-muted { color: var(--slate-400); font-size: 11px; }
.scan-manage { margin-top: 14px; min-height: 50px; }
.scan-footer { margin: 14px 0 0; color: var(--slate-400); font-size: 10px; text-align: center; }

.single-print-body { min-height: 100vh; background: var(--slate-100); }
.single-print-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--slate-200); background: white; padding: 16px 24px; }
.single-print-toolbar div { text-align: center; }
.single-print-toolbar strong, .single-print-toolbar small { display: block; }
.single-print-toolbar small { color: var(--slate-500); font-size: 11px; }
.single-print-sheet { display: grid; justify-items: center; gap: 15px; padding: 56px 20px; }
.qr-label-single { width: 70mm; min-height: 38mm; padding: 2.5mm; box-shadow: var(--shadow-md); }
.qr-label-single img { width: 28mm; }
.single-print-hint { max-width: 520px; margin: 0; color: var(--slate-500); text-align: center; }

.login-body { display: grid; min-height: 100vh; place-items: center; background: radial-gradient(circle at 50% 0, #ccebd7, transparent 38%), #eff5f1; padding: 22px; }
.login-shell { width: min(430px, 100%); }
.login-card { overflow: hidden; border: 1px solid var(--slate-200); border-radius: 22px; background: white; box-shadow: 0 22px 60px rgba(16,24,40,.13); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 11px; border-bottom: 1px solid var(--slate-100); padding: 14px 23px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand small { color: var(--slate-500); font-size: 11px; }
.matrivo-lockup {
    position: relative;
    display: block;
    width: min(220px, 100%);
    aspect-ratio: 1094 / 870;
    overflow: hidden;
}
.matrivo-lockup img {
    position: absolute;
    width: 114.63%;
    max-width: none;
    height: auto;
    transform: translate(-6.38%, -17.54%);
}
.login-copy { padding: 27px 27px 8px; }
.login-copy h1 { margin: 3px 0 6px; font-size: 31px; letter-spacing: -.04em; }
.login-copy p:not(.eyebrow) { margin: 0; color: var(--slate-500); }
.login-flashes { display: grid; gap: 8px; padding: 14px 27px 0; }
.login-form { display: grid; gap: 9px; padding: 21px 27px 29px; }
.login-form label { color: var(--slate-700); font-size: 12px; font-weight: 750; }
.login-form .button { margin-top: 7px; min-height: 48px; }
.login-footer { margin: 13px 0 0; color: var(--slate-500); font-size: 11px; text-align: center; }

.sidebar-scrim { display: none; }

@media (max-width: 1080px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    body.menu-open .sidebar { transform: translateX(0); }
    .sidebar-scrim { position: fixed; inset: 0; z-index: 20; background: rgba(11,18,32,.45); }
    body.menu-open .sidebar-scrim { display: block; }
    .main { margin-left: 0; }
    .menu-button { display: block; }
    .label-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .topbar { min-height: 78px; padding: 14px 18px; }
    .topbar h1 { font-size: 21px; }
    .content { padding: 22px 16px 40px; }
    .flash-stack { padding: 14px 16px 0; }
    .hero-panel { display: block; padding: 27px 24px; }
    .hero-panel h2 { font-size: 31px; }
    .hero-actions { margin-top: 22px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-column-layout, .detail-grid, .form-layout, .settings-grid { grid-template-columns: 1fr; }
    .tip-card { position: static; }
    .detail-sidebar { grid-template-columns: minmax(240px, .7fr) 1fr; align-items: start; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .search-form { flex-wrap: wrap; }
    .search-input { max-width: none; }
    .toolbar-actions { justify-content: flex-end; }
}

@media (max-width: 620px) {
    .topbar-action { min-height: 38px; padding: 8px 11px; font-size: 12px; }
    .hero-actions, .toolbar-actions, .inline-form { align-items: stretch; flex-direction: column; }
    .hero-actions .button { width: 100%; }
    .stat-card { padding: 15px; }
    .stat-icon { width: 40px; height: 40px; }
    .stat-card strong { font-size: 23px; }
    .two-column-layout { gap: 16px; }
    .quick-panel { align-items: stretch; flex-direction: column; }
    .search-form { display: grid; grid-template-columns: 1fr; }
    .search-input { min-width: 0; }
    .table-wrap { display: none; }
    .mobile-asset-grid { display: grid; gap: 10px; padding: 12px; }
    .mobile-asset-card { display: grid; gap: 4px; border: 1px solid var(--slate-200); border-radius: 12px; padding: 13px; }
    .mobile-asset-card > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
    .mobile-asset-card small, .mobile-asset-card span { color: var(--slate-500); font-size: 12px; }
    .asset-form { grid-template-columns: 1fr; padding: 18px; }
    .field-wide { grid-column: auto; }
    .form-actions { flex-direction: column-reverse; }
    .detail-header { align-items: stretch; flex-direction: column; }
    .detail-header-actions { align-items: stretch; flex-direction: column; }
    .detail-title { align-items: flex-start; }
    .detail-title h2 { font-size: 22px; }
    .asset-avatar.large { width: 50px; height: 50px; border-radius: 13px; }
    .detail-sidebar { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .info-grid .info-wide { grid-column: auto; }
    .label-sheet { grid-template-columns: 1fr; }
    .qr-label { min-height: 132px; }
    .qr-label img { width: 102px; }
    .scan-info-grid { grid-template-columns: 1fr; }
    .scan-info-grid > div:nth-child(odd):not(.scan-info-wide) { border-right: 0; }
    .scan-info-grid .scan-info-wide { grid-column: auto; }
    .single-print-toolbar { align-items: stretch; flex-direction: column; }
}

@media print {
    @page { size: A4; margin: 10mm; }
    body { background: white; }
    .sidebar, .topbar, .flash-stack, .no-print { display: none !important; }
    .main { margin: 0; }
    .content { width: 100%; max-width: none; padding: 0; }
    .label-sheet { grid-template-columns: repeat(3, 1fr); gap: 5mm; }
    .qr-label { min-height: 38mm; border-color: #777; border-radius: 2mm; padding: 2.5mm; box-shadow: none; }
    .qr-label img { width: 28mm; }
    .qr-label strong { font-size: 9pt; }
    .qr-label small { font-size: 7.5pt; }
    .qr-label code { background: transparent; font-size: 6.5pt; }
    .single-print-body { background: white; }
    .single-print-sheet { display: block; padding: 0; }
    .qr-label-single { width: 70mm; height: 38mm; min-height: 38mm; margin: 0; }
}

/* Matrivo – responsive application interface */
.brand-jubla { padding-bottom: 24px; }
.sidebar-footer { display: grid; align-items: stretch; gap: 12px; padding-inline: 4px; }
.user-panel { display: flex; min-width: 0; align-items: center; gap: 10px; }
.user-panel > span:last-child { min-width: 0; }
.user-panel strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 50%; background: #e7f7ed; color: #086b34; font-size: 11px; font-weight: 850; }
.logout-form { border-top: 1px solid rgba(255,255,255,.08); padding-top: 5px; }
.workspace-switcher { width: 100%; }
.stat-icon.forest { background: #e7f5ec; color: var(--forest); }
.stat-icon.mint { background: #e9f8ef; color: #087a39; }
.jubla-hero { position: relative; }
.jubla-hero > * { position: relative; z-index: 1; }
.jubla-hero::after { position: absolute; right: -46px; bottom: -86px; width: 270px; height: 270px; border: 42px solid rgba(255,255,255,.07); border-radius: 50%; content: ""; pointer-events: none; }
.alert-strip { display: flex; align-items: center; gap: 11px; margin: -4px 0 22px; border: 1px solid #fecdca; border-radius: 13px; background: var(--red-soft); padding: 13px 16px; color: #b42318; }
.alert-strip > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #fee4e2; font-weight: 900; }
.alert-strip small { margin-left: auto; font-weight: 750; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-intro h2 { margin: 4px 0 5px; font-size: 27px; letter-spacing: -.035em; }
.page-intro p:not(.eyebrow) { margin: 0; color: var(--slate-500); }
.page-count { border-radius: 999px; background: var(--green-soft); padding: 7px 12px; color: #08723a; font-size: 12px; font-weight: 800; }
.result-bar { display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--slate-200); background: #fbfdfb; padding: 10px 16px; }
.result-bar strong { font-size: 12px; }
.result-bar small { color: var(--slate-500); }
.filter-form { flex-wrap: wrap; }
.filter-reset, .text-link { border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: underline; }
.stock-table td { vertical-align: middle; }
.stock-cell { display: grid; min-width: 150px; gap: 3px; }
.stock-cell > strong { color: var(--navy-900); }
.stock-cell small { color: var(--slate-500); font-size: 10px; }
.stock-bar { display: block; width: 100%; height: 6px; overflow: hidden; border-radius: 999px; background: #e6ebe7; }
.stock-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0b6c35, #24a85a); }
.stock-bar.large { height: 9px; margin-top: 7px; }
.badge-partial { background: #fff6d8; color: #9a5b00; }
.badge-muted { background: var(--slate-100); color: var(--slate-500); }
.block-badge { display: flex; width: max-content; margin-top: 4px; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.stock-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.stock-summary > div { min-height: 112px; border: 1px solid var(--slate-200); border-radius: 15px; background: white; padding: 18px; box-shadow: var(--shadow-sm); }
.stock-summary small, .stock-summary strong, .stock-summary span { display: block; }
.stock-summary small { color: var(--slate-500); font-size: 11px; font-weight: 750; }
.stock-summary strong { margin-top: 4px; font-size: 31px; line-height: 1; letter-spacing: -.04em; }
.stock-summary > div > span:not(.stock-bar) { margin-top: 5px; color: var(--slate-500); font-size: 11px; }
.stock-summary .stock-available { border-color: #a9dfbc; background: #f2fbf5; }
.stock-summary .stock-available strong { color: #08753a; }
.stock-summary .stock-borrowed { border-color: #fedf89; background: #fffaf0; }
.stock-summary .stock-borrowed strong { color: #b45d05; }
.stock-progress-card strong { font-size: 24px; }
.loan-panel { overflow: hidden; }
.loan-list { display: grid; }
.loan-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(110px, .7fr) minmax(100px, .7fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--slate-100); padding: 16px 20px; }
.loan-row:last-child { border-bottom: 0; }
.loan-overdue { background: #fffafa; }
.loan-team { display: flex; min-width: 0; align-items: center; gap: 11px; }
.loan-team > span:last-child { min-width: 0; }
.loan-team strong, .loan-team small, .loan-quantity strong, .loan-quantity small, .loan-date strong, .loan-date small { display: block; }
.loan-team small, .loan-quantity small, .loan-date small { color: var(--slate-500); font-size: 10px; }
.team-dot, .team-badge { display: grid; width: 39px; height: 39px; flex: none; place-items: center; border-radius: 11px; background: var(--green-soft); color: #08723a; font-size: 11px; font-weight: 850; }
.return-form { display: flex; align-items: end; gap: 7px; }
.return-form label { color: var(--slate-500); font-size: 10px; font-weight: 750; }
.return-form input { width: 75px; min-height: 38px; padding: 7px 9px; }
.return-form .button { min-height: 38px; padding: 7px 10px; font-size: 11px; }
.loan-note { grid-column: 1 / -1; margin: -4px 0 0 50px; color: var(--slate-500); font-size: 12px; }
.panel-message { padding: 18px; }
.panel-message p { margin: 0 0 12px; color: var(--slate-600); }
.always-open { border-top: 0; }
.loan-date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.qr-card .button { margin-top: 13px; }
.text-link { align-self: center; }

.teams-layout, .members-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 22px; }
.sticky-panel { position: sticky; top: 22px; overflow: hidden; }
.team-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.team-card { border: 1px solid var(--slate-200); border-radius: 14px; background: white; padding: 16px; }
.team-inactive { opacity: .64; background: var(--slate-50); }
.team-card-head { display: flex; align-items: center; gap: 10px; }
.team-card-head > div { min-width: 0; flex: 1; }
.team-card-head strong, .team-card-head small { display: block; }
.team-card-head small { color: var(--slate-500); font-size: 10px; }
.team-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.team-metrics span { border-radius: 9px; background: var(--slate-50); padding: 10px; }
.team-metrics strong, .team-metrics small { display: block; }
.team-metrics strong { font-size: 18px; }
.team-metrics small { color: var(--slate-500); font-size: 9px; }
.team-edit-form { display: grid; gap: 8px; }
.team-edit-form label { color: var(--slate-600); font-size: 10px; font-weight: 750; }
.team-edit-form input { margin-top: 3px; padding: 8px 10px; }
.team-toggle-form { margin-top: 10px; text-align: right; }
.team-toolbar { justify-content: flex-start; }
.team-toolbar .search-form { max-width: 760px; }
.team-description { margin: 11px 0 0; color: var(--slate-600); font-size: 12px; line-height: 1.45; }
.team-member-summary { display: grid; gap: 7px; margin: 0 0 13px; border-radius: 10px; background: #f5faf7; padding: 11px; }
.team-member-summary > strong { color: var(--slate-700); font-size: 11px; }
.team-member-summary > small { color: var(--slate-500); font-size: 10px; }
.team-member-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.team-member-tags span, .team-chip-row span { border: 1px solid #b9e1c6; border-radius: 999px; background: white; padding: 4px 8px; color: #08723a; font-size: 10px; font-weight: 800; }
.team-settings { margin-top: 8px; border: 1px solid var(--slate-200); border-radius: 10px; background: var(--slate-50); }
.team-settings > summary { padding: 10px 11px; color: var(--slate-700); font-size: 11px; font-weight: 800; cursor: pointer; }
.team-settings .team-edit-form, .team-members-form { border-top: 1px solid var(--slate-200); padding: 11px; }
.team-member-picker { display: grid; max-height: 270px; overflow-y: auto; margin-bottom: 10px; border: 1px solid var(--slate-200); border-radius: 9px; background: white; }
.member-check { display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--slate-100); padding: 9px; cursor: pointer; }
.member-check:last-child { border-bottom: 0; }
.member-check input { width: 17px; height: 17px; flex: none; accent-color: var(--green); }
.member-check span { min-width: 0; }
.member-check strong, .member-check small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-check strong { color: var(--navy-900); font-size: 11px; }
.member-check small { color: var(--slate-500); font-size: 9px; }
.team-no-members { border-top: 1px solid var(--slate-200); padding: 11px; }
.team-no-members p { margin: 0 0 4px; color: var(--slate-500); font-size: 11px; }
.my-team-panel { overflow: hidden; margin-bottom: 22px; border-color: #a7dfba; }
.my-team-panel .panel-heading { background: #f3fbf6; }
.team-chip-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.my-team-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.my-team-list .asset-list-item:nth-child(odd) { border-right: 1px solid var(--slate-100); }
.my-team-empty { display: flex; align-items: center; gap: 10px; padding: 17px 20px; color: var(--slate-600); }
.my-team-empty span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--green-soft); color: #08723a; font-weight: 900; }
.my-team-empty p { margin: 0; font-size: 12px; }
.panel-note { border-top: 1px solid var(--slate-200); background: #f4faf6; padding: 15px 18px; }
.panel-note strong { display: block; color: #08723a; font-size: 12px; }
.panel-note p { margin: 3px 0 0; color: var(--slate-600); font-size: 11px; }

.capacity { width: min(280px, 100%); border: 1px solid var(--slate-200); border-radius: 13px; background: white; padding: 12px 14px; }
.capacity strong, .capacity small { display: block; }
.capacity strong { font-size: 18px; }
.capacity small { margin-top: 4px; color: var(--slate-500); font-size: 10px; }
.capacity-bar { display: block; height: 7px; overflow: hidden; margin-top: 7px; border-radius: 999px; background: var(--slate-100); }
.capacity-bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.invite-result { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(300px, 1fr); align-items: center; gap: 24px; margin-bottom: 22px; border: 1px solid #9edbb5; border-radius: 16px; background: #f0faf4; padding: 20px; }
.invite-result h3 { margin: 3px 0; }
.invite-result p:not(.eyebrow) { margin: 0; color: var(--slate-600); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { min-width: 0; background: white; }
.member-list { display: grid; }
.member-row { display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--slate-100); padding: 13px 17px; }
.member-row:last-child { border-bottom: 0; }
.large-user { width: 42px; height: 42px; }
.member-identity { min-width: 0; flex: 1; }
.member-identity strong, .member-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-identity small { color: var(--slate-500); font-size: 11px; }
.role-form { display: flex; gap: 7px; }
.role-form select { max-width: 190px; }
.role-form .button { min-height: 40px; padding: 7px 10px; font-size: 11px; }
.danger-icon { border: 0; background: var(--red-soft); color: var(--red); }
.self-label { border-radius: 999px; background: var(--green-soft); padding: 4px 8px; color: #08723a; font-size: 10px; font-weight: 800; }
.pending-panel { margin-top: 22px; overflow: hidden; }
.pending-list { display: grid; }
.pending-list > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--slate-100); padding: 13px 18px; }
.pending-list > div:last-child { border-bottom: 0; }
.pending-list strong, .pending-list small { display: block; }
.pending-list small { color: var(--slate-500); font-size: 10px; }

.fixed-profile { display: flex; align-items: center; gap: 12px; border: 1px solid #a7dfba; border-radius: 12px; background: #f1faf4; padding: 14px; }
.fixed-profile strong, .fixed-profile small { display: block; }
.fixed-profile small { color: var(--slate-500); font-size: 11px; }
.green-info { border-color: #a7dfba; background: #f1faf4; }
.settings-single { width: min(820px, 100%); }
.settings-fieldset { margin: 0; border: 1px solid var(--slate-200); border-radius: 13px; padding: 17px; }
.settings-fieldset legend { padding: 0 7px; color: var(--slate-700); font-size: 12px; font-weight: 800; }
.settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.server-address { display: grid; gap: 4px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); padding: 13px 14px; }
.server-address > span { color: var(--slate-700); font-size: 11px; font-weight: 800; }
.server-address code { overflow-wrap: anywhere; color: #08723a; font-size: 12px; font-weight: 750; }
.server-address small { color: var(--slate-500); font-size: 10px; }
.ptouch-model { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.ptouch-model strong, .ptouch-model small { display: block; }
.ptouch-model small { color: var(--slate-500); font-size: 11px; }
.ptouch-hint { margin: 14px 0 0; border-radius: 10px; background: #f1faf4; padding: 11px 13px; color: var(--slate-600); font-size: 12px; }
.ptouch-hint strong { color: #08723a; }
.jubla-tip { background: linear-gradient(155deg, #06391c, #0b6e34); }
.jubla-tip > img { width: 55px; height: 70px; object-fit: contain; border-radius: 9px; background: white; padding: 4px; }

.jubla-auth-brand .matrivo-lockup { width: min(170px, 100%); }
.jubla-auth-brand img { width: 114.63%; max-width: none; height: auto; object-fit: initial; border-radius: 0; background: transparent; }
.login-shell-wide { width: min(620px, 100%); }
.setup-form { grid-template-columns: 1fr 1fr; }
.setup-form > label { display: grid; gap: 5px; }
.setup-form .field-wide { grid-column: 1 / -1; }
.invalid-invite { padding-bottom: 28px; }
.invalid-invite .button { margin-top: 20px; }

.scan-logo { display: grid; width: 38px; height: 48px; place-items: center; overflow: hidden; border-radius: 8px; background: white; padding: 3px; box-shadow: var(--shadow-sm); }
.scan-logo img { width: 100%; height: 100%; object-fit: contain; }
.scan-hero.status-partial { background: linear-gradient(135deg, #856000, #d89b00); }
.scan-stock { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin-top: 14px; border: 1px solid var(--slate-200); border-radius: 15px; background: var(--slate-200); }
.scan-stock > div { background: white; padding: 15px; text-align: center; }
.scan-stock small, .scan-stock strong { display: block; }
.scan-stock small { color: var(--slate-500); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.scan-stock strong { margin-top: 2px; font-size: 24px; }
.scan-stock > span { position: absolute; right: 8px; bottom: 4px; color: var(--slate-400); font-size: 9px; }
.scan-loans { display: grid; }
.scan-loans > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--slate-100); padding: 13px 17px; }
.scan-loans > div:last-child { border-bottom: 0; }
.scan-loans strong, .scan-loans small { display: block; }
.scan-loans small { color: var(--slate-500); font-size: 11px; }

@media (max-width: 1040px) {
    .team-list { grid-template-columns: 1fr; }
    .loan-row { grid-template-columns: minmax(170px, 1fr) 110px 100px; }
    .return-form { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 820px) {
    .stock-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .teams-layout, .members-layout { grid-template-columns: 1fr; }
    .my-team-list { grid-template-columns: 1fr; }
    .my-team-list .asset-list-item:nth-child(odd) { border-right: 0; }
    .my-team-panel .panel-heading { align-items: flex-start; flex-direction: column; }
    .team-chip-row { justify-content: flex-start; }
    .sticky-panel { position: static; }
    .invite-result { grid-template-columns: 1fr; }
    .page-intro { align-items: stretch; flex-direction: column; }
}

@media (max-width: 620px) {
    .stock-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-summary > div { min-height: 96px; padding: 14px; }
    .stock-summary strong { font-size: 26px; }
    .loan-row { grid-template-columns: 1fr 1fr; }
    .loan-team { grid-column: 1 / -1; }
    .return-form { justify-content: stretch; }
    .return-form label { flex: 1; }
    .return-form input { width: 100%; }
    .loan-date-fields { grid-template-columns: 1fr; }
    .team-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .team-metrics span { padding: 8px; }
    .member-row { align-items: stretch; flex-wrap: wrap; }
    .member-identity { min-width: calc(100% - 55px); }
    .role-form { width: 100%; }
    .role-form select { max-width: none; flex: 1; }
    .copy-row { align-items: stretch; flex-direction: column; }
    .setup-form { grid-template-columns: 1fr; }
    .setup-form .field-wide { grid-column: auto; }
    .settings-row { grid-template-columns: 1fr; }
}

/* Matrivo Einsatzversion 8: Kisten, Defektmeldesystem und neues Branding */
.badge-partial_defect { background: #fff0f0; color: #b42318; }
.badge-incomplete { background: #fff4e5; color: #a04b08; }
.defect-status-open { background: var(--red-soft); color: #b42318; }
.defect-status-in_progress { background: #fff4e5; color: #a04b08; }
.defect-status-resolved { background: var(--green-soft); color: #067647; }
.severity-badge-low { background: var(--slate-100); color: var(--slate-600); }
.severity-badge-normal { background: #eef4ff; color: #175cd3; }
.severity-badge-high { background: #fff4e5; color: #b54708; }
.severity-badge-critical { background: var(--red-soft); color: #b42318; }
.scan-hero.status-partial_defect { background: linear-gradient(135deg, #8e2b22, #e36b5f); }

.stock-summary-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stock-summary .stock-defective { border-color: #f7b4ae; background: #fff6f5; }
.stock-summary .stock-defective strong { color: #b42318; }
.summary-word { overflow: hidden; font-size: 20px !important; line-height: 1.15 !important; text-overflow: ellipsis; white-space: nowrap; }
.inline-tag { display: inline-flex; align-items: center; margin: 2px 6px 2px 0; border-radius: 999px; background: var(--green-soft); padding: 5px 9px; color: #067647; font-size: 11px; font-weight: 800; }
.loan-crate-link { display: block; width: max-content; margin-top: 4px; color: #08723a; font-size: 10px; font-weight: 800; }
.defect-alert { border-color: #f5a8a1; background: #fff4f2; color: #912018; }

.crate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 18px; }
.crate-card { display: grid; gap: 14px; min-width: 0; border: 1px solid var(--slate-200); border-radius: 16px; background: white; padding: 18px; color: inherit; box-shadow: var(--shadow-sm); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.crate-card:hover { border-color: #7bc497; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.crate-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crate-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #0b7037, #063c1f); color: white; font-size: 21px; box-shadow: 0 7px 15px rgb(6 84 40 / 16%); }
.crate-icon.large { width: 58px; height: 58px; border-radius: 17px; font-size: 28px; }
.crate-card h3 { margin: 0; font-size: 17px; }
.crate-card p { margin: 3px 0 0; color: var(--slate-500); font-size: 11px; }
.crate-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.crate-meta div { min-width: 0; border-radius: 10px; background: var(--slate-50); padding: 9px; }
.crate-meta dt, .crate-meta dd { margin: 0; }
.crate-meta dt { color: var(--slate-500); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.crate-meta dd { margin-top: 3px; overflow: hidden; font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.crate-ready, .crate-warning, .crate-loan-note { border-radius: 10px; padding: 10px 11px; font-size: 10px; font-weight: 800; }
.crate-ready { background: var(--green-soft); color: #067647; }
.crate-warning { background: #fff4e5; color: #a04b08; }
.crate-loan-note { display: grid; gap: 2px; background: #fff4e5; color: #8a4109; }
.crate-loan-note span { font-weight: 600; }
.crate-item-table td { vertical-align: middle; }
.inline-edit-form { display: grid; grid-template-columns: minmax(230px, 1fr) 130px auto; align-items: end; gap: 12px; padding: 18px; }
.inline-edit-form label { display: grid; gap: 5px; color: var(--slate-600); font-size: 11px; font-weight: 800; }
.return-checklist { display: grid; gap: 8px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); padding: 12px; }
.return-checklist > strong, .return-checklist > small { display: block; }
.return-checklist > small { color: var(--slate-500); font-size: 10px; }
.return-checklist label { display: grid; grid-template-columns: minmax(0, 1fr) 68px; align-items: center; gap: 10px; border-top: 1px solid var(--slate-200); padding-top: 8px; }
.return-checklist label > span { min-width: 0; font-size: 11px; }
.return-checklist label small { display: block; color: var(--slate-500); font-weight: 600; }

.defect-list { display: grid; gap: 13px; padding: 18px; }
.defect-card { border: 1px solid var(--slate-200); border-left: 4px solid var(--slate-300); border-radius: 13px; background: white; padding: 15px 16px; box-shadow: var(--shadow-sm); }
.defect-card.severity-low { border-left-color: var(--slate-400); }
.defect-card.severity-normal { border-left-color: #528bdf; }
.defect-card.severity-high { border-left-color: #e38b23; }
.defect-card.severity-critical { border-left-color: #d92d20; }
.defect-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.defect-card-head h3 { margin: 8px 0 0; font-size: 16px; }
.defect-card-head h3 a { color: inherit; }
.defect-quantity { flex: 0 0 auto; border-radius: 9px; background: var(--slate-50); padding: 8px 10px; font-size: 13px; }
.defect-description { margin: 12px 0; color: var(--slate-700); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.defect-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.defect-meta div { min-width: 0; border-radius: 9px; background: var(--slate-50); padding: 8px 9px; }
.defect-meta dt, .defect-meta dd { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.defect-meta dt { color: var(--slate-500); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.defect-meta dd { margin-top: 2px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.defect-inline-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; color: var(--slate-500); font-size: 10px; }
.defect-inline-meta span::before { content: "•"; margin-right: 6px; color: var(--slate-300); }
.resolution-note { margin-top: 11px; border-radius: 9px; background: var(--green-soft); padding: 10px 12px; }
.resolution-note strong { color: #067647; font-size: 10px; }
.resolution-note p { margin: 3px 0 0; color: var(--slate-700); font-size: 11px; }
.defect-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 13px; border-top: 1px solid var(--slate-100); padding-top: 12px; }
.defect-actions details { min-width: 190px; border: 0; }
.defect-actions details summary { border: 1px solid #a9dfbc; border-radius: 9px; background: var(--green-soft); padding: 9px 12px; color: #067647; font-size: 11px; font-weight: 800; cursor: pointer; }
.defect-actions details[open] { flex: 1 1 300px; }
.defect-actions .mini-form { border: 1px solid var(--slate-200); border-radius: 10px; background: var(--slate-50); padding: 11px; }
.compact-defect-list { padding: 0; }
.compact-defect-list .defect-card { border-radius: 0; border-width: 0 0 1px 4px; box-shadow: none; }
.compact-defect-list .defect-card:last-child { border-bottom-width: 0; }
.report-defect-panel { border-color: #f1aaa4; }

.scan-stock-four { grid-template-columns: repeat(4, 1fr); }
.scan-stock .scan-defective { background: #fff4f2; }
.scan-stock .scan-defective strong { color: #b42318; }
.scan-defect-card { border-color: #f1aaa4; }
.scan-defect-list { display: grid; }
.scan-defect-list > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--slate-100); padding: 12px 15px; }
.scan-defect-list > div:last-child { border-bottom: 0; }
.scan-defect-list strong, .scan-defect-list small { display: block; }
.scan-defect-list small { margin-top: 3px; color: var(--slate-600); font-size: 10px; line-height: 1.4; }
.scan-defect-form { display: grid; gap: 11px; padding: 15px; }
.scan-defect-form label { display: grid; gap: 5px; color: var(--slate-600); font-size: 10px; font-weight: 800; }
.scan-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 1250px) {
    .stock-summary-five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .crate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .stock-summary-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crate-grid { grid-template-columns: 1fr; }
    .defect-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inline-edit-form { grid-template-columns: 1fr 120px; }
    .inline-edit-form .button { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    .stock-summary-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-summary-five > div:last-child { grid-column: 1 / -1; }
    .crate-grid, .defect-list { padding: 12px; }
    .crate-meta, .defect-meta { grid-template-columns: 1fr; }
    .inline-edit-form, .scan-form-row { grid-template-columns: 1fr; }
    .scan-stock-four { grid-template-columns: repeat(2, 1fr); }
    .scan-stock-four > span { bottom: 3px; }
    .defect-card-head { align-items: stretch; flex-direction: column; }
    .defect-quantity { width: max-content; }
    .return-checklist label { grid-template-columns: minmax(0, 1fr) 62px; }
}

/* Mandanten, Konto und Rechtstexte */
.sidebar-footer { display: grid; gap: 10px; }
.legal-links { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; border-top: 1px solid rgb(255 255 255 / 12%); padding: 12px 4px 0; }
.legal-links a, .legal-links span { color: rgb(255 255 255 / 67%); font-size: 9px; font-weight: 700; }
.legal-links a:hover { color: #fff; }
.workspace-switcher { display: grid; gap: 5px; border-bottom: 1px solid rgb(255 255 255 / 12%); padding: 0 4px 12px; }
.workspace-switcher label { color: rgb(255 255 255 / 64%); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.workspace-switcher select { width: 100%; border-color: rgb(255 255 255 / 18%); background: #103f24; color: #fff; }

.check-label { display: grid !important; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 9px !important; color: var(--slate-600); font-size: 11px; font-weight: 650; line-height: 1.45; }
.check-label input { width: 17px; height: 17px; margin: 1px 0 0; }
.check-label a, .text-link { color: #08723a; font-weight: 800; }

.legal-shell { width: min(760px, 100%); }
.legal-document { padding: 30px; }
.legal-document h1 { margin: 3px 0 18px; font-size: clamp(27px, 5vw, 38px); }
.legal-document h2 { margin: 25px 0 7px; font-size: 17px; }
.legal-document p, .legal-document li { color: var(--slate-600); font-size: 12px; line-height: 1.65; }
.legal-document a:not(.button) { color: #08723a; font-weight: 750; }

.panel-body { display: grid; gap: 18px; padding: 20px; }
.plain-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--slate-100); padding: 10px 0; }
.plain-list li:last-child { border-bottom: 0; }
.plain-list span { color: var(--slate-500); font-size: 11px; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.account-grid .danger-panel { grid-column: 1 / -1; }
.danger-panel { border-color: #efb6b0; }
.danger-panel .eyebrow { color: #b42318; }
.button-danger { border-color: #b42318; background: #b42318; color: #fff; }
.button-danger:hover { background: #8f1e15; }
.data-control-panel { margin-top: 18px; }
.data-control-panel .panel-body { align-items: center; grid-template-columns: max-content max-content; }

.platform-shell { width: min(1120px, 100%); }
.platform-shell .login-card { padding: 0; background: transparent; box-shadow: none; }
.platform-shell .login-brand { margin-bottom: 18px; border: 0; border-radius: 16px; background: #fff; padding: 16px 20px; box-shadow: var(--shadow-sm); }
.platform-shell .matrivo-lockup { width: 185px; }
.platform-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; border-radius: 18px; background: linear-gradient(135deg, #073d20, #169552); padding: 25px; color: #fff; box-shadow: var(--shadow-md); }
.platform-header h1 { margin: 3px 0 5px; font-size: 30px; }
.platform-header p { margin: 0; color: rgb(255 255 255 / 78%); }
.platform-header .eyebrow { color: #9ee6b8; }
.platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.platform-tenants { margin-top: 18px; }
.tenant-list { display: grid; }
.tenant-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(480px, 1.35fr); align-items: end; gap: 22px; border-bottom: 1px solid var(--slate-100); padding: 17px 20px; }
.tenant-row:last-child { border-bottom: 0; }
.tenant-row > div { display: grid; gap: 4px; }
.tenant-row small { color: var(--slate-500); font-size: 10px; }
.tenant-controls { display: grid; grid-template-columns: minmax(125px, 1fr) 110px auto; align-items: end; gap: 9px; }
.tenant-controls label { display: grid; gap: 4px; color: var(--slate-500); font-size: 9px; font-weight: 800; }
.tenant-controls input, .tenant-controls select { min-height: 38px; }
.compact-result { margin-bottom: 18px; }
.compact-result small { display: block; margin-top: 3px; color: var(--slate-500); }
.reset-result { border-color: #c5d6f5; background: #f4f7fd; }
.compact-button { min-height: 35px; padding: 6px 10px; font-size: 10px; }
.import-panel { margin-bottom: 18px; overflow: hidden; }
.import-panel > summary { padding: 15px 18px; color: #08723a; font-size: 12px; font-weight: 850; cursor: pointer; }
.import-panel[open] > summary { border-bottom: 1px solid var(--slate-100); }
.import-panel-body { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(310px, 1fr); align-items: end; gap: 22px; padding: 18px; }
.import-panel-body p { margin: 5px 0 9px; color: var(--slate-500); font-size: 11px; line-height: 1.5; }
.import-panel-body form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: end; gap: 10px; }
.file-field { display: grid; gap: 5px; color: var(--slate-600); font-size: 10px; font-weight: 800; }
.file-field input { padding: 8px; }

@media (max-width: 900px) {
    .tenant-row { grid-template-columns: 1fr; }
    .tenant-controls { grid-template-columns: minmax(130px, 1fr) 110px auto; }
}

@media (max-width: 720px) {
    .account-grid, .platform-grid { grid-template-columns: 1fr; }
    .account-grid .danger-panel { grid-column: auto; }
    .platform-header { align-items: stretch; flex-direction: column; }
    .tenant-controls { grid-template-columns: 1fr; }
    .data-control-panel .panel-body { grid-template-columns: 1fr; }
    .legal-document { padding: 22px 19px; }
    .import-panel-body, .import-panel-body form { grid-template-columns: 1fr; }
}

/* Matrivo v10: Vertrags- und Verkaufsbetrieb */
.flash-warning { border-color: #fedf89; background: var(--amber-soft); color: #93370d; }
.login-help-link { justify-self: center; margin-top: 2px; font-size: 11px; }
.subscription-alert { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px clamp(24px, 4vw, 56px) 0; border: 1px solid #fedf89; border-radius: 13px; background: var(--amber-soft); padding: 12px 15px; color: #7a2e0e; }
.subscription-alert strong, .subscription-alert small { display: block; }
.subscription-alert small { margin-top: 2px; }
.billing-intro { align-items: center; }
.subscription-badge { display: inline-flex; border-radius: 999px; background: var(--green-soft); padding: 8px 13px; color: #067647; font-size: 11px; font-weight: 850; }
.subscription-badge.subscription-past_due, .subscription-badge.subscription-cancelled, .subscription-badge.subscription-suspended { background: var(--amber-soft); color: #93370d; }
.billing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.contract-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contract-facts div { border-radius: 11px; background: var(--slate-50); padding: 12px; }
.contract-facts span, .contract-facts strong { display: block; }
.contract-facts span { color: var(--slate-500); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.contract-facts strong { margin-top: 3px; font-size: 13px; }
.terms-accept-panel { margin-bottom: 18px; border-color: #abefc6; }
.terms-accept-form { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; }
.terms-accept-form .check-label { flex: 1; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 20px; }
.plan-card { display: grid; align-content: start; gap: 9px; border: 1px solid var(--slate-200); border-radius: 14px; padding: 17px; }
.plan-card.selected { border-color: #75d39a; background: #f3fbf6; }
.plan-card h3, .plan-card p { margin: 0; }
.plan-card p, .plan-card small { color: var(--slate-500); font-size: 11px; }
.plan-card form { margin-top: 6px; }
.plan-state { width: max-content; border-radius: 999px; background: var(--slate-100); padding: 3px 8px; color: var(--slate-600); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.plan-card.selected .plan-state { background: #d8f3e2; color: #067647; }
.plan-feature-list { display: grid; gap: 5px; margin: 2px 0 4px; padding: 0; list-style: none; }
.plan-feature-list li { position: relative; padding-left: 17px; color: var(--slate-600); font-size: 11px; }
.plan-feature-list li::before { position: absolute; left: 0; color: #07883f; content: "✓"; font-weight: 900; }
.feature-lock-panel { max-width: 680px; margin: 32px auto; padding: 32px; text-align: center; }
.feature-lock-panel h2 { margin: 5px 0 8px; }
.feature-lock-panel > p:not(.eyebrow) { max-width: 520px; margin: 8px auto; color: var(--slate-600); }
.feature-lock-panel .form-actions { justify-content: center; margin-top: 20px; }
.feature-lock-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 14px; place-items: center; border-radius: 15px; background: var(--green-soft); color: #08723a; font-size: 28px; }
.label-delete-form { position: absolute; bottom: 9px; left: 11px; margin: 0; }
.label-delete-form button { border: 0; background: transparent; cursor: pointer; }
.billing-note { margin: 0 20px 20px; }
.portal-action { padding: 0 20px 20px; }
.billing-records { display: grid; }
.billing-record { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--slate-100); padding: 13px 20px; }
.billing-record:last-child { border-bottom: 0; }
.billing-record strong, .billing-record small { display: block; }
.billing-record small { margin-top: 2px; color: var(--slate-500); font-size: 10px; }
.status-pill { border-radius: 999px; background: var(--slate-100); padding: 5px 9px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.platform-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.platform-stat-grid > div { border: 1px solid var(--slate-200); border-radius: 13px; background: #fff; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.platform-stat-grid span, .platform-stat-grid strong { display: block; }
.platform-stat-grid span { color: var(--slate-500); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.platform-stat-grid strong { margin-top: 3px; font-size: 17px; }
.form-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tenant-row-expanded { align-items: start; grid-template-columns: minmax(200px, .55fr) minmax(560px, 1.45fr); }
.tenant-summary { align-content: start; }
.tenant-summary .subscription-badge { width: max-content; margin-bottom: 4px; }
.tenant-controls-expanded { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
.tenant-controls-expanded .tenant-billing-email { grid-column: span 2; }
.manual-billing-details { grid-column: 1 / -1; border-top: 1px solid var(--slate-100); padding-top: 10px; }
.manual-billing-details summary { width: max-content; color: #08723a; font-size: 10px; font-weight: 800; cursor: pointer; }
.manual-billing-form { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)) auto; align-items: end; gap: 8px; margin-top: 10px; }
.manual-billing-form label { display: grid; gap: 4px; color: var(--slate-500); font-size: 9px; font-weight: 800; }
.organization-delete-panel { margin-top: 18px; border-color: #efb6b0; }
.organization-delete-panel .eyebrow { color: #b42318; }
.deletion-request-state { background: #fff8f7; color: #912018; }
.deletion-request-state p { margin: 3px 0 0; color: var(--slate-600); }
.tenant-deletion-alert { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(310px, 1fr); align-items: end; gap: 12px; border: 1px solid #fecdca; border-radius: 11px; background: var(--red-soft); padding: 12px; }
.tenant-deletion-alert strong, .tenant-deletion-alert small { display: block; }
.tenant-deletion-alert small { color: var(--slate-600); }
.tenant-deletion-alert form:last-child { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(160px, .7fr) auto; align-items: end; gap: 8px; }
.tenant-deletion-alert label { display: grid; gap: 4px; color: #912018; font-size: 9px; font-weight: 800; }
.platform-admin-list li { align-items: flex-start; }
.platform-admin-list li > span { display: grid; gap: 2px; }
.platform-admin-list li > span strong { color: var(--slate-800); font-size: 12px; }
.platform-admin-list details { text-align: right; }
.platform-admin-list summary { color: #b42318; font-size: 9px; font-weight: 800; cursor: pointer; }
.inline-admin-revoke { display: grid; grid-template-columns: minmax(130px, 1fr) auto; gap: 6px; margin-top: 7px; }
.inline-admin-revoke input, .inline-admin-revoke .button { min-height: 34px; }
.audit-filter { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, .7fr) auto auto; align-items: end; gap: 10px; padding: 16px 20px; }
.audit-filter label { display: grid; gap: 4px; color: var(--slate-500); font-size: 9px; font-weight: 800; }
.audit-filter .text-link { align-self: center; font-size: 10px; }
.audit-list { display: grid; }
.audit-list article { display: grid; grid-template-columns: 145px minmax(0, 1fr) minmax(100px, auto); align-items: start; gap: 15px; border-top: 1px solid var(--slate-100); padding: 13px 20px; }
.audit-list article:first-child { border-top: 0; }
.audit-list time, .audit-list small, .audit-list article > span { color: var(--slate-500); font-size: 10px; }
.audit-list strong, .audit-list small { display: block; }
.audit-list p { margin: 4px 0 0; color: var(--slate-600); font-size: 11px; }
.audit-list article > span { text-align: right; }

@media (max-width: 820px) {
    .billing-grid, .plan-grid { grid-template-columns: 1fr; }
    .terms-accept-form { align-items: stretch; flex-direction: column; }
    .platform-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tenant-row-expanded, .manual-billing-form { grid-template-columns: 1fr; }
    .tenant-controls-expanded { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tenant-deletion-alert { grid-template-columns: 1fr; }
    .tenant-deletion-alert form:last-child { grid-template-columns: 1fr; }
    .audit-filter, .audit-list article { grid-template-columns: 1fr; }
    .audit-list article > span { text-align: left; }
}

@media (max-width: 620px) {
    .subscription-alert { align-items: stretch; flex-direction: column; }
    .contract-facts { grid-template-columns: 1fr; }
    .form-grid-two, .tenant-controls-expanded, .platform-stat-grid { grid-template-columns: 1fr; }
    .tenant-controls-expanded .tenant-billing-email { grid-column: auto; }
}
