:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #818cf8;
    --indigo: #6366f1;
    --violet: #8b5cf6;
    --secondary: #64748b;
    --bg-main: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
}

header.wastu-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

@media (max-width: 768px) {
    header {
        padding: 0.75rem 1rem;
    }
}

.title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.title img {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    object-fit: cover;
}

.title-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.title-main {
    font-size: 1.1rem;
    color: #1e293b;
    letter-spacing: -0.02em;
    font-weight: 700;
    display: block; /* Force block to ensure stacking */
}

.title-sub {
    font-size: 0.65rem;
    color: #64748b;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 800;
    display: block; /* Force block to ensure stacking */
}

header nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-links a {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
    transition: color 0.2s;
}

.nav-links a.active {
    color: var(--primary) !important;
}

.nav-links a:hover {
    color: var(--primary) !important;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid #e2e8f0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    object-fit: cover;
}

.user-name-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.nav-toggle {
    display: none;
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.2rem;
    color: var(--text-main);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 992px) {
    .nav-toggle {
        display: flex;
    }

    header nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 1.5rem;
        border-bottom: 2px solid var(--primary);
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
        gap: 1.5rem !important;
        align-items: stretch !important;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    header nav.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-links a {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        background: #f8fafc;
        width: 100%;
    }

    .user-actions {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        flex-direction: column;
        gap: 1rem;
        border-top: 1px solid #f1f5f9;
        padding-top: 1.5rem;
    }

    .user-profile {
        width: 100%;
        background: #f1f5f9;
        padding: 0.75rem;
        border-radius: 12px;
    }

    .btn-logout {
        width: 100%;
        justify-content: center;
    }
}

/* Page Headers */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.page-header p {
    color: #64748b;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-header h1 {
        font-size: 1.5rem;
    }
}

/* Grids */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table th {
    background: #f8fafc;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-outline {
    background: white;
    border: 1.5px solid #e2e8f0;
    color: #475569;
}
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-dosen { background: #dcfce7 !important; color: #166534 !important; }
.badge-mhs { background: #dbeafe !important; color: #1e40af !important; }
.badge-karyawan { background: #fef9c3 !important; color: #854d0e !important; }
.badge-all { background: #f1f5f9 !important; color: #475569 !important; }

/* Utilities */
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}
