:root {
  --primary: #2563eb; --primary-dark: #1e40af;
  --success: #16a34a; --danger: #dc2626;
  --bg: #f8fafc; --card: #ffffff; --text: #0f172a; --muted: #64748b;
  --radius: 12px; --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }
body { background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; }
.container { max-width: 680px; margin: 0 auto; padding: 20px; }



.app-header { text-align: center; padding: 40px 20px 20px; color: var(--primary-dark); }
.app-header h1 { font-size: 1.8rem; margin-bottom: 5px; }
.app-header p { color: var(--muted); font-size: 0.9rem; }


.card { background: var(--card); border-radius: var(--radius); padding: 24px; margin: 20px 0; box-shadow: var(--shadow); }
h2 { font-size: 1.25rem; margin-bottom: 15px; color: var(--text); }

.form-input { width: 100%; padding: 12px 16px; border: 2px solid #e2e8f0; border-radius: var(--radius); font-size: 16px; margin-bottom: 12px; transition: 0.2s; }
.form-input:focus { border-color: var(--primary); outline: none; }
.search-form { display: flex; gap: 10px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: none; border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: 0.2s; min-height: 44px; font-size: 1rem; }
.btn-primary { background: var(--primary); color: white; flex: 1; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; min-height: auto; }

.countdown-wrapper { background: #f1f5f9; padding: 15px; border-radius: var(--radius); margin: 20px 0; text-align: center; }
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.cd-item { background: var(--primary-dark); color: white; padding: 10px 5px; border-radius: 8px; }
.cd-item span { display: block; font-size: 1.2rem; font-weight: bold; }
.cd-item small { font-size: 0.7rem; text-transform: uppercase; opacity: 0.8; }

.result-card { border-left: 5px solid var(--primary); }
.result-card.lulus { border-left-color: var(--success); }
.result-card.gagal { border-left-color: var(--danger); }
.status-badge { text-align: center; padding: 10px; border-radius: 50px; color: white; font-weight: bold; margin-bottom: 15px; }
.bg-lulus { background: var(--success); } .bg-gagal { background: var(--danger); }

.result-table { width: 100%; border-collapse: collapse; margin: 15px 0; }
.result-table td { padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
.result-table .lbl { width: 35%; color: var(--muted); font-weight: 500; }
.result-table .val { font-weight: 600; }

.message-box { padding: 12px; border-radius: 8px; text-align: center; font-size: 0.9rem; margin-top: 10px; }
.msg-success { background: #dcfce7; color: #166534; }
.msg-info { background: #fee2e2; color: #991b1b; }
.error-card { background: #fee2e2; color: #991b1b; text-align: center; padding: 12px; border-radius: 8px; margin-top: 15px; }

.app-footer { text-align: center; padding: 30px 20px; color: var(--muted); font-size: 0.8rem; }
.app-footer a { color: var(--primary); text-decoration: none; display: block; margin-bottom: 10px; }

/* Admin Styles */
.admin-nav { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 15px; overflow-x: auto; display: block; }
.admin-table th, .admin-table td { padding: 10px; border-bottom: 1px solid #e2e8f0; text-align: left; white-space: nowrap; }
.admin-table th { background: #f8fafc; font-weight: 600; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 15px; }
.badge { padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.fade-in { animation: fadeIn 0.5s ease-out forwards; }
.pop-in { animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.shake { animation: shake 0.4s ease-in-out; }
.icon-pulse { font-size: 2.5rem; text-align: center; margin-bottom: 10px; animation: pulse 2s infinite; }

@media (min-width: 768px) {
  .search-form { flex-direction: row; }
  .btn-primary { width: auto; min-width: 150px; }
}
@media (max-width: 480px) {
  .cd-item span { font-size: 1rem; }
  .card { padding: 18px; }
}