/* style.css - Versi Sidebar Gradien Merah Lembut */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* --- PALET WARNA --- */
    --primary-color: #6B7FFF;
    --primary-hover: #5B6CFF;
    --secondary-color: #F9FAFB;
    --success-color: #34D399;
    --warning-color: #FBBf24;
    --danger-color: #F87171;
    --text-color: #374151;
    --text-light: #6B7280;
    --border-color: #E5E7EB;
    
    /* --- WARNA SIDEBAR GRADIEN MERAH LEMBUT --- */
    --sidebar-gradient-start: #FCA5A5; /* Merah salmon lembut */
    --sidebar-gradient-end: #F87171;   /* Merah yang sedikit lebih cerah */
    --sidebar-header-bg: rgba(255, 255, 255, 0.15); /* Header transparan dengan overlay putih */
    --sidebar-accent: #7F1D1D; /* Aksen merah tua untuk kontras */
    --sidebar-text: #FFFFFF; /* Teks putih untuk kontras maksimal */
    --sidebar-text-light: rgba(255, 255, 255, 0.9); /* Teks sekunder yang sedikit transparan */
    --sidebar-hover-bg: rgba(255, 255, 255, 0.2); /* Overlay putih untuk hover */

    /* --- WARNA TOMBOL MERAH NETRAL --- */
    --btn-primary-bg: #DC2626;
    --btn-primary-hover: #B91C1C;
    --btn-secondary-bg: #FEF2F2;
    --btn-secondary-hover: #FEE2E2;
    --btn-secondary-text: #991B1B;
    
    /* --- LAYOUT VARIABLES --- */
    --sidebar-width: 220px;
    --header-height: 70px;
    --transition-speed: 0.3s;
    
    /* --- SHADOWS --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);
    --sidebar-shadow: 0 4px 20px rgba(220, 38, 38, 0.25); /* Bayangan dengan sentuhan merah */
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--secondary-color);
    margin: 0;
    color: var(--text-color);
    line-height: 1.6;
    font-size: 12px;
}

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

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #890000 0%, var(--sidebar-gradient-end) 100%);/* Gradien merah lembut */
    box-shadow: var(--sidebar-shadow);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform var(--transition-speed) ease-in-out;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 25px 20px;
    background-color: var(--sidebar-header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    backdrop-filter: blur(5px); /* Efek blur modern untuk header */
}

.sidebar-header h1 {
    margin: 0;
    font-size: 26px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--sidebar-text);
    /* --- DIUBAH: Efek bayangan yang lebih menonjol dan berdimensi --- */
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.4), 3px 3px 5px rgba(0, 0, 0, 0.3);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.sidebar-header h3 {
    margin: 5px 0 0;
    font-size: 12px; /* Diperkecil */
    font-weight: 500;
    font-style: italic; /* Dibuat miring (italic) */
    color: var(--sidebar-text-light);
    letter-spacing: 0.7px; /* Jarak antar huruf disesuaikan */
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: var(--sidebar-text-light);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

/* Efek hover dan aktif dengan overlay transparan */
.sidebar-menu a:hover {
    color: var(--sidebar-text);
    background-color: var(--sidebar-hover-bg);
}

.sidebar-menu a.active {
    color: var(--sidebar-text);
    background-color: var(--sidebar-hover-bg);
}

/* Garis indikator merah tua untuk item aktif */
.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--sidebar-accent);
}

.sidebar-menu a i {
    margin-right: 12px;
    font-size: 16px;
    color: var(--sidebar-text-light);
    transition: color 0.2s ease;
}

.sidebar-menu a:hover i, .sidebar-menu a.active i {
    color: var(--sidebar-text);
}

/* --- MAIN CONTENT AREA --- */
.main-content {
    flex: 1;
    margin-left: 0;
    transition: margin-left var(--transition-speed) ease-in-out;
}

.main-content.shifted {
    margin-left: var(--sidebar-width);
}

/* --- TOP HEADER --- */
.top-header {
    background-color: #FFFFFF;
    height: var(--header-height);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 3px solid var(--btn-primary-bg);
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-color);
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.menu-toggle:hover {
    background-color: var(--sidebar-gradient-start); /* Hover dengan warna gradien */
    color: var(--sidebar-text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* --- NOTIFICATION --- */
.notification-dropdown {
    position: relative;
}

.notification-icon {
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.notification-icon:hover {
    background-color: var(--sidebar-gradient-start);
    color: var(--sidebar-text);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 12px;
}

.dropdown-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.dropdown-item:hover {
    background-color: var(--secondary-color);
}
.dropdown-item a {
    text-decoration: none;
    color: var(--text-color);
}
.dropdown-item strong {
    display: block;
    margin-bottom: 4px;
}

/* --- PROFILE --- */
.profile-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
}
.profile-dropdown:hover {
    background-color: var(--secondary-color);
}

.profile-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--btn-primary-bg);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.profile-info {
    text-align: right;
}
.profile-name {
    font-weight: 600;
    font-size: 12px;
    line-height: 1.2;
}
.profile-role {
    font-size: 10px;
    color: var(--text-light);
    line-height: 1.2;
}

/* --- CONTENT WRAPPER --- */
.content-wrapper {
    padding: 30px;
}

/* --- COMPONENTS (Tables, Forms, Buttons, etc.) --- */
.container {
    max-width: 100%;
    padding: 0;
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
}

h2 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 14px;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    background-color: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #f3f4f6;
}
th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}
th {
    background-color: #F3F4F6;
    font-weight: 600;
    color: #dc2626;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
tr:last-child td { border-bottom: none; }
tr:hover { background-color: #FAFAFA; }

/* --- GANTI atau TAMBAHKAN class .form-container yang lama dengan yang ini --- */
.form-container {
    max-width: 800px;
    margin: 0 auto 30px auto;
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}
.form-container .form-group {
    margin-bottom: 20px;
}
.form-container label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 12px;
}
.form-container select,
.form-container input,
.form-container textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-container select:focus,
.form-container input:focus,
.form-container textarea:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}
.form-container .btn {
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
}

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 12px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    margin-right: 10px;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-primary { background-color: var(--btn-primary-bg); color: white; }
.btn-primary:hover { background-color: var(--btn-primary-hover); }
.btn-secondary { background-color: var(--btn-secondary-bg); color: var(--btn-secondary-text); border: 1px solid var(--sidebar-accent); }
.btn-secondary:hover { background-color: var(--btn-secondary-hover); }
.btn-success { background-color: var(--success-color); color: white; }
.btn-success:hover { background-color: #10B981; }
.btn-danger { background-color: var(--danger-color); color: white; }
.btn-danger:hover { background-color: #EF4444; }
.btn-sm { padding: 8px 16px; font-size: 12px; }

.toggle-section { margin-bottom: 20px; }
.toggle-btn {
    background-color: var(--btn-primary-bg);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s;
}
.toggle-btn:hover { background-color: var(--btn-primary-hover); }

.inventory-container {
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}
.inventory-container.hidden { max-height: 0; }
.inventory-container.show { max-height: 2000px; }

.status {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-pending { background-color: rgba(251, 191, 36, 0.2); color: #92400e; }
.status-disetujui { background-color: rgba(52, 211, 153, 0.2); color: #065f46; }
.status-ditolak { background-color: rgba(248, 113, 113, 0.2); color: #991b1b; }

.alert {
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
}
.alert-success { color: #065F46; background-color: #D1FAE5; border: 1px solid #A7F3D0; }
.alert-error { color: #991B1B; background-color: #FEE2E2; border: 1px solid #FECACA; }

/* --- LOGIN PAGE --- */
body.login-page {
    background-color: var(--btn-primary-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}
.login-page .app-container {
    width: 100%;
    max-width: 420px;
}
.login-page .sidebar { display: none; }
.login-page .main-content { margin-left: 0; }
.login-page .top-header { display: none; }
.login-page .content-wrapper { padding: 0; }
.login-page .form-container {
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}
.login-page header h1 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}
.login-page .form-group label { color: white; }
.login-page .form-group input { background-color: rgba(255, 255, 255, 0.9); }
.login-page p { text-align: center; margin-top: 20px; color: rgba(255, 255, 255, 0.8); font-size: 12px; }
.login-page p a { color: white; font-weight: 600; }

/* --- PRINT STYLES --- */
@media print {
    body * { visibility: hidden; }
    .print-container, .print-container * { visibility: visible; }
    .print-container { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; }
    .no-print { display: none !important; }
    .sidebar, .top-header { display: none !important; }
    .main-content { margin-left: 0 !important; }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
}

/* Style untuk kotak notifikasi agar ada ruang untuk tombol close */
.alert {
    position: relative;
    padding-right: 40px;
}

/* Style untuk tombol close (x) */
.alert-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

.alert-close:hover {
    opacity: 1;
}

/* Style untuk baris barang yang stoknya menipis */
.low-stock-row {
    background-color: rgba(251, 191, 36, 0.1);
}

/* Style untuk teks angka stok yang menipis */
.low-stock-text {
    color: var(--warning-color);
    font-weight: 700;
}

/* --- GANTI class .form-page-wrapper yang lama dengan yang ini di style.css --- */
.form-page-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.form-page-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.form-page-header .icon {
    font-size: 48px;
    color: var(--btn-primary-bg);
    margin-bottom: 15px;
}

.form-page-header h2 {
    color: var(--text-color);
    margin-bottom: 5px;
    font-size: 18px;
}

.form-page-header p {
    color: var(--text-light);
    font-size: 12px;
}

.form-group-with-icon {
    position: relative;
    margin-bottom: 20px;
}

.form-group-with-icon .form-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
}

.form-group-with-icon input,
.form-group-with-icon select,
.form-group-with-icon textarea {
    width: 100%;
    padding: 12px 16px;
    padding-left: 45px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group-with-icon input:focus,
.form-group-with-icon select:focus,
.form-group-with-icon textarea:focus {
    outline: none;
    border-color: var(--btn-primary-bg);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* --- STYLES UNTUK HALAMAN LAPORAN --- */
.report-controls {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.report-controls .form-group {
    margin: 0;
    min-width: 200px;
}
.report-controls .form-group label {
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 500;
}
.report-controls .form-group select,
.report-controls .form-group input {
    font-size: 12px;
    padding: 10px 12px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}
.report-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 25px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.report-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.report-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.report-card .chart-container {
    position: relative;
    height: 250px;
}
.report-card .table-container {
    max-height: 300px;
    overflow-y: auto;
    font-size: 12px;
}
.report-card .table-container table th,
.report-card .table-container td {
    padding: 10px;
    font-size: 12px;
}
.report-card .no-data {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px;
    color: var(--text-light);
    font-size: 14px;
}

/* --- PRINT STYLES --- */
@media print {
    body * { visibility: hidden; }
    .print-area, .print-area * { visibility: visible; }
    .print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; }
    .no-print { display: none !important; }
    .sidebar, .top-header { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .report-grid { grid-template-columns: 1fr; }
    .report-card { break-inside: avoid; page-break-inside: inside; }
}