@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;600&display=swap');

:root {
    /* Formal Corporate Palette */
    --primary: #1e293b;        /* Deep Slate */
    --primary-light: #334155;
    --accent: #2563eb;         /* Royal Blue */
    --accent-hover: #1d4ed8;
    --bg-body: #f8fafc;        /* Soft Gray-Blue Background */
    --white: #ffffff;
    --text-dark: #0f172a;      /* Slate 900 */
    --text-muted: #64748b;     /* Slate 500 */
    --border-color: #e2e8f0;   /* Slate 200 */
    --success: #059669;        /* Emerald 600 */
    --error: #dc2626;          /* Red 600 */
    --warning: #d97706;        /* Amber 600 */
    
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-hover-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    --radius-lg: 8px;          /* Slightly less rounded for formal look */
    --radius-md: 6px;
    --radius-sm: 4px;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--primary);
}

/* Navbar - Corporate Style */
.navbar {
    background: var(--primary);
    padding: 0.75rem 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-brand img {
    height: 36px;
    filter: brightness(0) invert(1); /* Make logo white for dark navbar */
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
}

.logout-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cards - Official Look */
.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--card-hover-shadow);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-light);
}

input, textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    background-color: #fff;
    color: var(--text-dark);
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: white;
    border-color: var(--border-color);
    color: var(--primary);
}

.btn-secondary:hover {
    background-color: var(--bg-body);
}

.btn-block {
    display: flex;
    width: 100%;
}

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

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* Dashboard Specifics */
.stat-card {
    border-top: 4px solid var(--accent);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f1f5f9;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

tr:hover td {
    background-color: #fbfcfe;
}

/* Notifications */
#notification-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.notification.success { border-left-color: var(--success); }
.notification.error { border-left-color: var(--error); }
.notification.loading { border-left-color: var(--accent); }

@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Login Page Specific - Simple Formal */
.login-page {
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header img {
    height: 60px;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.login-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-card .form-group label {
    font-weight: 600;
    color: var(--primary);
}

.login-card input {
    border: 1px solid var(--border-color);
    background: #fff;
}

.login-card .btn-primary {
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

/* Sidebar Custom for Admin Dashboard */
.sidebar {
    background: var(--white) !important;
    border: 1px solid var(--border-color) !important;
}

.sidebar-menu li:hover, .sidebar-menu li.active {
    background: #eff6ff !important;
    color: var(--accent) !important;
    border-left: 3px solid var(--accent);
    padding-left: 12px !important;
}

/* Tab Management */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Responsive Overrides */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .nav-brand {
        font-size: 1rem;
    }

    .nav-user {
        width: 100%;
        justify-content: center;
        gap: 10px;
        font-size: 0.8rem;
    }

    .container {
        padding: 1rem;
    }

    /* Force all grids to stack on mobile */
    .grid {
        grid-template-columns: 1fr !important;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.25rem;
    }

    .stat-icon {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Admin Sidebar behavior for mobile */
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px;
    }
    
    .sidebar-menu li {
        white-space: nowrap;
        margin-bottom: 0;
        font-size: 0.8rem;
        padding: 8px 12px !important;
    }
}

@media (max-width: 480px) {
    .nav-brand span {
        display: none; /* Hide 'Manajemen PKL' text on very small screens, keep logo */
    }
    
    .nav-brand img {
        height: 30px;
    }
    
    .btn {
        width: 100%; /* Many buttons should be full width on mobile */
    }
}
