:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --soft: #eef2ff;
    --ink: #172033;
    --muted: #64748b;
    --surface: #ffffff;
    --line: #e9edf5;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f5f7fb; color: var(--ink); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar, .mobile-sidebar { width: 260px; background: linear-gradient(180deg, #312e81 0%, #4338ca 50%, #312e81 100%); color: white; }
.sidebar { position: fixed; inset: 0 auto 0 0; padding: 24px 18px; z-index: 1030; }
.brand { display: flex; align-items: center; gap: 12px; color: white; font-size: 1.15rem; }
.brand small { font-weight: 500; opacity: .75; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.16); font-size: 1.2rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.sidebar .nav-link, .mobile-sidebar .nav-link { color: rgba(255,255,255,.76); border-radius: 12px; padding: 11px 13px; display: flex; align-items: center; gap: 12px; transition: .2s ease; }
.sidebar .nav-link:hover, .mobile-sidebar .nav-link:hover { color: white; background: rgba(255,255,255,.1); }
.sidebar .nav-link.active, .mobile-sidebar .nav-link.active { color: #312e81; background: white; box-shadow: 0 10px 30px rgba(0,0,0,.12); font-weight: 700; }
.sidebar .nav-link i, .mobile-sidebar .nav-link i { font-size: 1.05rem; width: 22px; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.15); padding-top: 18px; }
.main-content { width: 100%; min-width: 0; margin-left: 260px; }
.topbar { min-height: 82px; padding: 16px 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
.content-wrap { padding: 28px; }
.user-menu { border: 0; background: transparent; display: flex; align-items: center; gap: 9px; }
.avatar { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, var(--primary), #7c3aed); font-weight: 800; }
.card { border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 7px 24px rgba(15,23,42,.045); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 18px 20px; }
.card-body { padding: 20px; }
.stat-card { overflow: hidden; position: relative; }
.stat-card .stat-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; font-size: 1.25rem; background: var(--soft); color: var(--primary); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.stat-card:after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; background: var(--soft); right: -38px; bottom: -42px; opacity: .75; }
.btn { border-radius: 11px; font-weight: 600; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.form-control, .form-select { border-radius: 11px; border-color: #dce2ec; min-height: 43px; }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .22rem rgba(79,70,229,.12); }
.table { --bs-table-bg: transparent; }
.table thead th { color: #64748b; text-transform: uppercase; font-size: .73rem; letter-spacing: .05em; border-bottom-width: 1px; white-space: nowrap; }
.table > :not(caption) > * > * { padding: .85rem .75rem; vertical-align: middle; border-color: #edf0f5; }
.table-responsive { border-radius: 14px; }
.badge { border-radius: 999px; padding: .48em .75em; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state i { font-size: 2.5rem; color: #c7d2fe; }
.score-input { width: 90px; min-width: 80px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 14px 0 0; }
.metric-progress { height: 8px; border-radius: 999px; background: #edf0f6; overflow: hidden; }
.metric-progress > span { height: 100%; display: block; background: linear-gradient(90deg, #4f46e5, #8b5cf6); }
.login-page { min-height: 100vh; background: radial-gradient(circle at top left, #c7d2fe, transparent 35%), radial-gradient(circle at bottom right, #ddd6fe, transparent 35%), #f8fafc; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 430px; border: 0; border-radius: 26px; box-shadow: 0 24px 60px rgba(49,46,129,.14); }
.login-logo { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 20px; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: white; font-size: 1.7rem; }
.mobile-sidebar .offcanvas-header { padding: 22px; }
.mobile-sidebar .offcanvas-body { padding: 8px 18px 24px; }
.app-footer { border-top: 1px solid var(--line); }
@media (max-width: 991.98px) {
    .main-content { margin-left: 0; }
    .topbar { padding: 12px 16px; min-height: 72px; }
    .content-wrap { padding: 18px 14px; }
}
@media print {
    .sidebar, .topbar, .app-footer, .no-print, .btn { display: none !important; }
    .main-content { margin: 0; }
    .content-wrap { padding: 0; }
    body { background: white; }
    .card { border: 0; box-shadow: none; }
}

/* Sidebar ringkas dengan submenu */
.sidebar { overflow-y: auto; }
.sidebar-nav { padding-bottom: 18px; }
.nav-group { width: 100%; }
.sidebar .nav-group-toggle,
.mobile-sidebar .nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}
.sidebar .nav-group-toggle .nav-chevron,
.mobile-sidebar .nav-group-toggle .nav-chevron {
    width: auto;
    margin-left: auto;
    font-size: .78rem;
    transition: transform .2s ease;
}
.sidebar .nav-group-toggle[aria-expanded="true"] .nav-chevron,
.mobile-sidebar .nav-group-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.sidebar .nav-group-toggle.active-parent,
.mobile-sidebar .nav-group-toggle.active-parent {
    color: white;
    background: rgba(255,255,255,.11);
}
.nav-submenu { padding: 5px 0 7px 20px; display: grid; gap: 3px; }
.sidebar .nav-sublink,
.mobile-sidebar .nav-sublink {
    color: rgba(255,255,255,.72);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: .9rem;
    transition: .2s ease;
    position: relative;
}
.sidebar .nav-sublink:before,
.mobile-sidebar .nav-sublink:before {
    content: "";
    position: absolute;
    left: -9px;
    width: 1px;
    height: 100%;
    background: rgba(255,255,255,.12);
}
.sidebar .nav-sublink i,
.mobile-sidebar .nav-sublink i { width: 18px; font-size: .9rem; }
.sidebar .nav-sublink:hover,
.mobile-sidebar .nav-sublink:hover { color: white; background: rgba(255,255,255,.09); }
.sidebar .nav-sublink.active,
.mobile-sidebar .nav-sublink.active { color: #312e81; background: white; font-weight: 700; box-shadow: 0 8px 22px rgba(0,0,0,.1); }

/* Backup & Pemulihan */
.backup-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
    box-shadow: 0 5px 18px rgba(15,23,42,.035);
}
.backup-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 11px;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 650;
    font-size: .91rem;
}
.backup-tab:hover { color: var(--primary); background: var(--soft); }
.backup-tab.active { color: white; background: var(--primary); box-shadow: 0 8px 18px rgba(79,70,229,.22); }
.backup-filename { max-width: 260px; }
.system-check { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.system-check:last-child { border-bottom: 0; padding-bottom: 0; }
.check-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; font-weight: 800; }
.check-icon.ok { color: #047857; background: #d1fae5; }
.check-icon.warning { color: #b45309; background: #fef3c7; }
.min-w-0 { min-width: 0; }
.backup-type-grid { display: grid; gap: 14px; }
.backup-type-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 17px;
    cursor: pointer;
    position: relative;
    transition: .2s ease;
    background: white;
}
.backup-type-card:hover { border-color: #c7d2fe; transform: translateY(-1px); box-shadow: 0 9px 24px rgba(79,70,229,.07); }
.backup-type-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.backup-type-card:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.backup-type-card input { position: absolute; opacity: 0; pointer-events: none; }
.backup-type-card strong { display: block; margin-bottom: 3px; }
.backup-type-card small { display: block; color: var(--muted); line-height: 1.45; }
.backup-type-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: var(--soft); font-size: 1.2rem; }
.selected-mark { color: var(--primary); opacity: 0; font-size: 1.2rem; }
.backup-type-card:has(input:checked) .selected-mark { opacity: 1; }
.recommended { position: absolute; right: 16px; top: -10px; background: #f59e0b; color: white; font-size: .68rem; font-weight: 800; border-radius: 999px; padding: 4px 9px; }
.backup-option { display: flex; gap: 12px; align-items: flex-start; padding-left: 0; }
.backup-option .form-check-input { margin-left: 0; flex: 0 0 auto; }
.backup-option strong, .backup-option small { display: block; }
.backup-option small { color: var(--muted); margin-top: 2px; line-height: 1.45; }
.backup-summary-card { top: 104px; }
.backup-list-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; font-size: 1.05rem; }
.backup-list-icon.type-database { background: #dbeafe; color: #1d4ed8; }
.backup-list-icon.type-application { background: #ede9fe; color: #6d28d9; }
.backup-list-icon.type-full { background: #dcfce7; color: #15803d; }
.checksum-preview { font: .73rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.security-note { display: flex; align-items: flex-start; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.security-note:last-child { border-bottom: 0; padding-bottom: 0; }
.security-note > i { color: var(--primary); font-size: 1.25rem; }
.security-note p { color: var(--muted); font-size: .87rem; margin: 3px 0 0; }
.cron-command { background: #111827; color: #d1fae5; border-radius: 12px; padding: 13px; overflow-x: auto; font: .78rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.restore-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.restore-steps li { display: grid; grid-template-columns: 38px 1fr; gap: 14px; }
.restore-steps li > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--soft); color: var(--primary); font-weight: 800; }
.restore-steps p { color: var(--muted); margin: 4px 0 0; }
.restore-order { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.restore-order:last-child { border-bottom: 0; }
.restore-order span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--soft); color: var(--primary); font-weight: 800; }
@media (max-width: 767.98px) {
    .backup-tab span { display: none; }
    .backup-tab { flex: 1; justify-content: center; }
    .backup-type-card { grid-template-columns: auto 1fr; }
    .selected-mark { display: none; }
    .recommended { right: 10px; }
}

/* Agenda Guru & Jadwal Pelajaran v1.4.1 */
.planning-stat { overflow: hidden; position: relative; }
.planning-stat .card-body { position: relative; z-index: 1; }
.planning-stat-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    margin-bottom: 14px;
    color: var(--primary);
    background: var(--soft);
    font-size: 1.1rem;
}
.planning-form-card { position: sticky; top: 94px; }
.agenda-timeline { display: grid; gap: 4px; }
.agenda-day-group { display: grid; grid-template-columns: 66px 1fr; gap: 14px; position: relative; }
.agenda-day-group:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 31px;
    top: 58px;
    bottom: -6px;
    width: 2px;
    background: #e5e7eb;
}
.agenda-date-marker {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 18px;
    color: white;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    box-shadow: 0 10px 24px rgba(79,70,229,.18);
    position: relative;
    z-index: 1;
}
.agenda-date-marker span { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.agenda-date-marker small { font-size: .68rem; margin-top: 4px; opacity: .85; }
.agenda-day-content { min-width: 0; padding-bottom: 10px; }
.agenda-item-card { transition: .2s ease; }
.agenda-item-card:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(15,23,42,.07); }
.agenda-item-card.agenda-done { opacity: .72; }
.agenda-item-card.agenda-done h3 { text-decoration: line-through; }
.agenda-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--primary);
    background: var(--soft);
}
.agenda-description { line-height: 1.55; }
.schedule-week-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.schedule-day-card { overflow: hidden; }
.schedule-current-day { border: 1px solid #a5b4fc; box-shadow: 0 10px 30px rgba(79,70,229,.09); }
.schedule-current-day .card-header { background: #eef2ff; }
.schedule-day-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.schedule-current-day .schedule-day-dot { background: var(--primary); box-shadow: 0 0 0 5px rgba(79,70,229,.12); }
.schedule-item { display: flex; gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); }
.schedule-item:last-child { border-bottom: 0; }
.schedule-inactive { opacity: .55; background: #f8fafc; }
.schedule-time-block {
    width: 58px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 8px 4px;
    border-radius: 12px;
    color: var(--primary);
    background: var(--soft);
}
.schedule-time-block strong { font-size: .9rem; }
.schedule-time-block small { font-size: .72rem; color: var(--muted); }
.schedule-empty { color: var(--muted); text-align: center; padding: 28px 16px; font-size: .9rem; }
.schedule-today-card { overflow: hidden; }
.today-schedule-item { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 14px; padding: 13px; height: 100%; }
.today-schedule-time { min-width: 54px; color: var(--primary); font-weight: 800; }
.dashboard-planning-item { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dashboard-planning-item:last-child { border-bottom: 0; }
.dashboard-planning-time { min-width: 50px; font-weight: 800; color: var(--primary); }
@media (max-width: 1199.98px) {
    .planning-form-card { position: static; }
}
@media (max-width: 767.98px) {
    .schedule-week-grid { grid-template-columns: 1fr; }
    .agenda-day-group { grid-template-columns: 48px 1fr; gap: 10px; }
    .agenda-date-marker { width: 48px; height: 54px; border-radius: 14px; }
    .agenda-date-marker span { font-size: 1.05rem; }
    .agenda-date-marker small { font-size: .58rem; }
    .agenda-day-group:not(:last-child)::before { left: 23px; top: 50px; }
    .agenda-icon { display: none; }
}
