/* ==========================================================
   SI-DIKLIT - Stylesheet Utama
   ========================================================== */
:root {
    --navy: #0b1220;
    --navy-light: #16213a;
    --teal: #10b981;
    --teal-dark: #0d9668;
    --orange: #f97316;
    --red: #ef4444;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f4f6f9;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
}

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

/* ---------- Layout ---------- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 28px 36px;
    max-width: calc(100% - 260px);
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 260px;
    background: var(--navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 18px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
    flex-shrink: 0;
    padding: 3px;
}
.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-title { font-size: 13px; font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--teal); font-weight: 600; }

.sidebar-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 14.5px;
    font-weight: 500;
    transition: background 0.15s;
}

.nav-item:hover { background: rgba(255,255,255,0.06); }

.nav-item.active {
    background: var(--teal);
    color: #fff;
    font-weight: 600;
}

.nav-icon { font-size: 16px; }

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 12px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: #94a3b8; }
.logout-btn { color: #94a3b8; font-size: 16px; padding: 4px; }
.logout-btn:hover { color: var(--red); }

/* ---------- Top Header ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; }
.page-header p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-outline {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-dark);
}
.btn-outline:hover { background: #f8fafc; }

.btn-primary { background: var(--teal); color: #fff; width: 100%; margin-top: 20px; }
.btn-primary:hover { background: var(--teal-dark); }

.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }

.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-danger-outline { background: #fff; border: 1px solid #fca5a5; color: var(--red); }
.btn-danger-outline:hover { background: #fef2f2; }
.btn-edit { background: #eff6ff; border: 1px solid #bfdbfe; color: #2563eb; }

/* ---------- Stat Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--teal);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-card.orange { border-left-color: var(--orange); }
.stat-card.red { border-left-color: var(--red); }

.stat-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value { font-size: 30px; font-weight: 800; margin: 8px 0 6px; color: var(--text-dark); }
.stat-value.orange { color: var(--orange); }

.stat-foot { font-size: 12.5px; color: var(--teal-dark); font-weight: 500; }
.stat-foot.orange { color: var(--orange); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #ecfdf5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.stat-icon.orange-bg { background: #fff7ed; }

/* ---------- Card / Table Container ---------- */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 22px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 { margin: 0 0 4px; font-size: 17px; }
.card-header p { margin: 0; color: var(--text-muted); font-size: 13px; }

.search-input {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13.5px;
    width: 260px;
    max-width: 100%;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
    text-align: left;
    padding: 12px 10px;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border);
}

tbody td { padding: 14px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
tbody tr:hover { background: #fafbfc; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--text-dark);
    font-size: 11.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.badge-link { background: #ecfdf5; color: var(--teal-dark); padding: 5px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; }

.pegawai-name { font-weight: 700; }
.pegawai-nip { color: var(--text-muted); font-size: 12px; }
.actions-cell { white-space: nowrap; display: flex; gap: 8px; align-items: center; }

.judul-text { font-weight: 600; max-width: 320px; }
.penyelenggara-text { font-size: 12px; margin-top: 2px; }

.badge-status {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.badge-ket {
    background: #f1f5f9;
    color: var(--text-dark);
}

.icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.icon-link { background: #eff6ff; border-color: #bfdbfe; }
.icon-link:hover { background: #dbeafe; }
.icon-edit { background: #f0fdf4; border-color: #bbf7d0; }
.icon-edit:hover { background: #dcfce7; }
.icon-delete { background: #fef2f2; border-color: #fecaca; color: var(--red); }
.icon-delete:hover { background: #fee2e2; }
.icon-disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-dark);
    font-size: 13.5px;
    font-weight: 600;
    transition: background 0.15s;
}

.page-btn:hover { background: #f8fafc; }

.page-btn.active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.page-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-ellipsis {
    padding: 0 6px;
    color: var(--text-muted);
    font-size: 13.5px;
}

.text-muted { color: var(--text-muted); }
.empty-row td { text-align: center; padding: 40px; color: var(--text-muted); }

/* ---------- Modal ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-box {
    background: #fff;
    border-radius: 14px;
    width: 640px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px 28px;
}

.modal-box.small { width: 460px; }

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 20px;
}
.modal-head h2 { font-size: 19px; margin: 0; }
.modal-close { cursor: pointer; font-size: 20px; color: var(--text-muted); background: none; border: none; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 13.5px; font-weight: 600; }
.form-group label .req { color: var(--red); }
.form-group input, .form-group select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--teal); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.alert-success { background: #ecfdf5; color: var(--teal-dark); border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ---------- Auth Pages ---------- */
.auth-body {
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 34px;
    width: 380px;
    max-width: 90vw;
}

.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-logo h1 { font-size: 14px; margin: 0; line-height: 1.3; }
.logo-icon {
    width: 46px; height: 46px; border-radius: 10px;
    background: #fff; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    overflow: hidden; flex-shrink: 0; padding: 3px;
}
.logo-icon img { width: 100%; height: 100%; object-fit: contain; }
.logo-sub { font-size: 12.5px; color: var(--teal); font-weight: 700; }

.auth-card h2 { font-size: 18px; margin: 0 0 18px; }
.auth-card form { display: flex; flex-direction: column; }
.auth-card label { font-size: 13.5px; font-weight: 600; margin: 12px 0 6px; }
.auth-card input {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}
.auth-card code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }

/* ---------- Login Page (Premium Split Layout) ---------- */
.login-body { margin: 0; min-height: 100vh; }

.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Panel kiri - branding */
.login-visual {
    position: relative;
    flex: 1.1;
    background: linear-gradient(160deg, #0b1220 0%, #0f2e28 45%, #0d3b2f 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 60px;
    overflow: hidden;
    color: #fff;
}

.login-visual-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.35;
    pointer-events: none;
}
.blob-1 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, var(--teal), transparent 70%);
    top: -120px; right: -100px;
}
.blob-2 {
    width: 380px; height: 380px;
    background: radial-gradient(circle, var(--orange), transparent 70%);
    bottom: -140px; left: -80px;
}

.login-visual-content { position: relative; z-index: 1; margin-top: 40px; }

.login-visual-logo {
    width: 84px; height: 84px;
    background: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    margin-bottom: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.login-visual-logo img { width: 100%; height: 100%; object-fit: contain; }

.login-visual h1 {
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: 0.3px;
}

.login-visual-tagline {
    font-size: 15px;
    color: #cbd5e1;
    max-width: 380px;
    line-height: 1.6;
    margin: 0 0 36px;
}

.login-visual-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.login-visual-points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: #e2e8f0; }
.point-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: linear-gradient(135deg, var(--teal), var(--orange));
    flex-shrink: 0;
}

.login-visual-footer {
    position: relative;
    z-index: 1;
    font-size: 12.5px;
    color: #64748b;
}

/* Panel kanan - form */
.login-panel {
    flex: 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.login-form-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    border: 1px solid #eef1f5;
    animation: loginFadeIn 0.5s ease;
}

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

.login-form-logo-mobile { display: none; align-items: center; gap: 10px; margin-bottom: 20px; }
.login-form-logo-mobile img { width: 40px; height: 40px; object-fit: contain; }
.login-form-brand { font-size: 13px; font-weight: 700; }
.login-form-brand-sub { font-size: 11.5px; color: var(--teal); font-weight: 700; }

.login-form-header h2 { font-size: 23px; margin: 0 0 6px; font-weight: 800; color: var(--text-dark); }
.login-form-subtitle { font-size: 13.5px; color: var(--text-muted); margin: 0 0 26px; }

.login-form .input-group { margin-bottom: 18px; }
.login-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-dark); }

.input-with-icon { position: relative; display: flex; align-items: center; }
.input-icon {
    position: absolute; left: 14px;
    font-size: 15px; opacity: 0.55; pointer-events: none;
}
.input-with-icon input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-with-icon input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
.toggle-password {
    position: absolute; right: 10px;
    background: none; border: none; cursor: pointer;
    font-size: 15px; opacity: 0.6; padding: 4px 6px;
}
.toggle-password:hover { opacity: 1; }

.btn-login {
    width: 100%;
    margin-top: 6px;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.12s, box-shadow 0.12s;
    box-shadow: 0 8px 20px rgba(16,185,129,0.25);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16,185,129,0.32); }
.btn-login:active { transform: translateY(0); }
.btn-login-arrow { transition: transform 0.15s; }
.btn-login:hover .btn-login-arrow { transform: translateX(3px); }

.login-form-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin: 24px 0 0;
}

@media (max-width: 900px) {
    .login-visual { display: none; }
    .login-form-logo-mobile { display: flex; }
    .login-panel { background: #f8fafc; }
}

/* ---------- Misc / CSV upload box ---------- */
.csv-drop {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 26px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13.5px;
}
.csv-hint { font-size: 12px; color: var(--text-muted); margin-top: 10px; line-height: 1.6; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; min-height: auto; position: relative; }
    .main-content { max-width: 100%; padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}
