@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Outlined');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --dark: #0F172A;
    --gray-900: #1E293B;
    --gray-800: #334155;
    --gray-600: #475569;
    --gray-400: #94A3B8;
    --gray-200: #E2E8F0;
    --gray-100: #F1F5F9;
    --gray-50: #F8FAFC;
    --white: #FFFFFF;

    --bg-gradient: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.4);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 280px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-gradient);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.mat-icon {
    font-family: 'Material Icons Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: inherit;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--dark);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }

/* ── Login Page (Premium Glassmorphism) ── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--login-bg, url('../media/gambar-andalan.png')) center/cover no-repeat;
    position: relative;
}
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15,23,42,0.8) 0%, rgba(79,70,229,0.7) 100%);
    backdrop-filter: blur(8px);
}
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 10;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 1.5rem;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.1));
}
.login-header h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.login-header p { color: var(--gray-600); font-size: 0.95rem; }

/* ── Form Controls ── */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--dark);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
input.form-control, select.form-control {
    height: 46px;
}
input[type="file"].form-control {
    padding: 0.6rem 1rem;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-block { width: 100%; padding: 0.875rem; font-size: 1rem; }
.btn-primary {
    background: var(--primary);
    color: var(--white) !important;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(79, 70, 229, 0.3);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}
.btn-danger {
    background: var(--danger);
    color: var(--white) !important;
}
.btn-danger:hover {
    background: #DC2626;
    color: var(--white) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(239, 68, 68, 0.3);
}
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}
.btn-icon {
    padding: 0.5rem;
}

td .btn + .btn {
    margin-left: 0.5rem;
}

/* ── Dashboard Layout ── */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: var(--white);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.sidebar-brand {
    height: 72px;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    background: rgba(0,0,0,0.2);
}
.sidebar-brand-logo {
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 2px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    object-fit: contain;
}
.sidebar-brand-text { display: flex; flex-direction: column; }
.sidebar-brand-text h1 { color: var(--white); font-size: 1.25rem; line-height: 1.2; margin-bottom: 0.1rem; }
.sidebar-brand-text small { color: var(--gray-400); font-size: 0.75rem; line-height: 1.2; }
.sidebar-nav { padding: 1.5rem 1rem; flex: 1; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--gray-400);
    border-radius: var(--radius-sm);
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}
.top-header {
    height: 72px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.top-header-left { display: flex; align-items: center; gap: 1rem; }
.top-header-left h2 { margin: 0; font-size: 1.25rem; }
.top-header-right { display: flex; align-items: center; gap: 1rem; font-weight: 600; }
.hamburger { background: none; border: none; font-size: 1.5rem; cursor: pointer; display: none; color: var(--dark); }

.page-content { padding: 2.5rem; flex: 1; }

.page-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.page-title-bar h2 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}
.page-title-bar p {
    color: var(--gray-500);
    margin: 0;
}

.main-footer {
    padding: 1rem 2.5rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    text-align: left;
    border-top: 1px solid var(--gray-200);
    position: sticky;
    bottom: 0;
    background: var(--white);
    z-index: 40;
    margin-top: auto;
}

/* ── Cards & Stats ── */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-body { padding: 1.5rem; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}
.stat-card.blue .stat-icon { background: #EEF2FF; color: var(--primary); }
.stat-card.green .stat-icon { background: #ECFDF5; color: var(--secondary); }
.stat-card.orange .stat-icon { background: #FFFBEB; color: var(--warning); }
.stat-card.red .stat-icon { background: #FEF2F2; color: var(--danger); }
.stat-info h4 { font-size: 0.875rem; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.stat-info .stat-value { font-size: 1.75rem; font-weight: 800; color: var(--dark); }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
th {
    background: var(--gray-50);
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--gray-600);
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
}
td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
}
tr:hover td { background: var(--gray-50); }

/* ── Badges ── */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-success { background: #ECFDF5; color: var(--secondary); }
.badge-warning { background: #FFFBEB; color: var(--warning); }
.badge-danger { background: #FEF2F2; color: var(--danger); }

/* ── Alerts ── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert-danger { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
.alert-success { background: #ECFDF5; color: var(--secondary); border: 1px solid #A7F3D0; }