:root {
    --primary: #0f4c81;
    --primary-dark: #0b395f;
    --accent: #b35a3b;
    --text: #17324d;
    --muted: #64748b;
    --border: #d8e5ee;
    --background: #f4f8fb;
    --surface: #fff;
    --success: #15803d;
    --danger: #dc2626;
    --shadow: 0 16px 45px rgba(15, 76, 129, .09);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font-family: "Segoe UI", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
.container { width: min(1200px, calc(100% - 32px)); margin: auto; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 4px 22px rgba(15, 76, 129, .08); }
.site-nav { width: min(1200px, calc(100% - 32px)); min-height: 78px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; color: var(--primary); text-decoration: none; }
.brand-logo { width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 18px; font-weight: 800; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 20px; white-space: nowrap; }
.brand-copy small { margin-top: 2px; color: var(--muted); }
.back-link { padding: 12px 18px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--primary); font-weight: 700; text-decoration: none; }

.page-hero { background: linear-gradient(135deg, #eaf6fc, #fdf7ed); border-bottom: 1px solid var(--border); }
.page-hero .container { padding-top: 42px; padding-bottom: 36px; }
.eyebrow { margin: 0; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.page-hero h1 { margin: 8px 0; color: var(--primary); font-size: clamp(30px, 4vw, 48px); line-height: 1.15; }
.page-hero p:last-child { margin: 0; color: #52687d; font-size: 17px; }

.page-content { padding-top: 32px; padding-bottom: 64px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.card { padding: 26px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.section-heading { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.section-heading h2, .lookup-card h2 { margin: 0; font-size: 21px; }
.section-heading p, .lookup-card p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.heading-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: #e0f2fe; color: #0284c7; }
.lookup-card .heading-icon { margin-bottom: 16px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; color: #334155; font-size: 13px; font-weight: 600; }
.field-wide { grid-column: 1 / -1; }
.field b { color: var(--danger); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: #fbfdff; color: var(--text); outline: none; transition: .2s; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #0284c7; box-shadow: 0 0 0 3px rgba(14, 165, 233, .14); }
.time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 12px; }

.button { min-height: 46px; padding: 0 20px; border: 0; border-radius: 11px; cursor: pointer; font-weight: 700; transition: .2s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { border: 1px solid var(--border); background: #eef4f8; color: var(--text); }
.button-dark { width: 100%; background: #334155; color: #fff; }
.button-success { width: 100%; margin-top: 18px; background: var(--success); color: #fff; }
.lookup-card { position: sticky; top: 24px; }

.message { margin-top: 18px; padding: 13px 15px; border: 1px solid; border-radius: 11px; font-size: 14px; }
.message-success { border-color: #86efac; background: #f0fdf4; color: #166534; }
.message-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

.modal { position: fixed; inset: 0; z-index: 150; padding: 18px; display: flex; align-items: center; justify-content: center; background: rgba(15, 35, 55, .38); backdrop-filter: blur(5px); }
.modal-dialog { width: min(520px, 100%); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(15, 35, 55, .25); }
.modal-header, .modal-footer { padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 19px; }
.modal-footer { justify-content: flex-end; border-top: 1px solid var(--border); border-bottom: 0; }
.modal-body { padding: 22px; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #eef4f8; color: var(--muted); cursor: pointer; font-size: 24px; }
.lookup-form, .lookup-result { display: grid; gap: 16px; }
.uppercase { text-transform: uppercase; }
.result-code { padding: 16px; border: 1px solid #bae6fd; border-radius: 12px; background: #f0f9ff; text-align: center; }
.result-code strong { display: block; margin-top: 4px; color: #0369a1; font-family: monospace; font-size: 25px; }
.result-grid, .result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-item { padding: 12px; border-radius: 10px; background: #f3f8fb; }
.result-item-wide { grid-column: 1 / -1; }
.result-item span { color: var(--muted); font-size: 12px; }
.result-item strong { display: block; margin-top: 4px; }
.status-confirmed { color: var(--success); }
.status-cancelled { color: var(--danger); }
.status-pending { color: #b45309; }

.success-dialog { padding: 30px; text-align: center; }
.success-dialog h3 { margin: 16px 0 8px; font-size: 26px; }
.success-dialog p { color: var(--muted); }
.success-icon { width: 64px; height: 64px; margin: auto; display: grid; place-items: center; border-radius: 50%; background: #dcfce7; color: var(--success); font-size: 28px; }
.success-code { display: block; color: #0369a1; font-family: monospace; font-size: 30px; }
.success-status { margin-top: 10px; color: #b45309; }
.site-footer { padding: 28px 16px; border-top: 1px solid var(--border); background: #fff; color: var(--muted); text-align: center; }

@media (max-width: 820px) {
    .page-content { grid-template-columns: 1fr; }
    .lookup-card { position: static; grid-row: 1; }
}

@media (max-width: 600px) {
    .brand-copy strong { font-size: 16px; }
    .brand-copy small, .back-link span { display: none; }
    .back-link { padding: 12px 15px; }
    .page-hero .container { padding-top: 30px; padding-bottom: 28px; }
    .card { padding: 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .form-actions { flex-direction: column; }
    .result-grid, .result-actions { grid-template-columns: 1fr; }
    .result-item-wide { grid-column: auto; }
}
