:root {
    --grahneis-blue: #12477f;
    --grahneis-blue-dark: #0a315d;
    --app-bg: #f5f7fb;
    --app-border: #dbe3ee;
    --app-text: #182536;
    --app-muted: #607086;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
}

.app-body {
    min-height: 100vh;
}

.app-navbar {
    box-shadow: 0 1px 10px rgba(19, 42, 72, 0.05);
}

.app-brand {
    align-items: center;
    display: flex;
    min-height: 48px;
    padding-bottom: 0;
    padding-top: 0;
}

.app-brand img {
    display: block;
    height: 42px;
    width: auto;
}

.user-area {
    color: var(--app-text);
}

.user-name {
    color: #2e3a49;
    font-size: 0.95rem;
    font-weight: 600;
}

.app-main {
    padding-bottom: 48px;
    padding-top: 36px;
}

.page-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.app-card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(19, 42, 72, 0.07);
}

.btn-primary {
    --bs-btn-bg: var(--grahneis-blue);
    --bs-btn-border-color: var(--grahneis-blue);
    --bs-btn-hover-bg: var(--grahneis-blue-dark);
    --bs-btn-hover-border-color: var(--grahneis-blue-dark);
    --bs-btn-active-bg: var(--grahneis-blue-dark);
    --bs-btn-active-border-color: var(--grahneis-blue-dark);
}

.btn {
    border-radius: 6px;
    font-weight: 600;
}

.app-table thead th {
    background: #f0f4f9;
    color: var(--app-muted);
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-table td,
.app-table th {
    padding: 0.95rem 1rem;
}

.dashboard-toolbar {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.dashboard-search {
    flex: 1 1 auto;
    max-width: 760px;
}

.dashboard-search .input-group {
    flex-wrap: wrap;
}

.dashboard-search .form-control {
    min-width: 260px;
}

.empty-state {
    align-items: center;
    background: #ffffff;
    border: 1px dashed #b9c6d8;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 260px;
    padding: 40px 24px;
    text-align: center;
}

.form-card {
    max-width: 860px;
}

.form-label {
    color: #405066;
    font-weight: 700;
}

.form-control {
    border-color: #c8d2df;
    border-radius: 6px;
    min-height: 44px;
}

.form-control:focus {
    border-color: var(--grahneis-blue);
    box-shadow: 0 0 0 0.2rem rgba(18, 71, 127, 0.14);
}

.detail-card {
    max-width: 900px;
}

.detail-list dt,
.detail-list dd {
    border-bottom: 1px solid #edf1f5;
    margin-bottom: 0;
    padding-bottom: 14px;
    padding-top: 14px;
}

.detail-list dt {
    color: var(--app-muted);
    font-weight: 700;
}

.detail-list dd {
    overflow-wrap: anywhere;
}

.detail-qr {
    display: block;
    height: 160px;
    width: 160px;
}

.detail-list dt:last-of-type,
.detail-list dd:last-of-type {
    border-bottom: 0;
}

.confirm-card,
.login-card {
    margin-left: auto;
    margin-right: auto;
    max-width: 520px;
}

.login-shell {
    display: grid;
    min-height: calc(100vh - 156px);
    place-items: center;
}

.login-logo,
.public-logo {
    display: block;
    height: 46px;
    margin-bottom: 22px;
    width: auto;
}

.public-body {
    background: linear-gradient(180deg, #ffffff 0, var(--app-bg) 100%);
    min-height: 100vh;
}

.public-page {
    max-width: 760px;
    padding-bottom: 48px;
    padding-top: 48px;
}

.public-card {
    box-shadow: 0 18px 42px rgba(19, 42, 72, 0.08);
}

.public-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.public-qr-block {
    margin: 0 auto;
    max-width: 320px;
}

.pin-card {
    margin-left: auto;
    margin-right: auto;
    max-width: 520px;
}

.pin-input {
    font-size: 1.35rem;
    letter-spacing: 0.12em;
    text-align: center;
}

.pin-alert {
    border-color: #f1cf75;
    max-width: 900px;
}

.pin-display {
    color: #111827;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    margin: 8px 0;
}

.label-page {
    background: #ffffff;
    min-height: 100vh;
    padding: 24px;
}

.label {
    align-items: center;
    background: #ffffff;
    border: 2px solid #17202a;
    display: flex;
    justify-content: center;
    margin: 0 auto 18px;
    max-width: 560px;
    min-height: 310px;
    padding: 24px;
}

.label-content {
    align-items: center;
    display: grid;
    gap: 22px;
    grid-template-columns: auto 1fr;
    width: 100%;
}

.label-qr {
    width: auto;
}

.label-qr img {
    height: 220px;
    width: 220px;
}

.label-info {
    color: #111827;
    display: grid;
    gap: 14px;
    min-width: 0;
}

.label-info span {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.label-info strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.qr-block {
    align-items: center;
    display: grid;
    gap: 12px;
    justify-items: center;
    width: 100%;
}

.qr-block img {
    display: block;
    height: 220px;
    width: 220px;
}

.qr-block small {
    color: var(--app-muted);
    font-size: 0.72rem;
    overflow-wrap: anywhere;
    text-align: center;
}

.print-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.app-footer {
    color: var(--app-muted);
    font-size: 0.85rem;
    padding: 24px 0;
}

.app-footer .container-xl {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: center;
    text-align: center;
}

.app-footer a {
    color: var(--grahneis-blue);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 767.98px) {
    .app-main {
        padding-top: 24px;
    }

    .app-brand img {
        height: 36px;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-toolbar > .btn {
        width: 100%;
    }

    .page-heading .btn,
    .page-heading > .d-flex {
        width: 100%;
    }

    .page-heading > .d-flex .btn {
        flex: 1 1 auto;
    }

    .user-area {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 8px !important;
        margin-top: 12px;
    }

    .detail-list dt {
        border-bottom: 0;
        padding-bottom: 2px;
    }

    .detail-list dd {
        padding-top: 2px;
    }

    .label-page {
        padding: 16px;
    }

    .label-content {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .label-info {
        text-align: center;
    }
}

@media print {
    @page {
        margin: 10mm;
    }

    body,
    .label-page {
        background: #ffffff;
        padding: 0;
    }

    .print-actions,
    .public-actions,
    .app-footer {
        display: none;
    }

    .label {
        box-shadow: none;
        margin: 0;
        page-break-inside: avoid;
    }
}
