/* =========================================
   FILE: assets/css/styles.css
   VERSI: FINAL (Tema Elfath + Mobile 2 Kolom + Fix Input)
   ========================================= */

/* 1. VARIABEL TEMA */
:root {
    /* Warna Utama */
    --primary-color: #2c3e50;      /* Biru Navy (Header) */
    --accent-blue: #3498db;        /* Biru Terang (Tombol/Link) */
    --accent-pink: #e84393;        /* Pink (Aksen Cantik) */
    
    /* Background & Teks */
    --bg-color: #f0f2f5;           /* Abu-abu Soft (Background Body) */
    --card-bg: #ffffff;            /* Putih Bersih (Card/Container) */
    --text-dark: #2d3436;          /* Hitam Abu (Teks Utama - JELAS) */
    --text-muted: #636e72;         /* Abu-abu (Teks Sekunder) */
    
    /* Status Colors */
    --success: #00b894;            /* Hijau */
    --danger: #d63031;             /* Merah */
    --warning: #fdcb6e;            /* Kuning/Oranye */
    
    /* Dekorasi */
    --border-radius: 10px;
    --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 2. RESET & GLOBAL STYLES */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* 3. HEADER & NAVIGASI (DESKTOP) */
header {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.container-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent-pink);
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 5px;
}

/* Menu Desktop */
nav ul {
    display: flex;
    gap: 15px;
}

nav ul li a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-size: 14px;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-2px);
}

/* Tombol Logout Spesial */
.logout-btn a {
    background-color: var(--accent-pink);
    color: white !important;
    box-shadow: 0 4px 10px rgba(232, 67, 147, 0.3);
}

.logout-btn a:hover {
    background-color: #c42673;
}

/* 4. LAYOUT UTAMA & TYPOGRAPHY */
main.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: 85vh;
}

h1 {
    font-size: 28px;
    color: var(--primary-color);
    border-left: 5px solid var(--accent-pink);
    padding-left: 15px;
    margin-bottom: 25px;
}

h2 { font-size: 22px; color: var(--text-dark); margin-bottom: 15px; }

/* 5. KOMPONEN CARD & FORM */
form, .table-container, .card-box {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.02);
}

/* Label & Input Styles */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

input[type="text"],
input[type="number"], /* Style umum untuk input number */
input[type="date"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-dark);
    background-color: #fcfcfc;
    transition: all 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

/* 6. TOMBOL (BUTTONS) */
button, .btn {
    display: inline-block;
    padding: 12px 25px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

button:hover, .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0,0,0,0.15);
}

button[type="submit"] { background: linear-gradient(135deg, var(--accent-blue), #2980b9); color: white; }
.btn-secondary { background: #95a5a6; color: white; }
.btn-delete { background: linear-gradient(135deg, var(--danger), #c0392b); color: white; padding: 8px 16px; font-size: 12px;}
.btn-edit { background: linear-gradient(135deg, var(--warning), #f39c12); color: white; padding: 8px 16px; font-size: 12px;}

/* =========================================
   7. TABEL (UPDATED: High Contrast Fix)
   ========================================= */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: separate; /* Agar border-radius bekerja */
    border-spacing: 0;
    background-color: var(--card-bg);
    overflow: hidden; /* Mencegah sudut tajam */
    border: 1px solid #eee;
}

/* =========================================
   PERBAIKAN TOMBOL AKSI (EDIT & HAPUS)
   ========================================= */

/* Pastikan tombol Edit dan Hapus tampil berdampingan dengan rapi */
table td form,
table td a {
    display: inline-block;
    vertical-align: middle;
}

/* Style Khusus Tombol EDIT (Warna Biru/Kuning agar kontras dengan Merah) */
.btn-edit, 
a.btn-edit {
    display: inline-block;
    background-color: var(--accent-blue) !important; /* Biru Terang */
    color: #ffffff !important; /* Teks Putih Pasti Terlihat */
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    margin-right: 8px; /* Memberi jarak dengan tombol Hapus */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

/* Efek saat tombol Edit disorot */
.btn-edit:hover, 
a.btn-edit:hover {
    background-color: #2980b9 !important; /* Biru lebih gelap */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Memperbaiki tombol Hapus (Delete) agar sejajar */
.btn-delete {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    /* Margin kiri dihapus karena margin sudah ada di btn-edit */
}

/* HEADER TABEL (Bagian yang bermasalah sebelumnya) */
/* Kita paksa background menjadi BIRU NAVY agar teks putih terlihat */
thead tr th, 
table tr th {
    background-color: var(--primary-color) !important; 
    color: #ffffff !important; /* Teks Putih Pasti Terlihat di Background Navy */
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--accent-pink); /* Sedikit aksen pink di bawah header */
}

/* ISI TABEL (BODY) */
tbody tr td, 
table tr td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #f1f1f1;
    color: var(--text-dark) !important; /* Paksa Teks Hitam/Gelap */
    background-color: #ffffff; /* Background Putih */
    vertical-align: middle;
}

/* Efek Hover Baris */
tbody tr:hover { 
    background-color: #f8fdfb; 
}

/* KHUSUS INPUT DI DALAM TABEL (Seperti di Penerimaan Produk) */
/* Pastikan teks input di dalam tabel berwarna gelap */
table input[type="text"],
table input[type="number"],
table select {
    color: var(--text-dark) !important;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
}

/* Label di dalam tabel (jika ada) */
table label {
    color: var(--text-dark) !important;
    margin-bottom: 0;
}

/* 8. GRID PRODUK (DESKTOP) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.product-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: all 0.3s;
    border: 1px solid transparent;
    
    /* Scroll margin agar produk tidak tertutup header saat redirect */
    scroll-margin-top: 100px; 
}

.product-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-blue);
}

.product-item img {
    border-radius: 8px;
    margin-bottom: 15px;
    max-height: 120px;
    object-fit: cover;
}

.product-item h3 {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 600;
}

.product-item p {
    color: var(--accent-pink);
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 10px;
}

/* --- PERBAIKAN: STYLE INPUT JUMLAH PRODUK --- */
.product-item input[type="number"] {
    width: 80px;            /* Lebar default desktop */
    height: 40px;           /* Tinggi fix agar kotak terlihat jelas */
    padding: 5px;
    font-size: 16px;        /* Font besar */
    text-align: center;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 5px;
    margin-bottom: 10px;
    display: inline-block;  /* Pastikan muncul */
}

/* 9. TOMBOL FLOATING (HITUNG) */
#btnHitung {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--success), #00b894);
    color: white;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: bounceIn 1s;
}

@keyframes bounceIn {
    0% { transform: scale(0.1); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

/* =========================================
   10. MOBILE RESPONSIVE (HP)
   ========================================= */
.hamburger {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
}

@media (max-width: 768px) {
    /* -- Header & Menu -- */
    .hamburger { display: block; }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #ffffff; /* Background Putih */
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        border-top: 4px solid var(--accent-pink);
        padding: 10px 0;
        border-radius: 0 0 15px 15px;
        z-index: 999;
    }

    .nav-menu.show {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }

    .nav-menu li a {
        display: block;
        padding: 15px 25px;
        color: var(--text-dark); /* Teks Gelap Jelas */
        border-bottom: 1px solid #f0f0f0;
        border-radius: 0;
    }

    .nav-menu li a:hover {
        background-color: #fff0f6;
        color: var(--accent-pink);
        transform: none;
        padding-left: 35px;
    }

    /* -- Layout Umum Mobile -- */
    main.container { padding: 0 15px; margin-top: 20px; }
    h1 { font-size: 24px; }
    
    /* -- GRID PRODUK 2 KOLOM (Agar Tampilan Jelas) -- */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* Paksa 2 kolom */
        gap: 15px; /* Jarak antar kartu */
    }

    .product-item {
        padding: 15px;
        border-radius: 10px;
    }

    .product-item img {
        height: 100px; /* Gambar lebih besar */
        width: 100%;
        object-fit: contain;
        margin-bottom: 10px;
    }

    .product-item h3 {
        font-size: 14px; /* Font nama produk */
        margin-bottom: 5px;
        height: auto;
        max-height: 42px;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.4;
    }

    .product-item p {
        font-size: 14px; /* Font harga */
        margin-bottom: 8px;
    }

    /* Input Quantity Mobile (Full Width agar mudah diklik) */
    .product-item input[type="number"] {
        width: 100%;    /* Lebar penuh */
        height: 45px;   /* Tinggi nyaman untuk jempol */
        font-size: 16px;
        margin-bottom: 10px;
    }

    /* Tombol Tambah Mobile */
    .product-item button {
        padding: 10px 0;
        font-size: 14px;
        width: 100%;
        border-radius: 6px;
    }
    
    /* Tombol Floating Mobile */
    #btnHitung {
        padding: 12px 25px;
        font-size: 14px;
        bottom: 20px;
        right: 20px;
    }
}

/* Animasi Dropdown */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* =========================================
   FIX: RESET TAMPILAN TOMBOL DI TABEL
   ========================================= */

/* 1. Reset Form di dalam Tabel */
/* Agar form tombol hapus tidak menjadi kotak putih besar */
table td form {
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    display: inline-block !important; /* Agar sejajar dengan tombol edit */
    width: auto !important;
}

/* 2. Style Tombol Aksi (Edit & Hapus) agar Rapi */
table td .btn-edit, 
table td .btn-delete {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;  /* Lebar kotak fix */
    height: 32px !important; /* Tinggi kotak fix */
    padding: 0 !important;
    border-radius: 4px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    margin: 0 2px; /* Jarak antar tombol */
    vertical-align: middle;
}

/* Warna Tombol */
table td .btn-edit {
    background-color: var(--accent-blue) !important; 
    color: white !important;
}

table td .btn-delete {
    background-color: var(--danger) !important;
    color: white !important;
}

/* Efek Hover */
table td .btn-edit:hover,
table td .btn-delete:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}
/* =========================================
   STYLE REVISI: JAM DI BAWAH LOGO (HEMAT TEMPAT)
   ========================================= */

/* Wadah Logo & Jam */
.header-branding {
    display: flex;
    flex-direction: column; /* Menyusun ke bawah (Stack) */
    align-items: flex-start; /* Rata kiri */
    justify-content: center;
}

/* Penyesuaian Logo agar pas dengan jam di bawahnya */
.logo {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2; /* Jarak antar baris dirapatkan */
    margin-bottom: 0;
}

/* Tampilan Jam Digital (Versi Kecil di Bawah Logo) */
.live-clock {
    color: rgba(255, 255, 255, 0.7); /* Warna agak redup agar tidak saingan dengan logo */
    font-size: 11px; /* Ukuran kecil tapi terbaca */
    font-weight: 400;
    margin-top: -2px; /* Geser naik sedikit mendekati logo */
    letter-spacing: 0.5px;
    
    /* Hapus border/padding lama jika ada */
    border-left: none !important;
    padding-left: 0 !important;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    /* Di HP, kita kecilkan sedikit lagi */
    .logo { font-size: 20px; }
    .live-clock { font-size: 10px; }
}