/* General body styling */
body {
    font-family: 'Inter', sans-serif; /* Menggunakan font Inter */
    margin: 0;
    padding: 0; /* Mengatur padding body ke 0 agar container bisa mengatur semua */
    background-color: #e0e7ee; /* Warna latar belakang lembut, lebih dingin */
    color: #333;
    line-height: 1.6;
    display: flex; /* Menggunakan flexbox untuk centering vertikal dan horizontal */
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Pastikan body mengambil tinggi viewport penuh */
    box-sizing: border-box; /* Pastikan padding tidak menambah ukuran elemen */
}

/* Modal styles */
.modal {
    display: none; /* KOREKSI: Ini harus 'none' secara default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

.modal-content {
    background-color: #fefefe;
    margin: auto; /* Removed auto margin as flexbox is used */
    padding: 30px;
    border: 1px solid #888;
    width: 80%; /* Lebar responsif */
    max-width: 450px; /* Lebar maksimum */
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    text-align: center; /* Center text within modal content */
}

.modal-content h2 {
    color: #0a4f8f;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.modal-content p {
    margin-bottom: 25px;
    font-size: 1.1em;
    color: #555;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    justify-content: center; /* Center buttons */
    gap: 15px; /* Spacing between buttons */
    margin-top: 20px;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.delete-button-modal,
.cancel-button-modal {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.delete-button-modal {
    background-color: #e74c3c; /* Merah untuk hapus */
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.delete-button-modal:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.cancel-button-modal {
    background-color: #6c757d; /* Abu-abu untuk batal */
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.cancel-button-modal:hover {
    background-color: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* Specific body style for the dashboard page */
body.dashboard-body {
    background-image: url('polban_depan.jpeg'); /* Ganti dengan path gambar latar belakang Anda */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Latar belakang tetap saat digulir */
    display: flex; /* Memastikan konten dashboard terpusat */
    flex-direction: column; /* Mengatur arah flex menjadi kolom */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px; /* Tambahkan padding agar konten tidak terlalu mepet tepi */
    box-sizing: border-box;
}

/* Dark overlay for better text readability on dashboard background */
body.dashboard-body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Overlay gelap transparan */
    z-index: -1; /* Pastikan di belakang konten */
}


/* Dashboard Container */
.dashboard-container {
    background-color: rgba(255, 255, 255, 0.2); /* Latar belakang transparan untuk kesan modern */
    backdrop-filter: blur(10px); /* Efek blur pada latar belakang */
    -webkit-backdrop-filter: blur(10px); /* Dukungan untuk Safari */
    border-radius: 20px; /* Sudut lebih melengkung */
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); /* Shadow yang lebih dalam */
    text-align: center;
    max-width: 1200px; /* Lebar maksimum container */
    width: 100%; /* Lebar responsif */
    box-sizing: border-box;
}

.welcome-message {
    color: #ffffff;
    font-size: 2.8em;
    margin-bottom: 50px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    font-weight: 900;
    letter-spacing: 1.5px;
}

/* Dashboard Grid for cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-content: center;
}

/* Individual Dashboard Card */
.dashboard-card {
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    background-color: rgba(255, 255, 255, 0.25);
}

.dashboard-card h2 {
    color: #ffffff;
    font-size: 1.8em;
    margin-bottom: 15px;
    text-align: left;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.dashboard-card p {
    color: #e0e0e0;
    font-size: 1em;
    margin-bottom: 5px;
    flex-grow: 1;
    text-align: left;
}
/* Gaya khusus untuk paragraf terakhir di dalam kartu, agar ada jarak sebelum tombol */
.dashboard-card p:last-of-type:not(:only-child) {
    margin-bottom: 25px;
}

/* Dashboard Buttons */
.dashboard-button {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
}

/* Button Color Variations (matching image) */
.dashboard-button.primary {
    background-color: #007bff;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}
.dashboard-button.primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.5);
}

.dashboard-button.secondary {
    background-color: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}
.dashboard-button.secondary:hover {
    background-color: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.5);
}

.dashboard-button.tertiary {
    background-color: #20c997;
    color: white;
    box-shadow: 0 4px 15px rgba(32, 201, 151, 0.4);
}
.dashboard-button.tertiary:hover {
    background-color: #17a2b8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(32, 201, 151, 0.5);
}


.dashboard-button.success {
    background-color: #28a745;
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}
.dashboard-button.success:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.dashboard-button.info {
    background-color: #17a2b8;
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.4);
}
.dashboard-button.info:hover {
    background-color: #138496;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.5);
}

.dashboard-button.danger {
    background-color: #dc3545;
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}
.dashboard-button.danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

.dashboard-button.warning {
    background-color: #ffc107;
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}
.dashboard-button.warning:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
}


/* Responsive Adjustments */
@media (max-width: 992px) {
    .welcome-message {
        font-size: 2.2em;
    }
    .dashboard-card {
        padding: 25px;
    }
    .dashboard-card h2 {
        font-size: 1.6em;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 25px;
    }
    .welcome-message {
        font-size: 1.8em;
        margin-bottom: 30px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .dashboard-card {
        padding: 20px;
    }
    .dashboard-card h2 {
        font-size: 1.4em;
    }
    .dashboard-card p {
        font-size: 0.9em;
    }
    .dashboard-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    /* Table responsive adjustments for small screens (applies to ALL tables) */
    table, .responsive-table {
        border: 0;
    }

    table thead, .responsive-table thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    table tr, .responsive-table tr {
        border: 1px solid #ddd;
        display: block;
        margin-bottom: 10px;
        border-radius: 8px;
        overflow: hidden;
    }

    table td, .responsive-table td {
        border-bottom: 1px solid #eee;
        display: block;
        font-size: .9em;
        text-align: left;
        padding-left: 45%;
        position: relative;
    }

    table td::before, .responsive-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: uppercase;
        color: #555;
    }

    table td:last-child, .responsive-table td:last-child {
        border-bottom: 0;
    }
}

/* Container general styles */
.container {
    max-width: 1200px;
    margin: 20px auto;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    width: 95%;
}

h1 {
    color: #0a4f8f;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}
h2 {
    color: #0a4f8f;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}


.menu {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.menu .button {
    display: inline-block;
    padding: 14px 28px;
    background-color: #1a73e8;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 115, 232, 0.3);
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
}

.menu .button:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 115, 232, 0.4);
}

hr {
    border: 0;
    height: 2px;
    background: linear-gradient(to right, rgba(204,204,204,0), #999, rgba(204,204,204,0));
    margin: 50px 0;
}


/* Action button styles within table */
.edit-button, .delete-button, .action-button {
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-size: 0.8em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: inline-block;
    margin: 0 5px;
    border: none;
}

.edit-button {
    background-color: #2ecc71;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.edit-button:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.4);
}

.delete-button {
    background-color: #e74c3c;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.delete-button:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.4);
}

.print-detail-button, .print-label-button {
    background-color: #007bff;
    color: white; /* Pastikan teks putih */
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}
.print-detail-button:hover, .print-label-button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.4);
}


/* Form styling (general) */
form {
    background-color: #fcfdfe;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9f0f7;
}

form label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: #495057;
    font-size: 0.95em;
}

form input[type="text"],
form input[type="number"],
form select,
form input[type="tel"],
form input[type="date"]
{
    width: calc(100% - 28px);
    padding: 14px;
    margin-bottom: 25px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #f8fafc;
}

form input[type="text"]:focus,
form input[type="number"]:focus,
form select:focus,
form input[type="tel"]:focus,
form input[type="date"]:focus
{
    border-color: #66b5ff;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.2);
}

form button[type="submit"] {
    background-color: #1a73e8;
    color: white;
    padding: 16px 30px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: block;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 115, 232, 0.3);
    letter-spacing: 0.5px;
}

form button[type="submit"]:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 115, 232, 0.4);
}


/* Styles for sorting controls (from index.php) */
.sort-controls {
    margin-bottom: 20px;
    display: grid; /* Mengubah dari flex menjadi grid */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Kolom responsif, min 200px */
    gap: 15px; /* Mengurangi jarak antar elemen */
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}
.sort-controls label {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 5px; /* Mengurangi margin bawah label */
}
.sort-controls select,
.sort-controls input[type="text"] { /* Tambahkan input text untuk filter */
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ced4da;
    background-color: #fff;
    font-size: 0.9em;
    cursor: pointer;
    width: 100%; /* Pastikan lebar 100% dalam grid cell */
    box-sizing: border-box; /* Sertakan padding dalam lebar */
}
.sort-controls select:focus,
.sort-controls input[type="text"]:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
.sort-controls button {
    padding: 10px 15px; /* Mengurangi padding tombol */
    border-radius: 5px;
    border: none;
    background-color: #1a73e8;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%; /* Pastikan lebar 100% dalam grid cell */
    box-sizing: border-box;
}
.sort-controls button:hover {
    background-color: #0056b3;
}
/* Untuk memastikan tombol submit filter mengambil lebar penuh di barisnya sendiri */
.filter-sort-controls .form-group:last-child {
    grid-column: 1 / -1; /* Mengambil semua kolom */
    text-align: center; /* Pusatkan tombol */
    margin-top: 10px; /* Sedikit jarak dari elemen di atasnya */
}


/* New styles for Barang Keluar form (kasir-like) */
.item-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #e0e7ee;
    border-radius: 12px;
    background-color: #fbfdff;
    align-items: end;
    box-shadow: inset 0 1px 5px rgba(0,0,0,0.05);
}

.item-row .form-group {
    display: flex;
    flex-direction: column;
}

.item-row .form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #5d7e9d;
    font-size: 0.9em;
}

.item-row .form-group input[type="text"],
.item-row .form-group input[type="number"],
.item-row .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cce0f0;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.95em;
    background-color: #ffffff;
}
.item-row .form-group input[type="text"]:focus,
.item-row .form-group input[type="number"]:focus,
.item-row .form-group select:focus {
    border-color: #8bbfea;
    box-shadow: 0 0 0 3px rgba(139, 191, 234, 0.4);
}


.item-row .form-group button {
    width: 100%;
    padding: 12px;
    margin-top: 25px;
    font-size: 0.9em;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.item-row .form-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}


/* Accordion styles for riwayat_barang_keluar.php */
.accordion-item {
    margin-bottom: 15px;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    }

    .accordion-header {
        background-color: #f2f7fc;
        padding: 18px 25px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 700;
        color: #34495e;
        border-bottom: 1px solid #e0e7ee;
        transition: background-color 0.3s ease, box-shadow 0.3s ease;
        font-size: 1.05em;
    }

    .accordion-header:hover {
        background-color: #e6f3ff;
        box-shadow: inset 0 0 10px rgba(0, 115, 232, 0.1);
    }

    .accordion-header.active {
        background-color: #d1e5fa;
        color: #0a4f8f;
        border-bottom: 1px solid #a3c9e6;
    }

    .arrow {
        font-size: 1.4em;
        transition: transform 0.3s ease;
        color: #5e7e9b;
    }

    .accordion-header.active .arrow {
        transform: rotate(90deg);
    }

    .accordion-content {
        padding: 20px 25px;
        background-color: #ffffff;
        border-top: none;
        display: none;
        font-size: 0.95em;
        color: #555;
    }

    .accordion-content p {
        margin-bottom: 10px;
    }

    .accordion-content h4 {
        margin-top: 20px;
        margin-bottom: 12px;
        color: #0a4f8f;
        font-size: 1.15em;
        border-bottom: 1px solid #e0e7ee;
        padding-bottom: 5px;
    }

    .accordion-content table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 15px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    .accordion-content table th,
    .accordion-content table td {
        border: 1px solid #e9f0f7;
        padding: 12px;
        text-align: left;
        font-size: 0.9em;
    }

    .accordion-content table th {
        background-color: #eef5fb;
        color: #4a6c8e;
        font-weight: 600;
    }

    /* Styles for Pengembalian Barang (barang_kembali.php) */
    #transaction_details {
        border: 1px solid #d9e2ec;
        border-radius: 12px;
        padding: 30px;
        margin-top: 30px;
        background-color: #fcfdfe;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    #transaction_details h4 {
        color: #0a4f8f;
        margin-bottom: 20px;
        font-size: 1.2em;
        border-bottom: 1px solid #e0e7ee;
        padding-bottom: 8px;
    }
    #transaction_details p {
        margin-bottom: 10px;
        font-size: 1em;
        color: #4a6c8e;
    }
    #transaction_details table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
        border-radius: 8px;
        overflow: hidden;
    }
    #transaction_details table th,
    #transaction_details table td {
        border: 1px solid #eef0f7;
        padding: 12px;
        text-align: left;
        font-size: 0.95em;
    }
    #transaction_details table th {
        background-color: #e9f0f7;
        color: #4a6c8e;
    }
    .qty-returned-input {
        width: 90px;
        padding: 8px;
        border: 1px solid #cce0f0;
        border-radius: 6px;
        font-size: 0.95em;
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
    }
    .qty-returned-input:focus {
        border-color: #8bbfea;
        box-shadow: 0 0 0 3px rgba(139, 191, 234, 0.4);
    }
    .info-message {
        background-color: #d4edda;
        color: #155724;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 25px;
        border: 1px solid #c3e6cb;
        font-weight: 600;
        text-align: center;
    }
    .error-message {
        background-color: #f8d7da;
        color: #721c24;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 25px;
        border: 1px solid #f5c6cb;
        font-weight: 600;
        text-align: center;
    }
    /* Status colors for riwayat_barang_keluar */
    .status-dipinjam { color: #e74c3c; font-weight: bold; }
    .status-kembali-sebagian { color: #f39c12; font-weight: bold; }
    .status-sudah-kembali { color: #28a745; font-weight: bold; }
