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

:root {
    --primary: #0d9488; /* Teal */
    --primary-hover: #0f766e;
    --primary-light: #f0fdfa;
    --secondary: #0284c7; /* Sky blue */
    --secondary-hover: #0369a1;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #ca8a04;
    --warning-light: #fef9c3;
    --bg-main: #f8fafc; /* Slate 50 */
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a; /* Slate 900 */
    --text-dark: #0f172a;
    --text-light: #64748b;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #ffffff;
    --border-color: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.sidebar-brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 0.7rem;
    color: var(--text-sidebar);
    display: block;
    font-weight: 400;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.sidebar-item a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-sidebar-active);
}

.sidebar-item.active a {
    background-color: var(--primary);
    color: var(--text-sidebar-active);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    text-align: center;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* Header Styling */
.header {
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.header-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

.header-title-container {
    display: flex;
    flex-direction: column;
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user-info {
    text-align: right;
}

.header-username {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    display: block;
}

.header-role {
    font-size: 0.75rem;
    color: var(--text-light);
    background-color: #f1f5f9;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 2px;
    display: inline-block;
}

/* Content Area */
.content-body {
    padding: 32px;
    flex-grow: 1;
}

/* Grid & Layout Utilities */
.grid {
    display: grid;
    gap: 24px;
}

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

.grid-cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

/* Card Component */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 4px 0;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background-color: var(--primary-light); color: var(--primary); }
.stat-icon.success { background-color: var(--success-light); color: var(--success); }
.stat-icon.danger { background-color: var(--danger-light); color: var(--danger); }
.stat-icon.warning { background-color: var(--warning-light); color: var(--warning); }

/* Forms & Inputs */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #fff;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-control:disabled {
    background-color: #f1f5f9;
    color: var(--text-light);
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

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

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-dark);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-full {
    width: 100%;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.table th {
    background-color: #f8fafc;
    color: var(--text-light);
    font-weight: 600;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table-judul {
    font-size: 0.8rem !important;
}

.table-judul th {
    padding: 10px 12px !important;
    font-size: 0.72rem !important;
}

.table-judul td {
    padding: 10px 12px !important;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: capitalize;
}

.badge-pending {
    background-color: var(--warning-light);
    color: var(--warning);
}

.badge-approved {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-rejected {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* Alert Message */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.alert-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Login Page Styling */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(13, 148, 136, 0.1) 0%, rgba(2, 132, 199, 0.05) 90%), var(--bg-main);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 40px 32px;
}

.login-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 1.8rem;
    box-shadow: 0 8px 16px rgba(13, 148, 136, 0.3);
    margin-bottom: 16px;
}

.login-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Search Bar & Filter styling */
.search-filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex-grow: 1;
    position: relative;
}

/* Custom CSS Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Styling */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header {
        padding: 0 20px;
    }
    
    .header-toggle {
        display: block;
    }
    
    .content-body {
        padding: 20px;
    }
}
