/* ===== CSS Variables & Reset ===== */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f35;
    --bg-card-hover: #222842;
    --bg-sidebar: #0d1225;
    --border: #1e293b;
    --border-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.3);
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.3);
    --accent-orange: #f59e0b;
    --accent-orange-glow: rgba(245, 158, 11, 0.3);
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-primary);
}
.loader-container { text-align: center; }
.loader-ring {
    width: 56px; height: 56px; margin: 0 auto 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: var(--text-secondary); font-size: 0.95rem; letter-spacing: 1px; }

.hidden { display: none !important; }

/* ===== App Layout ===== */
.app { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white;
}
.logo-icon svg { width: 22px; height: 22px; }
.logo-title { font-weight: 700; font-size: 1.1rem; display: block; color: var(--text-primary); }
.logo-subtitle { font-size: 0.75rem; color: var(--text-muted); display: block; }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none; font-size: 0.9rem; font-weight: 500;
    transition: var(--transition);
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.1));
    color: var(--accent-blue);
    border: 1px solid rgba(59,130,246,0.2);
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem; color: var(--text-muted); text-align: center;
}

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1; min-height: 100vh;
    display: flex; flex-direction: column;
}

/* ===== Topbar ===== */
.topbar {
    position: sticky; top: 0; z-index: 50;
    height: var(--topbar-height);
    padding: 0 32px;
    display: flex; align-items: center; gap: 20px;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.menu-toggle {
    display: none;
    background: none; border: none; color: var(--text-primary);
    cursor: pointer; padding: 8px;
}
.menu-toggle svg { width: 24px; height: 24px; }
.topbar-title { flex: 1; }
.topbar-title h1 { font-size: 1.25rem; font-weight: 700; }
.topbar-title p { font-size: 0.8rem; color: var(--text-muted); }
.search-box {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 40px; padding: 8px 16px;
    transition: var(--transition);
}
.search-box:focus-within { border-color: var(--accent-blue); box-shadow: 0 0 0 3px var(--accent-blue-glow); }
.search-box svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-box input {
    background: none; border: none; outline: none;
    color: var(--text-primary); font-size: 0.9rem;
    width: 220px; font-family: inherit;
}
.search-box input::placeholder { color: var(--text-muted); }

/* ===== Content Sections ===== */
.content-section { display: none; padding: 28px 32px; animation: fadeIn 0.4s ease; }
.content-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Dashboard Filter Bar ===== */
.dashboard-filter-bar {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    flex-wrap: wrap;
}
.filter-bar-group {
    display: flex; align-items: center; gap: 12px;
}
.filter-bar-divider {
    width: 1px; height: 28px;
    background: var(--border-light);
    flex-shrink: 0;
}
.filter-bar-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary); white-space: nowrap;
}
.angkatan-chips, .semester-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    padding: 6px 18px; border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent; color: var(--text-secondary);
    font-size: 0.82rem; font-weight: 500;
    cursor: pointer; font-family: inherit;
    transition: var(--transition);
}
.chip:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.chip.active {
    background: var(--accent-blue); color: white;
    border-color: var(--accent-blue);
    box-shadow: 0 2px 12px var(--accent-blue-glow);
}

/* ===== Stats Cards ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stats-grid-5 { grid-template-columns: repeat(5, 1fr); }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex; align-items: center; gap: 18px;
    transition: var(--transition);
    cursor: default;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-light); }
.stat-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.blue { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.stat-icon.green { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.stat-icon.orange { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.stat-icon.cyan { background: rgba(6,182,212,0.15); color: var(--accent-cyan); }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.badge-purple { background: rgba(139,92,246,0.15); color: var(--accent-purple); }

/* ===== Charts ===== */
.charts-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 28px; }
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.chart-card.full-width { margin-bottom: 28px; }
.chart-header { padding: 24px 24px 0; }
.chart-header h3 { font-size: 1rem; font-weight: 700; }
.chart-header p { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.chart-body { padding: 20px 24px 24px; position: relative; }

/* ===== Toolbar ===== */
.section-toolbar {
    display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; align-items: center;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.filter-group select {
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-primary); padding: 8px 14px;
    border-radius: 8px; font-family: inherit; font-size: 0.85rem;
    cursor: pointer; outline: none;
    transition: var(--transition);
}
.filter-group select:focus { border-color: var(--accent-blue); }

/* ===== Table ===== */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: rgba(59,130,246,0.08); }
.data-table th {
    padding: 14px 18px; text-align: left;
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 14px 18px; font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

.badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600;
}
.badge-green { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.badge-orange { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.badge-blue { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.badge-red { background: rgba(239,68,68,0.15); color: #ef4444; }

.btn-detail {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white; border: none;
    padding: 7px 16px; border-radius: 8px;
    font-size: 0.8rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: var(--transition);
}
.btn-detail:hover { transform: scale(1.05); box-shadow: 0 4px 16px var(--accent-blue-glow); }

/* ===== Pagination ===== */
.pagination {
    display: flex; justify-content: center; gap: 6px;
    padding: 20px;
}
.page-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-secondary);
    font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: var(--transition);
    font-family: inherit;
}
.page-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.page-btn.active {
    background: var(--accent-blue); color: white;
    border-color: var(--accent-blue);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 650px;
    max-height: 85vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.15rem; font-weight: 700; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; transition: var(--transition);
}
.modal-close:hover { color: var(--text-primary); }
.modal-close svg { width: 22px; height: 22px; }
.modal-body { padding: 24px; }

.detail-section { margin-bottom: 20px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section h4 {
    font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}
.detail-section h4 svg { width: 16px; height: 16px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px; padding: 14px;
}
.info-item .label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.info-item .value { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }

.internship-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px; margin-bottom: 12px;
    transition: var(--transition);
}
.internship-card:hover { border-color: var(--accent-blue); }
.internship-card:last-child { margin-bottom: 0; }
.internship-card .company {
    font-weight: 700; font-size: 1rem;
    color: var(--accent-blue); margin-bottom: 8px;
}
.internship-card .meta {
    display: flex; flex-wrap: wrap; gap: 12px;
    margin-bottom: 12px; font-size: 0.8rem; color: var(--text-muted);
}
.internship-card .meta span { display: flex; align-items: center; gap: 4px; }
.feedback-box {
    background: rgba(59,130,246,0.06);
    border-left: 3px solid var(--accent-blue);
    border-radius: 0 8px 8px 0;
    padding: 14px; margin-top: 10px;
}
.feedback-box .fb-label {
    font-size: 0.75rem; font-weight: 600;
    color: var(--accent-blue); text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 6px;
}
.feedback-box .fb-text {
    font-size: 0.85rem; color: var(--text-secondary);
    line-height: 1.7; font-style: italic;
}
.no-data {
    text-align: center; padding: 40px;
    color: var(--text-muted); font-size: 0.9rem;
}

/* ===== Inline Search Box ===== */
.search-box-inline {
    border-radius: 8px;
}
.search-box-inline input {
    width: 200px;
}

/* ===== Position Cards ===== */
.position-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.position-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}
.position-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}
.position-card-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.position-card-header:hover {
    background: var(--bg-card-hover);
}
.position-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.position-card-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}
.position-card-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.position-card-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.position-card-badge {
    background: rgba(59,130,246,0.15);
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 6px 14px;
    border-radius: 10px;
    flex-shrink: 0;
}
.position-card-toggle {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 8px;
}
.position-card.expanded .position-card-toggle {
    transform: rotate(180deg);
}
.position-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.position-card.expanded .position-card-body {
    max-height: 1000px;
}
.position-card-content {
    padding: 0 20px 20px;
    border-top: 1px solid var(--border);
}
.position-student-list {
    list-style: none;
    margin-top: 14px;
}
.position-student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: rgba(59,130,246,0.04);
    border: 1px solid transparent;
    transition: var(--transition);
}
.position-student-item:hover {
    border-color: var(--accent-blue);
    background: rgba(59,130,246,0.08);
}
.position-student-item:last-child { margin-bottom: 0; }
.position-student-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.position-student-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
}
.position-student-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .stats-grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .position-cards-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .topbar { padding: 0 16px; }
    .content-section { padding: 20px 16px; }
    .stats-grid, .stats-grid-5 { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 1.4rem; }
    .search-box input { width: 140px; }
    .info-grid { grid-template-columns: 1fr; }
    .section-toolbar { flex-direction: column; align-items: flex-start; }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 10px 12px; }
    .dashboard-filter-bar { flex-direction: column; align-items: flex-start; }
    .search-box-inline input { width: 150px; }
}
@media (max-width: 480px) {
    .stats-grid, .stats-grid-5 { grid-template-columns: 1fr; }
    .search-box:not(.search-box-inline) { display: none; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
