/* assets/css/style.css */
/* SIAKAD Universitas Asahan - Yellow Theme */
/* DENGAN FITUR COLLAPSED SIDEBAR (ICON ONLY) */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
:root {
    --primary-color: #FFC107;
    --primary-dark: #FFA000;
    --primary-light: #FFECB3;
    --secondary-color: #FF9800;
    --text-dark: #212121;
    --text-light: #757575;
    --background: #F5F5F5;
    --white: #FFFFFF;
    --sidebar-bg: #1e3a5f;
    --sidebar-hover: #2c5282;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Poppins', sans-serif;
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Membantu mencegah teks tidak terlihat saat memuat font */
}
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    color: var(--text-dark);
}

/* Sidebar */
.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: var(--sidebar-width) !important;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0f1f38 100%) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transition: width 0.3s ease !important;
    z-index: 1000 !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
}

/* COLLAPSED SIDEBAR STATE - Hanya tampilkan icon */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width) !important;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width) !important;
}

/* Hide text elements when collapsed */
body.sidebar-collapsed .sidebar-header .university-name {
    display: none !important;
}

body.sidebar-collapsed .user-profile .user-name,
body.sidebar-collapsed .user-profile .user-role {
    display: none !important;
}

body.sidebar-collapsed .user-avatar {
    width: 40px !important;
    height: 40px !important;
}

body.sidebar-collapsed .menu-item a span {
    display: none !important;
}

body.sidebar-collapsed .menu-item a {
    justify-content: center !important;
    padding: 15px !important;
}

body.sidebar-collapsed .menu-item i {
    margin-right: 0 !important;
    font-size: 20px !important;
}

body.sidebar-collapsed .menu-toggle::after {
    display: none !important;
}

body.sidebar-collapsed .menu-submenu {
    display: none !important;
}

body.sidebar-collapsed .logo-icon {
    margin: 0 auto !important;
}

body.sidebar-collapsed .university-logo {
    justify-content: center !important;
}

body.sidebar-collapsed .user-profile {
    padding: 15px 10px !important;
}

body.sidebar-collapsed .sidebar-header {
    padding: 15px 10px !important;
}

/* Tooltip on hover when collapsed */
body.sidebar-collapsed .menu-item {
    position: relative !important;
}

body.sidebar-collapsed .menu-item a:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--sidebar-bg);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 5px;
    white-space: nowrap;
    z-index: 1001;
    margin-left: 10px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    font-size: 13px;
}

/* Sidebar hanya melebar saat tombol toggle ditekan, tidak saat hover */

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: padding 0.3s ease;
}

.university-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    transition: justify-content 0.3s ease;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    flex-shrink: 0;
}

.university-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    transition: opacity 0.3s ease;
}

.user-profile {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: padding 0.3s ease;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 10px;
    border: 3px solid var(--primary-color);
    transition: all 0.3s ease;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-name {
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    transition: opacity 0.3s ease;
}

.user-role {
    color: var(--primary-light);
    font-size: 12px;
    transition: opacity 0.3s ease;
}

.sidebar-menu {
    padding: 10px 0;
    list-style: none !important;
}

.menu-item {
    list-style: none !important;
}

.menu-item a {
    display: flex !important;
    align-items: center !important;
    padding: 12px 20px !important;
    color: rgba(255,255,255,0.8) !important;
    text-decoration: none !important;
    transition: all 0.3s !important;
}

.menu-item a:hover,
.menu-item a.active {
    background: var(--sidebar-hover) !important;
    color: var(--primary-color) !important;
    border-left: 4px solid var(--primary-color) !important;
    padding-left: 16px !important;
}

.menu-item i {
    width: 24px;
    margin-right: 10px;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.menu-item a span {
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.menu-submenu {
    list-style: none !important;
    padding-left: 0 !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.menu-submenu.active {
    max-height: 1000px;
}

.menu-submenu a {
    padding: 10px 20px 10px 54px !important;
    font-size: 13px;
}

.menu-toggle::after {
    content: '›';
    float: right;
    font-size: 20px;
    transition: transform 0.3s;
}

.menu-toggle.active::after {
    transform: rotate(90deg);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width) !important;
    min-height: 100vh !important;
    transition: margin-left 0.3s ease !important;
}

/* Topbar */
.topbar {
    background: var(--white) !important;
    padding: 15px 30px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
}

.topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

.menu-toggle-btn {
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    cursor: pointer !important;
    color: var(--text-dark) !important;
    padding: 5px 10px !important;
    border-radius: 5px !important;
    transition: background-color 0.3s !important;
}

.menu-toggle-btn:hover {
    background-color: var(--primary-light) !important;
}

.menu-toggle-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.topbar-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-time {
    color: var(--text-light);
    font-size: 14px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.btn-logout {
    background: var(--primary-color) !important;
    color: var(--text-dark) !important;
    padding: 8px 20px !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    transition: all 0.3s !important;
}

.btn-logout:hover {
    background: var(--primary-dark) !important;
}

/* Content Area */
.content-area {
    padding: 30px;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-dark);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.welcome-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.welcome-text p {
    font-size: 16px;
    opacity: 0.9;
}

.welcome-icon {
    font-size: 60px;
}

/* Info Box */
.info-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.info-box p {
    margin: 0;
    color: var(--text-dark);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 15px 20px;
    border-bottom: none;
}

.card-header h3 {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--white);
}

.stat-icon.yellow {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-icon.blue {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.stat-icon.green {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.stat-icon.red {
    background: linear-gradient(135deg, #F44336, #D32F2F);
}

.stat-info h4 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.stat-info .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

table thead th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border: none;
}

table tbody td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

table tbody tr:hover {
    background: var(--primary-light);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

select.form-control {
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-dark);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: #4CAF50;
    color: var(--white);
}

.btn-success:hover {
    background: #388E3C;
}

.btn-danger {
    background: #F44336;
    color: var(--white);
}

.btn-danger:hover {
    background: #D32F2F;
}

.btn-info {
    background: #2196F3;
    color: var(--white);
}

.btn-info:hover {
    background: #1976D2;
}

.btn-warning {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #F57C00;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Badges */
.badge {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #4CAF50;
    color: var(--white);
}

.badge-danger {
    background: #F44336;
    color: var(--white);
}

.badge-warning {
    background: var(--primary-color);
    color: var(--text-dark);
}

.badge-info {
    background: #2196F3;
    color: var(--white);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #C8E6C9;
    color: #2E7D32;
    border-left: 4px solid #4CAF50;
}

.alert-danger {
    background: #FFCDD2;
    color: #C62828;
    border-left: 4px solid #F44336;
}

.alert-warning {
    background: var(--primary-light);
    color: #E65100;
    border-left: 4px solid var(--primary-color);
}

.alert-info {
    background: #B3E5FC;
    color: #01579B;
    border-left: 4px solid #2196F3;
}

/* Tabs */
.nav-tabs {
    display: flex;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-light);
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-dark);
}

.pagination a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-dark);
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-light);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px) !important;
        width: var(--sidebar-width) !important;
    }
    
    .sidebar.active {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    body.sidebar-collapsed .sidebar {
        transform: translateX(-70px) !important;
    }
    
    body.sidebar-collapsed .main-content {
        margin-left: 0 !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-content {
        flex-direction: column;
        text-align: center;
    }
    
    .topbar {
        padding: 15px !important;
    }
    
    .content-area {
        padding: 15px;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--primary-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }