:root {
    --primary: #4cc9f0;
    --primary-dark: #4361ee;
    --bg-body: #f0f4f8;
    --bg-sidebar: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #8d99ae;
    --border: #edf2f4;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --glass: rgba(255, 255, 255, 0.85);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    text-decoration: none;
    list-style: none;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.6;
}

button,
input,
select {
    font-family: inherit;
}

/* CUSTOM ALERT STYLES */
#custom-alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#custom-alert-overlay.show {
    opacity: 1;
}

.custom-alert-box {
    background: white;
    width: 90%;
    max-width: 400px;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#custom-alert-overlay.show .custom-alert-box {
    transform: scale(1);
}

.alert-icon-circle {
    width: 60px;
    height: 60px;
    background: #e0f2fe;
    color: var(--primary-dark);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.alert-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.alert-message {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.btn-alert {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: var(--primary-dark);
    color: white;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.btn-alert:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}

/* LOGIN PAGE */
#login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.bg-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -50px;
    left: -50px;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: 50px;
    right: -30px;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.login-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.login-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-dark);
    color: white;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
    transform: rotate(-10deg);
}

.role-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.role-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: 0.3s;
}

.role-tab.active {
    background: white;
    color: var(--primary-dark);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-group {
    position: relative;
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    font-weight: 600;
    transition: 0.3s;
    color: var(--text-main);
}

.form-input:focus {
    background: white;
    border-color: #4cc9f0;
    box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.2);
}

.btn-grad {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(to right, var(--primary-dark), #3a0ca3);
    color: white;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(58, 12, 163, 0.3);
    transition: 0.3s;
}

.btn-grad:hover {
    transform: translateY(-3px);
}

/* DASHBOARD LAYOUT */
#app-wrapper {
    display: none;
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: 0.4s;
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
    border-bottom: 1px solid var(--border);
}

.sidebar-header i {
    margin-right: 10px;
    color: #f72585;
}

.nav-menu {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 700;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: var(--text-muted);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 8px;
    font-weight: 600;
}

.nav-item:hover {
    background: #f0f7ff;
    color: var(--primary-dark);
}

.nav-item.active {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.25);
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
}

.user-profile {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #ffd166;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: white;
}

.user-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.user-info p {
    font-size: 0.75rem;
    margin: 0;
    color: var(--text-muted);
}

.btn-logout {
    margin-left: auto;
    background: #ffe5ec;
    color: #ef476f;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: 0.4s;
}

.topbar {
    height: 80px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.academic-pill {
    background: white;
    border: 1px solid #4cc9f0;
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    position: relative;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-count {
    background: #e0f2fe;
    color: #0284c7;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    border: 1px solid #bae6fd;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th {
    text-align: left;
    padding: 18px 15px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    background: #f8f9fa;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-warning {
    background-color: #ffc107;
    color: #000;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: white;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 20px;
    animation: slideUp 0.3s;
}

.hidden {
    display: none !important;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- STYLE KHUSUS: LAPORAN GURU --- */
.teacher-tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-weight: bold;
    color: #666;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--primary-dark);
    border-bottom: 3px solid var(--primary-dark);
}

.teacher-tab-content {
    display: none;
}

.teacher-tab-content.active {
    display: block;
}

.control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.teacher-loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
}

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

@keyframes slideUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 300px;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .mobile-toggle {
        display: block;
    }
}
