:root {
    --primary-blue: #519A66;
    --accent-green: #519A66;
    --accent-red: #cc3030;
    --dark-green: #237227;
}

/* ================= CONTENT LAYOUT ================= */
.content {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    background-color: #f0f2f5;
    padding: 30px;
}

.content-beranda h1 {
    color: #237227;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 2rem;
}

/* ================= TOP ACTION BAR ================= */
.top-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.left-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-custom-tambah,
.btn-custom-export {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    min-width: 120px;
    justify-content: center;
}

.btn-custom-tambah {
    background-color: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 6px rgba(13, 26, 74, 0.2);
}

.btn-custom-tambah:hover {
    background-color: #237227;
    color: white;
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 6px 12px rgba(13, 26, 74, 0.3);
}

.btn-custom-export {
    background-color: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-custom-export:hover {
    background-color: #237227;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-custom-filter {
    background-color: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
    justify-content: center;
}

.btn-custom-filter:hover {
    background-color: #237227;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* ================= SEARCH BAR ================= */
.search-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-radius: 8px;
    overflow: hidden;
    width: 320px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 10px;
    border: 1px solid #ccc;
    outline: none;
}

.search-input {
    width: 100%;
    padding: 10px 45px 10px 45px;
    border-radius: 8px;
    border: 1px solid #ddd;
    outline: none;
    color: var(--primary-blue);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(13, 26, 74, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 16px;
}

.filter-trigger {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-blue);
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.filter-trigger:hover {
    color: #237227;
    transform: translateY(-50%) scale(1.1);
}

/* ================= FILTER SECTION ================= */
#filterSection {
    display: none;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#filterSection h6 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-weight: 600;
}

#filterSection form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.custom-select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 15px;
    color: var(--primary-blue);
    outline: none;
    min-width: 180px;
    flex: 1;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: white;
    cursor: pointer;
}

.custom-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(13, 26, 74, 0.1);
}

/* ================= TABLE ================= */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    overflow-x: auto;
    /* ← Horizontal scroll */
    -webkit-overflow-scrolling: touch;
    /* ← Smooth scroll di mobile */
}

.table {
    margin-bottom: 0;
    width: 100%;
}

.table-custom-header {
    background-color: #237227;
    color: white;
}

.table-custom-header th {
    border: none;
    font-weight: 600;
    padding: 16px;
    vertical-align: middle;
    white-space: nowrap;
    font-size: 14px;
}

.table td {
    vertical-align: middle;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    font-size: 14px;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* ================= BADGE STATUS ================= */
.badge-status {
    padding: 6px 14px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    min-width: 75px;
    text-transform: capitalize;
}

.bg-bagus {
    background-color: var(--accent-green);
}

.bg-rusak {
    background-color: var(--accent-red);
}

.bg-secondary {
    background-color: #6c757d;
}

/* ================= CHECKBOX ================= */
.custom-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

/* ================= FLASH MESSAGE ================= */
.flash {
    margin-bottom: 20px;
}

/* ================= RESPONSIVE DESIGN ================= */

/* Tablet & Small Desktop (≤1200px) */
@media screen and (max-width: 1200px) {
    .content {
        padding: 25px;
    }

    .content-beranda h1 {
        font-size: 1.75rem;
    }

    .btn-custom-tambah,
    .btn-custom-export {
        min-width: 110px;
        padding: 10px 18px;
    }

    .search-container {
        max-width: 280px;
    }
}

/* Tablet (≤992px) - Sidebar jadi slide-in */
@media screen and (max-width: 992px) {
    .content {
        margin-left: 0;
        width: 100%;
        padding: 80px 20px 20px;
        /* Extra padding top untuk hamburger */
    }

    .content-beranda h1 {
        font-size: 1.6rem;
        margin-top: 10px;
    }

    .top-action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .left-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .search-container {
        max-width: 100%;
        width: 100%;
    }

    #filterSection form {
        flex-direction: column;
    }

    .custom-select {
        width: 100%;
        min-width: auto;
    }

    /* Table scroll horizontal */
    .table-container {
        overflow-x: auto;
    }

    .table {
        min-width: 900px;
    }
}

/* Mobile Landscape (≤768px) */
@media screen and (max-width: 768px) {
    .content {
        padding: 70px 15px 15px;
    }

    .content-beranda h1 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    .btn-custom-tambah,
    .btn-custom-export {
        padding: 10px 16px;
        font-size: 13px;
        gap: 6px;
        min-width: 100px;
    }

    .btn-custom-tambah i,
    .btn-custom-export i {
        font-size: 14px;
    }

    #filterSection {
        padding: 15px;
    }

    #filterSection h6 {
        font-size: 14px;
    }

    .custom-select {
        padding: 8px 12px;
        font-size: 13px;
    }

    .table-custom-header th {
        padding: 12px;
        font-size: 13px;
    }

    .table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .badge-status {
        padding: 5px 10px;
        font-size: 11px;
        min-width: 65px;
    }
}

/* Mobile Portrait (≤576px) */
@media screen and (max-width: 576px) {
    .content {
        padding: 65px 12px 12px;
    }

    .content-beranda h1 {
        font-size: 1.25rem;
        margin-bottom: 12px;
    }

    .top-action-bar {
        gap: 10px;
    }

    .left-buttons {
        width: 100%;
        gap: 8px;
    }

    .btn-custom-tambah,
    .btn-custom-export {
        flex: 1;
        min-width: 0;
        padding: 10px 14px;
        font-size: 12px;
    }

    .search-input {
        padding: 10px 40px 10px 40px;
        font-size: 13px;
    }

    .search-icon,
    .filter-trigger {
        font-size: 14px;
    }

    #filterSection {
        padding: 12px;
    }

    #filterSection h6 {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .custom-select {
        padding: 8px 10px;
        font-size: 12px;
    }

    .table {
        min-width: 800px;
    }

    .table-custom-header th {
        padding: 10px 8px;
        font-size: 12px;
    }

    .table td {
        padding: 8px;
        font-size: 12px;
    }

    .badge-status {
        padding: 4px 8px;
        font-size: 10px;
        min-width: 60px;
    }

    .custom-checkbox {
        width: 16px;
        height: 16px;
    }

    /* Icon actions lebih kecil */
    .table td i {
        font-size: 1rem !important;
    }
}

/* Mobile Extra Small (≤375px) */
@media screen and (max-width: 375px) {
    .content {
        padding: 60px 10px 10px;
    }

    .content-beranda h1 {
        font-size: 1.15rem;
    }

    .btn-custom-tambah,
    .btn-custom-export {
        padding: 9px 12px;
        font-size: 11px;
    }

    .search-input {
        padding: 9px 38px 9px 38px;
        font-size: 12px;
    }

    .table-custom-header th {
        padding: 8px 6px;
        font-size: 11px;
    }

    .table td {
        padding: 7px 6px;
        font-size: 11px;
    }
}

/* ================= MODAL RESPONSIVE ================= */
@media screen and (max-width: 992px) {
    .modal-dialog {
        max-width: 95%;
        margin: 1.75rem auto;
    }

    .modal-content {
        width: 100% !important;
    }
}

@media screen and (max-width: 768px) {
    .modal-body.body-barang form>div {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .modal-body.body-barang form>div>div {
        width: 100% !important;
    }

    .modal-body.body-barang input[type="text"],
    .modal-body.body-barang input[type="number"],
    .modal-body.body-barang input[type="date"],
    .modal-body.body-barang select {
        width: 100% !important;
    }
}