* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f8faff;
    color: #081e56;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

nav {
    background: #082575;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    margin-right: 15px;
}

.brand {
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: bold;
}

main {
    max-width: 980px;
    margin: 30px auto 60px;
    padding: 0 16px;
}

h1 {
    font-family: Georgia, serif;
    font-size: clamp(27px, 5vw, 42px);
}

p {
    color: #52617b;
}

.eyebrow {
    color: #b28526;
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: bold;
}

.box,
.stats article {
    background: white;
    border: 1px solid #e3e7f2;
    border-radius: 18px;
    padding: 22px;
    margin: 18px 0;
    box-shadow: 0 4px 15px #0825750a;
}

.auth {
    max-width: 450px;
    margin: 60px auto;
}

label {
    display: block;
    font-weight: bold;
    margin: 12px 0;
}

input {
    font: inherit;
    padding: 12px;
    border: 1px solid #bdc6d9;
    border-radius: 8px;
    width: 100%;
    margin-top: 6px;
}

.primary,
.secondary,
button {
    font: inherit;
    cursor: pointer;
    border-radius: 10px;
    padding: 12px 17px;
    border: 0;
    display: inline-block;
    text-decoration: none;
    font-weight: bold;
}

.primary {
    background: #082b8a;
    color: white;
}

.secondary {
    background: #edf1ff;
    color: #082b8a;
}

.text-btn {
    background: transparent;
    color: white;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 22px 0;
}

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

.stats article {
    display: flex;
    flex-direction: column;
}

.stats b {
    font-size: 32px;
    color: #082b8a;
}

.stats span {
    font-size: 13px;
}

.hint {
    font-size: 14px;
    color: #69728c;
}

.inline {
    display: inline;
}

.result {
    text-align: center;
    padding: 35px 20px;
}

.good {
    border-top: 8px solid #13a66c;
}

.bad {
    border-top: 8px solid #d73f4c;
}

.large {
    margin: 20px 0;
    font-size: 20px;
    width: 100%;
    max-width: 420px;
}

.scanbox {
    max-width: 600px;
    margin: auto;
}

#reader {
    max-width: 550px;
    margin: auto;
}

.tablewrap {
    overflow: auto;
    background: white;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e5e9f2;
    text-align: left;
    padding: 10px;
}

th {
    background: #e9efff;
}

.rowform {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rowform input {
    min-width: 140px;
}

.rowform button {
    background: #e7edf9;
    color: #082b8a;
}

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

.label {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    border: 1px dotted #aaa;
    padding: 10px;
    background: white;
    break-inside: avoid;
}

.qr {
    width: 128px;
    height: 128px;
}

footer {
    text-align: center;
    color: #7b849d;
    font-size: 12px;
    padding: 24px;
}

@media(max-width:700px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    nav {
        padding: 15px;
    }

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

    .rowform {
        display: block;
    }
}

@media print {
    body {
        background: white;
    }

    nav,
    footer,
    .no-print {
        display: none !important;
    }

    main {
        margin: 0;
        max-width: none;
    }

    .labels {
        grid-template-columns: repeat(5, 1fr);
    }

    .label {
        border: 1px dotted #bbb;
        page-break-inside: avoid;
    }
}
