/* ============================================
   FILE: style.css
   FUNGSI: Styling modern soft UI untuk semua halaman
   ============================================ */

/* --- Import Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Variables (Warna & Ukuran Global) --- */
:root {
    --primary:        #6C63FF;   /* Ungu utama */
    --primary-light:  #EDE9FF;   /* Ungu muda untuk background */
    --primary-dark:   #4F46E5;   /* Ungu gelap untuk hover */
    --secondary:      #06B6D4;   /* Biru cyan aksen */
    --success:        #10B981;   /* Hijau untuk status aktif */
    --danger:         #F43F5E;   /* Merah untuk hapus/tidak aktif */
    --warning:        #F59E0B;   /* Kuning untuk warning */
    --sidebar-bg:     #1E1B4B;   /* Sidebar warna biru dongker */
    --sidebar-width:  260px;
    --body-bg:        #F5F4FF;   /* Background halaman */
    --card-bg:        #FFFFFF;
    --text-dark:      #1E1B4B;
    --text-muted:     #94A3B8;
    --border-color:   #E8E6FF;
    --shadow-sm:      0 2px 8px rgba(108,99,255,0.08);
    --shadow-md:      0 4px 20px rgba(108,99,255,0.14);
    --shadow-lg:      0 8px 40px rgba(108,99,255,0.18);
    --radius-sm:      10px;
    --radius-md:      16px;
    --radius-lg:      24px;
    --transition:     all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--body-bg);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 28px 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(108,99,255,0.4);
}

.sidebar-brand-text h6 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}
.sidebar-brand-text small {
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    font-weight: 400;
}

.sidebar-nav {
    padding: 20px 12px;
    flex: 1;
}

.sidebar-section-label {
    color: rgba(255,255,255,0.3);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0 12px 8px;
    margin-top: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    transform: translateX(4px);
}

.sidebar-item.active {
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    color: #fff;
    box-shadow: 0 4px 14px rgba(108,99,255,0.4);
    font-weight: 600;
}

.sidebar-item .nav-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-item.active .nav-icon {
    background: rgba(255,255,255,0.2);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
}

.sidebar-user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info small {
    display: block;
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 600;
}
.sidebar-user-info span {
    color: rgba(255,255,255,0.4);
    font-size: 10px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 32px;
    transition: var(--transition);
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.topbar-title h4 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
}
.topbar-title p {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-top: 4px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   CARDS DASHBOARD
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 0 var(--radius-md) 0 80px;
    opacity: 0.07;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-card-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Warna varian card */
.stat-purple .stat-card-icon { background: var(--primary-light); color: var(--primary); }
.stat-purple .stat-card-value { color: var(--primary); }
.stat-purple::before { background: var(--primary); }

.stat-green .stat-card-icon { background: #ECFDF5; color: var(--success); }
.stat-green .stat-card-value { color: var(--success); }
.stat-green::before { background: var(--success); }

.stat-red .stat-card-icon { background: #FFF1F2; color: var(--danger); }
.stat-red .stat-card-value { color: var(--danger); }
.stat-red::before { background: var(--danger); }

.stat-cyan .stat-card-icon { background: #ECFEFF; color: var(--secondary); }
.stat-cyan .stat-card-value { color: var(--secondary); }
.stat-cyan::before { background: var(--secondary); }

/* ============================================
   CARD SECTION (TABLE WRAPPER)
   ============================================ */
.section-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-card-header h5 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.search-box input {
    padding: 10px 16px 10px 40px;
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-dark);
    background: var(--body-bg);
    width: 240px;
    transition: var(--transition);
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(108,99,255,0.1);
    width: 280px;
}

.search-box input::placeholder { color: var(--text-muted); }

/* ============================================
   TABLE
   ============================================ */
.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern thead tr {
    background: var(--body-bg);
    border-radius: var(--radius-sm);
}

.table-modern thead th {
    padding: 13px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-align: left;
    border: none;
}

.table-modern thead th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.table-modern thead th:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.table-modern tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.table-modern tbody tr:hover {
    background: var(--primary-light);
}

.table-modern tbody tr:last-child { border-bottom: none; }

.table-modern tbody td {
    padding: 16px 16px;
    font-size: 14px;
    color: var(--text-dark);
    vertical-align: middle;
}

.table-modern tbody td .student-name {
    font-weight: 600;
    color: var(--text-dark);
}

.table-modern tbody td .student-nim {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Row number cell */
.cell-no {
    width: 50px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
}

/* ============================================
   BADGES
   ============================================ */
.badge-jurusan {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.badge-aktif {
    background: #ECFDF5;
    color: var(--success);
}
.badge-aktif::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
}

.badge-nonaktif {
    background: #FFF1F2;
    color: var(--danger);
}
.badge-nonaktif::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--danger);
    border-radius: 50%;
    display: inline-block;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-action {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    text-decoration: none;
}

.btn-view  { background: #EEF2FF; color: #6366F1; }
.btn-edit  { background: #FFFBEB; color: #D97706; }
.btn-delete{ background: #FFF1F2; color: var(--danger); }

.btn-action:hover { transform: scale(1.12); filter: brightness(0.92); }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(108,99,255,0.35);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108,99,255,0.45);
    color: white;
}

.btn-secondary-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: var(--text-dark);
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-secondary-custom:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-danger-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--danger), #FB7185);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(244,63,94,0.3);
}
.btn-danger-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244,63,94,0.4);
    color: white;
}

/* ============================================
   FORMS
   ============================================ */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 36px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    max-width: 600px;
}

.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-label span {
    color: var(--danger);
    margin-left: 2px;
}

.form-control-custom {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
    background: white;
    transition: var(--transition);
    outline: none;
    appearance: none;
}

.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108,99,255,0.1);
}

.form-control-custom::placeholder { color: var(--text-muted); }

/* Select dengan arrow custom */
select.form-control-custom {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-helper {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Radio/Status Selector */
.status-selector {
    display: flex;
    gap: 12px;
}

.status-option {
    flex: 1;
    position: relative;
}

.status-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.status-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-muted);
}

.status-option input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.status-option.danger input[type="radio"]:checked + label {
    border-color: var(--danger);
    background: #FFF1F2;
    color: var(--danger);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal-box {
    transform: translateY(0) scale(1);
}

.modal-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.modal-icon.danger  { background: #FFF1F2; color: var(--danger); }
.modal-icon.success { background: #ECFDF5; color: var(--success); }
.modal-icon.info    { background: var(--primary-light); color: var(--primary); }

.modal-box h5 {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.modal-box p {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ============================================
   DETAIL CARD
   ============================================ */
.detail-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 36px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    max-width: 560px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.detail-avatar {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(108,99,255,0.3);
}

.detail-header-info h4 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
}

.detail-header-info small {
    color: var(--text-muted);
    font-size: 13px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-of-type { border-bottom: none; }

.detail-key {
    width: 140px;
    flex-shrink: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 2px;
}

.detail-val {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 52px;
    color: var(--border-color);
    margin-bottom: 16px;
    display: block;
}

.empty-state h6 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 13.5px;
}

/* ============================================
   ALERT / FLASH MESSAGE
   ============================================ */
.alert-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    animation: slideDown 0.4s ease;
}

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

.alert-success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: #FFF1F2;
    color: #9F1239;
    border: 1px solid #FDA4AF;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb-custom a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-custom a:hover { text-decoration: underline; }

.breadcrumb-custom .separator { color: var(--border-color); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 20px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .section-card-header { flex-direction: column; align-items: flex-start; }
    .search-box input { width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .form-card, .detail-card { padding: 24px; }
    .modal-box { padding: 24px; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================
   ANIMASI MASUK
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

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

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }
