:root {
    --bg: #f5f2ec;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --ink: #163252;
    --muted: #63748a;
    --primary: #1e4b85;
    --primary-soft: #f59c3b;
    --line: rgba(22, 50, 82, 0.1);
    --shadow: 0 24px 48px rgba(23, 43, 77, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    /* Font diganti ke Tahoma */
    font-family: Tahoma, Verdana, Segoe UI, sans-serif; 
    color: var(--ink);
    background: radial-gradient(circle at top left, rgba(245, 156, 59, 0.24), transparent 26%), radial-gradient(circle at top right, rgba(30, 75, 133, 0.2), transparent 24%), linear-gradient(180deg, #fff7ea 0%, var(--bg) 100%);
    padding: 30px;
}

.page-shell {
    max-width: 1360px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(30, 75, 133, 0.08);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.page-header h1 {
    margin: 12px 0 8px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
}

.page-header p {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.search-panel,
.preview-panel {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.search-panel {
    padding: 26px;
}

.panel-head h2,
.preview-head h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.panel-head p,
.preview-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.search-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.input-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
}

.search-form input {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid rgba(30, 75, 133, 0.14);
    border-radius: 18px;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    background: var(--surface-strong);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.search-form input:focus {
    border-color: rgba(30, 75, 133, 0.44);
    box-shadow: 0 0 0 4px rgba(30, 75, 133, 0.08);
    transform: translateY(-1px);
}

.form-actions,
.header-actions {
    display: flex;
}

.primary-btn,
.ghost-btn {
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.primary-btn {
    background: linear-gradient(135deg, #1d467d 0%, #285ea5 60%, #f59c3b 160%);
    color: #fff;
    box-shadow: 0 16px 28px rgba(30, 75, 133, 0.24);
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    border: 1px solid var(--line);
}

.primary-btn:hover,
.ghost-btn:hover {
    transform: translateY(-1px);
}

.search-meta {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(30, 75, 133, 0.06);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
}

.result-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.result-item {
    width: 100%;
    border: 1px solid rgba(30, 75, 133, 0.1);
    background: #fff;
    border-radius: 20px;
    padding: 16px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.result-item:hover {
    transform: translateY(-1px);
    border-color: rgba(30, 75, 133, 0.24);
    box-shadow: 0 14px 26px rgba(23, 43, 77, 0.08);
}

.result-item strong {
    display: block;
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--ink);
}

.result-item span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.preview-panel {
    padding: 26px;
}

.preview-stage {
    margin-top: 22px;
    min-height: 680px;
    display: grid;
    place-items: center;
}

.empty-card {
    width: min(100%, 520px);
    min-height: 300px;
    border-radius: 28px;
    border: 1.5px dashed rgba(30, 75, 133, 0.22);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 234, 0.92)), radial-gradient(circle at top right, rgba(245, 156, 59, 0.16), transparent 28%);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 28px;
    color: var(--muted);
}

.empty-card strong {
    display: block;
    margin-bottom: 10px;
    font-size: 22px;
    color: var(--ink);
}

.participant-card {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 886 / 1280;
    background: url("kartu.png") center/cover no-repeat;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 26px 54px rgba(23, 43, 77, 0.22);
}

.card-value,
.card-branch {
    position: absolute;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.card-value {
    left: 36%;
    width: 58%;
    color: #32507a;
    /* Font diganti ke Tahoma */
    font-family: Tahoma, sans-serif;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    line-height: 0.98;
}

.field-name {
    top: 41.2%;
    height: 8%;
    font-size: 15px;
}

.field-number {
    top: 50.45%;
    height: 6%;
    font-size: 15px;
    text-transform: none;
    letter-spacing: 0.02em;
}

.field-school {
    top: 59.82%;
    height: 6%;
    font-size: 15px;
}

.field-category {
    top: 69.06%;
    height: 6%;
    font-size: 15px;
}

.card-branch {
    left: 12%;
    width: 76%;
    top: 90.15%;
    height: 4%;
    font-size: 18px;
    justify-content: center;
    text-align: center;
    color: #6b573e;
    /* Font diganti ke Tahoma */
    font-family: Tahoma, sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.02;
    padding: 0 16px;
}

.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

@media (max-width: 1080px) {
    body {
        padding: 20px;
    }
    .page-header,
    .content-grid {
        grid-template-columns: 1fr;
    }
    .page-header {
        align-items: stretch;
    }
    .header-actions {
        justify-content: flex-start;
    }
    .preview-stage {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    body {
        padding: 14px;
    }
    .search-panel,
    .preview-panel {
        padding: 18px;
        border-radius: 22px;
    }
    .form-actions,
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    .primary-btn,
    .ghost-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media print {
    body {
        background: #fff;
        padding: 0;
        margin: 0;
        font-family: Tahoma, sans-serif; /* Pastikan print juga Tahoma */
    }
    .page-header,
    .search-panel,
    .preview-head {
        display: none !important;
    }
    .page-shell,
    .content-grid,
    .preview-panel,
    .preview-stage {
        display: block;
        margin: 0;
        padding: 0;
        max-width: none;
        min-height: auto;
        box-shadow: none;
        border: 0;
        background: transparent;
    }
    .empty-card {
        display: none !important;
    }
    .participant-card {
        display: block !important;
        width: 886px;
        height: 1280px;
        aspect-ratio: unset;
        box-shadow: none;
        border-radius: 0;
        margin: 0 auto;
        position: relative;
        overflow: hidden;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background: url("kartu.png") center/cover no-repeat !important;
    }
    .card-value {
        left: 36%;
        width: 58%;
        font-family: Tahoma, sans-serif;
    }
    .field-name {
        top: 41.2%;
        height: 8%;
        font-size: 26px;
    }
    .field-number {
        top: 50.45%;
        height: 6%;
        font-size: 24px;
    }
    .field-school {
        top: 59.82%;
        height: 6%;
        font-size: 24px;
    }
    .field-category {
        top: 69.06%;
        height: 6%;
        font-size: 24px;
    }
    .card-branch {
        top: 90.15%;
        height: 4%;
        font-size: 22px;
        font-family: Tahoma, sans-serif;
    }
    @page {
        size: 886px 1280px;
        margin: 0;
    }
}