/* =========================================================
   STYLE.CSS - Tema Modern Sistem Akademik Rumah Belajar IPM Kudus
   ========================================================= */
:root {
    --primary: #6c5ce7;
    --primary-dark: #5641d8;
    --secondary: #00cec9;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --dark: #2d3436;
    --light-bg: #f6f7fb;
    --sidebar-w: 270px;
    --radius: 16px;
    --shadow: 0 8px 24px rgba(108, 92, 231, 0.08);
    --transition: all .25s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: var(--light-bg);
    color: var(--dark);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9c4f5; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- LOGIN PAGE ---------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6c5ce7 0%, #341f97 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    opacity: .35;
    animation: floatBlob 8s ease-in-out infinite;
}
.blob1 { width: 320px; height: 320px; background: #00cec9; top: -80px; left: -80px; }
.blob2 { width: 260px; height: 260px; background: #fd79a8; bottom: -60px; right: -60px; animation-delay: 2s; }
.blob3 { width: 200px; height: 200px; background: #fdcb6e; bottom: 40%; right: 10%; animation-delay: 4s; }

@keyframes floatBlob {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.08); }
}

.login-card {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    max-width: 900px;
    background: rgba(255,255,255,.97);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,.25);
    animation: popIn .6s ease;
}
@keyframes popIn {
    from { opacity: 0; transform: translateY(30px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-welcome {
    flex: 1.1;
    background: linear-gradient(160deg, var(--primary), #341f97 120%);
    color: #fff;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}
.login-welcome h1 { font-size: 26px; font-weight: 700; margin-bottom: 10px; }
.login-welcome p { opacity: .9; line-height: 1.7; font-size: 14.5px; }
.login-welcome .logo-circle {
    width: 70px; height: 70px; border-radius: 20px;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; margin-bottom: 24px;
    animation: pulseLogo 2.4s ease-in-out infinite;
}
@keyframes pulseLogo {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,.25); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(255,255,255,0); }
}
.badge-feature {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.12);
    padding: 8px 14px; border-radius: 30px;
    font-size: 12.5px; margin: 5px 6px 0 0;
}

.login-form-side {
    flex: 1;
    padding: 50px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-form-side h2 { font-weight: 700; margin-bottom: 6px; }
.login-form-side .subtitle { color: #8a8a9c; margin-bottom: 26px; font-size: 14px; }

.input-modern {
    position: relative;
    margin-bottom: 20px;
}
.input-modern i {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--primary); font-size: 16px;
}
.input-modern input, .form-select {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border: 1.5px solid #ecebfa;
    border-radius: 12px;
    background: #f9f9ff;
    font-size: 14.5px;
    transition: var(--transition);
}
.input-modern input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(108,92,231,.12);
}
.toggle-pass {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    cursor: pointer; color: #b2b2c2;
}

.btn-modern {
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 13px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(108,92,231,.35);
}
.btn-modern:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(108,92,231,.45); }
.btn-modern:active { transform: translateY(0); }

.role-tabs { display: flex; gap: 8px; margin-bottom: 22px; background: #f2f1fb; padding: 5px; border-radius: 12px; }
.role-tabs .role-tab {
    flex: 1; text-align: center; padding: 9px 0; border-radius: 9px;
    font-size: 13.5px; font-weight: 600; color: #6c6c85; cursor: pointer;
    transition: var(--transition); user-select: none;
}
.role-tabs .role-tab.active { background: #fff; color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,.06); }

/* ---------- DASHBOARD LAYOUT ---------- */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
    background: linear-gradient(180deg, #1e1b3a, #2d2a5a);
    color: #fff; padding: 24px 18px; overflow-y: auto; z-index: 100;
    transition: var(--transition);
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; padding: 0 6px; }
.sidebar .brand .icon-box {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.sidebar .brand h5 { margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.2; }
.sidebar .brand small { color: #b2aee6; font-size: 11px; }

.nav-menu { list-style: none; padding: 0; margin: 0; }
.nav-menu .menu-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #7d78b8; margin: 18px 8px 8px; }
.nav-menu li a {
    display: flex; align-items: center; gap: 12px;
    color: #d9d7f5; text-decoration: none;
    padding: 11px 14px; border-radius: 12px; margin-bottom: 4px;
    font-size: 13.8px; font-weight: 500;
    transition: var(--transition);
}
.nav-menu li a i { width: 18px; text-align: center; font-size: 15px; }
.nav-menu li a:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(3px); }
.nav-menu li a.active { background: linear-gradient(135deg, var(--primary), #8175f0); color: #fff; box-shadow: 0 6px 16px rgba(108,92,231,.4); }

.main-content { margin-left: var(--sidebar-w); padding: 26px 30px; min-height: 100vh; transition: var(--transition); }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; padding: 16px 22px; border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 24px;
}
.topbar .page-title h4 { margin: 0; font-weight: 700; }
.topbar .page-title small { color: #9a9ab0; }
.topbar-right { display: flex; align-items: center; gap: 18px; }

.icon-btn {
    position: relative; width: 42px; height: 42px; border-radius: 12px;
    background: #f4f3ff; display: flex; align-items: center; justify-content: center;
    color: var(--primary); cursor: pointer; transition: var(--transition); border: none;
}
.icon-btn:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.icon-btn .dot-badge {
    position: absolute; top: -4px; right: -4px; background: var(--danger);
    color: #fff; font-size: 10px; padding: 2px 5px; border-radius: 50%;
    min-width: 18px; text-align: center; animation: pulseDot 1.6s infinite;
}
@keyframes pulseDot { 0%,100% { transform: scale(1);} 50% { transform: scale(1.2);} }

.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-chip img, .avatar-circle {
    width: 42px; height: 42px; border-radius: 12px; object-fit: cover;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
}
.user-chip .u-name { font-size: 13.5px; font-weight: 600; line-height: 1.1; }
.user-chip .u-role { font-size: 11px; color: #9a9ab0; }

.notif-dropdown { min-width: 320px; border: none; border-radius: 16px; box-shadow: 0 20px 45px rgba(0,0,0,.15); padding: 10px; }
.notif-item { display: flex; gap: 12px; padding: 10px; border-radius: 12px; transition: var(--transition); }
.notif-item:hover { background: #f6f5ff; }
.notif-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items:center; justify-content:center; flex-shrink:0; color:#fff; }

/* ---------- CARDS / STATS ---------- */
.stat-card {
    background: #fff; border-radius: var(--radius); padding: 22px;
    box-shadow: var(--shadow); position: relative; overflow: hidden;
    transition: var(--transition); animation: fadeUp .5s ease;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(108,92,231,.15); }
.stat-card .stat-icon {
    width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff; margin-bottom: 14px;
}
.stat-card h3 { margin: 0; font-weight: 700; font-size: 26px; }
.stat-card p { margin: 2px 0 0; color: #9a9ab0; font-size: 13px; }

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

.card-modern { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: none; animation: fadeUp .5s ease; }
.card-modern .card-header { background: transparent; border-bottom: 1px solid #f0f0f7; font-weight: 700; padding: 18px 22px; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-modern .card-body { padding: 22px; }

.table-modern thead th { background: #f6f5ff; color: #6c5ce7; border: none; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; padding: 14px; }
.table-modern tbody td { padding: 13px 14px; vertical-align: middle; border-color: #f2f1f8; font-size: 14px; }
.table-modern tbody tr { transition: var(--transition); }
.table-modern tbody tr:hover { background: #faf9ff; }

.btn-soft-primary { background: #f0eefd; color: var(--primary); border: none; }
.btn-soft-success { background: #e4faf3; color: var(--success); border: none; }
.btn-soft-warning { background: #fff8e8; color: #e6a23c; border: none; }
.btn-soft-danger { background: #fdece7; color: var(--danger); border: none; }
.btn-soft-primary:hover, .btn-soft-success:hover, .btn-soft-warning:hover, .btn-soft-danger:hover { filter: brightness(.94); }
.btn-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; transition: var(--transition); }
.btn-icon:hover { transform: translateY(-2px) scale(1.05); }

.badge-modern { padding: 6px 12px; border-radius: 30px; font-size: 11.5px; font-weight: 600; }

.form-label { font-size: 13.5px; font-weight: 600; color: #4a4a5e; margin-bottom: 6px; }
.form-control, .form-select { border-radius: 10px; border: 1.5px solid #ecebf5; padding: 10px 14px; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108,92,231,.1); }

.modal-content { border-radius: 18px; border: none; overflow: hidden; }
.modal-header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border: none; }
.modal-header .btn-close { filter: invert(1); }

.empty-state { text-align: center; padding: 50px 20px; color: #9a9ab0; }
.empty-state i { font-size: 46px; margin-bottom: 14px; color: #d8d6f2; }

.fade-in-item { animation: fadeUp .4s ease both; }

.jadwal-chip { padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; color: #fff; display: inline-block; }

.absen-btn { width: 100%; padding: 16px; border-radius: 14px; border: 2px dashed #d8d6f2; background: #faf9ff; cursor: pointer; transition: var(--transition); }
.absen-btn:hover { border-color: var(--primary); background: #f0eefd; }

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .login-card { flex-direction: column; }
}

.overlay-mobile { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }
.overlay-mobile.show { display: block; }
