* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #ffffff;
    color: #18181b;
    font-size: 14px;
    line-height: 1.5;
}

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
}

.login-topbar {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e4e4e7;
    padding: 0 32px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.login-brand {
    font-size: 16px;
    font-weight: 700;
    color: #18181b;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    padding: 32px;
}

.login-title {
    font-size: 20px;
    font-weight: 700;
    color: #18181b;
    margin-bottom: 4px;
    text-align: center;
}

.login-subtitle {
    font-size: 13px;
    color: #71717a;
    margin-bottom: 24px;
    text-align: center;
}

.login-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f4f4f5;
    text-align: center;
    font-size: 12px;
    color: #71717a;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: #ffffff;
    border-right: 1px solid #e4e4e7;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid #e4e4e7;
    color: #18181b;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid #e4e4e7;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    color: #52525b;
    text-decoration: none;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: #f4f4f5;
    color: #18181b;
}

.nav-link.active {
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: #fafafa;
}

.topbar {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e4e4e7;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-title {
    font-weight: 700;
    font-size: 15px;
    color: #18181b;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    font-size: 13px;
    color: #52525b;
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #e4e4e7;
    border-radius: 5px;
    background: #f4f4f5;
    font-size: 12px;
    font-weight: 600;
    color: #27272a;
}

.page-content {
    padding: 28px 32px;
    width: 100%;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 20px 22px;
}

.stat-label {
    font-size: 13px;
    color: #71717a;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #18181b;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: #18181b;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 11px;
    width: 15px;
    height: 15px;
    stroke: #71717a;
    fill: none;
    stroke-width: 2;
}

.search-input {
    width: 240px;
    height: 38px;
    padding: 0 12px 0 34px;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    background: #ffffff;
    font-size: 13px;
    color: #18181b;
}

.search-input:focus {
    outline: none;
    border-color: #18181b;
}

.card {
    background: #ffffff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    margin-bottom: 22px;
    overflow: hidden;
}

.card-header {
    padding: 16px 22px;
    font-size: 15px;
    font-weight: 700;
    color: #18181b;
    border-bottom: 1px solid #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 20px 22px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #71717a;
    background-color: #fafafa;
    border-bottom: 1px solid #e4e4e7;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #f4f4f5;
    color: #27272a;
    vertical-align: middle;
}

tbody tr:hover {
    background-color: #fafafa;
}

tfoot td {
    font-weight: 700;
    background-color: #f4f4f5;
    border-top: 2px solid #d4d4d8;
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.badge-outline {
    background: #ffffff;
    border: 1px solid #d4d4d8;
    color: #18181b;
}

.badge-dark {
    background: #18181b;
    border: 1px solid #18181b;
    color: #ffffff;
}

.badge-soft {
    background: #f4f4f5;
    border: 1px solid #d4d4d8;
    color: #27272a;
}

.badge-muted {
    background: #ffffff;
    border: 1px solid #d4d4d8;
    color: #71717a;
}

.split-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #3f3f46;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    background: #ffffff;
    font-size: 13px;
    color: #18181b;
}

.form-control:focus {
    outline: none;
    border-color: #18181b;
}

.file-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    height: 38px;
    padding: 0 5px 0 12px;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    background: #ffffff;
}

.file-input-hidden {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-input-name {
    font-size: 13px;
    color: #18181b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-input-name.text-muted {
    color: #71717a;
}

.file-input-btn {
    flex-shrink: 0;
    height: 28px;
    padding: 0 10px;
    font-weight: 500;
}

.form-grid-5 {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.5fr 0.8fr 0.9fr;
    gap: 14px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.form-grid-peserta-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: end;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn:hover {
    opacity: 0.9;
}

.btn-dark {
    background-color: #18181b;
    color: #ffffff;
    border-color: #18181b;
}

.btn-outline {
    background-color: #ffffff;
    color: #18181b;
    border-color: #d4d4d8;
}

.btn-sm {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.link-action {
    background: none;
    border: none;
    color: #18181b;
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.link-danger {
    color: #b91c1c;
}

.action-sep {
    color: #d4d4d8;
    margin: 0 6px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(24, 24, 27, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: #ffffff;
    border-radius: 10px;
    max-width: 580px;
    width: 100%;
    border: 1px solid #e4e4e7;
    overflow: hidden;
}

.modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e4e4e7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #71717a;
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.modal-body img {
    max-width: 100%;
    max-height: 420px;
    border-radius: 6px;
    border: 1px solid #e4e4e7;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #71717a; }
.text-bold { font-weight: 600; color: #18181b; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.btn-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.print-header { display: none; }

@media (max-width: 960px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .split-grid, .form-grid-5, .form-grid-3, .form-grid-peserta-bottom { grid-template-columns: 1fr; }
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e4e4e7; }
}

@media print {
    .sidebar, .topbar, .no-print {
        display: none !important;
    }
    .page-content {
        padding: 0;
        max-width: 100%;
    }
    .card {
        border: none;
    }
    .print-header {
        display: block;
        margin-bottom: 16px;
        border-bottom: 2px solid #18181b;
        padding-bottom: 10px;
    }
}
