:root {
    /* ZENTRALE DESIGN-VARIABLEN: Farben hier ändern. */
    --blue: #054578;
    --blue-dark: #03365f;
    --yellow: #ffc825;
    --ink: #121212;
    --muted: #66727e;
    --line: #dfe5ea;
    --surface: #ffffff;
    --background: #f3f6f8;
    --green: #16835f;
    --orange: #c77208;
    --red: #c93a3a;
    --shadow: 0 8px 28px rgba(4, 42, 70, 0.08);
    --radius: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); font-family: Montserrat, Arial, sans-serif; font-size: 15px; }
h1, h2, h3 { margin: 0; color: var(--blue); font-family: Exo, Montserrat, sans-serif; }
h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h2 { font-size: 1.2rem; }
p { line-height: 1.55; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar { min-height: 76px; padding: 12px clamp(18px, 4vw, 56px); display: flex; align-items: center; gap: 32px; background: white; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand, .login-brand { display: flex; align-items: center; gap: 11px; min-width: max-content; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--yellow); background: var(--blue); font: 700 1.5rem Exo; border-radius: 7px 7px 15px 7px; }
.brand-mark.large { width: 52px; height: 52px; font-size: 2rem; }
.brand strong, .login-brand strong { display: block; color: var(--blue); font: 700 1.08rem Exo; letter-spacing: .08em; }
.brand small, .login-brand small { display: block; color: var(--muted); font-size: .66rem; letter-spacing: .18em; }
nav { display: flex; align-items: center; gap: 6px; flex: 1; }
nav a { padding: 10px 12px; border-radius: 9px; font-weight: 600; }
nav a:hover { background: #edf4f8; }
nav .nav-action { color: var(--blue); background: var(--yellow); }
nav .scan-nav { color: white; background: var(--blue); }
nav .scan-nav:hover { color: var(--blue); background: var(--yellow); }
.account { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .77rem; }
.menu-button { display: none; border: 0; background: none; font-size: 1.5rem; color: var(--blue); }
.link-button { padding: 0; color: var(--blue); background: none; border: 0; font-weight: 700; }

.page { width: min(1480px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading p { margin: 6px 0 0; color: var(--muted); }
.eyebrow { display: block; margin-bottom: 5px; color: var(--orange); font-size: .73rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.date-chip { padding: 7px 12px; color: var(--blue); background: white; border: 1px solid var(--line); border-radius: 99px; font-weight: 700; }
.heading-actions { display: flex; align-items: center; gap: 12px; }
.back-link { display: inline-block; margin-bottom: 9px; font-weight: 700; }

.panel, .scanner-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { margin-top: 22px; }
.panel-heading { padding: 22px 24px 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-heading p, .form-section > p { margin: 5px 0 0; color: var(--muted); font-size: .88rem; }
.panel-heading > a { font-weight: 700; }

.scanner-card { padding: 19px 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-left: 5px solid var(--yellow); }
.scanner-card > div { display: flex; align-items: center; gap: 14px; }
.scanner-card h2 { font-size: 1.05rem; }
.scanner-card p { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.scanner-icon { width: 42px; height: 42px; display: grid; place-items: center; background: #fff5ce; border-radius: 10px; color: var(--blue); font-size: 1.7rem; }
.scanner-card form { width: min(560px, 55%); display: flex; gap: 8px; }

input, select, textarea { width: 100%; padding: 11px 12px; color: var(--ink); background: white; border: 1px solid #bac5ce; border-radius: 8px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(5,69,120,.12); }
textarea { resize: vertical; }
label { display: grid; gap: 7px; color: #34424e; font-size: .83rem; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
.button { min-height: 42px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.button.primary { color: white; background: var(--blue); }
.button.primary:hover { background: var(--blue-dark); }
.button.yellow { color: var(--blue-dark); background: var(--yellow); }
.button.ghost { color: var(--blue); background: white; border-color: #b6c4cf; }
.button.full { width: 100%; }
.success-button { color: white; background: var(--green); }
.warning-button { color: white; background: var(--orange); }
.danger-button { color: white; background: var(--red); }

.stats-grid { margin: 22px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { min-height: 142px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); background: white; border: 1px solid var(--line); border-top: 5px solid; border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .15s ease; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card > span { font-weight: 700; }
.stat-card strong { color: var(--blue); font: 700 2.6rem Exo; }
.stat-card small { color: var(--muted); }
.stat-card.warehouse { border-top-color: var(--green); }
.stat-card.employee { border-top-color: var(--blue); }
.stat-card.repair { border-top-color: var(--orange); }
.stat-card.missing { border-top-color: var(--red); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); background: #f8fafb; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.machine-cell { min-width: 240px; display: flex; align-items: center; gap: 12px; }
.machine-cell small, .block { display: block; margin-top: 4px; color: var(--muted); }
.thumb { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; color: var(--blue); background: #edf3f7; border-radius: 8px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-link { font-weight: 700; }
.nowrap { white-space: nowrap; }

.status, .service { width: max-content; padding: 5px 9px; display: inline-flex; align-items: center; border-radius: 99px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.status.warehouse, .service.success { color: #076245; background: #dff6ed; }
.status.employee { color: var(--blue); background: #e2eff9; }
.status.repair, .service.warning { color: #8b4c00; background: #fff0d5; }
.status.missing, .service.danger { color: #9d2020; background: #fde5e5; }
.service.neutral { color: #5a6670; background: #edf0f2; }
.large-status { padding: 8px 12px; font-size: .8rem; }
.beta-badge { padding: 5px 8px; color: #5d4300; background: var(--yellow); border-radius: 6px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.alert-grid { margin: 0 0 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.alert-card { padding: 16px 20px; display: flex; align-items: center; gap: 13px; color: var(--ink); background: #fff8df; border-left: 5px solid var(--orange); border-radius: 10px; }
.alert-card strong { color: var(--blue); font: 700 1.8rem Exo; }

.filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) 220px auto auto; gap: 10px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.machine-grid { padding: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.machine-card { color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color .15s, transform .15s; }
.machine-card:hover { border-color: #8aa8bd; transform: translateY(-2px); }
.machine-image { height: 155px; display: grid; place-items: center; color: #9cb0bf; background: #edf2f5; font-size: 3rem; overflow: hidden; }
.machine-image img { width: 100%; height: 100%; object-fit: cover; }
.machine-card-body { padding: 16px; }
.machine-card h3 { margin: 12px 0 4px; font-size: 1.05rem; }
.machine-card p { margin: 0 0 12px; color: var(--muted); font-size: .8rem; }
.machine-card small { color: #3f4e59; }

.form-panel { overflow: hidden; }
.form-section { padding: 25px; border-bottom: 1px solid var(--line); }
.form-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { padding: 20px 25px; display: flex; justify-content: flex-end; gap: 10px; background: #f8fafb; }

.detail-grid { display: grid; grid-template-columns: minmax(330px, .85fr) minmax(400px, 1.15fr); gap: 22px; }
.detail-grid .panel { margin-top: 0; }
.machine-profile { padding: 22px; }
.profile-image { min-height: 240px; display: grid; place-items: center; color: #9cb0bf; background: #edf2f5; border-radius: 11px; overflow: hidden; font-size: 4rem; }
.profile-image:has(small) { align-content: center; gap: 6px; }
.profile-image small { font-size: .8rem; }
.profile-image img { width: 100%; height: 280px; object-fit: contain; background: white; }
.data-list { margin: 20px 0; }
.data-list > div { padding: 11px 0; display: grid; grid-template-columns: 150px 1fr; gap: 16px; border-bottom: 1px solid var(--line); }
.data-list dt { color: var(--muted); font-size: .78rem; }
.data-list dd { margin: 0; font-weight: 600; }
.qr-box { padding: 12px; display: flex; align-items: center; gap: 14px; background: #f4f7f9; border-radius: 10px; }
.qr-box img { width: 88px; height: 88px; }
.qr-box small, .qr-box a { display: block; margin-top: 5px; font-size: .75rem; }
.qr-box a { font-weight: 700; }
.notes { margin-top: 18px; padding: 15px; background: #fff8df; border-left: 4px solid var(--yellow); border-radius: 6px; }
.notes p { margin: 6px 0 0; white-space: pre-wrap; }
.action-column { display: grid; align-content: start; gap: 22px; }
.current-location { padding: 22px; }
.location-value { margin-top: 15px; display: flex; align-items: center; gap: 14px; }
.location-value > span { width: 45px; height: 45px; display: grid; place-items: center; color: var(--yellow); background: var(--blue); border-radius: 50%; font-size: 1.4rem; }
.location-value strong, .location-value small { display: block; }
.location-value small { margin-top: 4px; color: var(--muted); }
.action-panel { padding: 22px; }
.action-tabs { margin: 18px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.tab-button { padding: 9px 5px; color: var(--muted); background: #edf1f4; border: 0; border-radius: 7px; font-size: .76rem; font-weight: 700; }
.tab-button.active { color: white; background: var(--blue); }
.tab-form { display: none; gap: 14px; }
.tab-form.active { display: grid; }
.tab-form p { margin: 0; color: var(--muted); }
.timeline-panel { overflow: hidden; }
.timeline { padding: 20px 25px; }
.timeline-item { min-height: 68px; padding: 0 0 22px 27px; position: relative; border-left: 2px solid var(--line); }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot { width: 12px; height: 12px; position: absolute; left: -7px; top: 3px; background: var(--yellow); border: 2px solid var(--blue); border-radius: 50%; }
.timeline-item p { margin: 4px 0; color: var(--muted); font-size: .78rem; }
.timeline-item small { color: #45545e; }

.compact-panel { padding: 22px; }
.inline-form { margin-top: 16px; display: grid; grid-template-columns: 1.2fr .7fr 1fr auto; align-items: end; gap: 10px; }
.employee-form { grid-template-columns: 1.15fr .7fr .85fr 1fr auto; }
.scan-workflow { margin: 0 0 22px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; }
.scan-step { min-height: 94px; padding: 17px; display: flex; align-items: center; gap: 13px; color: var(--muted); background: white; border: 2px solid var(--line); border-radius: var(--radius); }
.scan-step.active { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,200,37,.18); }
.scan-step.done { border-color: var(--green); background: #f0faf7; }
.step-number { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 50%; font: 700 1rem Exo; }
.scan-step.done .step-number { background: var(--green); }
.scan-step small, .scan-step strong, .scan-step code { display: block; }
.scan-step small { margin-bottom: 4px; text-transform: uppercase; letter-spacing: .08em; }
.scan-step strong { color: var(--blue); }
.scan-step code { margin-top: 4px; }
.workflow-arrow { color: var(--blue); font-size: 1.6rem; font-weight: 700; }
.quick-panel { padding: 34px; text-align: center; }
.quick-icon { width: 70px; height: 70px; margin: 0 auto 16px; display: grid; place-items: center; color: var(--yellow); background: var(--blue); border-radius: 16px; font-size: 2.6rem; }
.quick-panel > p { margin: 7px auto 22px; max-width: 650px; color: var(--muted); }
.quick-form { max-width: 720px; margin: 0 auto 18px; display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.quick-form input { font-size: 1.05rem; }
.camera-form { max-width: 720px; margin: 20px auto; display: grid; justify-items: center; gap: 8px; }
.camera-button { width: 100%; min-height: 62px; display: flex; align-items: center; justify-content: center; color: white; background: var(--blue); border: 3px solid var(--yellow); border-radius: 12px; font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.camera-button input { width: 1px; height: 1px; position: absolute; opacity: 0; pointer-events: none; }
.camera-form > small { color: var(--muted); font-weight: 400; }
.camera-loading { display: none; padding: 9px 12px; color: var(--blue); background: #e5f0f7; border-radius: 8px; font-weight: 700; }
.camera-loading.visible { display: block; }
.scan-divider { max-width: 720px; margin: 22px auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .75rem; }
.scan-divider::before, .scan-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.phone-hint { max-width: 720px; margin: 0 auto 18px; padding: 13px; color: #4e5e68; background: #eef5fa; border-radius: 8px; font-size: .82rem; }
.confirm-card { max-width: 760px; margin: 0 auto; padding: 30px; }
.confirm-pair { margin-bottom: 28px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.confirm-pair > div { padding: 22px; background: #f2f6f8; border-radius: 12px; }
.confirm-pair > span { color: var(--blue); font-size: 2rem; font-weight: 700; }
.confirm-pair small, .confirm-pair strong, .confirm-pair code { display: block; }
.confirm-pair small { color: var(--muted); }
.confirm-pair strong { margin: 6px 0; color: var(--blue); font: 700 1.1rem Exo; }
.confirm-card > .button { margin-top: 10px; }
.return-summary { margin-bottom: 25px; display: flex; align-items: center; gap: 18px; }
.return-summary .quick-icon { margin: 0; flex: 0 0 70px; }
.return-summary small, .return-summary strong, .return-summary code { display: block; }
.return-summary strong { margin: 5px 0; color: var(--blue); font: 700 1.25rem Exo; }
.return-summary p { margin: 8px 0 0; color: var(--muted); }
.return-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.return-option { padding: 18px; display: grid; align-content: start; gap: 12px; border: 2px solid; border-radius: 12px; }
.return-option h2 { font-size: 1rem; }
.return-option p { margin: 0; color: var(--muted); font-size: .82rem; }
.warehouse-option { background: #f1faf7; border-color: #abdcca; }
.repair-option { background: #fff8e9; border-color: #efca89; }
.catalog-intro { margin-bottom: 22px; padding: 16px 20px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; color: var(--blue); background: #eaf2f7; border-radius: 12px; }
.catalog-intro > div { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; text-align: center; }
.catalog-intro span { color: var(--muted); }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.catalog-card { color: var(--ink); background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, border-color .15s; }
.catalog-card:hover { transform: translateY(-2px); border-color: #8aa8bd; }
.catalog-photo { height: 185px; display: grid; place-items: center; color: #9cb0bf; background: #edf2f5; font-size: 3.2rem; overflow: hidden; }
.catalog-photo img { width: 100%; height: 100%; object-fit: cover; }
.catalog-body { padding: 19px; }
.catalog-body > small, .advisor-card-head small { color: var(--orange); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.catalog-body h2 { margin: 5px 0; }
.catalog-body p { margin: 0 0 12px; color: var(--muted); }
.tag-line { min-height: 42px; color: #465762; font-size: .78rem; line-height: 1.5; }
.availability { margin-top: 16px; padding-top: 14px; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); font-size: .78rem; }
.availability strong { color: var(--green); }
.availability span { color: var(--muted); }
.catalog-empty { grid-column: 1 / -1; margin: 0; }
.catalog-detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr); gap: 22px; align-items: start; }
.catalog-detail-grid > .panel { margin-top: 0; }
.catalog-knowledge { padding: 22px; }
.catalog-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.catalog-photos > img { width: 100%; height: 300px; object-fit: contain; background: #f4f7f9; border-radius: 11px; }
.catalog-photos > :only-child { grid-column: 1 / -1; }
.knowledge-block { padding: 22px 0; border-bottom: 1px solid var(--line); }
.knowledge-block:last-child { border-bottom: 0; }
.knowledge-block p { margin: 9px 0 0; }
.knowledge-block.accent, .knowledge-block.safety, .knowledge-block.warning-block { margin-top: 16px; padding: 17px; border: 0; border-left: 4px solid; border-radius: 8px; }
.knowledge-block.accent { background: #fff8df; border-color: var(--yellow); }
.knowledge-block.safety { background: #eaf7f2; border-color: var(--green); }
.knowledge-block.warning-block { background: #fdeaea; border-color: var(--red); }
.preline { white-space: pre-line; }
.application-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.application-tags span { padding: 6px 9px; color: var(--blue); background: #e5f0f7; border-radius: 99px; font-size: .74rem; font-weight: 700; }
.catalog-machines { overflow: hidden; }
.catalog-machine-list > a { padding: 15px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink); border-bottom: 1px solid var(--line); }
.catalog-machine-list > a:last-child { border-bottom: 0; }
.catalog-machine-list small { display: block; margin-top: 4px; color: var(--muted); }
.catalog-machine-list > a > div:last-child { text-align: right; }
.advisor-search { padding: 24px; color: white; background: var(--blue); border-radius: var(--radius); box-shadow: var(--shadow); }
.advisor-search form { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.advisor-search input { min-height: 50px; font-size: 1.05rem; }
.search-examples { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .77rem; }
.search-examples a { padding: 5px 9px; color: white; border: 1px solid rgba(255,255,255,.4); border-radius: 99px; }
.result-heading { margin: 27px 0 14px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.result-heading span { color: var(--muted); }
.advisor-results { display: grid; gap: 17px; }
.advisor-card { padding: 22px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.advisor-card-head { display: flex; justify-content: space-between; gap: 20px; }
.advisor-card-head h2 { margin: 5px 0 2px; }
.advisor-card-head p { margin: 0; color: var(--muted); }
.stock-badge { height: max-content; padding: 8px 11px; border-radius: 99px; font-weight: 700; white-space: nowrap; }
.stock-badge.available { color: #076245; background: #dff6ed; }
.stock-badge.unavailable { color: #9d2020; background: #fde5e5; }
.advisor-note { margin-top: 13px; padding: 11px 13px; background: #fff8df; border-radius: 7px; }
.advisor-match { margin-top: 13px; padding: 11px 13px; color: #07533c; background: #e8f6f0; border-left: 4px solid var(--green); border-radius: 7px; }
.advisor-machines { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.advisor-machines h3 { margin-bottom: 10px; font-size: .9rem; }
.advisor-machines > a { padding: 10px 0; display: grid; grid-template-columns: 1fr auto minmax(130px, .45fr); align-items: center; gap: 12px; color: var(--ink); border-bottom: 1px solid var(--line); }
.advisor-machines > a:last-child { border-bottom: 0; }
.advisor-machines small { color: var(--muted); }
.narrow-panel { width: min(720px, 100%); margin-inline: auto; padding: 26px; }
.compact-stack { margin-top: 14px; gap: 11px; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.media-actions { margin: 16px 0; display: flex; flex-wrap: wrap; gap: 9px; }
.info-panel h3 { margin-top: 20px; }
.check-list { padding-left: 20px; }
.check-list li { margin: 8px 0; }
.help-list { display: grid; gap: 9px; }
.help-list details { padding: 13px 15px; background: #f4f7f9; border-radius: 8px; }
.help-list summary { color: var(--blue); font-weight: 700; cursor: pointer; }
.help-list p { margin: 10px 0; }
.structured-list { display: grid; gap: 8px; }
.structured-list article { padding: 11px; display: flex; align-items: flex-start; gap: 10px; background: #f6f8f9; border-radius: 8px; }
.structured-list article > div { flex: 1; }
.structured-list p { margin: 4px 0 0; }
.accessory-form { grid-template-columns: 1fr 150px 1fr auto; }
.troubleshooting-form { padding: 16px; background: #f6f8f9; border-radius: 10px; }
.case-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.case-card { margin: 0; padding: 20px; }
.case-head { display: flex; justify-content: space-between; gap: 12px; }
.case-head h2 { margin: 8px 0 2px; }
.case-head p { margin: 0; color: var(--muted); }
.case-list article { padding: 15px 20px; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.case-list article:last-child { border-bottom: 0; }
.case-list p { margin: 5px 0; }
.project-form { grid-template-columns: .65fr 1fr 1.4fr auto; }
.user-form { grid-template-columns: 1.3fr 1fr 1fr auto; }
.empty { padding: 50px 24px; text-align: center; color: var(--muted); }
.empty p { margin-bottom: 0; }
.error-card { padding: 60px 24px; text-align: center; }
.error-card > span { width: 54px; height: 54px; margin: 0 auto 15px; display: grid; place-items: center; color: white; background: var(--red); border-radius: 50%; font: 700 1.7rem Exo; }

.flash-stack { margin-bottom: 18px; display: grid; gap: 8px; }
.flash { padding: 12px 15px; border-radius: 8px; font-weight: 600; }
.flash.success { color: #075c43; background: #dcf5eb; border: 1px solid #a8decf; }
.flash.error { color: #922828; background: #fde7e7; border: 1px solid #efb8b8; }

.login-page { width: 100%; min-height: 100vh; padding: 40px 18px; display: grid; place-items: center; background: linear-gradient(130deg, rgba(5,69,120,.96), rgba(3,54,95,.9)), radial-gradient(circle at 80% 20%, #ffc825 0 8%, transparent 9%); }
.login-card { width: min(440px, 100%); padding: 34px; background: white; border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.24); }
.login-brand { margin-bottom: 30px; }
.login-card h1 { margin-bottom: 3px; }
.muted { color: var(--muted); }
.stack-form { margin-top: 24px; display: grid; gap: 16px; }
.demo-hint { margin-top: 20px; color: var(--muted); font-size: .78rem; }
.demo-hint summary { cursor: pointer; }

@media (max-width: 1280px) {
    .topbar { flex-wrap: wrap; gap: 12px; }
    .menu-button { display: block; margin-left: auto; }
    nav { width: 100%; order: 5; display: none; flex-wrap: wrap; }
    nav.open { display: flex; }
    .account { margin-left: auto; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .machine-grid { grid-template-columns: repeat(2, 1fr); }
    .catalog-grid { grid-template-columns: repeat(2, 1fr); }
    .catalog-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .page { width: min(100% - 24px, 1480px); padding-top: 22px; }
    .account span { display: none; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .scanner-card { align-items: stretch; flex-direction: column; }
    .scanner-card form { width: 100%; }
    .stats-grid, .machine-grid, .detail-grid, .alert-grid, .case-board { grid-template-columns: 1fr; }
    .catalog-grid, .catalog-photos { grid-template-columns: 1fr; }
    .catalog-photos > img, .catalog-photos > :only-child { grid-column: auto; }
    .catalog-intro { grid-template-columns: 1fr; }
    .catalog-intro > b { text-align: center; transform: rotate(90deg); }
    .advisor-search form { grid-template-columns: 1fr; }
    .advisor-machines > a { grid-template-columns: 1fr auto; }
    .advisor-machines > a small { grid-column: 1 / -1; }
    .stat-card { min-height: 120px; }
    .filter-bar, .inline-form, .form-grid { grid-template-columns: 1fr; }
    .scan-workflow { grid-template-columns: 1fr; }
    .workflow-arrow { text-align: center; transform: rotate(90deg); }
    .quick-form { grid-template-columns: 1fr; }
    .confirm-pair { grid-template-columns: 1fr; text-align: center; }
    .confirm-pair > span { transform: rotate(90deg); }
    .return-options { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
    .action-tabs { grid-template-columns: repeat(2, 1fr); }
    .data-list > div { grid-template-columns: 120px 1fr; }
    .mini-grid { grid-template-columns: 1fr; }
    th, td { padding: 12px; }
}

@media (max-width: 440px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card { min-height: 110px; padding: 14px; }
    .stat-card strong { font-size: 2rem; }
    .stat-card > span { font-size: .77rem; }
    .scanner-card form { flex-direction: column; }
    .heading-actions { align-items: flex-start; flex-direction: column; }
    .login-card { padding: 25px; }
}

.mobile-navigation { display: none; }
.mobile-shortcuts { display: none; }
:focus-visible { outline: 3px solid #bc8300; outline-offset: 3px; }
@media (max-width: 760px) {
    html { scroll-padding-top: 150px; }
    body { overflow-wrap: anywhere; }
    .page { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
    .topbar { padding: 12px; gap: 8px; }
    .brand { gap: 7px; min-width: 0; }
    .brand strong { font-size: .9rem; }
    .brand small { font-size: .55rem; }
    .beta-badge { font-size: .6rem; padding: 5px; }
    .account { width: 100%; justify-content: space-between; }
    .account span { display: block; font-size: .72rem; }
    .menu-button { min-width: 44px; min-height: 44px; }
    [data-menu].open { display: grid; grid-template-columns: 1fr 1fr; max-height: 55dvh; overflow-y: auto; }
    [data-menu] a { padding: 13px 10px; min-height: 44px; }
    h1 { font-size: clamp(1.5rem, 6.5vw, 2rem); line-height: 1.2; }
    .heading-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    input:not([type=checkbox]):not([type=hidden]), select, textarea { font-size: 16px; min-width: 0; width: 100%; }
    input:not([type=checkbox]):not([type=hidden]), select { min-height: 48px; }
    input[type=checkbox] { width: 22px; height: 22px; vertical-align: middle; }
    .button, .tab-button { min-height: 48px; white-space: normal; }
    .link-button { min-height: 44px; }
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .date-chip { display: none; }
    .stat-card { min-height: 100px; padding: 14px; }
    .stat-card strong { font-size: 2rem; }
    .stat-card > span { font-size: .78rem; }
    .scanner-card { padding: 16px; }
    .panel-heading { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 16px; }
    .panel-heading > a { padding-block: 10px; }
    .table-wrap .mobile-cards, .mobile-cards tbody { display: block; width: 100%; }
    .mobile-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .mobile-cards tr { display: block; margin: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
    .mobile-cards td { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 7px 0; border: 0; white-space: normal; }
    .mobile-cards td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; flex-basis: 110px; }
    .mobile-cards td:first-child { padding-bottom: 12px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
    .mobile-cards td:first-child::before, .mobile-cards td[data-label='']::before { display: none; }
    .mobile-cards td > * { min-width: 0; max-width: 100%; }
    .mobile-cards .row-link { display: block; width: 100%; text-align: center; padding: 13px; background: #edf4fa; border-radius: 8px; }
    .machine-cell { min-width: 0; }
    .machine-grid { padding: 12px; gap: 12px; }
    .machine-card { display: grid; grid-template-columns: 80px minmax(0,1fr); align-items: start; }
    .machine-image { height: 90px; min-height: 0; margin: 12px 0 12px 12px; border-radius: 10px; }
    .machine-card-body { padding: 12px; }
    .machine-card-body h3 { font-size: 1rem; }
    .machine-card-body .status { font-size: .65rem; white-space: normal; }
    .detail-grid > *, .action-column, .catalog-detail-grid > * { min-width: 0; }
    .machine-profile { padding: 16px; }
    .profile-image { min-height: 140px; max-height: 180px; }
    .profile-image img { height: 180px; }
    .mobile-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 16px; }
    .mobile-shortcuts a { background: #e7f0f7; border-radius: 10px; padding: 14px 12px; font-size: .8rem; font-weight: 700; }
    .quick-page { display: flex; flex-direction: column; }
    .quick-page .page-heading { order: 0; margin-bottom: 12px; }
    .quick-page .quick-panel { order: 1; margin-top: 0; }
    .quick-page .scan-workflow { order: 2; }
    .quick-page .compact-panel { order: 3; }
    .quick-panel .quick-icon { display: none; }
    .camera-form { margin-top: 16px; }
    .camera-button { min-height: 56px; width: 100%; }
    .data-list > div { grid-template-columns: minmax(95px,.8fr) minmax(0,1.2fr); gap: 8px; }
    .qr-box { flex-wrap: wrap; }
    .action-panel, .narrow-panel, .confirm-card, .quick-panel, .advisor-card { padding: 16px; }
    .advisor-card-head, .case-head { flex-wrap: wrap; }
    .stock-badge { white-space: normal; }
    .form-section { padding: 16px; }
    .form-actions { flex-wrap: wrap; gap: 10px; }
    .form-actions .button { flex: 1 1 130px; }
    .mobile-navigation { position: fixed; z-index: 90; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -5px 20px #05457812; }
    .mobile-navigation a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 55px; color: var(--blue); font-size: .68rem; font-weight: 700; border-radius: 10px; }
    .mobile-navigation span { font-size: 1.35rem; line-height: 1; }
    .mobile-navigation a[aria-current=page] { background: #e7f0f7; }
    .mobile-navigation a.mobile-scan { background: var(--yellow); color: #12394e; }
    .login-page { padding-bottom: 24px; min-height: 100dvh; }
}
@media print {
    .mobile-navigation { display: none !important; }
    .topbar, .action-column, .back-link, .heading-actions, .timeline-panel { display: none !important; }
    body, .page { background: white; }
    .detail-grid { display: block; }
    .machine-profile { border: 0; box-shadow: none; }
}
