@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Sora:wght@300;400;500;600&display=swap');

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Sora', sans-serif;
    background: #0E0F14;
    color: #F0EDE6;
    font-size: 14px;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ── LAYOUT ── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
    width: 240px;
    background: #16181F;
    border-right: 0.5px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-logo {
    padding: 22px 20px 18px;
    border-bottom: 0.5px solid rgba(255,255,255,0.07);
}
.sidebar-logo .logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 20px; font-weight: 700;
    color: #C9A84C; letter-spacing: 0.02em;
}
.sidebar-logo .logo-sub {
    font-size: 10px; color: #4A4A5A;
    margin-top: 2px; letter-spacing: 0.05em;
    text-transform: uppercase;
}
.sidebar-profile {
    padding: 14px 16px;
    border-bottom: 0.5px solid rgba(255,255,255,0.07);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
    width: 38px; height: 38px;
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
    transition: transform 0.2s ease;
}
.sidebar-avatar:hover { transform: scale(1.05); }
.sidebar-avatar-initials {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
    transition: transform 0.2s ease;
}
.sidebar-avatar-initials:hover { transform: scale(1.05); }
.sidebar-profile-info .name {
    font-size: 12px; font-weight: 600; color: #F0EDE6;
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 150px;
}
.sidebar-profile-info .role-badge {
    display: inline-block; font-size: 9px; font-weight: 600;
    padding: 2px 7px; border-radius: 20px; margin-top: 3px;
    text-transform: uppercase; letter-spacing: 0.06em;
}
.role-dosen { background: rgba(201,168,76,0.15); color: #C9A84C; border: 0.5px solid rgba(201,168,76,0.3); }
.role-mahasiswa { background: rgba(62,207,178,0.15); color: #3ECFB2; border: 0.5px solid rgba(62,207,178,0.3); }

/* Nav */
.sidebar-nav { flex: 1; padding: 10px; overflow-y: auto; }
.nav-section-label {
    font-size: 9px; font-weight: 600; color: #4A4A5A;
    text-transform: uppercase; letter-spacing: 0.1em;
    padding: 10px 10px 4px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 10px;
    color: #8A8A9A; text-decoration: none;
    font-size: 13px; font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    border: 0.5px solid transparent;
    position: relative; overflow: hidden;
}
.nav-item::before {
    content: '';
    position: absolute; left: 0; top: 0;
    width: 3px; height: 100%;
    background: #C9A84C;
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}
.nav-item:hover {
    background: rgba(255,255,255,0.04);
    color: #F0EDE6;
    transform: translateX(2px);
}
.nav-item.active {
    background: rgba(201,168,76,0.1);
    color: #C9A84C;
    border-color: rgba(201,168,76,0.2);
}
.nav-item.active::before { transform: scaleY(1); }
.nav-item .nav-icon { width: 16px; text-align: center; flex-shrink: 0; }
.nav-item .nav-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: #C9A84C; margin-left: auto;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%,100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
.sidebar-footer {
    padding: 12px 16px;
    border-top: 0.5px solid rgba(255,255,255,0.07);
}
.sidebar-footer form button {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 9px 12px;
    background: transparent;
    border: 0.5px solid rgba(255,255,255,0.08);
    border-radius: 8px; color: #8A8A9A;
    font-size: 12px; font-family: 'Sora', sans-serif;
    cursor: pointer; transition: all 0.2s ease;
}
.sidebar-footer form button:hover {
    background: rgba(240,98,146,0.08);
    color: #F06292; border-color: rgba(240,98,146,0.2);
    transform: translateX(2px);
}

/* ── MAIN CONTENT ── */
.main-content {
    margin-left: 240px; flex: 1;
    display: flex; flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ── TOPBAR ── */
.topbar {
    height: 60px; background: #16181F;
    border-bottom: 0.5px solid rgba(255,255,255,0.07);
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 28px; position: sticky;
    top: 0; z-index: 50;
    backdrop-filter: blur(10px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px; font-weight: 600;
}
.topbar-subtitle { font-size: 11px; color: #8A8A9A; margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 11px; color: #4A4A5A; }

/* ── PAGE CONTENT ── */
.page-content {
    padding: 28px; flex: 1;
    animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── CARDS ── */
.card {
    background: #1C1F2A;
    border: 0.5px solid rgba(255,255,255,0.07);
    border-radius: 16px; padding: 20px 22px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    border-color: rgba(255,255,255,0.12);
}
.card-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 600; }

/* ── STAT CARDS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px; margin-bottom: 24px;
}
.stat-card {
    background: #1C1F2A;
    border: 0.5px solid rgba(255,255,255,0.07);
    border-radius: 14px; padding: 18px 20px;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    cursor: default; position: relative; overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(201,168,76,0.05) 0%, transparent 70%);
    opacity: 0; transition: opacity 0.3s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.stat-card:hover::after { opacity: 1; }
.stat-label { font-size: 11px; color: #8A8A9A; font-weight: 500; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 32px; font-weight: 700;
    line-height: 1;
}
.stat-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center;
    justify-content: center; font-size: 18px;
    margin-bottom: 12px;
}

/* Colors */
.text-gold  { color: #C9A84C; }
.text-teal  { color: #3ECFB2; }
.text-rose  { color: #F06292; }
.text-sky   { color: #60AFFF; }
.text-muted { color: #8A8A9A; }
.text-purple{ color: #A78BFA; }

/* ── BADGES ── */
.badge {
    display: inline-block; font-size: 10px; font-weight: 600;
    padding: 3px 9px; border-radius: 20px; letter-spacing: 0.04em;
    transition: all 0.15s ease;
}
.badge-gold   { background: rgba(201,168,76,0.15); color: #C9A84C; border: 0.5px solid rgba(201,168,76,0.3); }
.badge-teal   { background: rgba(62,207,178,0.15); color: #3ECFB2; border: 0.5px solid rgba(62,207,178,0.3); }
.badge-rose   { background: rgba(240,98,146,0.15); color: #F06292; border: 0.5px solid rgba(240,98,146,0.3); }
.badge-sky    { background: rgba(96,175,255,0.15); color: #60AFFF; border: 0.5px solid rgba(96,175,255,0.3); }
.badge-muted  { background: rgba(255,255,255,0.05); color: #8A8A9A; border: 0.5px solid rgba(255,255,255,0.1); }
.badge-purple { background: rgba(167,139,250,0.15); color: #A78BFA; border: 0.5px solid rgba(167,139,250,0.3); }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: 10px; border: none;
    font-family: 'Sora', sans-serif; font-size: 12px;
    font-weight: 600; cursor: pointer; text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    position: relative; overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0; transition: opacity 0.15s ease;
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, #C9A84C, #B8962E); color: #000; box-shadow: 0 2px 8px rgba(201,168,76,0.3); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(201,168,76,0.4); transform: translateY(-1px); color: #000; }
.btn-secondary { background: #1C1F2A; color: #F0EDE6; border: 0.5px solid rgba(255,255,255,0.1); }
.btn-secondary:hover { border-color: rgba(255,255,255,0.25); transform: translateY(-1px); }
.btn-danger { background: rgba(240,98,146,0.1); color: #F06292; border: 0.5px solid rgba(240,98,146,0.3); }
.btn-danger:hover { background: rgba(240,98,146,0.2); transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-teal { background: rgba(62,207,178,0.1); color: #3ECFB2; border: 0.5px solid rgba(62,207,178,0.3); }
.btn-teal:hover { background: rgba(62,207,178,0.2); transform: translateY(-1px); }

/* ── ALERTS ── */
.alert {
    padding: 12px 16px; border-radius: 10px;
    font-size: 13px; margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.alert-success { background: rgba(62,207,178,0.1); border: 0.5px solid rgba(62,207,178,0.3); color: #3ECFB2; }
.alert-error   { background: rgba(240,98,146,0.1); border: 0.5px solid rgba(240,98,146,0.3); color: #F06292; }
.alert-info    { background: rgba(96,175,255,0.1); border: 0.5px solid rgba(96,175,255,0.3); color: #60AFFF; }
.alert-warning { background: rgba(201,168,76,0.1); border: 0.5px solid rgba(201,168,76,0.3); color: #C9A84C; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block; font-size: 11px; font-weight: 600;
    color: #8A8A9A; text-transform: uppercase;
    letter-spacing: 0.07em; margin-bottom: 6px;
}
.form-control {
    width: 100%; padding: 10px 14px;
    background: #16181F;
    border: 0.5px solid rgba(255,255,255,0.1);
    border-radius: 8px; color: #F0EDE6;
    font-size: 13px; font-family: 'Sora', sans-serif;
    transition: all 0.2s ease;
}
.form-control:focus {
    outline: none; border-color: #C9A84C;
    box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
    background: #1C1F2A;
}
.form-control:hover:not(:focus) { border-color: rgba(255,255,255,0.2); }
.form-control::placeholder { color: #4A4A5A; }
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-error { font-size: 11px; color: #F06292; margin-top: 4px; animation: shake 0.3s ease; }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: #16181F; }
th {
    padding: 11px 14px; text-align: left;
    font-size: 10px; font-weight: 600; color: #8A8A9A;
    text-transform: uppercase; letter-spacing: 0.07em;
    border-bottom: 0.5px solid rgba(255,255,255,0.07);
    white-space: nowrap;
}
td {
    padding: 11px 14px;
    border-bottom: 0.5px solid rgba(255,255,255,0.04);
    color: #F0EDE6;
    transition: background 0.15s ease;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ── PROGRESS ── */
.progress { background: rgba(255,255,255,0.07); border-radius: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 8px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }

/* ── GRID HELPERS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; justify-content: center; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 11px; }
.font-serif { font-family: 'Playfair Display', serif; }
.font-bold  { font-weight: 700; }

/* ── MOBILE ── */
.sidebar-toggle {
    display: none; background: none; border: none;
    color: #F0EDE6; font-size: 20px; cursor: pointer;
}
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%) !important;
        z-index: 200; width: 260px;
    }
    .sidebar.open { transform: translateX(0) !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; }
    .sidebar-toggle { display: flex !important; align-items: center; justify-content: center; }
    .sidebar-overlay {
        display: none; position: fixed; inset: 0;
        background: rgba(0,0,0,0.6); z-index: 199;
        backdrop-filter: blur(2px);
    }
    .sidebar-overlay.show { display: block; animation: fadeIn 0.2s ease; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
    .page-content { padding: 16px !important; }
    .topbar { padding: 0 16px !important; }
    .topbar-date { display: none; }
    .topbar-title { font-size: 15px !important; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr !important; }
    .stat-value { font-size: 24px !important; }
    .btn { padding: 8px 14px !important; }
}

/* ── LIGHT MODE ── */
body.light { background: #F4F4EF; color: #1A1A2E; }
body.light .sidebar { background: #FFFFFF; border-right-color: rgba(0,0,0,0.08); }
body.light .sidebar-logo .logo-sub { color: #AAAAAA; }
body.light .sidebar-profile { border-bottom-color: rgba(0,0,0,0.07); }
body.light .sidebar-profile-info .name { color: #1A1A2E; }
body.light .nav-section-label { color: #BBBBBB; }
body.light .nav-item { color: #777; }
body.light .nav-item:hover { background: rgba(0,0,0,0.04); color: #1A1A2E; }
body.light .nav-item.active { background: rgba(201,168,76,0.1); color: #8B6914; border-color: rgba(201,168,76,0.25); }
body.light .nav-item::before { background: #8B6914; }
body.light .nav-dot { background: #8B6914; }
body.light .sidebar-footer { border-top-color: rgba(0,0,0,0.07); }
body.light .sidebar-footer form button { color: #888; border-color: rgba(0,0,0,0.1); }
body.light .sidebar-footer form button:hover { background: rgba(220,50,50,0.06); color: #C0392B; }
body.light .main-content { background: #F4F4EF; }
body.light .topbar { background: rgba(255,255,255,0.95); border-bottom-color: rgba(0,0,0,0.08); }
body.light .topbar-title { color: #1A1A2E; }
body.light .topbar-subtitle { color: #888; }
body.light .topbar-date { color: #AAAAAA; }
body.light .card { background: #FFFFFF; border-color: rgba(0,0,0,0.07); color: #1A1A2E; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
body.light .card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
body.light .stat-card { background: #FFFFFF; border-color: rgba(0,0,0,0.07); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
body.light .stat-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
body.light .stat-label { color: #888; }
body.light .form-control { background: #F0EFF0; border-color: rgba(0,0,0,0.12); color: #1A1A2E; }
body.light .form-control:focus { background: #FFFFFF; box-shadow: 0 0 0 3px rgba(201,168,76,0.15); }
body.light .form-control::placeholder { color: #BBBBBB; }
body.light .form-label { color: #888; }
body.light table { color: #1A1A2E; }
body.light thead tr { background: #F8F8F5; }
body.light th { color: #999; border-bottom-color: rgba(0,0,0,0.07); }
body.light td { border-bottom-color: rgba(0,0,0,0.04); color: #333; }
body.light tbody tr:hover { background: rgba(0,0,0,0.02); }
body.light .text-muted { color: #888 !important; }
body.light .btn-secondary { background: #F0EFF0; color: #1A1A2E; border-color: rgba(0,0,0,0.12); }
body.light .btn-secondary:hover { background: #E8E8E3; }
body.light .alert-success { background: rgba(62,207,178,0.08); border-color: rgba(62,207,178,0.25); }
body.light .alert-error   { background: rgba(240,98,146,0.08); border-color: rgba(240,98,146,0.25); }
body.light .alert-warning { background: rgba(201,168,76,0.08); border-color: rgba(201,168,76,0.25); }
body.light .progress { background: rgba(0,0,0,0.08); }
body.light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }
body.light .page-content { background: #F4F4EF; }
body.light .table-wrap { background: #FFFFFF; border-radius: 12px; }
body.light .topbar-left button { background: rgba(0,0,0,0.05) !important; border-color: rgba(0,0,0,0.12) !important; color: #333 !important; }


    .topbar { padding-left: 60px !important; }
}

/* ── LIGHT MODE FIXES ── */
body.light .text-muted { color: #555566 !important; }
body.light .text-xs { color: #666677 !important; }
body.light .card .text-muted { color: #4A4A5A !important; }
body.light .stat-value { color: #1A1A2E !important; }
body.light .table-wrap td { color: #2A2A3E !important; }
body.light .table-wrap .text-muted { color: #555566 !important; }
body.light .badge-muted { background: rgba(0,0,0,0.07) !important; color: #444455 !important; }
body.light .form-label { color: #333344 !important; }
body.light .nav-section-label { color: #888899 !important; }

/* ── FIX PAGINATION ── */
.pagination { display:flex;gap:6px;flex-wrap:wrap;margin-top:16px;align-items:center; }
.pagination svg { width:14px !important;height:14px !important; }
.pagination span, .pagination a {
    display:inline-flex;align-items:center;justify-content:center;
    min-width:32px;height:32px;padding:0 10px;
    border-radius:8px;font-size:12px;font-weight:600;
    text-decoration:none;
    background:rgba(255,255,255,0.05);
    border:0.5px solid rgba(255,255,255,0.1);
    color:#F0EDE6;transition:all 0.2s;
}
.pagination a:hover { background:rgba(201,168,76,0.15);border-color:rgba(201,168,76,0.3);color:#C9A84C; }
.pagination .active span { background:rgba(201,168,76,0.2);border-color:rgba(201,168,76,0.4);color:#C9A84C; }
.pagination .disabled span { opacity:0.3;cursor:not-allowed; }
body.light .pagination span, body.light .pagination a {
    background:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.1);color:#1A1A2E;
}

/* ── FIX PAGINATION ── */
.pagination { display:flex;gap:6px;flex-wrap:wrap;margin-top:16px;align-items:center; }
.pagination svg { width:14px !important;height:14px !important; }
.pagination span, .pagination a {
    display:inline-flex;align-items:center;justify-content:center;
    min-width:32px;height:32px;padding:0 10px;
    border-radius:8px;font-size:12px;font-weight:600;
    text-decoration:none;
    background:rgba(255,255,255,0.05);
    border:0.5px solid rgba(255,255,255,0.1);
    color:#F0EDE6;transition:all 0.2s;
}
.pagination a:hover { background:rgba(201,168,76,0.15);border-color:rgba(201,168,76,0.3);color:#C9A84C; }
.pagination .active span { background:rgba(201,168,76,0.2);border-color:rgba(201,168,76,0.4);color:#C9A84C; }
.pagination .disabled span { opacity:0.3;cursor:not-allowed; }
body.light .pagination span, body.light .pagination a {
    background:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.1);color:#1A1A2E;
}
