:root {
    --csam-shell: #1e2f4e;
    --csam-shell-soft: #2f405f;
    --csam-accent: #13bdc3;
    --csam-accent-text: #05212a;
    --csam-focus: #ffbf47;
    --csam-bg: #e9f7f9;
    --csam-panel: #faf9f6;
    --csam-panel-soft: #f8fafc;
    --csam-border: #d3e4ea;
    --csam-text: #071c38;
    --csam-muted: #5f6f88;
    --csam-warn: #a86404;
    --csam-danger: #aa1111;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: var(--csam-bg);
    color: var(--csam-text);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-synthesis: none;
}

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

button,
a,
input,
select,
textarea {
    border-radius: 6px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--csam-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.26);
}

a {
    color: #086b7c;
}

.csam-app-root {
    min-height: 100vh;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 520px);
    gap: 32px;
    align-items: center;
    padding: clamp(24px, 5vw, 72px);
    background:
        linear-gradient(135deg, rgba(30, 47, 78, 0.96), rgba(30, 47, 78, 0.78)),
        linear-gradient(90deg, #1e2f4e, #13bdc3);
}

.login-hero {
    color: #fff;
    max-width: 760px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--csam-accent);
    color: var(--csam-accent-text);
    font-weight: 900;
    font-size: 24px;
}

.brand-lockup strong {
    display: block;
    font-size: 18px;
    line-height: 1.15;
}

.brand-lockup span {
    display: block;
    color: #c9e6f2;
    font-size: 13px;
    line-height: 1.3;
}

.login-hero h1 {
    margin: 56px 0 18px;
    max-width: 760px;
    font-size: clamp(44px, 7vw, 82px);
    line-height: 0.96;
    font-weight: 850;
}

.login-hero p {
    max-width: 660px;
    color: #e9f7f9;
    font-size: 20px;
    line-height: 1.55;
}

.login-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 720px;
    margin: 40px 0 0;
}

.login-points div,
.login-card,
.panel {
    border: 1px solid rgba(211, 228, 234, 0.86);
    background: var(--csam-panel);
    box-shadow: 0 20px 44px rgba(7, 28, 56, 0.12);
}

.login-points div {
    padding: 18px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.login-points dt {
    font-size: 14px;
    font-weight: 850;
}

.login-points dd {
    margin: 6px 0 0;
    color: #d9f1fb;
    font-size: 13px;
}

.login-card {
    padding: 34px;
    border-radius: 8px;
}

.login-card h2,
.panel h1,
.panel h2 {
    margin: 0;
    color: var(--csam-text);
    line-height: 1.1;
    font-weight: 850;
}

.login-card h2 {
    font-size: 30px;
}

.login-card p,
.panel-heading p,
.photo-panel p {
    margin: 8px 0 0;
    color: var(--csam-muted);
    line-height: 1.45;
}

.stack-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.stack-form label,
.form-grid label {
    display: grid;
    gap: 7px;
}

.stack-form label span,
.form-grid label span {
    color: var(--csam-muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--csam-border);
    background: #fff;
    color: var(--csam-text);
    padding: 11px 12px;
    min-height: 44px;
}

textarea {
    resize: vertical;
}

.primary-action,
.secondary-action,
.quiet-button {
    min-height: 42px;
    border: 1px solid transparent;
    padding: 10px 16px;
    font-weight: 850;
    cursor: pointer;
}

.primary-action {
    background: var(--csam-accent);
    color: var(--csam-accent-text);
}

.secondary-action {
    border-color: var(--csam-border);
    background: #fff;
    color: var(--csam-text);
}

.danger-action {
    border-color: #f5b8b8;
    color: var(--csam-danger);
}

.quiet-button {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.quiet-button.dark {
    border-color: var(--csam-border);
    background: var(--csam-shell);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.form-message,
.error-banner {
    border: 1px solid #ffd2d2;
    background: #fff1f1;
    color: var(--csam-danger);
}

.form-message,
.status-banner,
.error-banner,
.loading-panel {
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 750;
}

.demo-credentials {
    display: grid;
    gap: 4px;
    margin-top: 22px;
    border-top: 1px solid var(--csam-border);
    padding-top: 16px;
    color: var(--csam-muted);
    font-size: 13px;
}

.login-alternate {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13px;
}

.signup-shell .login-card {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.signup-complete {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.signup-complete p {
    margin: 0;
}

.signup-details {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--csam-border);
    background: var(--csam-panel-soft);
}

.signup-details div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.signup-details dt {
    color: var(--csam-muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.signup-details dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 750;
}

.signup-link {
    display: block;
    text-align: center;
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
}

.console-shell {
    background: #f4f7fb;
}

.app-header {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(360px, 620px) auto;
    gap: 18px;
    align-items: center;
    padding: 18px 24px;
    background: var(--csam-shell);
    color: #fff;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.header-stats div {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    padding: 10px 12px;
}

.header-stats strong {
    display: block;
    font-size: 22px;
    line-height: 1;
}

.header-stats span,
.user-strip span {
    color: #d9f1fb;
    font-size: 12px;
    font-weight: 800;
}

.user-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.section-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 24px;
    border-bottom: 1px solid var(--csam-border);
    background: #fff;
}

.section-tabs button {
    border: 1px solid var(--csam-border);
    background: #fff;
    color: var(--csam-text);
    padding: 10px 15px;
    font-weight: 850;
    white-space: nowrap;
}

.section-tabs button.active {
    border-color: var(--csam-accent);
    background: #eefeff;
}

.status-banner {
    margin: 16px 24px 0;
    border: 1px solid #a8e9ed;
    background: #effeff;
    color: #074d70;
}

.error-banner {
    margin: 16px 24px 0;
}

.loading-panel {
    margin: 24px;
    border: 1px solid var(--csam-border);
    background: #fff;
}

.work-grid {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.sign-in-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
}

.admin-grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.delivery-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.panel {
    border-radius: 8px;
    padding: 20px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.panel-heading.compact {
    margin-bottom: 14px;
}

.panel h1 {
    font-size: 30px;
}

.panel h2 {
    font-size: 21px;
}

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

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

.wide-field {
    grid-column: 1 / -1;
}

.terms-box {
    margin-top: 18px;
    border: 1px solid var(--csam-border);
    border-radius: 8px;
    background: var(--csam-panel-soft);
    padding: 16px;
}

.terms-box div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.terms-box p {
    max-height: 138px;
    overflow: auto;
    margin: 12px 0;
    color: var(--csam-text);
    line-height: 1.55;
}

.terms-box .privacy-note {
    max-height: 84px;
    border-left: 3px solid var(--csam-accent);
    padding-left: 12px;
    color: var(--csam-muted);
}

.check-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 750;
}

.lookup-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    border: 1px solid #c7edf0;
    border-radius: 8px;
    background: #f3fdfe;
    padding: 12px;
}

.lookup-strip span {
    color: var(--csam-muted);
    font-size: 14px;
    font-weight: 750;
}

.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--csam-muted);
    font-size: 13px;
    line-height: 1.35;
}

.check-row input {
    width: 18px;
    min-height: 18px;
    margin-top: 3px;
}

.form-actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
}

.button-row.inline {
    margin-top: 0;
    justify-content: flex-end;
}

.photo-panel {
    align-self: start;
}

.camera-wrap {
    position: relative;
}

.camera-frame,
.photo-preview {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--csam-border);
    border-radius: 8px;
    background: #d8e6f2;
    object-fit: cover;
}

.photo-preview {
    margin-top: 12px;
}

.photo-required {
    display: block;
    margin-top: 12px;
    color: #8a3917;
    font-weight: 800;
    line-height: 1.35;
}

.photo-saved {
    display: block;
    margin-top: 10px;
    color: #0f766e;
    font-weight: 850;
    line-height: 1.35;
}

.pass-panel {
    margin: 0 24px 24px;
}

.badge-pass {
    width: min(100%, 86mm);
    height: 54mm;
    border: 1px solid var(--csam-shell);
    border-radius: 4px;
    background: #fff;
    padding: 3mm;
    color: #071c38;
    box-sizing: border-box;
    overflow: hidden;
}

.badge-pass .brand {
    background: var(--badge-accent, var(--csam-shell));
    color: var(--badge-accent-text, #fff);
    padding: 1.6mm 2mm;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 850;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-pass-body {
    display: grid;
    grid-template-columns: 18mm minmax(0, 1fr) 26mm;
    gap: 2.5mm;
    align-items: start;
    margin-top: 2.4mm;
}

.badge-photo-slot,
.badge-main {
    min-width: 0;
}

.badge-photo {
    width: 18mm;
    height: 24mm;
    border: 1px solid var(--csam-border);
    border-radius: 3px;
    object-fit: cover;
    background: #d8e6f2;
}

.badge-photo.fallback {
    display: grid;
    place-items: center;
    background: var(--badge-accent, var(--csam-accent));
    color: var(--badge-accent-text, var(--csam-accent-text));
    font-size: 15px;
    font-weight: 900;
}

.badge-pass .number {
    margin: 0 0 0.8mm;
    font-size: 7px;
    font-weight: 850;
    line-height: 1;
    color: #4b5b70;
}

.badge-pass .name {
    font-size: 11px;
    font-weight: 850;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.badge-pass .meta {
    margin-top: 0.8mm;
    font-size: 6.2px;
    line-height: 1.2;
}

.badge-fields {
    display: grid;
    grid-template-columns: 13mm minmax(0, 1fr);
    gap: 0.6mm 1.4mm;
    margin-top: 1.3mm;
}

.badge-fields span {
    color: #69778a;
    font-size: 5.3px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
    text-transform: uppercase;
}

.badge-fields strong {
    min-width: 0;
    font-size: 6.2px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-qr-slot {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 0.9mm;
    min-width: 0;
}

.badge-qr {
    width: 26mm;
    height: 26mm;
    display: block;
    box-sizing: border-box;
    padding: 0.8mm;
    border: 1px solid var(--csam-border);
    border-radius: 2px;
    background: #fff;
    object-fit: contain;
    image-rendering: crisp-edges;
}

.badge-qr-slot strong,
.badge-qr-slot span {
    display: block;
    max-width: 100%;
    text-align: center;
}

.badge-qr-slot span {
    color: var(--csam-muted);
    font-size: 4.8px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.badge-qr-slot strong {
    font-size: 6.2px;
    line-height: 1.1;
}

.badge-pass .footer {
    margin-top: 1.1mm;
    padding-top: 0.9mm;
    border-top: 1px solid var(--csam-border);
    color: var(--csam-muted);
    font-size: 5.5px;
    line-height: 1.15;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--csam-border);
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--csam-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.compact-table td {
    font-size: 14px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 850;
}

.status-pill.good {
    background: #e8fbff;
    color: #074d70;
}

.status-pill.warn {
    background: #fff7df;
    color: var(--csam-warn);
}

.expected-list,
.supplier-grid {
    display: grid;
    gap: 12px;
}

.expected-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.7fr) minmax(160px, 0.7fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--csam-border);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.expected-row strong,
.expected-row span {
    display: block;
}

.expected-row span {
    color: var(--csam-muted);
    font-size: 13px;
}

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

.supplier-card {
    border: 1px solid var(--csam-border);
    border-radius: 8px;
    background: #fff;
    padding: 18px;
}

.supplier-card h2 {
    margin-bottom: 6px;
}

.supplier-card p {
    color: var(--csam-text);
    font-weight: 750;
}

.supplier-card span {
    display: block;
    color: var(--csam-muted);
    line-height: 1.5;
}

.supplier-card a {
    display: inline-block;
    margin-top: 12px;
    font-weight: 850;
}

.kiosk-welcome {
    --tenant-accent: #f5c400;
    --tenant-accent-text: #071c38;
    --welcome-image: url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80");
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    color: #fff;
    background-image:
        linear-gradient(90deg, rgba(5, 12, 20, 0.68), rgba(5, 12, 20, 0.2) 55%, rgba(5, 12, 20, 0.55)),
        var(--welcome-image);
    background-size: cover;
    background-position: center;
}

.kiosk-welcome-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 42%, rgba(0, 0, 0, 0.34)),
        linear-gradient(90deg, color-mix(in srgb, var(--tenant-accent) 76%, transparent), transparent 48%);
    opacity: 0.86;
}

.kiosk-topbar,
.kiosk-hero,
.kiosk-bottom-nav,
.kiosk-welcome .status-banner,
.kiosk-welcome .error-banner {
    position: relative;
    z-index: 1;
}

.kiosk-topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: clamp(20px, 4vw, 42px);
}

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

.kiosk-brand img,
.brand-preview img {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.92);
    padding: 7px;
}

.kiosk-brand span,
.brand-preview span {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--csam-text);
    font-weight: 900;
}

.kiosk-brand strong {
    overflow-wrap: anywhere;
    font-size: clamp(18px, 2.2vw, 28px);
    line-height: 1.05;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

.kiosk-clock {
    text-align: right;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

.kiosk-clock strong {
    display: block;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 300;
    line-height: 1;
}

.kiosk-clock span {
    display: block;
    margin-top: 8px;
    font-weight: 750;
}

.kiosk-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
    gap: clamp(24px, 5vw, 72px);
    align-items: center;
    padding: 24px clamp(24px, 8vw, 120px) 110px;
}

.kiosk-copy {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 24px;
}

.kiosk-copy h1 {
    margin: 0;
    max-width: 880px;
    font-size: clamp(72px, 12vw, 156px);
    line-height: 0.9;
    font-weight: 250;
    text-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.kiosk-copy p {
    max-width: 720px;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(18px, 2.4vw, 30px);
    line-height: 1.35;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.kiosk-primary {
    display: inline-flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    min-width: min(420px, 86vw);
    min-height: 82px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--tenant-accent-text);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
    padding: 18px 34px;
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 400;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.kiosk-primary span:last-child {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tenant-accent);
    color: var(--tenant-accent-text);
    font-size: 20px;
    font-weight: 900;
}

.kiosk-qr {
    align-self: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.72);
    padding: 14px;
    text-align: center;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.kiosk-qr strong {
    display: block;
    margin-bottom: 10px;
    font-size: 17px;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    width: 150px;
    aspect-ratio: 1;
    background: #fff;
    padding: 10px;
}

.qr-grid span {
    background: #fff;
}

.qr-grid span.on {
    background: #050505;
}

.kiosk-bottom-nav {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
}

.kiosk-bottom-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 86px;
    border: 0;
    border-radius: 0;
    background: rgba(5, 20, 28, 0.58);
    color: #fff;
    cursor: pointer;
}

.kiosk-bottom-nav button:hover {
    background: rgba(5, 20, 28, 0.76);
}

.nav-symbol {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
}

.kiosk-bottom-nav strong {
    font-size: clamp(15px, 2vw, 23px);
    font-weight: 500;
}

.kiosk-welcome .status-banner,
.kiosk-welcome .error-banner {
    position: absolute;
    left: clamp(20px, 4vw, 44px);
    right: clamp(20px, 4vw, 44px);
    bottom: 104px;
    margin: 0;
}

.white-label-panel {
    margin: 24px 24px 0;
}

.brand-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 18px;
    align-items: stretch;
}

.brand-editor input[type="file"] {
    border: 1px solid var(--csam-border);
    background: #fff;
    padding: 9px;
    min-height: 44px;
}

.brand-preview {
    --preview-image: url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=900&q=80");
    display: grid;
    align-content: end;
    gap: 10px;
    min-height: 320px;
    border-radius: 8px;
    padding: 18px;
    color: #fff;
    background-image:
        linear-gradient(35deg, color-mix(in srgb, var(--tenant-accent) 70%, rgba(0, 0, 0, 0.55)), rgba(0, 0, 0, 0.08)),
        var(--preview-image);
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 -120px 90px rgba(0, 0, 0, 0.32);
}

.brand-preview strong,
.brand-preview em {
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.35);
}

.brand-preview strong {
    font-size: 24px;
    line-height: 1.1;
}

.brand-preview em {
    font-size: 38px;
    font-style: normal;
    font-weight: 250;
}

.visitor-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.visitor-out-self-service {
    max-width: 760px;
}

.qr-signout-panel {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 22px;
    align-items: center;
}

.qr-camera-wrap {
    position: relative;
    min-height: 260px;
}

.qr-camera,
.qr-camera-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--csam-border);
    border-radius: 8px;
    background: #10243f;
    object-fit: cover;
}

.qr-camera-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.78);
    font-size: 54px;
    font-weight: 900;
}

.qr-camera-wrap::after {
    content: "";
    position: absolute;
    inset: 18%;
    border: 3px solid var(--csam-accent);
    border-radius: 8px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.qr-signout-copy h2 {
    margin: 0 0 8px;
    font-size: 26px;
}

.qr-signout-copy p {
    color: var(--csam-muted);
    line-height: 1.5;
}

.manual-toggle {
    margin-top: 18px;
}

.manual-signout {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--csam-border);
}

.manual-signout.open {
    display: block;
}

.visitor-out-card,
.empty-state {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--csam-border);
    border-radius: 8px;
    background: #fff;
    padding: 16px;
}

.visitor-out-card strong,
.visitor-out-card span,
.visitor-out-card small,
.empty-state strong,
.empty-state span {
    display: block;
}

.visitor-out-card small,
.empty-state span,
.microcopy {
    color: var(--csam-muted);
    line-height: 1.35;
}

.wide-copy {
    grid-column: 1 / -1;
    margin: 0;
}

.avatar-dot {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--csam-accent);
    color: var(--csam-accent-text);
    font-weight: 900;
}

.avatar-dot.small {
    width: 38px;
    height: 38px;
    font-size: 12px;
}

.employee-name {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    font-weight: 800;
}

.metric-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.metric-list div {
    border: 1px solid var(--csam-border);
    border-radius: 8px;
    background: #fff;
    padding: 16px;
}

.metric-list dt {
    font-size: 34px;
    line-height: 1;
    font-weight: 850;
}

.metric-list dd {
    margin: 6px 0 0;
    color: var(--csam-muted);
    font-weight: 750;
}

.empty-state {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff1f1;
    border-top: 1px solid #ffd2d2;
    color: var(--csam-danger);
    padding: 12px 16px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
    font-weight: 850;
}

@media (max-width: 980px) {
    .login-shell,
    .app-header,
    .sign-in-grid,
    .admin-grid,
    .supplier-grid,
    .delivery-grid,
    .qr-signout-panel,
    .brand-editor,
    .kiosk-hero {
        grid-template-columns: 1fr;
    }

    .login-shell {
        padding: 24px;
    }

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

    .work-grid {
        padding: 16px;
    }

    .pass-panel {
        margin: 0 16px 16px;
    }

    .kiosk-hero {
        padding: 14px 24px 120px;
        justify-items: center;
    }

    .kiosk-qr {
        display: none;
    }

    .kiosk-bottom-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .kiosk-bottom-nav button {
        min-height: 74px;
    }
}

@media (max-width: 640px) {
    .login-points,
    .form-grid,
    .expected-row {
        grid-template-columns: 1fr;
    }

    .login-hero h1 {
        font-size: 42px;
    }

    .panel-heading,
    .form-actions {
        display: grid;
    }

    .app-header {
        padding: 16px;
    }

    .section-tabs {
        padding: 10px 16px;
    }

    .kiosk-topbar {
        align-items: flex-start;
        padding: 18px;
    }

    .kiosk-brand img,
    .kiosk-brand span {
        width: 46px;
        height: 46px;
    }

    .kiosk-copy h1 {
        font-size: 64px;
    }

    .kiosk-primary {
        min-height: 68px;
        min-width: min(340px, 88vw);
    }

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

    .visitor-out-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .visitor-out-card button {
        grid-column: 1 / -1;
    }

}
