:root {
    --bg: #f3f3f4;
    --panel: #ffffff;
    --ink: #121216;
    --muted: #64656d;
    --line: #dedee3;
    --brand: #d73632;
    --brand-2: #b92825;
    --brand-background: #07070a;
    --charcoal: #111115;
    --charcoal-2: #1a1a20;
    --soft-red: #fff0ef;
    --success: #137333;
    --warning: #b06000;
    --danger: #b3261e;
    --shadow: 0 18px 45px rgba(21, 32, 51, 0.08);
    --radius: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(215,54,50,.10), transparent 28rem),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}
.self-checkin-body {
    background:
        radial-gradient(circle at top right, rgba(215,54,50,.18), transparent 24rem),
        linear-gradient(180deg, var(--brand-background) 0%, #0d0d12 100%);
}
a { color: inherit; }
.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}
.site-header {
    background: var(--brand-background);
    border-bottom: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand {
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.brand img {
    display: block;
    width: clamp(118px, 16vw, 150px);
    height: auto;
}
.brand-text {
    color: #fff;
    font-size: 1.18rem;
    font-weight: 800;
}
.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.nav a {
    color: rgba(255,255,255,.78);
    text-decoration: none;
    font-weight: 600;
}
.nav a:hover { color: #fff; }
.page-shell { padding: 28px 0 48px; }
.hero {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
}
.landing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 18px;
    align-items: start;
}
.feature-card {
    padding: 22px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(215,54,50,.28), transparent 16rem),
        linear-gradient(145deg, var(--charcoal), var(--charcoal-2));
    color: #fff;
}
.feature-card .muted { color: rgba(255,255,255,.7); }
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-card {
    width: min(680px, 100%);
    padding: clamp(22px, 4vw, 36px);
    position: relative;
    overflow: hidden;
}
.hero-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand), #ef6a63);
}
.eyebrow {
    color: var(--brand);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.65rem); }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
    padding: 22px;
}
.stack > * + * { margin-top: 16px; }
.field label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 700;
}
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 15px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(23, 78, 166, .14);
    border-color: var(--brand);
}
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.button, button {
    appearance: none;
    border: 0;
    border-radius: 14px;
    padding: 13px 17px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.button:hover, button:hover { background: var(--brand-2); }
.button.secondary {
    background: var(--soft-red);
    color: var(--brand);
}
.button.secondary:hover { background: #ffe1de; }
.button.ghost {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--line);
}
.button.danger { background: var(--danger); }
.notice {
    border-radius: 14px;
    padding: 14px 16px;
    background: #f7f7f8;
    border: 1px solid var(--line);
}
.notice.success {
    background: #ecf8f0;
    border-color: #b8e1c4;
}
.notice.warning {
    background: #fff7e8;
    border-color: #f5d6a3;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: .88rem;
    font-weight: 800;
}
.status-active { background: var(--soft-red); color: var(--brand); }
.status-ready { background: #ecf8f0; color: var(--success); }
.status-warning { background: #fff7e8; color: var(--warning); }
.status-complete { background: #edf3f1; color: #285943; }
.status-muted { background: #eef0f3; color: #5b6572; }
.metric {
    padding: 18px;
    background: #fafafa;
    border: 1px solid var(--line);
    border-radius: 18px;
}
.metric .label {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.metric .value {
    font-size: 1.1rem;
    font-weight: 800;
}
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}
th, td {
    text-align: left;
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
th {
    color: var(--muted);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
tr:last-child td { border-bottom: 0; }
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    justify-content: space-between;
}
.toolbar .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
}
.toolbar .filters > * { min-width: 180px; }
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}
.timeline li {
    position: relative;
    padding: 0 0 20px 26px;
}
.timeline li::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: -4px;
    width: 2px;
    background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline li::after {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--brand);
    position: absolute;
    left: 1px;
    top: 4px;
}
.note {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
}
.note.internal { border-left: 5px solid #6b7280; }
.note.public { border-left: 5px solid var(--brand); }
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 700;
}
.checkbox-row input {
    width: auto;
    margin-top: 4px;
}
.self-checkin-page {
    min-height: calc(100vh - 148px);
    display: grid;
    place-items: center;
    padding: 12px 0;
}
.self-checkin-card {
    width: min(840px, 100%);
    padding: clamp(22px, 4vw, 38px);
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(215,54,50,.25), transparent 18rem),
        linear-gradient(145deg, #09090c, #15151b);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 24px 70px rgba(0,0,0,.32);
}
.self-checkin-card h1,
.self-checkin-card h2,
.self-checkin-card h3 {
    color: #fff;
}
.self-checkin-card .muted {
    color: rgba(255,255,255,.70);
}
.self-checkin-card .field label {
    color: rgba(255,255,255,.78);
}
.self-checkin-card input,
.self-checkin-card select,
.self-checkin-card textarea {
    background: rgba(255,255,255,.98);
}
.self-checkin-card .choice-grid label {
    color: #fff;
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.14);
}
.self-checkin-card .choice-grid label:hover {
    background: rgba(215,54,50,.16);
    border-color: rgba(215,54,50,.42);
}
.self-checkin-card .notice {
    color: var(--ink);
}
.self-checkin-card .notice.success {
    color: #123524;
    font-weight: 700;
}
.self-checkin-card .tracking-code {
    color: #fff;
}
.self-checkin-card a:not(.button) {
    color: #fff;
    text-decoration-color: rgba(255,255,255,.5);
}
.qr-card {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
}
.qr-card img {
    width: 132px;
    height: 132px;
    padding: 8px;
    border-radius: 14px;
    background: #fff;
}
.qr-card p {
    margin: 0;
}
.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.choice-grid label {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
}
.choice-grid input {
    width: auto;
    margin-right: 8px;
}
.tracking-code {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 900;
    letter-spacing: .08em;
}
.print-slip {
    display: none;
}
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.action-menu {
    position: relative;
    display: inline-block;
}
.action-menu-list {
    position: fixed;
    z-index: 1000;
    min-width: 210px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(7, 7, 10, .18);
}
.action-menu-list a,
.action-menu-list button {
    width: 100%;
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    font-weight: 700;
}
.action-menu-list a:hover,
.action-menu-list button:hover {
    background: var(--soft-red);
    color: var(--brand);
}
.action-menu-list form {
    margin: 0;
}
.danger-zone {
    border-color: rgba(179, 38, 30, .35);
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 7, 10, .62);
}
.modal-card {
    width: min(520px, 100%);
    padding: 24px;
}
.small { font-size: .9rem; }
.empty {
    padding: 28px;
    text-align: center;
    color: var(--muted);
}
@media (max-width: 780px) {
    .header-inner { align-items: flex-start; flex-direction: column; padding: 16px 0; }
    .landing-grid { grid-template-columns: 1fr; }
    .grid.two, .grid.three, .choice-grid { grid-template-columns: 1fr; }
    .toolbar { display: grid; }
    .toolbar .filters { display: grid; }
    .toolbar .filters > * { min-width: 0; }
    .button, button { width: 100%; }
}
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body {
        background: #fff !important;
        color: #121216;
    }
    .site-header, .page-shell > *:not(.print-slip) { display: none !important; }
    .page-shell {
        padding: 0 !important;
    }
    .shell {
        width: 100% !important;
        margin: 0 !important;
    }
    .print-slip {
        display: block;
        color: #121216;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .print-card {
        min-height: 0;
        max-height: 272mm;
        overflow: hidden;
        padding: 14px;
        border: 1.5px solid #121216;
        border-radius: 12px;
        background: #fff;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .print-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 10px;
        border-bottom: 1.5px solid #121216;
    }
    .print-logo {
        max-width: 115px;
        max-height: 52px;
        object-fit: contain;
        margin-right: auto;
    }
    .print-header h1 {
        margin: 0;
        font-size: 20px;
        line-height: 1.1;
    }
    .print-header p,
    .print-hero p,
    .print-footer p {
        margin: 4px 0 0;
    }
    .print-hero {
        margin: 12px 0;
        padding: 10px 12px;
        border-left: 5px solid var(--brand);
        border-radius: 10px;
        color: #121216;
        background: #fff;
    }
    .print-hero h2 {
        margin: 2px 0;
        color: #121216;
        font-size: 22px;
    }
    .print-hero p {
        font-size: 13px;
    }
    .print-label {
        margin: 0;
        color: var(--brand);
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .12em;
        text-transform: uppercase;
    }
    .print-code-row {
        display: grid;
        grid-template-columns: 1fr 118px;
        gap: 12px;
        align-items: center;
        padding: 12px;
        border: 1px solid #dedee3;
        border-radius: 12px;
        background: #fff;
    }
    .print-slip .tracking-code {
        margin-top: 4px;
        font-size: 34px;
        line-height: 1.05;
        letter-spacing: .06em;
    }
    .print-qr {
        text-align: center;
        font-weight: 800;
    }
    .print-qr img {
        display: block;
        width: 104px;
        height: 104px;
        margin: 0 auto 4px;
        padding: 5px;
        border: 1px solid #dedee3;
        border-radius: 10px;
        background: #fff;
    }
    .print-qr span {
        font-size: 11px;
    }
    .print-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        margin-top: 10px;
    }
    .print-details div {
        padding: 8px 10px;
        border: 1px solid #dedee3;
        border-radius: 9px;
        background: #fff;
    }
    .print-details span {
        display: block;
        margin-bottom: 2px;
        color: #64656d;
        font-size: 9px;
        font-weight: 900;
        letter-spacing: .08em;
        text-transform: uppercase;
    }
    .print-details strong {
        font-size: 13px;
    }
    .print-footer {
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid #dedee3;
        color: #3f4047;
        font-size: 11px;
    }
    .print-footer p {
        margin-top: 3px;
    }
}
