:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #dbe3ef;
    --soft: #eef4ff;
    --blue: #2563eb;
    --green: #16a34a;
    --yellow: #ca8a04;
    --red: #dc2626;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #e8f0ff 0, #f8fafc 42%, #eef2ff 100%);
    color: var(--ink);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.container-page { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.hero {
    padding: 28px 0 20px;
}

.hero-card {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(219, 227, 239, .95);
    border-radius: 28px;
    box-shadow: 0 22px 70px rgba(15, 23, 42, .10);
    padding: 28px;
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 22px;
    align-items: center;
}

.logo-box {
    width: 92px;
    height: 92px;
    border-radius: 24px;
    background: white;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    overflow: hidden;
}

.logo-box img { width: 82px; height: 82px; object-fit: contain; }

.badge-soft {
    display: inline-flex;
    align-items: center;
    width: max-content;
    border-radius: 999px;
    padding: 8px 14px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.title-xl { font-size: clamp(30px, 5vw, 54px); line-height: .98; margin: 10px 0; letter-spacing: -.045em; }
.text-muted { color: var(--muted); line-height: 1.7; }

.search-card, .result-card, .admin-card {
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.search-grid { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }

.input-main, .form-control, .form-select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 15px;
    outline: none;
    background: white;
}

.input-main:focus, .form-control:focus, .form-select:focus, textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.btn-main, .btn-dark, .btn-blue, .btn-red, .btn-green, .btn-yellow {
    border: 0;
    border-radius: 16px;
    padding: 14px 20px;
    color: white;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-main, .btn-blue { background: var(--blue); }
.btn-dark { background: var(--ink); }
.btn-red { background: var(--red); }
.btn-green { background: var(--green); }
.btn-yellow { background: var(--yellow); color: #111827; }

.result-card { margin-top: 22px; animation: rise .45s ease both; }
.result-card.success { border-color: #86efac; background: linear-gradient(145deg, #f0fdf4, #ffffff); }
.result-card.warning { border-color: #fde68a; background: linear-gradient(145deg, #fffbeb, #ffffff); }
.result-card.danger { border-color: #fecaca; background: linear-gradient(145deg, #fef2f2, #ffffff); }
.result-card.blue { border-color: #bfdbfe; background: linear-gradient(145deg, #eff6ff, #ffffff); }
.result-status { font-size: clamp(28px, 6vw, 48px); margin: 8px 0; letter-spacing: -.035em; }
.result-status.success { color: #15803d; }
.result-status.warning { color: #a16207; }
.result-status.danger { color: #b91c1c; }
.result-status.blue { color: #1d4ed8; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.info-box { border: 1px solid var(--line); border-radius: 18px; padding: 15px; background: rgba(255,255,255,.72); }
.info-box small { display: block; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.info-box strong { font-size: 18px; }

.rich-content { color: #334155; line-height: 1.75; }
.rich-content ul, .rich-content ol { padding-left: 22px; }

.admin-shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar {
    background: #0f172a;
    color: white;
    padding: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.sidebar-logo img { width: 54px; height: 54px; object-fit: contain; background: white; border-radius: 16px; padding: 4px; }
.nav-link { display: flex; padding: 13px 14px; border-radius: 14px; color: #cbd5e1; margin-bottom: 8px; font-weight: 700; }
.nav-link.active, .nav-link:hover { background: rgba(255,255,255,.10); color: white; }
.admin-main { padding: 28px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.admin-title h1 { margin: 6px 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.04em; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { border-radius: 24px; padding: 22px; border: 1px solid var(--line); background: white; box-shadow: 0 14px 30px rgba(15, 23, 42, .06); }
.stat-card strong { font-size: 32px; display: block; margin-top: 12px; }
.stat-green { background: #dcfce7; }
.stat-yellow { background: #fef9c3; }
.stat-red { background: #fee2e2; }
.stat-blue { background: #dbeafe; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 22px; background: white; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
th { background: #f8fafc; font-size: 13px; color: #475569; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-flex; padding: 7px 10px; border-radius: 999px; font-weight: 800; font-size: 12px; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-dark { background: #e2e8f0; color: #0f172a; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 800; margin-bottom: 7px; }
.help { font-size: 13px; color: var(--muted); line-height: 1.6; }
.alert { padding: 14px 16px; border-radius: 18px; margin-bottom: 16px; border: 1px solid var(--line); background: white; }
.alert-success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #854d0e; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.switch-wrap { display: flex; align-items: center; gap: 12px; }
.switch-wrap input { width: 48px; height: 26px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-card { grid-template-columns: 1fr; text-align: center; }
    .logo-box { margin: 0 auto; }
}

@media (max-width: 620px) {
    .search-grid, .info-grid, .form-grid { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .admin-main { padding: 18px; }
    .admin-top { align-items: flex-start; flex-direction: column; }
    .btn-main, .btn-dark, .btn-blue, .btn-red, .btn-green, .btn-yellow { width: 100%; }
}

/* V3 responsive layout refinements */
.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(219,227,239,.9);
    backdrop-filter: blur(12px);
}
.site-header-inner {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.admin-header-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-brand {
    font-weight: 900;
    color: var(--ink);
    letter-spacing: -.02em;
}
.admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-brand img { width: 34px; height: 34px; object-fit: contain; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.site-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 999px;
    color: #1e293b;
    font-weight: 800;
    font-size: 13px;
}
.site-nav a:hover, .site-nav a.active { background: #dbeafe; color: #1d4ed8; }
.site-footer {
    padding: 18px 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}
.compact-hero { padding: 22px 0 14px; }
.public-hero-card { grid-template-columns: 72px 1fr; padding: 20px; border-radius: 22px; }
.public-hero-card .logo-box { width: var(--public-logo-size, 96px); height: var(--public-logo-size, 96px); border-radius: 18px; }
.public-hero-card .logo-box img { width: var(--public-logo-img-size, 84px); height: var(--public-logo-img-size, 84px); }
.public-hero-card .title-xl { font-size: clamp(24px, 3.4vw, 38px); line-height: 1.08; margin: 4px 0 8px; max-width: 920px; }
.intro-content { margin-top: 8px; }
.page-content { padding-bottom: 30px; }
.public-search-card { padding: 20px; border-radius: 22px; }
.public-form-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(250px, 330px) auto; gap: 12px; align-items: end; }
.no-margin { margin-bottom: 0; }
.captcha-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: center; }
.captcha-img { width: 170px; height: 54px; border: 1px solid var(--line); border-radius: 14px; background: white; object-fit: cover; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.note-box {
    margin-top: 18px;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    background: rgba(255,255,255,.78);
    overflow: hidden;
}
.note-title {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 900;
    color: #1e293b;
}
.note-box .rich-content { padding: 14px; }
.note-box .rich-content > :first-child { margin-top: 0; }
.note-box .rich-content > :last-child { margin-bottom: 0; }
.special-note { border-color: #bfdbfe; }
.login-head { display:flex; gap:14px; align-items:center; margin-bottom:20px; }
.login-head h1 { margin: 8px 0 0; font-size: 30px; }
.small-logo { width: 72px; height: 72px; border-radius: 18px; margin: 0; }
.small-logo img { width: 62px; height: 62px; }
.compact-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0; }
.compact-top { margin-bottom: 14px; }
.admin-title h1 { font-size: clamp(26px, 3.2vw, 38px); margin: 5px 0 0; }
.compact-card { padding: 22px; border-radius: 22px; }
.compact-card h2 { margin: 0 0 10px; font-size: 22px; }
.compact-form-grid { grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto; align-items: end; }
.form-button-row { padding-bottom: 16px; }
.btn-sm { padding: 11px 15px; border-radius: 13px; font-size: 14px; min-height: 42px; }
.compact-actions { gap: 8px; }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:14px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; }
.compact-table-wrap { border-radius: 18px; }
.compact-table th, .compact-table td { padding: 12px 14px; }
.compact-table th { font-size: 12px; }
.pagination-row { margin-top: 14px; }
.settings-switches { display: grid; gap: 10px; margin: 10px 0 18px; }
.toggle-line { display: flex; align-items: center; gap: 10px; font-weight: 800; color: #1e293b; }
.toggle-line input { width: 20px; height: 20px; }
.soft-divider { border: 0; border-top: 1px solid #dbe3ef; margin: 22px 0; }
.inline-prodi-form { display: grid; grid-template-columns: 130px minmax(220px, 1fr) 90px auto; gap: 10px; align-items: center; float: left; width: calc(100% - 86px); }
.delete-prodi-form { float: right; }
.compact-input { padding: 10px 12px; border-radius: 12px; }
.mini-check { display: flex; align-items: center; gap: 6px; font-weight: 800; color: #475569; }
.mini-check input { width: 16px; height: 16px; }
.add-prodi-form { margin-bottom: 4px; }

@media (max-width: 980px) {
    .public-form-grid, .compact-form-grid { grid-template-columns: 1fr; }
    .form-button-row { padding-bottom: 0; }
    .inline-prodi-form { width: 100%; grid-template-columns: 1fr; float: none; margin-bottom: 10px; }
    .delete-prodi-form { float: none; }
}

@media (max-width: 700px) {
    .site-header-inner, .admin-header-inner { align-items: flex-start; flex-direction: column; padding: 12px 0; }
    .site-nav { width: 100%; }
    .site-nav a { flex: 1; }
    .public-hero-card { grid-template-columns: 1fr; text-align: center; }
    .captcha-wrap { grid-template-columns: 1fr; }
    .captcha-img { width: 100%; }
    .section-head { align-items: flex-start; flex-direction: column; }
    .compact-main { width: min(100% - 20px, 1180px); padding: 14px 0; }
    .compact-card { padding: 18px; }
}
.public-header-inner { justify-content: space-between; }
.public-header-inner > div:empty { width: 1px; }

/* V4/V5 admin user shortcut and tabbed Site Panel */
.public-site-nav { gap: 10px; }
.site-nav a.admin-user-pill {
    background: #0f172a;
    color: #fff;
    padding-inline: 16px;
}
.site-nav a.admin-user-pill:hover { background: #1e293b; color: #fff; }
.admin-menu-card { margin-bottom: 18px; }
.no-bottom-margin { margin-bottom: 0; }
.admin-quick-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}
.admin-quick-menu a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #1e293b;
    font-size: 13px;
    font-weight: 900;
}
.admin-quick-menu a:hover,
.admin-quick-menu a.active {
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.settings-shell { padding-top: 16px; }
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f8fafc;
}
.settings-tabs .tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 14px;
    font-weight: 900;
    font-size: 13px;
    color: #475569;
}
.settings-tabs .tab-link:hover,
.settings-tabs .tab-link.active {
    background: #0f172a;
    color: #fff;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: rise .22s ease both; }
.tab-panel .section-head { margin-bottom: 16px; }

@media (max-width: 700px) {
    .public-site-nav {
        width: 100%;
        justify-content: space-between;
    }
    .public-site-nav > a { flex: 0 0 auto; }
    .settings-tabs { display: grid; grid-template-columns: 1fr 1fr; }
    .settings-tabs .tab-link { width: 100%; }
    .admin-quick-menu { display: grid; grid-template-columns: 1fr 1fr; }
}


/* V5 refinements */
.admin-header-simple { min-height: 60px; }
.header-user-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 15px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}
.header-user-pill:hover { background: #1e293b; color: #fff; }
.single-admin-menu {
    margin-bottom: 18px;
    padding: 12px;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15,23,42,.06);
}
.single-admin-menu .admin-quick-menu { margin-top: 0; }
.settings-shell { scroll-margin-top: 90px; }
.settings-tabs .tab-link { cursor: pointer; }
.public-site-nav { justify-content: flex-end; }

@media (max-width: 700px) {
    .public-hero-card .title-xl { font-size: clamp(23px, 7vw, 32px); }
    .admin-header-simple { align-items: center; flex-direction: row; padding: 10px 0; }
    .header-user-pill { flex: 0 0 auto; }
}

/* V6 refinements */
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.admin-account { position: relative; display: inline-flex; align-items: center; }
.admin-account-toggle { border: 0; gap: 8px; font-family: inherit; }
.admin-account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 170px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(15,23,42,.14);
    display: none;
    z-index: 80;
}
.admin-account.open .admin-account-menu { display: grid; gap: 4px; }
.admin-account-menu a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 12px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
}
.admin-account-menu a:hover { background: #eef4ff; color: #1d4ed8; }
.admin-account-menu a:last-child:hover { background: #fef2f2; color: #b91c1c; }
.single-admin-menu .admin-quick-menu { margin-top: 0; }
.import-shell .template-actions { margin-bottom: 6px; }
.import-shell .tab-panel { scroll-margin-top: 100px; }

@media (max-width: 700px) {
    .admin-account { align-self: flex-end; }
    .admin-account-menu { right: 0; }
}

/* V7 access control and countdown */
.access-closed-card {
    text-align: center;
    border-color: #bfdbfe;
    background: linear-gradient(145deg, #eff6ff, #ffffff);
}
.access-closed-card h2 {
    margin: 14px 0 8px;
    font-size: clamp(24px, 4vw, 36px);
    letter-spacing: -.035em;
}
.access-closed-card .rich-content {
    max-width: 720px;
    margin: 0 auto;
}
.countdown-box {
    margin: 22px auto 0;
    max-width: 720px;
    padding: 18px;
    border: 1px solid #bfdbfe;
    border-radius: 22px;
    background: rgba(255,255,255,.78);
}
.countdown-label {
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 12px;
}
.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.countdown-grid div {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px 10px;
    background: #f8fafc;
}
.countdown-grid strong {
    display: block;
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1;
    letter-spacing: -.04em;
}
.countdown-grid span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.result-card { scroll-margin-top: 92px; }
.access-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.access-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
}
.access-mode-option.active,
.access-mode-option:has(input:checked) {
    border-color: #93c5fd;
    background: #eff6ff;
}
.access-mode-option input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
}
.access-mode-option strong {
    display: block;
    font-weight: 900;
    margin-bottom: 4px;
}
.access-mode-option small {
    display: block;
    color: var(--muted);
    line-height: 1.5;
}
.access-current-status {
    min-height: 50px;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 900;
    border: 1px solid var(--line);
}
.access-current-status.open {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}
.access-current-status.closed {
    background: #fffbeb;
    border-color: #fde68a;
    color: #854d0e;
}

@media (max-width: 700px) {
    .countdown-grid,
    .access-mode-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* V8 public hero alignment */
.public-hero-card-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    padding: 28px 26px;
}
.public-hero-card-centered .hero-logo {
    margin: 0 auto;
}
.public-hero-card-centered .hero-text-center {
    width: min(920px, 100%);
    margin: 0 auto;
}
.public-hero-card-centered .title-xl {
    margin-left: auto;
    margin-right: auto;
    max-width: 920px;
}
.public-hero-card-centered .intro-content {
    display: inline-block;
    text-align: center;
}
@media (max-width: 700px) {
    .public-hero-card-centered {
        padding: 22px 18px;
    }
}


/* Revisi: pagination peserta admin */
.peserta-pagination {
    align-items: center;
    row-gap: 10px;
}
.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
}
.pagination-page:hover,
.pagination-page.active {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
}
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    min-height: 42px;
    color: var(--muted);
    font-weight: 900;
}
