:root {
    --brand: #4f46e5;
    --brand-dark: #3730a3;
    --brand-soft: #eef2ff;
    --sidebar-bg: #073b15;
    --sidebar-w: 270px;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f5f7fb;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: .925rem;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: #073b15;
    color: rgba(255, 255, 255, .82);
    display: flex; flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}
.sidebar .brand {
    display: flex; align-items: center; gap: .75rem;
    padding: 1.4rem 1.4rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.brand-logo {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, #16a34a, #15803d);
    display: grid; place-items: center; color: #fff; font-size: 1.3rem;
    box-shadow: 0 6px 16px rgba(22, 163, 74, .45);
}
.brand-title { color: #fff; font-weight: 700; line-height: 1.15; font-size: .95rem; }
.brand-sub { font-size: .7rem; color: rgba(255, 255, 255, .65); }

.sidebar-nav { padding: 1rem .9rem; flex: 1; overflow-y: auto; }
.nav-label {
    font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
    color: rgba(255, 255, 255, .5); padding: .9rem .8rem .4rem; font-weight: 600;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: .8rem;
    padding: .7rem .85rem; border-radius: 10px; margin-bottom: 3px;
    color: rgba(255, 255, 255, .82); text-decoration: none; font-weight: 500;
    transition: background .15s, color .15s;
}
.sidebar-nav a i { font-size: 1.1rem; opacity: .9; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar-nav a.active {
    background: rgba(255, 255, 255, .18);
    color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.sidebar-nav a .badge { margin-left: auto; }

.sidebar-user {
    padding: 1rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .1);
}
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #15803d);
    color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.sidebar-user .name { color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.2; }
.sidebar-user .role { font-size: .72rem; color: rgba(255, 255, 255, .65); text-transform: capitalize; }
.btn-logout {
    width: 100%; margin-top: .85rem; background: rgba(255, 255, 255, .07);
    border: 0; color: #fecaca; border-radius: 10px; padding: .55rem; font-weight: 500;
}
.btn-logout:hover { background: rgba(239, 68, 68, .2); color: #fff; }

/* ---------- Main ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
    background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: .9rem 1.75rem; position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: 1rem;
}
.topbar h1 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.topbar .date { margin-left: auto; color: var(--muted); font-size: .82rem; }
.content { padding: 1.75rem; }

.sidebar-toggle { display: none; border: 0; background: var(--brand-soft); color: var(--brand); border-radius: 10px; width: 40px; height: 40px; font-size: 1.3rem; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: none; }
    .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 1030; }
    .main { margin-left: 0; }
    .sidebar-toggle { display: inline-grid; place-items: center; }
    .topbar .date { display: none; }
    .content { padding: 1.1rem; }
}

/* ---------- Components ---------- */
.card { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .04); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 1rem 1.25rem; font-weight: 600; }
.card-body { padding: 1.25rem; }

.stat-card { position: relative; overflow: hidden; }
.stat-icon {
    width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem;
}
.stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.tone-indigo { background: #eef2ff; color: #4f46e5; }
.tone-green { background: #dcfce7; color: #16a34a; }
.tone-amber { background: #fef3c7; color: #d97706; }
.tone-rose { background: #ffe4e6; color: #e11d48; }

.hero {
    background: linear-gradient(120deg, #4f46e5 0%, #7c3aed 60%, #a855f7 100%);
    color: #fff; border-radius: 18px; padding: 1.75rem 2rem; position: relative; overflow: hidden;
    box-shadow: 0 14px 30px rgba(99, 102, 241, .35);
}
.hero::after {
    content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
    border-radius: 50%; background: rgba(255, 255, 255, .1);
}
.hero h2 { font-weight: 700; font-size: 1.5rem; }
.hero p { opacity: .85; margin: 0; }

.info-item { padding: .85rem 0; border-bottom: 1px dashed var(--line); display: flex; gap: 1rem; }
.info-item:last-child { border-bottom: 0; }
.info-item .k { width: 40%; color: var(--muted); font-weight: 500; }
.info-item .v { font-weight: 600; }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th {
    background: #f8fafc; color: var(--muted); font-size: .72rem; text-transform: uppercase;
    letter-spacing: .06em; font-weight: 600; border-bottom: 1px solid var(--line); padding: .85rem 1rem; white-space: nowrap;
}
.table td { padding: .85rem 1rem; border-color: var(--line); vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8faff; }

.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); }
.form-control, .form-select { border-radius: 10px; border-color: #cbd5e1; padding: .6rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15); }
.form-label { font-weight: 600; font-size: .82rem; color: #334155; }

.badge { font-weight: 600; padding: .4em .75em; border-radius: 999px; }
.badge-soft-success { background: #dcfce7; color: #15803d; }
.badge-soft-warning { background: #fef3c7; color: #b45309; }
.badge-soft-danger { background: #ffe4e6; color: #be123c; }
.badge-soft-info { background: #e0f2fe; color: #0369a1; }
.badge-soft-secondary { background: #f1f5f9; color: #475569; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.page-head h4 { font-weight: 700; margin: 0; }
.alert { border-radius: 12px; border: 0; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
    background: linear-gradient(145deg, #0f172a 0%, #312e81 55%, #6d28d9 100%);
    color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.login-art::before, .login-art::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.login-art::before { width: 380px; height: 380px; right: -120px; top: -100px; }
.login-art::after { width: 260px; height: 260px; left: -80px; bottom: -80px; }
.login-art h1 { font-weight: 800; font-size: 2.1rem; line-height: 1.2; }
.login-art p { color: #c7d2fe; max-width: 420px; }
.login-form-side { display: grid; place-items: center; padding: 2rem; background: #fff; }
.login-box { width: 100%; max-width: 380px; }
@media (max-width: 860px) {
    .login-wrap { grid-template-columns: 1fr; }
    .login-art { display: none; }
}



/* ---------- Notifications & Progress Stepper ---------- */
.notif-btn {
    position: relative; width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
    display: inline-grid; place-items: center; font-size: 1.15rem;
}
.notif-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: #c7d2fe; }
.notif-dot {
    position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px;
    padding: 0 5px; border-radius: 999px; background: #e11d48; color: #fff;
    font-size: .68rem; font-weight: 700; display: grid; place-items: center;
    border: 2px solid #fff;
}
.notif-menu {
    width: 340px; max-width: 92vw; border-radius: 14px; border: 1px solid var(--line);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12); padding: 0; overflow: hidden;
}
.notif-item {
    display: block; padding: .8rem 1rem; border-bottom: 1px solid var(--line);
    text-decoration: none; color: var(--ink); transition: background .15s;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: #f8faff; }
.notif-item.unread { background: #eef2ff; }
.notif-item.unread:hover { background: #e0e7ff; }

.progress-stepper {
    display: flex; justify-content: space-between; position: relative; margin: 1rem 0 .5rem;
}
.progress-stepper::before {
    content: ''; position: absolute; top: 15px; left: 12%; right: 12%;
    height: 3px; background: var(--line); z-index: 0;
}
.step-node {
    position: relative; z-index: 1; text-align: center; flex: 1;
}
.step-circle {
    width: 32px; height: 32px; border-radius: 50%; margin: 0 auto .35rem;
    background: #f1f5f9; border: 2px solid #cbd5e1; color: #64748b;
    display: grid; place-items: center; font-size: .85rem; font-weight: 700;
}
.step-node.done .step-circle {
    background: #16a34a; border-color: #16a34a; color: #fff;
}
.step-node.active .step-circle {
    background: var(--brand); border-color: var(--brand); color: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .18);
}
.step-title { font-size: .75rem; font-weight: 600; color: var(--muted); }
.step-node.done .step-title, .step-node.active .step-title { color: var(--ink); }


/* ---------- Certificate / Ijazah Preview (Compact under Data Tercatat) ---------- */
.ijazah-scroll {
    overflow-x: auto;
}
.ijazah-paper {
    position: relative;
    width: 100%;
    min-width: 480px;
    background-color: #f4f5f0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
    overflow: hidden;
    color: #111827;
    font-family: 'Times New Roman', Georgia, serif;
    padding: 1.1rem 1.25rem 1.25rem 4.6rem;
}
.ijazah-watermark {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .15;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 5px;
    font-weight: 700;
    letter-spacing: .2px;
    line-height: 8.5px;
    color: #334155;
    word-spacing: 4px;
    overflow: hidden;
    user-select: none;
}
/* Left decorative ribbon */
.ijazah-ribbon {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 26px;
    z-index: 2;
    background: linear-gradient(90deg,
        #4a6fa5 0%, #3b5998 30%, #e2e8f0 30%, #ffffff 50%, #e2e8f0 70%, #3b5998 70%, #4a6fa5 100%);
    box-shadow: 0 0 6px rgba(0, 0, 0, .16);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 6px 0;
}
.ijazah-ribbon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 9px,
        rgba(59, 89, 152, .85) 9px,
        rgba(59, 89, 152, .85) 14px
    );
    width: 5px;
    margin: 0 auto;
}
.ijazah-seal {
    position: absolute;
    top: 85px;
    left: 6px;
    width: 56px;
    height: 62px;
    z-index: 3;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.32));
}
.ijazah-content {
    position: relative;
    z-index: 2;
    text-align: center;
}
.ijazah-no {
    position: absolute;
    top: 0;
    right: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: .62rem;
    font-weight: 700;
    color: #1e293b;
}
.ijazah-top-logo {
    width: 46px;
    height: 48px;
    margin: 0 auto .15rem;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.15));
}
.ijazah-title {
    font-family: 'Times New Roman', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: .28em;
    color: #374151;
    margin: .05rem 0 .15rem;
    text-shadow: 1px 1px 0 #fff;
}
.ijazah-inst-1 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .03em;
    color: #1f2937;
}
.ijazah-inst-2 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: .92rem;
    font-weight: 900;
    letter-spacing: .02em;
    color: #111827;
    margin: .03rem 0;
}
.ijazah-inst-3 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .04em;
    color: #1f2937;
    margin-bottom: .25rem;
}
.ijazah-akreditasi {
    font-style: italic;
    font-weight: 700;
    font-size: .62rem;
    margin-bottom: .35rem;
}
.ijazah-body {
    font-size: .68rem;
    line-height: 1.48;
    color: #111827;
}
.ijazah-nama {
    font-family: Arial, Helvetica, sans-serif;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin: .12rem 0 .06rem;
}
.ijazah-gelar {
    font-size: .78rem;
    font-weight: 700;
    margin: .1rem 0;
}
.ijazah-sign-row {
    display: flex;
    justify-content: space-between;
    margin-top: .65rem;
    padding: 0 .6rem;
    font-size: .66rem;
}
.ijazah-sign-box {
    width: 46%;
    text-align: center;
}
.ijazah-sign-space {
    height: 38px;
}
.ijazah-sign-name {
    font-weight: 700;
    font-size: .62rem;
    letter-spacing: .01em;
}

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    .ijazah-paper { box-shadow: none; border: 0; width: 100%; min-width: 0; }
}


/* ---------- DataTables Customization ---------- */
.dt-container .row {
    margin: 0;
    padding: .75rem 1rem;
    align-items: center;
}
.dt-container .row:nth-child(2) {
    padding: 0;
}
.dt-container .dt-search input {
    border-radius: 10px;
    padding: .4rem .75rem;
    min-width: 220px;
}
.dt-container .dt-length select {
    border-radius: 8px;
    padding: .35rem 1.8rem .35rem .65rem;
}
.dt-container .dt-info {
    font-size: .82rem;
    color: var(--muted);
}
.dt-container .pagination {
    margin-bottom: 0;
}
