:root {
    --bg-from: #0e1a2b;
    --bg-to: #1b2b46;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --brand: #2563eb;
    --brand-2: #22c55e;
    --danger: #dc2626;
    --ring: rgba(37, 99, 235, .35);
    --radius: 14px;
    --shadow: 0 10px 30px rgba(2, 8, 23, .25);
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: var(--text);
    background: radial-gradient(1200px 900px at 10% -10%, #1a2d4f 0%, transparent 60%),
        radial-gradient(1400px 1000px at 100% 0%, #0f172a 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-from), var(--bg-to));
    padding-bottom: 48px;
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, .4);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.topbar .inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    color: #e5e7eb;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: .3px;
}

.brand .badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(145deg, var(--brand), #60a5fa);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    /* optional */
}
.top-actions a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    margin-left: 14px;
    opacity: .9;
}

.top-actions a:hover {
    opacity: 1
}

/* Shell + hero */
.shell {
    max-width: 1100px;
    margin: 28px auto;
    padding: 0 18px;
}

.hero {
    color: #f8fafc;
    text-align: center;
    margin: 16px 0 26px;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: clamp(22px, 3.6vw, 36px);
}

.hero p {
    margin: 0;
    color: #cbd5e1
}

/* Card */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    border: 1px solid rgba(15, 23, 42, .06);
}

/* Headings with chips */
h2 {
    color: #0f172a;
    font-size: clamp(16px, 2.6vw, 22px);
    margin: 26px 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 .chip {
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 700;
    border-radius: 10px;
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #dbeafe;
}

/* Form basics */
form {
    margin: 0
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px
}

.hint {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px
}

input,
select,
button {
    width: 100%;
    font-size: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 12px;
    box-sizing: border-box;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: box-shadow .15s, border-color .15s, transform .04s;
}

input:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--ring);
}

input[type="date"] {
    padding: 10px 12px
}

.form-section {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(12, 1fr);
}

.form-group {
    grid-column: span 6
}

.full-width {
    grid-column: 1 / -1
}

/* Buttons */
.btn {
    cursor: pointer;
    user-select: none;
    width: auto
}

.btn-primary {
    background: linear-gradient(180deg, var(--brand), #1e40af);
    color: #fff;
    border: none;
    box-shadow: 0 10px 20px rgba(37, 99, 235, .25);
}

.btn-primary:hover {
    transform: translateY(-1px)
}

.btn-danger {
    background: linear-gradient(180deg, #ef4444, #b91c1c);
    color: #fff;
    border: none;
    box-shadow: 0 10px 18px rgba(239, 68, 68, .25);
}

.btn-ghost {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e5e7eb;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
}

.lookup-button {
    width: auto;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    cursor: pointer;
    font-size: 14px;
}

.lookup-button:hover {
    background: #eef2ff;
    border-color: #c7d2fe
}

/* Applicant card */
.applicant-container {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
}

/* Mismatch UI (for your script.js) */
.mismatch-controls {
    display: none;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px
}

.mismatch-controls.show {
    display: flex
}

.mismatch-flag {
    outline: 2px solid #e55353 !important
}

.mismatch-controls button {
    background: #f8f9fa !important;
    color: #111 !important;
    border: 1px solid #cbd3da !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    width: auto !important;
    display: inline-block !important;
    box-shadow: none !important;
}

.mismatch-controls button:hover {
    background: #e9ecef !important
}

.mismatch-controls span {
    font-weight: 600;
    color: #b02a37
}

/* Alerts (for RSP page) */
.alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin: 10px 0;
    border: 1px solid transparent;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b
}

.alert-ok {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #065f46
}

.alert-warn {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412
}

/* Log window */
.log-window {
    margin-top: 22px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #334155;
    overflow: hidden;
    background: #0f172a;
    color: #e5e7eb;
    box-shadow: 0 8px 22px rgba(2, 8, 23, .35);
}

.log-window header {
    padding: 10px 14px;
    background: linear-gradient(180deg, #0b1220, #0f172a);
    border-bottom: 1px solid #1f2937;
    font-weight: 700;
    color: #93c5fd;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-content {
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    max-height: 260px;
    overflow-y: auto;
}

/* Footer */
.footer {
    text-align: center;
    color: #e5e7eb;
    margin-top: 20px
}

.footer a {
    color: #c7d2fe;
    text-decoration: none
}

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

@media (max-width:880px) {
    .form-group {
        grid-column: span 12
    }

    .hero h1 {
        font-size: clamp(20px, 5vw, 30px)
    }
}