/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-wrapper .material-icons {
    padding: 0 12px;
    color: #666;
}

.input-wrapper input {
    flex: 1;
    border: none;
    padding: 12px;
    font-size: 16px;
    outline: none;
    background: transparent;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}



.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 60px;
    justify-content: center;
}

/* Stok Habis Styles */
.stok-habis {
    opacity: 0.6;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.stok-habis .checkbox-label {
    cursor: not-allowed;
    pointer-events: none;
}

.stok-habis .checkbox-label.disabled {
    opacity: 0.5;
}

.stok-habis-label {
    color: #ff0000 !important;
    font-weight: bold;
    font-size: 14px;
    background-color: #ffffff;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
    border: 2px solid #ff0000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stok-tersedia {
    color: #28a745;
    font-size: 12px;
    font-weight: 500;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.demo-accounts {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.demo-accounts h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

.account-item {
    font-size: 14px;
    margin-bottom: 8px;
    color: #666;
}

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

.sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #eee;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.sidebar-footer {
    border-top: 1px solid #eee;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

.nav-item.active {
    background: #f0f4ff;
    color: #667eea;
    border-left-color: #667eea;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    background: #f5f5f5;
}

.top-bar {
    background: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 500;
    color: #333;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    font-weight: 500;
    color: #333;
}

.user-role {
    font-size: 14px;
    color: #666;
    background: #f0f4ff;
    padding: 4px 8px;
    border-radius: 4px;
}

.content {
    padding: 24px;
}

.welcome-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.welcome-section h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #333;
}

.welcome-section p {
    color: #666;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f0f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 24px;
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.stat-content p {
    color: #666;
    font-size: 14px;
}

.quick-actions {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-actions h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid #eee;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 500;
    color: #333;
}

.form {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.currency {
    color: #666;
    font-weight: 500;
}

.form-section {
    margin: 24px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.form-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #333;
}

.form-section p {
    color: #666;
    margin-bottom: 16px;
}

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

.stok-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 12px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.stok-info strong {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
}

.stok-info span {
    font-size: 14px;
    color: #666;
}

.stok-inputs {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #333;
}

.input-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.input-group input[readonly] {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    user-select: none !important;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 500;
    color: #333;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.text-center {
    text-align: center;
}

.chart-container {
    padding: 24px;
    height: 400px;
}

.download-options {
    padding: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stok-grid {
        grid-template-columns: 1fr;
    }
    
    .input-row {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .user-menu {
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }
    
    .content {
        padding: 16px;
    }
    
    .card {
        margin-bottom: 16px;
    }
    
    .card-header,
    .form {
        padding: 16px;
    }
    
    .download-options {
        padding: 16px;
        flex-direction: column;
    }
}

/* Overlay for mobile menu */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.open {
    display: block;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-karyawan {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-kordinator {
    background: #fff3e0;
    color: #f57c00;
}

.badge-owner {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-laporan_harian {
    background: #e8f5e8;
    color: #2e7d32;
}

.badge-manajemen_stok {
    background: #fff3e0;
    color: #f57c00;
}

.badge-manajemen_akun {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-add_laporan {
    background: #e8f5e8;
    color: #2e7d32;
}

.badge-edit_laporan {
    background: #fff3e0;
    color: #f57c00;
}

.badge-delete_laporan {
    background: #ffebee;
    color: #c62828;
}

.badge-add_pengeluaran {
    background: #e8f5e8;
    color: #2e7d32;
}

.badge-delete_pengeluaran {
    background: #ffebee;
    color: #c62828;
}

.badge-login {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-logout {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
}

/* Page header */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.page-header p {
    color: #666;
    font-size: 16px;
}

/* Form hints */
small {
    color: #6c757d;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px 0;
    margin-top: auto;
    text-align: center;
    font-size: 14px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-left .material-icons {
    font-size: 20px;
    color: #3498db;
}

.footer-left span {
    font-weight: 500;
}

.footer-center {
    text-align: center;
}

.footer-center p {
    margin: 0;
    color: #bdc3c7;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-right a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-right a:hover {
    color: #3498db;
}

/* Ensure main content takes full height */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
}

/* Mobile responsive footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-left,
    .footer-right {
        justify-content: center;
    }
}