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

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

body { 
    background-color: #f8fafc; /* Lebih cerah dan bersih */
    color: #334155; 
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   UTILITY CLASSES (Kelas Bantuan)
   ========================================= */
.container { 
    max-width: 1100px; 
    margin: 40px auto; 
    padding: 30px; 
    background: #ffffff; 
    /* Soft modern shadow */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.025); 
    border-radius: 12px; /* Sudut lebih membulat */
    border: 1px solid #f1f5f9;
}

.text-hint { 
    font-size: 0.875em; 
    color: #64748b; 
    margin-bottom: 15px; 
    display: block; 
}

hr {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 20px 0;
}

/* =========================================
   NAVBAR & DROPDOWN MENU
   ========================================= */
.navbar { 
    background-color: #0f172a; /* Warna dark blue/slate modern */
    color: #f8fafc; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 16px 5%; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .logo {
    font-size: 1.25em;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar ul { 
    list-style: none; 
    display: flex; 
    gap: 8px; 
    align-items: center;
}

.navbar a { 
    color: #cbd5e1; 
    text-decoration: none; 
    padding: 8px 16px; 
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease; 
}

.navbar a:hover, .dropdown:hover .dropbtn { 
    background-color: #1e293b; 
    color: #ffffff;
}

/* Tombol Logout di Navbar */
.navbar a.btn-logout {
    background-color: #ef4444; 
    color: white;
    font-weight: 600;
    margin-left: 15px; 
    padding: 8px 18px;
}

.navbar a.btn-logout:hover {
    background-color: #dc2626; 
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

/* Dropdown Khusus */
.dropdown { 
    position: relative; 
    display: inline-block; 
}

.dropdown-content { 
    opacity: 0;
    visibility: hidden;
    position: absolute; 
    background-color: #ffffff; 
    min-width: 220px; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); 
    z-index: 1; 
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid #f1f5f9;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown-content a { 
    color: #475569 !important; 
    padding: 12px 16px; 
    display: block; 
    border-bottom: 1px solid #f1f5f9;
    font-weight: 400;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover { 
    background-color: #f8fafc; 
    color: #0f172a !important;
    padding-left: 20px; /* Sedikit animasi geser teks */
}

.dropdown:hover .dropdown-content { 
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =========================================
   HALAMAN LOGIN
   ========================================= */
.login-body { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); 
}

.login-container { 
    background: #ffffff; 
    padding: 40px; 
    border-radius: 16px; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01); 
    width: 100%; 
    max-width: 420px; 
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.login-container h2 {
    text-align: center;
    color: #0f172a;
    font-size: 1.75em;
    margin-bottom: 8px;
    font-weight: 700;
}

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

.form-group label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 500;
    font-size: 0.9em;
    color: #475569;
}

.form-group input { 
    width: 100%; 
    padding: 12px 16px; 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    font-size: 15px;
    color: #334155;
    background-color: #f8fafc;
    transition: all 0.3s ease;
}

.form-group input:focus {
    background-color: #ffffff;
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); /* Focus ring modern */
}

/* Tombol */
.btn-primary { 
    width: 100%; 
    padding: 12px; 
    background-color: #3b82f6; 
    color: #ffffff; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 16px; 
    font-weight: 600; 
    transition: all 0.2s ease; 
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover { 
    background-color: #2563eb; 
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.4);
}

.btn-warning { 
    padding: 10px 20px; 
    background-color: #f59e0b; 
    color: #ffffff; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.btn-warning:hover {
    background-color: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.25);
}

.auth-links { 
    text-align: center; 
    margin-top: 25px; 
    font-size: 0.9em; 
}

.auth-links a { 
    color: #3b82f6; 
    text-decoration: none; 
    font-weight: 500;
    transition: color 0.2s;
}

.auth-links a:hover { 
    color: #1d4ed8; 
}

/* =========================================
   TABLES (Tabel Stok Modern)
   ========================================= */
.data-table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0;
    margin-top: 20px; 
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.data-table th, .data-table td { 
    padding: 14px 16px; 
    text-align: left; 
    border-bottom: 1px solid #e2e8f0;
}

.data-table th { 
    background-color: #f8fafc; 
    color: #475569; 
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: #f1f5f9;
}

/* Form Tambah Stok inline */
.add-stok-section {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px dashed #cbd5e1;
}

.add-stok-section .form-group {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    align-items: flex-end;
}

/* =========================================
   MODAL BOX (Pop-up)
   ========================================= */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(4px); /* Efek blur pada background */
}

.modal-content { 
    background-color: #ffffff; 
    margin: 5% auto; 
    padding: 35px; 
    width: 90%; 
    max-width: 450px; 
    border-radius: 16px; 
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideDown 0.3s ease-out;
}

@keyframes modalSlideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close { 
    color: #94a3b8; 
    position: absolute;
    top: 15px;
    right: 20px; 
    font-size: 28px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: color 0.2s;
}

.close:hover { 
    color: #0f172a; 
}

/* =========================================
   CARD & BADGES (Hasil Tracking)
   ========================================= */
.search-form {
    display: flex;
    gap: 12px;
    align-items: center; /* Diubah agar lebih pas */
    margin-bottom: 35px;
}

.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.search-form input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.card { 
    background: #ffffff; 
    padding: 25px 30px; 
    border-radius: 12px; 
    border-left: 5px solid #3b82f6; 
    margin-top: 25px; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border-top: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateX(5px); /* Sedikit bergeser saat dihover */
}

.card h3 {
    margin-bottom: 15px;
    color: #0f172a;
    font-size: 1.25em;
}

.card p {
    margin-bottom: 10px;
    color: #475569;
}

.card ul {
    margin-top: 15px;
    padding-left: 20px;
    color: #475569;
}

.card ul li {
    margin-bottom: 8px;
}

.badge { 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 0.8em; 
    font-weight: 600; 
    color: #ffffff; 
    display: inline-block;
    letter-spacing: 0.05em;
}

.status-dikirim { 
    background-color: #10b981; /* Hijau emerald modern */
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.alert-error { 
    background-color: #fef2f2; 
    color: #b91c1c; 
    padding: 16px 20px; 
    border-radius: 8px; 
    margin-top: 20px; 
    border: 1px solid #fecaca; 
    display: flex;
    align-items: center;
    font-weight: 500;
}

/* Styling untuk Toast Notification */
.toast {
    visibility: hidden; 
    min-width: 320px;
    background: #1e293b; /* Ubah ke dark mode styling agar kontras */
    color: #f8fafc;
    text-align: left;
    border-radius: 10px;
    padding: 16px 20px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%) translateY(30px) scale(0.95);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Animasi memantul (bouncy) */
    border-left: 4px solid #3b82f6;
}

/* Class animasi saat notifikasi muncul */
.toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}