* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #172033;
}

a {
    color: #4f46e5;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: white;
    border-bottom: 1px solid #e1e5ef;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-size: 22px;
    font-weight: 800;
    color: #172033;
}

.topbar nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 34px auto;
}

.narrow {
    max-width: 720px;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 24px;
    align-items: center;
    padding: 44px;
}

.auth-hero {
    background: linear-gradient(135deg, #172033, #303a59);
    color: white;
    border-radius: 30px;
    padding: 48px;
    min-height: 460px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-hero h1 {
    font-size: clamp(42px, 6vw, 76px);
    line-height: 0.95;
    margin: 10px 0 18px;
}

.auth-hero p {
    max-width: 680px;
    color: #d8ddec;
}

.auth-panel {
    min-height: 320px;
}

.hero {
    background: linear-gradient(135deg, #172033, #303a59);
    color: white;
    border-radius: 28px;
    padding: 44px;
    margin-bottom: 28px;
    box-shadow: 0 18px 45px rgba(23, 32, 51, 0.16);
}

.hero h1 {
    font-size: clamp(34px, 5vw, 64px);
    line-height: 0.98;
    margin: 10px 0 18px;
    max-width: 900px;
}

.hero .muted {
    color: #d8ddec;
    max-width: 760px;
}

.signed-in {
    color: #c7d2fe;
    font-size: 14px;
    margin-top: 18px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 18px;
}

.dash-card,
.panel,
.spool-card,
.empty {
    background: white;
    border: 1px solid #e1e5ef;
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
}

.dash-card {
    color: inherit;
    min-height: 210px;
}

.dash-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.primary-card {
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #ffffff, #eef2ff);
}

.dash-card h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.button-fake,
.button-link,
button {
    display: inline-block;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 18px;
    background: #4f46e5;
    color: white;
    font-weight: 700;
    cursor: pointer;
    font: inherit;
}

.button-fake:hover,
.button-link:hover,
button:hover {
    text-decoration: none;
    background: #4338ca;
}

h1, h2 {
    margin-top: 0;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    font-weight: 700;
    color: #6366f1;
}

.hero .eyebrow,
.auth-hero .eyebrow {
    color: #a5b4fc;
}

.muted {
    color: #697386;
}

.small {
    font-size: 14px;
    color: #697386;
}

label {
    display: block;
    font-weight: 700;
    margin: 16px 0 6px;
}

input, select, textarea {
    width: 100%;
    border: 1px solid #d5dae7;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #e0e7ff;
    border-color: #6366f1;
}

.alert {
    background: #fff1f2;
    color: #9f1239;
    border: 1px solid #fecdd3;
    padding: 14px;
    border-radius: 12px;
    margin: 14px 0 24px;
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.spool-card {
    padding: 22px;
}

.card-top {
    margin-bottom: 12px;
}

.main-line {
    font-weight: 700;
}

.badge {
    display: inline-block;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    margin: 0 0 10px;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    font-weight: 700;
}

.danger-link {
    color: #b91c1c;
}

.empty {
    border-style: dashed;
    text-align: center;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 22px;
}

.details {
    display: grid;
    gap: 12px;
    margin: 22px 0;
}

.details div {
    display: grid;
    grid-template-columns: 150px 1fr;
    border-bottom: 1px solid #edf0f6;
    padding-bottom: 10px;
}

dt {
    font-weight: 800;
    color: #697386;
}

dd {
    margin: 0;
}

.qr-panel {
    text-align: center;
}

.qr {
    width: 300px;
    height: 300px;
    max-width: 100%;
    border: 1px solid #e1e5ef;
    border-radius: 16px;
    padding: 10px;
    background: white;
}

.qr-actions {
    display: grid;
    gap: 10px;
}

@media print {
    body {
        background: white;
    }

    .topbar,
    .panel:first-child,
    .qr-actions,
    .small {
        display: none;
    }

    .container,
    .two-col {
        display: block;
        width: 100%;
        margin: 0;
    }

    .qr-panel {
        box-shadow: none;
        border: none;
    }

    .qr {
        width: 75mm;
        height: 75mm;
    }
}

@media (max-width: 980px) {
    .dashboard-grid,
    .two-col,
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .topbar {
        padding: 0 16px;
    }

    .topbar nav {
        gap: 10px;
        font-size: 14px;
    }

    .hero,
    .auth-page,
    .auth-hero {
        padding: 24px;
    }

    .page-head {
        align-items: start;
        flex-direction: column;
    }

    .details div {
        grid-template-columns: 1fr;
    }
}
