/* =============================================
   BASE.CSS - Shared Design System & Components
   Used by both public and admin pages
   ============================================= */

/* --- Design Tokens --- */
:root {
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #f1f5f9;
    --sidebar-active: #3b82f6;
    --sidebar-active-bg: rgba(59,130,246,0.12);
    --sidebar-width: 260px;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #eff6ff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --primary: #1e3c72;
}

/* --- Modern Scrollbar --- */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,0.35) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.35);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(148,163,184,0.55);
}

/* Dark surface scrollbar (sidebar etc) */
.admin-sidebar::-webkit-scrollbar-thumb,
.admin-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.2);
}

.admin-sidebar::-webkit-scrollbar-thumb:hover,
.admin-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(148,163,184,0.35);
}

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* --- Container (legacy) --- */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Header (legacy) --- */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header .logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: white;
    border-radius: 10px;
    padding: 5px;
}

.header-text h1 { font-size: 1.5rem; margin-bottom: 5px; }
.header-text h2 { font-size: 1.1rem; font-weight: normal; opacity: 0.9; }
.header-text h3 {
    font-size: 1rem;
    font-weight: normal;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.logout-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.logout-btn:hover { background: rgba(255, 255, 255, 0.25); }
.logout-icon { font-size: 1.1rem; transform: rotate(180deg); display: inline-block; }

@media (max-width: 600px) {
    .logout-text { display: none; }
    .logout-btn { padding: 8px 12px; }
    .logout-icon { font-size: 1.2rem; }
}

/* =============================================
   FORM STYLES (shared)
   ============================================= */
.opr-form {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.form-section {
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child { border-bottom: none; }

.form-section h4 {
    color: #1e3c72;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8f0fe;
    font-size: 1.1rem;
}

.form-row { margin-bottom: 15px; width: 100%; }

.form-row.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.form-group { margin-bottom: 15px; width: 100%; max-width: 100%; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    background-color: #fff;
}

.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.form-group textarea { resize: vertical; min-height: 100px; }
.form-group input[type="file"] { padding: 10px 0; }

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.85rem;
}

/* Image Preview */
.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-preview .preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.image-preview .preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.image-preview .preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.image-preview .preview-item .remove-btn:hover { background: rgba(220, 53, 69, 1); }

.image-count-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    color: #666;
}

.image-count-indicator small { font-size: 0.9rem; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #152a52 0%, #1e3c72 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }

.btn-outline { background: transparent; color: #1e3c72; border: 1px solid #1e3c72; }
.btn-outline:hover { background: #1e3c72; color: white; }

.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; }

.btn-small { padding: 6px 12px; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 5px; }
.btn-small svg, .btn-small i { width: 14px; height: 14px; flex-shrink: 0; }

.btn-edit { background: #ffc107; color: #333; }
.btn-edit:hover { background: #e0a800; }

.btn-full { width: 100%; }

.form-actions {
    padding: 25px 30px;
    background: #f8f9fa;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.login-container { width: 100%; max-width: 400px; padding: 20px; }

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-box h1 { text-align: center; color: #1e3c72; margin-bottom: 5px; }
.login-subtitle { text-align: center; color: #666; margin-bottom: 30px; }
.login-form .form-group { margin-bottom: 20px; }

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer a { color: #2a5298; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* =============================================
   LOADING SPINNER
   ============================================= */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1e3c72;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================
   PDF GENERATION OVERLAY
   ============================================= */
.pdf-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pdf-overlay-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
}

.pdf-overlay-content h3 { margin-top: 20px; color: #1e3c72; }

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease;
    border-left: 4px solid;
}

.toast.toast-hide { animation: toastSlideOut 0.3s ease forwards; }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast-icon { font-size: 1.4rem; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.toast-message { font-size: 0.85rem; color: #666; }

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover { color: #333; }

/* Toast Types */
.toast-success { border-left-color: #28a745; }
.toast-success .toast-icon { color: #28a745; }
.toast-success .toast-title { color: #28a745; }

.toast-error { border-left-color: #dc3545; }
.toast-error .toast-icon { color: #dc3545; }
.toast-error .toast-title { color: #dc3545; }

.toast-warning { border-left-color: #ffc107; }
.toast-warning .toast-icon { color: #e6ac00; }
.toast-warning .toast-title { color: #997300; }

.toast-info { border-left-color: #17a2b8; }
.toast-info .toast-icon { color: #17a2b8; }
.toast-info .toast-title { color: #17a2b8; }

/* =============================================
   CONFIRM MODAL
   ============================================= */
.confirm-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

/* Confirmation dialog must overlay other modals that reuse .confirm-modal */
#confirmModal { z-index: 200000; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.confirm-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.confirm-modal-body { padding: 30px; text-align: center; }
.confirm-modal-icon { font-size: 3rem; margin-bottom: 15px; }
.confirm-modal-icon.warning { color: #ffc107; }
.confirm-modal-icon.danger { color: #dc3545; }
.confirm-modal-icon.info { color: #17a2b8; }

.confirm-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.confirm-modal-message { color: #666; font-size: 0.95rem; line-height: 1.5; }

.edit-modal-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.edit-modal-input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.confirm-modal-footer { display: flex; border-top: 1px solid #eee; }

.confirm-modal-footer .btn {
    flex: 1;
    padding: 15px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.confirm-modal-footer .btn-cancel { background: #f8f9fa; color: #666; }
.confirm-modal-footer .btn-cancel:hover { background: #e9ecef; }
.confirm-modal-footer .btn-confirm { background: #dc3545; color: white; }
.confirm-modal-footer .btn-confirm:hover { background: #c82333; }

.confirm-modal-footer .btn-confirm.primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.confirm-modal-footer .btn-confirm.primary:hover {
    background: linear-gradient(135deg, #152a52 0%, #1e3c72 100%);
}

/* =============================================
   VIEW OPR MODAL
   ============================================= */
.view-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.view-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    animation: modalScaleIn 0.25s ease;
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.view-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #0f172a;
    color: white;
}

.view-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-family: var(--font);
}

.view-modal-close {
    background: rgba(148, 163, 184, 0.2);
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.view-modal-close:hover { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.view-modal-close .lucide, .view-modal-close svg { width: 18px; height: 18px; }

.view-modal-body { flex: 1; overflow-y: auto; padding: 24px; }

.view-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #f1f5f9; }
.view-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.view-section h4 {
    color: #0f172a;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eff6ff;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.view-section p { color: #475569; line-height: 1.7; font-size: 0.92rem; }

.view-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.view-item { font-size: 0.9rem; color: #64748b; }
.view-item strong { color: #0f172a; font-weight: 600; }

.view-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.view-badge--peringkat { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.view-badge--kedudukan { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Peserta table in view modals (shared staff + admin) */
.view-modal-body .peserta-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.view-modal-body .peserta-table thead th {
    background: #f1f5f9;
    color: #334155;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #e2e8f0;
}
.view-modal-body .peserta-table thead th:first-child {
    width: 40px;
    text-align: center;
}
.view-modal-body .peserta-table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
.view-modal-body .peserta-table tbody td:first-child {
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}
.view-modal-body .peserta-table tbody tr:hover {
    background: #f8fafc;
}
.view-modal-body .peserta-table tbody tr:last-child td {
    border-bottom: none;
}

.view-images { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.view-images img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease;
}

.view-images img:hover { transform: scale(1.02); }

.view-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.view-modal-footer .btn .lucide, .view-modal-footer .btn svg { width: 16px; height: 16px; }

/* =============================================
   PDF PREVIEW MODAL
   ============================================= */
.pdf-preview-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.pdf-preview-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    animation: modalScaleIn 0.25s ease;
}

.pdf-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: #0f172a;
    color: white;
}

.pdf-preview-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-family: var(--font);
}

/* PDF Theme Strip */
.pdf-theme-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.theme-strip-label { font-size: 0.82rem; font-weight: 600; color: #64748b; }

/* PDF Theme Toggle */
.pdf-theme-toggle {
    display: flex;
    gap: 4px;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 8px;
}

.theme-btn {
    padding: 7px 18px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font);
}

.theme-btn .lucide, .theme-btn svg { width: 15px; height: 15px; }
.theme-btn:hover { color: #0f172a; background: rgba(255,255,255,0.5); }

.theme-btn.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Download Theme Picker */
.download-theme-picker {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.download-theme-option {
    flex: 1;
    max-width: 160px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.download-theme-option:hover { border-color: #2a5298; background: #f8f9ff; }
.download-theme-option .theme-option-icon { font-size: 1.8rem; }
.download-theme-option .theme-option-label { font-weight: 600; color: #333; font-size: 0.95rem; }
.download-theme-option .theme-option-desc { font-size: 0.75rem; color: #888; }

.pdf-preview-close {
    background: rgba(148, 163, 184, 0.2);
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.pdf-preview-close:hover { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.pdf-preview-close .lucide, .pdf-preview-close svg { width: 18px; height: 18px; }

.pdf-preview-body {
    flex: 1;
    overflow: auto;
    background: #e2e8f0;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.pdf-preview-frame { width: 100%; height: 100%; min-height: 500px; border: none; }

.pdf-preview-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.pdf-preview-footer .btn .lucide, .pdf-preview-footer .btn svg { width: 16px; height: 16px; }

/* =============================================
   PROGRESS OVERLAY
   ============================================= */
.progress-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.progress-overlay-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 40px;
    min-width: 360px;
    max-width: 480px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    animation: modalScaleIn 0.25s ease;
}

.progress-overlay-content h3 {
    color: #0f172a;
    margin-bottom: 24px;
    font-size: 1.1rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-family: var(--font);
}

.progress-steps { display: flex; flex-direction: column; gap: 12px; }

.progress-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
}

.progress-step .step-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    color: #cbd5e1;
    transition: all 0.25s ease;
}

.progress-step .step-text {
    font-size: 0.9rem;
    color: #94a3b8;
    transition: all 0.25s ease;
    font-family: var(--font);
}

.progress-step.active { background: #eff6ff; border-color: #bfdbfe; }
.progress-step.active .step-icon { color: #3b82f6; animation: spin 1s linear infinite; }
.progress-step.active .step-text { color: #1e40af; font-weight: 500; }

.progress-step.done { background: #f0fdf4; border-color: #bbf7d0; }
.progress-step.done .step-icon { color: #10b981; }
.progress-step.done .step-text { color: #166534; }

/* =============================================
   GENERATE BUTTON
   ============================================= */
.btn-generate {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    font-size: 1.05rem;
    padding: 14px 30px;
}

.btn-generate:hover {
    background: linear-gradient(135deg, #152a52 0%, #1e3c72 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.35);
}

/* =============================================
   BADGE PERTANDINGAN
   ============================================= */
.badge-pertandingan {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    vertical-align: middle;
    margin-right: 4px;
}

/* =============================================
   SHARED RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    body { overflow-x: hidden; }

    .container { padding: 10px; overflow-x: hidden; max-width: 100%; }
    .opr-form { overflow: hidden; }

    .header {
        flex-direction: column;
        text-align: center;
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .header .logo { width: 60px; height: 60px; margin-bottom: 10px; }
    .header-text h1 { font-size: 1.2rem; }
    .header-text h2 { font-size: 0.95rem; }
    .header-text h3 { font-size: 0.9rem; }

    .form-section { padding: 20px 15px; overflow: hidden; }
    .form-section h4 { font-size: 1rem; margin-bottom: 15px; }

    .form-row { width: 100%; margin-bottom: 0; }

    .form-row.two-cols {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .form-row.two-cols .form-group {
        margin-bottom: 15px;
        width: 100% !important;
        max-width: 100% !important;
        flex: none;
    }

    .form-row.two-cols .form-group:last-child { margin-bottom: 0; }

    .form-group { width: 100% !important; max-width: 100%; overflow: hidden; }

    .form-group input:not([type="checkbox"]),
    .form-group select,
    .form-group textarea {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px;
        font-size: 16px;
        box-sizing: border-box !important;
        display: block;
        -webkit-appearance: none;
        border-radius: 6px;
    }

    .form-group input[type="checkbox"],
    .toggle-label input[type="checkbox"] {
        width: 20px !important;
        height: 20px !important;
        -webkit-appearance: checkbox !important;
        appearance: checkbox !important;
        display: inline-block !important;
        flex-shrink: 0;
    }

    .form-group input[type="date"],
    .form-group input[type="time"] {
        min-height: 44px;
        -webkit-appearance: none;
        appearance: none;
        background-color: #fff;
        position: relative;
    }

    .form-group input[type="date"]::-webkit-date-and-time-value,
    .form-group input[type="time"]::-webkit-date-and-time-value {
        text-align: left;
    }

    .form-group label { font-size: 0.9rem; margin-bottom: 6px; display: block; }

    .form-actions { flex-direction: column; padding: 20px 15px; }
    .form-actions .btn { width: 100%; padding: 14px; }

    .image-preview { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .toast-container { top: 15px; bottom: auto; left: 15px; right: 15px; }
    .toast { min-width: auto; max-width: none; }
    .confirm-modal-content { max-width: none; }

    .view-modal { align-items: flex-start; padding-top: env(safe-area-inset-top, 10px); }
    .view-modal-content { max-width: 100%; max-height: 90vh; max-height: 90dvh; border-radius: 10px; }
    .view-modal-body { padding: 15px; }
    .view-grid { grid-template-columns: 1fr; }
    .view-images { grid-template-columns: 1fr; }
    .view-images img { height: 200px; }
    .view-modal-footer { flex-direction: column; }
    .view-modal-footer .btn { width: 100%; }

    .pdf-preview-modal { align-items: flex-start; padding-top: env(safe-area-inset-top, 10px); }
    .pdf-preview-content { max-width: 100%; max-height: 90vh; max-height: 90dvh; border-radius: 10px; }
    .pdf-preview-header { padding: 14px 18px; }

    .pdf-theme-strip { padding: 8px 15px; gap: 8px; }
    .theme-btn { flex: 1; justify-content: center; padding: 8px 12px; font-size: 0.85rem; }

    .download-theme-picker { flex-direction: row; }
    .download-theme-option { max-width: none; padding: 12px; }

    .pdf-preview-frame { min-height: 350px; }
    .pdf-preview-footer { flex-direction: column; padding: 12px 18px; }
    .pdf-preview-footer .btn { width: 100%; }

    .progress-overlay-content { min-width: auto; padding: 25px 20px; }
}

@media (max-width: 480px) {
    .header-text h1 { font-size: 1.1rem; }
    .image-preview { grid-template-columns: 1fr; }
    .form-group input, .form-group select { font-size: 16px; }
}

/* =============================================
   SHARED ANIMATIONS
   ============================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
