:root {
    --dam-navy: #1f3864;
    --dam-ink: #0b0b0b;
    --dam-muted: #898781;
    --dam-surface: #ffffff;
    --dam-grid: #e1e0d9;
}

html {
    font-size: 16px;
    position: relative;
    min-height: 100%;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--dam-ink);
}

/* Public registration shell: mobile first, one column, large tap targets. */
.public-shell {
    max-width: 560px;
}

.public-shell .card {
    border: 1px solid rgba(11, 11, 11, 0.10);
    border-radius: 12px;
}

.public-shell .form-label,
.public-shell .form-check-label {
    font-weight: 600;
}

/* 16px minimum prevents iOS Safari from zooming on focus. */
.public-shell .form-control,
.public-shell .form-select {
    font-size: 16px;
    min-height: 48px;
}

.public-shell .btn {
    font-size: 17px;
    min-height: 52px;
    font-weight: 600;
}

.public-shell .invalid-feedback {
    font-size: 14px;
}

/* The login card sizes itself. A Bootstrap .col-* here would subdivide the already
   narrow public shell: .col-lg-4 of that 560px container is 163px, which wrapped the
   product name onto three lines and gave the submit button 113px — worse than the
   phone layout, on a 1280px screen. One explicit width works at every size because
   it only ever shrinks. */
.login-shell {
    max-width: 420px;
    margin: 0 auto;
}

/* The one control used at the door, often one-handed on a phone. Sized to a real
   touch target instead of Bootstrap's 31px btn-sm. */
.btn-door {
    min-height: 44px;
    min-width: 96px;
    font-size: 15px;
    font-weight: 600;
}

.admin-shell {
    background: #f6f7f9;
}

/* The admin bar carries the same navy as the login rail, so the two read as one
   product. Bootstrap's near-black sat next to the blue wordmark and looked like a
   default rather than a brand. */
.admin-shell .navbar.bg-dark {
    background-color: var(--dam-navy) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.admin-shell .navbar-brand {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Bootstrap's #0d6efd is a vivid default that reads as "unstyled" beside the navy
   bar. Pin the primary action to the brand colour instead, and keep the states
   distinguishable: darker on hover, visibly darker on press. The public form keeps
   the same navy so a guest who scanned a poster sees the product they were shown. */
.admin-shell .btn-primary,
.public-shell .btn-primary {
    --bs-btn-bg: var(--dam-navy);
    --bs-btn-border-color: var(--dam-navy);
    --bs-btn-hover-bg: #172b4d;
    --bs-btn-hover-border-color: #172b4d;
    --bs-btn-active-bg: #10223f;
    --bs-btn-active-border-color: #10223f;
    --bs-btn-disabled-bg: var(--dam-navy);
    --bs-btn-disabled-border-color: var(--dam-navy);
}

/* Outline buttons that sit next to a primary action should not shout in a second
   accent colour either. */
.admin-shell .btn-outline-success {
    --bs-btn-color: #1a6b3c;
    --bs-btn-border-color: #b7d5c4;
    --bs-btn-hover-bg: #1a6b3c;
    --bs-btn-hover-border-color: #1a6b3c;
}

/* "Đóng đăng ký" was Bootstrap's vivid amber, which read as an error rather than a
   routine step. It is a neutral transition, so it is styled as one. */
.admin-shell .btn-warning {
    --bs-btn-color: #4a3a00;
    --bs-btn-bg: #f0e3b8;
    --bs-btn-border-color: #e2d296;
    --bs-btn-hover-bg: #e8d79f;
    --bs-btn-hover-border-color: #d8c47e;
    --bs-btn-active-bg: #dfcb8c;
    --bs-btn-active-border-color: #cbb56b;
}

/* ---- Status pills ------------------------------------------------------- */
/* A soft fill plus an inset ring, rather than Bootstrap's saturated badges: the
   status is metadata on the page, not the loudest thing on it. The dot carries the
   colour so the label stays legible for anyone who cannot separate the hues. */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    border-radius: 999px;
    vertical-align: middle;
}

.status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

/* ---- Event page header and toolbar -------------------------------------- */

.event-header {
    padding-bottom: 4px;
}

.event-header h1 {
    letter-spacing: -0.012em;
}

.event-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--dam-grid);
}

.event-actions__group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Visually marks the boundary between "changes the event" and "looks at it"
   without adding another label. */
.event-actions__group + .event-actions__group {
    margin-left: 8px;
    padding-left: 16px;
    border-left: 1px solid var(--dam-grid);
}

/* Cancel is destructive and belongs at the far edge, away from the buttons used
   daily. Pushed right only when the toolbar is wide enough to have a far edge. */
.event-actions__group--end {
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .event-actions__group + .event-actions__group {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
    }

    .event-actions__group--end {
        margin-left: 0;
    }
}

.status-pill--draft {
    color: #4b5058;
    background: #eef0f2;
    box-shadow: inset 0 0 0 1px #dcdfe3;
}

.status-pill--open {
    color: #14663c;
    background: #e7f4ec;
    box-shadow: inset 0 0 0 1px #bde0cb;
}

.status-pill--closed {
    color: #7a4a00;
    background: #fdf3e2;
    box-shadow: inset 0 0 0 1px #ecd6ae;
}

.status-pill--cancelled {
    color: #96202b;
    background: #fcecee;
    box-shadow: inset 0 0 0 1px #f0c3c8;
}

.table-actions {
    white-space: nowrap;
}

.stat-tile {
    background: #ffffff;
    border: 1px solid var(--dam-grid);
    border-radius: 12px;
    padding: 20px 24px;
}

.stat-tile__label {
    color: #52514e;
    font-size: 14px;
    margin-bottom: 6px;
}

.stat-tile__value {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.1;
}

.search-box {
    font-size: 17px;
    min-height: 48px;
}

.attendee-row {
    padding: 14px 16px;
    border-bottom: 1px solid var(--dam-grid);
}

.attendee-row:last-child {
    border-bottom: none;
}

.attendee-row:hover {
    background: #f6f6f4;
}

.attendee-name {
    font-weight: 600;
    font-size: 17px;
}

.attendee-meta {
    color: #52514e;
    font-size: 14px;
}

/* Print: only the poster is printed. */
@media print {
    body {
        background: #ffffff !important;
    }

    .no-print,
    .navbar {
        display: none !important;
    }

    .print-poster {
        page-break-inside: avoid;
    }
}

/* The poster is the one screen whose whole purpose is to be printed, so the screen
   and the page must be the same layout. Centring only inside @media print meant an
   organizer approved one thing and posted another. */
.print-poster {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 32px 32px;
    border: 2px solid var(--dam-navy);
    border-radius: 16px;
    text-align: center;
}

.print-poster h1 {
    color: var(--dam-navy);
    font-size: 30px;
    font-weight: 700;
}

.print-poster .qr-image {
    display: block;
    width: 320px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    image-rendering: pixelated;
}

/* Left-aligned even though the poster is centred: numbered instructions are read
   down the numbers, and a centred list makes each line start somewhere new. */
.print-poster .step {
    font-size: 16px;
    color: #52514e;
    text-align: left;
    padding-left: 1.25rem;
}

.print-poster .step li + li {
    margin-top: 4px;
}
