@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

/* =========================================
   1. VARIABLES & GLOBAL STYLES
   ========================================= */
:root {
    --primary: #FF8C00;
    --primary-dark: #E67E00;
    --primary-light: #FFA500;
    --bg-color: #F4F6F9;
    --text-dark: #2C3E50;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(255, 140, 0, 0.15);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    color: var(--text-dark);
}

/* =========================================
   2. LAYOUT & SIDEBAR
   ========================================= */
.wrapper { 
    display: flex; 
    min-height: 100vh; 
}

.main-content { 
    flex: 1; 
    padding: 30px; 
    overflow-y: auto; 
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 20px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
}

.sidebar h2 { 
    font-size: 1.2rem; 
    margin-bottom: 2rem; 
    text-align: center; 
    font-weight: 700; 
    letter-spacing: 1px;
}

/* --- Menu Utama (Level 1) --- */
/* Menggunakan selector '>' agar tidak merusak submenu */
.sidebar > a {
    display: block;
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    margin-bottom: 10px;
    border-radius: 10px;
    transition: 0.3s;
    background: rgba(255,255,255,0.1);
}

.sidebar > a:hover, 
.sidebar > a.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateX(5px);
}

/* --- Menu Dropdown (Level 1 - Tombol Pemicu) --- */
.dropdown-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: 0.3s;
    border-radius: 10px;
    margin-bottom: 5px;
}

.dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.1); 
}

/* Saat Halaman Aktif (Background Putih) */
.dropdown-btn.active {
    background: white !important;
    color: var(--primary) !important;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateX(5px);
}

/* Saat Menu Dibuka (Panah Berputar) */
.dropdown-btn.menu-open .arrow {
    transform: rotate(180deg);
}

.arrow { 
    font-size: 0.7rem; 
    transition: transform 0.3s ease; 
}

/* --- Container Submenu (Level 2) --- */
.dropdown-container {
    display: none;
    background-color: rgba(0, 0, 0, 0.25);
    margin: 0 0 10px 0;
    border-radius: 10px;
    padding: 5px 0;
}

/* --- Link Submenu (Anak) --- */
.sidebar .dropdown-container a {
    display: block;
    background: transparent !important;
    color: #eee !important;
    padding: 8px 15px 8px 35px !important; /* Indentasi ke dalam */
    font-size: 0.9rem !important;
    font-weight: normal !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    border-left: 3px solid transparent;
    text-decoration: none;
    transition: 0.2s;
}

.sidebar .dropdown-container a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-left: 3px solid #fff;
    padding-left: 40px !important;
}

.sidebar .dropdown-container a.active {
    color: #ffd700 !important; /* Warna Emas */
    font-weight: bold !important;
    border-left: 3px solid #ffd700;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* =========================================
   3. COMPONENTS (CARDS, BADGES)
   ========================================= */
.card-3d {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: transform 0.3s ease;
    border-left: 5px solid var(--primary);
}

.card-3d:hover {
    transform: translateY(-5px);
}

.badge { 
    padding: 5px 10px; 
    border-radius: 20px; 
    font-size: 0.8rem; 
    color: white; 
}
.badge-hot { background: #ff4757; }
.badge-warm { background: #ffa502; }
.badge-cold { background: #5352ed; }

/* =========================================
   4. BUTTONS
   ========================================= */
.btn-orange {
    background: linear-gradient(45deg, var(--primary), var(--primary-light));
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.4);
    transition: 0.3s;
    width: 100%;
}
.btn-orange:hover { 
    transform: scale(1.02); 
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.6); 
}

.btn-new {
    background: linear-gradient(45deg, #FF8C00, #FFA500);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 10px rgba(255, 140, 0, 0.3);
    transition: 0.3s;
}
.btn-new:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 15px rgba(255, 140, 0, 0.5); 
}

.btn-cancel {
    background: transparent;
    color: #888;
    border: 1px solid #ddd;
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn-cancel:hover { 
    background: #f5f5f5; 
    color: #333; 
}

/* =========================================
   5. FORMS
   ========================================= */
input, select, textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid #eee;
    border-radius: 10px;
    background: #fafafa;
    transition: 0.3s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.1);
}

.modern-form {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 Kolom */
    gap: 20px;
}

.form-group { margin-bottom: 5px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 0.85rem;
}
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #f9f9f9;
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.full-width { grid-column: span 2; }

/* =========================================
   6. TABLES
   ========================================= */
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 20px; 
    background: white; 
    border-radius: 15px; 
    overflow: hidden; 
    box-shadow: var(--shadow); 
}
th, td { 
    padding: 15px; 
    text-align: left; 
    border-bottom: 1px solid #eee; 
}
th { 
    background: var(--primary); 
    color: white; 
}
tr:hover { 
    background-color: #fff8e1; 
}

/* =========================================
   7. MODALS (POP UP)
   ========================================= */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    align-items: center; 
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: auto; 
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    position: relative;
    animation: zoomIn 0.3s ease;
}

.modal-footer {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.close-btn:hover { 
    color: #c0392b; 
    transform: rotate(90deg); 
}

@keyframes zoomIn {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

/* =========================================
   8. FOOTER
   ========================================= */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #888;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

/* --- 1. HEADER ACTION BUTTONS (Tombol Atas) --- */
.header-actions {
    display: flex;
    gap: 10px; /* Jarak antar tombol konsisten */
    align-items: center;
}

/* Base Style untuk tombol header agar simetris */
.btn-custom {
    height: 42px; /* Tinggi Tetap */
    padding: 0 20px;
    border-radius: 50px; /* Pill shape */
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    white-space: nowrap; /* Mencegah teks turun baris */
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Warna Spesifik */
.btn-query { 
    background: #34495e; 
    color: white; 
}
.btn-new { 
    background: linear-gradient(45deg, #FF8C00, #FFA500); 
    color: white; 
}
.btn-excel { 
    background: #27ae60; 
    color: white; 
}

/* --- 2. FILTER BUTTONS (Tombol Cari & Reset) --- */
.filter-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: flex-end; /* Pastikan rata bawah sejajar input */
}

.btn-filter, .btn-reset {
    height: 45px; /* Sesuaikan tinggi dengan Input Form */
    flex: 1;      /* Membagi lebar sama rata (50:50) */
    border-radius: 10px; /* Sudut kotak tumpul (sesuai input) */
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.3s;
}

.btn-filter {
    background: var(--primary);
    color: white;
}
.btn-reset {
    background: #95a5a6;
    color: white;
}
.btn-filter:hover, .btn-reset:hover { opacity: 0.9; }

/* --- 3. SIDEBAR DROPDOWN FIX (Agar tidak menumpuk seperti bata) --- */
/* Style Container Dropdown */
.dropdown-container {
    display: none;
    background-color: rgba(0, 0, 0, 0.2); /* Background agak gelap */
    margin: 5px 0 10px 0;
    border-radius: 10px;
    overflow: hidden; /* Agar radius terbaca */
}

/* Style ITEM dalam Dropdown */
.sidebar .dropdown-container a {
    display: block;
    background: transparent !important; /* Hapus background orange */
    color: rgba(255, 255, 255, 0.8) !important; /* Teks putih agak transparan */
    padding: 10px 20px 10px 35px !important; /* Indentasi ke dalam */
    font-size: 0.9rem !important;
    font-weight: normal !important;
    border-radius: 0 !important; /* Hapus radius per item */
    margin-bottom: 0 !important; /* Hapus jarak antar item */
    box-shadow: none !important;
    border-left: 3px solid transparent; /* Garis indikator kiri */
    text-decoration: none;
    transition: all 0.2s;
}

/* Hover Effect Menu Dropdown */
.sidebar .dropdown-container a:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: white !important;
    border-left: 3px solid #fff; /* Indikator putih saat hover */
    padding-left: 40px !important; /* Efek geser kanan */
}

/* Active State Menu Dropdown */
.sidebar .dropdown-container a.active {
    color: #ffd700 !important; /* Warna Emas */
    font-weight: bold !important;
    border-left: 3px solid #ffd700;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* =========================================
   STYLE FILTER BOX (Ala Rekom - Beige Theme)
   ========================================= */
.filter-box {
    background-color: #fff8e1; /* Warna dasar Beige/Krem */
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: 1px solid #ffe0b2; /* Garis tepi oranye tipis */
}

.filter-header {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e67e22; /* Judul Oranye Tebal */
    margin-bottom: 20px;
    border-bottom: 1px solid #ffe0b2;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-header::before {
    content: '🔍'; /* Ikon Kaca Pembesar */
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Default 4 Kolom */
    gap: 20px;
    align-items: end;
}

/* Style Input di dalam Filter */
.filter-item label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.filter-item input, 
.filter-item select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 0.9rem;
    transition: 0.3s;
    box-sizing: border-box; /* Agar padding tidak melebarkan input */
    height: 45px; /* Tinggi seragam */
}

.filter-item input:focus, 
.filter-item select:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
    outline: none;
}

/* Tombol Filter Action */
.filter-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* Pastikan Tombol Cari & Reset tingginya sama dengan Input */
.btn-filter, .btn-reset {
    height: 45px; 
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0 !important;
}

.btn-filter {
    background: #ff8c00;
    color: white;
    flex: 2; /* Tombol Cari lebih lebar */
}

.btn-reset {
    background: #7f8c8d;
    color: white;
    flex: 1;
}

.btn-filter:hover, .btn-reset:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* =========================================
   STYLE TOMBOL AKSI (EDIT & DELETE)
   ========================================= */
.btn-action {
    padding: 6px 12px;
    border-radius: 6px; /* Sudut agak membulat */
    text-decoration: none;
    color: white !important; /* Teks wajib putih */
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-action:hover {
    transform: translateY(-2px); /* Efek naik dikit saat hover */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Warna Tombol Edit (Biru) */
.btn-edit {
    background-color: #3498db; 
    border: 1px solid #2980b9;
}
.btn-edit:hover {
    background-color: #2980b9;
}

/* Warna Tombol Delete (Merah) */
.btn-del {
    background-color: #e74c3c; 
    border: 1px solid #c0392b;
}
.btn-del:hover {
    background-color: #c0392b;
}

/* Warna Tombol View/Lihat (Hijau - Opsional jika ada) */
.btn-view {
    background-color: #27ae60;
    border: 1px solid #219150;
}
.btn-view:hover {
    background-color: #219150;
}

/* =========================================
   STYLE KHUSUS HALAMAN LOGIN
   ========================================= */
.login-body {
    background-color: #fff8e1; /* Background Krem/Beige */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 400px; /* Lebar kartu dibatasi */
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: left;
    border-top: 5px solid #FF8C00; /* Garis Oranye di Atas */
    animation: zoomIn 0.5s ease;
}

.login-card h2 {
    color: #FF8C00;
    text-align: center;
    margin-bottom: 5px;
    font-weight: 700;
}

.login-card p {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #FF8C00, #FFA500);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.5);
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.8rem;
    color: #aaa;
}