/* ==========================================================================
   SIKAD - Sistem Informasi Akademik
   Main Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   1. BASE & RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1e40af;
    /* Academic Blue */
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --secondary: #0f172a;
    /* Slate Dark */
    --accent: #f59e0b;
    /* Amber */

    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #0f172a;

    --text-main: #334155;
    --text-muted: #64748b;
    --text-light: #f8fafc;

    --border-color: #e2e8f0;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--secondary);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: var(--primary-light);
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   2. LOGIN PAGE SPECIFIC STYLES
   ========================================================================== */
.login-body {
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.login-hero {
    flex: 1.2;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.85), rgba(30, 64, 175, 0.6)),
        url('https://images.unsplash.com/photo-1541339907198-e08756dedf3f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    color: white;
}

.hero-content {
    max-width: 650px;
    animation: fadeIn 1s ease-out;
}

.hero-title {
    font-size: 3.8rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    color: white;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.6;
    color: #e2e8f0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.glass-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    display: inline-block;
    margin-bottom: 2rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: white;
}

.login-panel {
    flex: 1;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
}

.login-form-container {
    width: 100%;
    max-width: 420px;
    animation: slideIn 0.8s ease-out;
}

.brand {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-logo {
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: rotate(0deg) scale(1.05);
}

.brand-logo svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.brand-text h1 {
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}

.brand-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* ==========================================================================
   3. FORMS & BUTTONS
   ========================================================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 0.9rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--secondary);
    transition: all 0.3s ease;
    background-color: var(--bg-body);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
    font-family: var(--font-heading);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #dc2626;
    color: white;
}

/* ==========================================================================
   4. DASHBOARD LAYOUT (Sistem Akademik Professional)
   ========================================================================== */
.dashboard-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-brand-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.sidebar-brand-text h2 {
    color: white;
    font-size: 1.4rem;
    margin: 0;
    letter-spacing: 0.5px;
}

.sidebar-brand-text span {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 1rem;
    flex: 1;
    overflow-y: auto;
}

.menu-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 1.5rem 0 0.5rem 1rem;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    color: #94a3b8;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.95rem;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-menu li a.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-right: 3px solid #3b82f6;
    border-radius: 0.5rem 0 0 0.5rem;
}

.sidebar-menu li a:hover .sidebar-icon,
.sidebar-menu li a.active .sidebar-icon {
    opacity: 1;
}

/* Sidebar Menu Submenus */
.has-submenu {
    flex-direction: column;
}

.submenu-toggle {
    display: flex;
    justify-content: space-between !important;
    align-items: center;
}

.chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.submenu-toggle.open .chevron {
    transform: rotate(90deg);
}

.submenu {
    display: none;
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.2rem;
    margin-bottom: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 1.5rem;
}

.submenu.open {
    display: block;
}

.submenu li a {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: #94a3b8;
    background: transparent !important;
    border: none !important;
}

.submenu li a:hover {
    color: white;
}

/* Topbar */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--bg-body);
}

.topbar {
    background-color: var(--bg-surface);
    height: 70px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-left h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-color);
    position: relative;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-family: var(--font-heading);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.user-info-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--secondary);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Dropdown Styles */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

.dropdown-item.danger {
    color: var(--danger);
    border-top: 1px solid var(--border-color);
}

.dropdown-item.danger:hover {
    background: #fef2f2;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
}

/* Content Area */
.content-area {
    padding: 2rem;
}

/* ==========================================================================
   5. COMPONENTS (Cards, Alerts, Badges)
   ========================================================================== */
.card {
    background: var(--bg-surface);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-box {
    background: var(--bg-surface);
    padding: 1.75rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Menghapus warna-warni yang berlebihan (clean minimalis) */
.stat-box::before {
    display: none;
}

.stat-title {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--secondary);
    font-family: var(--font-heading);
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    text-align: center;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ==========================================================================
   6. ANIMATIONS & RESPONSIVE
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

@media (max-width: 900px) {
    .login-hero {
        display: none;
    }

    .login-panel {
        padding: 2rem 1.5rem;
    }

    .sidebar {
        position: absolute;
        transform: translateX(-100%);
    }

    .topbar {
        padding: 0 1rem;
    }

    .content-area {
        padding: 1rem;
    }
}