:root {
    --color-primary: #1a73e8;
    --color-success: #34a853;
    --color-warning: #f9ab00;
    --color-danger: #ea4335;
    --color-info: #4285f4;
    --color-surface: #ffffff;
    --color-bg: #f8f9fa;
    --color-text: #202124;
    --color-muted: #5f6368;
    --shadow-soft: 0 18px 50px rgba(26, 115, 232, 0.08);
    --radius-lg: 24px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(26, 115, 232, 0.12), transparent 32%),
        radial-gradient(circle at top right, rgba(52, 168, 83, 0.08), transparent 28%),
        var(--color-bg);
    color: var(--color-text);
}

.app-navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(32, 33, 36, 0.08);
}

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

.auth-shell {
    width: min(100%, 460px);
}

.auth-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 28px;
    padding: 2rem;
    border: 1px solid rgba(26, 115, 232, 0.12);
}

.auth-card__top {
    padding-bottom: 0.75rem;
}

.auth-badge,
.eyebrow,
.scan-zone__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(26, 115, 232, 0.1);
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.scanner-shell {
    max-width: 1600px;
    margin: 0 auto;
}

.scanner-hero,
.card,
.result-card {
    border-radius: var(--radius-lg);
}

.scanner-top-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

.meta-card {
    min-width: 150px;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.08), rgba(66, 133, 244, 0.16));
}

.meta-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    margin-bottom: 0.2rem;
}

.method-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.method-tab {
    border: 1px solid rgba(32, 33, 36, 0.1);
    border-radius: 18px;
    background: #fff;
    min-height: 56px;
    padding: 0.95rem 1rem;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.method-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.scan-panel {
    display: none;
}

.scan-panel.is-active {
    display: block;
}

.scan-zone {
    min-height: 220px;
    padding: 1.5rem;
    border-radius: 26px;
    border: 2px dashed rgba(26, 115, 232, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.96));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.scan-zone.ready-state::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid rgba(52, 168, 83, 0.2);
    animation: pulseBorder 1.8s infinite;
}

.scan-zone.is-busy::after {
    animation-duration: 0.8s;
}

.scan-zone__content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.scan-hint {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--color-primary);
}

.scanner-hidden-input {
    position: absolute;
    inset: auto;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.camera-zone {
    justify-content: flex-start;
}

.camera-scanner-frame {
    min-height: 320px;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    background: #111827;
}

.camera-help {
    width: min(100%, 300px);
}

.result-card {
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(32, 33, 36, 0.08);
    min-height: 140px;
    animation: resultEnter 0.28s ease;
}

.result-card__body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
}

.result-card__body p {
    color: var(--color-muted);
}

.result-icon {
    width: 72px;
    min-width: 72px;
    height: 72px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: rgba(26, 115, 232, 0.08);
}

.result-card--success {
    border-color: rgba(52, 168, 83, 0.18);
    background: linear-gradient(135deg, rgba(52, 168, 83, 0.08), #fff 44%);
}

.result-card--success .result-icon {
    background: rgba(52, 168, 83, 0.12);
}

.result-card--warning {
    border-color: rgba(249, 171, 0, 0.2);
    background: linear-gradient(135deg, rgba(249, 171, 0, 0.08), #fff 44%);
}

.result-card--warning .result-icon {
    background: rgba(249, 171, 0, 0.12);
}

.result-card--error {
    border-color: rgba(234, 67, 53, 0.2);
    background: linear-gradient(135deg, rgba(234, 67, 53, 0.08), #fff 44%);
}

.result-card--error .result-icon {
    background: rgba(234, 67, 53, 0.12);
}

.result-card--info {
    border-color: rgba(26, 115, 232, 0.2);
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.08), #fff 44%);
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.result-meta > * {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(32, 33, 36, 0.06);
    font-size: 0.92rem;
}

.recent-scans-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.recent-scan-card {
    border-radius: 22px;
    padding: 1rem;
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.84));
    border: 1px solid rgba(32, 33, 36, 0.08);
    min-height: 132px;
}

.recent-scan-card__name {
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.recent-scan-card__sap,
.recent-scan-card__time {
    color: var(--color-muted);
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
}

.success-checkmark {
    width: 52px;
    height: 52px;
}

.success-checkmark__circle,
.success-checkmark__check {
    stroke: var(--color-success);
    stroke-linecap: round;
    stroke-width: 3;
    stroke-miterlimit: 10;
}

.success-checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: drawCircle 0.6s ease forwards;
}

.success-checkmark__check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: drawCheck 0.4s ease 0.4s forwards;
}

.table-modern thead th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    border-bottom-width: 1px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-chip--checked {
    background: rgba(52, 168, 83, 0.12);
    color: var(--color-success);
}

.status-chip--pending {
    background: rgba(249, 171, 0, 0.12);
    color: #8a6100;
}

.status-chip--blank {
    background: rgba(26, 115, 232, 0.12);
    color: var(--color-primary);
}

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

.summary-card {
    border-radius: 24px;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.08), rgba(255, 255, 255, 0.94));
    border: 1px solid rgba(32, 33, 36, 0.08);
}

.summary-label {
    color: var(--color-muted);
    font-size: 0.85rem;
}

.summary-value {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
}

.feed-list {
    display: grid;
    gap: 0.75rem;
}

.feed-item {
    border: 1px solid rgba(32, 33, 36, 0.08);
    border-radius: 18px;
    padding: 0.9rem 1rem;
    background: #fff;
}

.search-result-list {
    display: grid;
    gap: 0.75rem;
}

.search-result-item {
    border-radius: 18px;
    background: rgba(248, 249, 250, 0.9);
    padding: 0.9rem 1rem;
}

@keyframes pulseBorder {
    0% {
        opacity: 0.25;
        transform: scale(0.985);
    }
    50% {
        opacity: 0.9;
        transform: scale(1);
    }
    100% {
        opacity: 0.25;
        transform: scale(0.985);
    }
}

@keyframes resultEnter {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

@media (max-width: 991.98px) {
    .method-tabs,
    .summary-grid {
        grid-template-columns: 1fr;
    }

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

    .result-icon {
        width: 64px;
        min-width: 64px;
        height: 64px;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.98rem;
    }

    .scan-zone {
        min-height: 200px;
        padding: 1.1rem;
    }

    .camera-scanner-frame {
        min-height: 280px;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .form-control,
    .form-select {
        font-size: 16px;
    }
}
