:root {
    --green-start: #00b884;
    --green-end: #4ade80;
    --bg-soft: #eafff4;
    --border-soft: #d7f5e8;
    --text-main: #094235;
    --text-muted: #52606d;
    --danger: #ef4444;
    --success: #16a34a;
    --radius-lg: 18px;
    --radius-md: 10px;
    --shadow-soft: 0 18px 45px rgba(15, 118, 110, 0.13);
    --shadow-card: 0 25px 55px rgba(15, 118, 110, 0.15);
    --font-main: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-soft: rgba(255, 255, 255, 0.7);
    --focus-ring: rgba(34, 197, 94, 0.25);
    --page-border: rgba(34, 197, 94, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-main);
    color: var(--text-main);
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.9), var(--bg-soft)),
                linear-gradient(160deg, #f9fff6, #d3f5e1);
    min-height: 100vh;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--green-start), var(--green-end));
}
.auth-container { width: 100%; max-width: 420px; padding: 16px; }
.auth-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 32px 28px;
    box-shadow: var(--shadow-soft);
}
.logo-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.logo-subtitle { font-size: 14px; color: #6b7280; margin-bottom: 20px; }
.auth-demo { margin-top: 20px; font-size: 12px; color: #6b7280; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    margin: 0 auto;
    width: min(1200px, 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--page-border);
    border-radius: 0 0 30px 30px;
    background: var(--surface-soft);
    box-shadow: 0 25px 55px rgba(15, 118, 110, 0.08);
    backdrop-filter: blur(12px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.logo-circle {
    width: 34px; height: 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--green-start), var(--green-end));
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.logo-text { font-weight: 700; font-size: 18px; }
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.welcome {
    font-size: 14px;
    color: var(--text-muted);
}

.page {
    width: min(1200px, 100%);
    margin: 28px auto 40px;
    padding: 32px;
    border-radius: 32px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--page-border);
    backdrop-filter: blur(20px);
    position: relative;
}
.page::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.page-main {
    position: relative;
    z-index: 1;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.05);
}
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 35px rgba(15, 118, 110, 0.12);
}
.stat-card p { font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.stat-card h2 { font-size: 22px; font-weight: 700; }

.tabs {
    display: flex;
    margin-bottom: 18px;
    background: #dcfce7;
    border-radius: 999px;
    padding: 6px;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.2), 0 15px 35px rgba(34, 197, 94, 0.1);
}
.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.tab-btn.active {
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.18);
}

.tab-panel {
    display: none;
    background: #ffffff;
    border-radius: 24px;
    padding: 20px 22px;
    box-shadow: var(--shadow-soft);
}
.tab-panel {
    transition: transform 0.2s ease;
}
.tab-panel.active { display: block; }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.panel-header h3 { margin-bottom: 2px; }
.panel-header h3 { font-size: 18px; }
.panel-header p { font-size: 13px; color: #6b7280; }

.form-label { font-size: 13px; margin-bottom: 4px; display: block; }
.form { display: flex; flex-direction: column; gap: 10px; }
.input, textarea.input, select.input {
    width: 100%;
    padding: 9px 11px;
    border-radius: 11px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    outline: none;
    transition: border 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.btn {
    border-radius: 999px;
    border: none;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.15s;
}
.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--green-start), var(--green-end));
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(16, 185, 129, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
}
.w-full { width: 100%; }

.table-responsive {
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(15, 118, 110, 0.15);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 25px 45px rgba(15, 118, 110, 0.12);
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead { background: #f3f4f6; }
.table th, .table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.table tbody tr:nth-child(even) { background: #f9fafb; }

@media (max-width: 560px) {
    .table-responsive {
        border-radius: 16px;
        padding: 4px;
    }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }
    .table tr {
        margin-bottom: 12px;
        border: 1px solid rgba(15, 118, 110, 0.12);
        border-radius: 16px;
        padding: 12px 10px;
        background: #ffffff;
        box-shadow: 0 15px 35px rgba(15, 118, 110, 0.08);
    }
    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        border: none;
        font-size: 13px;
    }
    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #1f2937;
        flex: 1;
        white-space: nowrap;
        margin-right: 8px;
    }
}

.table tbody tr {
    transition: transform 0.18s ease;
}
.table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.filters-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    background: #f5fff9;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.filters-row .input {
    flex: 1 1 180px;
    min-width: 180px;
}
.pagination {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}
.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 13px;
    cursor: pointer;
}
.page-btn.active {
    background: #4ade80;
    border-color: #22c55e;
    color: #ffffff;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 40;
}
.modal.show { display: flex; }
.modal-content {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px 18px;
    max-width: 520px;
    width: min(90vw, 520px);
    max-height: 90vh;
    overflow: hidden;
}
.modal-content h3 { margin-bottom: 14px; }
.modal-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.ktp-preview {
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 520px;
    width: 100%;
}

.ktp-preview img {
    max-width: 480px;
    max-height: 65vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 46, 73, 0.15);
    object-fit: contain;
    display: block;
}

.alert {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 12px;
}
.alert-error {
    background: #fee2e2;
    color: #b91c1c;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* STATUS BADGES */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25), 0 0 12px rgba(148, 163, 184, 0.25);
}
.status-menunggu {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25), 0 0 14px rgba(59, 130, 246, 0.35);
}
.status-proses {
    background: rgba(234, 179, 8, 0.12);
    color: #b45309;
    box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.35), 0 0 14px rgba(234, 179, 8, 0.35);
}
.status-sukses {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.35), 0 0 16px rgba(22, 163, 74, 0.45);
}
.status-batal {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35), 0 0 16px rgba(239, 68, 68, 0.4);
}
.status-default {
    background: rgba(107, 114, 128, 0.12);
    color: #374151;
}

/* STATUS BADGES */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25), 0 0 12px rgba(148, 163, 184, 0.25);
}
.status-menunggu {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25), 0 0 14px rgba(59, 130, 246, 0.35);
}
.status-proses {
    background: rgba(234, 179, 8, 0.12);
    color: #b45309;
    box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.35), 0 0 14px rgba(234, 179, 8, 0.35);
}
.status-sukses {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.35), 0 0 16px rgba(22, 163, 74, 0.45);
}
.status-batal {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35), 0 0 16px rgba(239, 68, 68, 0.4);
}
.status-default {
    background: rgba(107, 114, 128, 0.12);
    color: #374151;
}

@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .topbar { padding: 0 16px; }
    .page { padding: 18px 16px 28px; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .stats-row { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .panel-header { flex-direction: column; align-items: flex-start; }
    .topbar-right .welcome { display: none; }
}

@media (min-width: 641px) and (max-width: 960px) {
    .page { padding: 20px 16px 30px; }
    .tab-panel, .table-responsive { padding: 16px; }
    .filters-row { flex-direction: column; }
    .panel-header h3 { font-size: 16px; }
}

@media (max-width: 620px) {
    .page { padding: 16px 12px 24px; }
    .topbar { padding: 0 12px; }
    .tabs { gap: 4px; flex-wrap: wrap; }
    .tab-btn { font-size: 12px; padding: 6px 10px; }
    .tab-panel { padding: 16px 14px; }
    .filters-row { flex-direction: column; }
    .table th, .table td { padding: 8px 10px; font-size: 12px; }
    .panel-header { gap: 8px; }
    .btn { padding: 6px 12px; font-size: 13px; }
    .table-responsive { border-radius: 14px; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .modal-content { width: min(96vw, 480px); }
}

@media (max-width: 420px) {
    .stats-row { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .tab-btn { flex: 100%; text-align: center; }
    .table { font-size: 11px; }
    .table th, .table td { padding: 6px 8px; }
    .filters-row > * { width: 100%; }
}

@media (max-width: 360px) {
    .topbar { flex-direction: column; gap: 8px; height: auto; }
    .topbar-left, .topbar-right { justify-content: center; width: 100%; }
    .topbar-right button { width: 100%; }
    .page { padding: 12px 10px 20px; }
    .tabs { padding: 4px; }
    .filters-row input, .filters-row select { font-size: 11px; }
}
