@import url('https://fonts.googleapis.com/css2?family=Arial:wght@400;700;900&display=swap');

*{
    font-size: 12px;
}
body {
    font-family: Arial, sans-serif;
    background-color: #d1d1d1;
}

.controls {
    background: #ffffff;
    border-right: 1px solid #eaeaea;
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 1000;
    overflow-y: auto;
}

.controls-container {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 30px;
    height: 100%;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    margin: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-multiselect {
    position: relative;
    width: 100%;
}

.multiselect-box {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    color: #374151;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 42px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
}
.multiselect-box:hover {
    border-color: #9ca3af;
}
.multiselect-box::after {
    content: '▼';
    font-size: 10px;
    color: #6b7280;
}

.multiselect-options {
    display: none;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-top: 6px;
    max-height: calc(100vh - 280px); /* Memanfaatkan sisa tinggi layar */
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.multiselect-options.show {
    display: block;
}

.dropdown-search {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    border-radius: 8px 8px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.dropdown-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.dropdown-search input:focus {
    border-color: #3b82f6;
}

.multiselect-options label {
    display: flex;
    padding: 10px 14px;
    cursor: pointer;
    align-items: center;
    gap: 10px;
    text-transform: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #f3f4f6;
    margin: 0;
}
.multiselect-options label:last-child {
    border-bottom: none;
}
.multiselect-options label:hover {
    background-color: #f3f4f6;
}
.multiselect-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(37,99,235,0.2);
    align-self: stretch;
    height: 42px;
}
.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37,99,235,0.3);
}

.btn-reset {
    background-color: #f3f4f6;
    color: #4b5563;
    padding: 0 15px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
    height: 42px;
}
.btn-reset:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

.btn-secondary {
    background-color: #111827;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    height: 44px;
}
.btn-secondary:hover {
    background-color: #374151;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.f4-page {
    width: 215mm;
    min-height: 330mm;
    background-color: white;
    margin: 40px auto 20px 320px; /* Geser ke kanan (320px) agar tidak tertutup sidebar */
    padding: 10mm;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
}


.label-card {
    max-width: 11cm;
    max-height: 8cm;
    background: #fdfdfd;
    border: 3px solid #ff0000;
    box-sizing: border-box;
    display: flex;
    margin: 0px 0px 0px 0px;
    padding: 0px;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: relative;
}

/* print style */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    @page {
        size: 215mm 330mm; /* Ukuran kertas F4 */
        margin: 10mm;
    }

    body, html {
        background-color: transparent;
        padding: 0;
        margin: 0;
        display: block;
    }
    
    .f4-page {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: auto !important;
        box-shadow: none !important;
        background-color: transparent !important;
        gap: 5mm; /* Jarak antar kartu */
    }
    
    .no-print {
        display: none !important;
    }
    
    .label-card {
        box-shadow: none !important;
        margin-left: 25px !important;
        margin-bottom: 10mm !important; /* Jarak 10mm dari atas, 0mm bawah (total 10mm antar kartu) */
        page-break-inside: avoid;
        break-inside: avoid;
        width: 11cm !important;
        height: 8cm !important;
        border: 3px solid #ff0000 !important;
    }

    .label-card::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        /* Lebarkan border ke luar untuk jadi panduan potong */
        right: -13mm; /* Jarak 13mm dari kanan kartu */
        bottom: -10mm; /* Jarak 10mm dari bawah kartu */
        border-right: 1px dashed #777;
        border-bottom: 1px dashed #777;
        pointer-events: none;
    }
    
}

/* 
 * Mengembalikan styling elemen di dalam card yang terhapus 
 * agar tampilannya tetap rapi dan sesuai referensi
 */
.header {
    display: flex;
    align-items: center;
    padding: 3px 8px;
    border-bottom: 2px solid #790400;
    background: #ff0202;
    height: 50px;
}

.logo-container {
    width: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 8px;
}

.logo {
    width: 40px;
    height: 40px;
    border: 2px solid #d32f2f;
    position: relative;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-u {
    width: 20px;
    height: 25px;
    border: 5px solid #d32f2f;
    border-top: none;
    border-radius: 0 0 12px 12px;
    position: relative;
    margin-top: -5px;
}

.logo-dot1, .logo-dot2 {
    width: 8px;
    height: 8px;
    background-color: #d32f2f;
    border-radius: 50%;
    position: absolute;
}
.logo-dot1 { top: 8px; left: 8px; }
.logo-dot2 { top: 8px; right: 8px; }

.header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.title-container {
    border-bottom: 2px solid #ffffff;
    padding-bottom: 1px;
    margin-bottom: 2px;
    display: inline-block;
    align-self: center;
}

.title-container h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 600;
    color: #ffffff;
}

.header-text p {
    margin: 0;
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;

}

.content {
    display: flex;
    flex: 1;
    height: calc(100% - 50px);
}

.location-block { 
    width: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
    border-right: 2px solid #ff0000;
    background-color: #f4f4f4;
}

.location-block h2 {
    font-size: 65px;
    font-weight: 900;
    color: #000000;
    margin: 0;
    text-align: center;
    line-height: 1;
    display: inline-block;
}
.gudang-separator {
    width: 100%;
    border: 0;
    border-top: 4px solid #fd0101;
    margin: 8px auto;
}

.table-block {
    width: 60%;
    background-color: #f4f4f4;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th, td {
    border-bottom: 1px solid #aaa;
    border-right: 1px solid #aaa;
    padding: 2px 4px;
    font-size: 10px;
    color: #000000;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

td {
    height: 12px;
}

th:last-child, td:last-child {
    border-right: none;
}

th {
    background-color: #ffffff;
    color: #490000;
    text-align: center;
    font-weight: bold;
    padding: 4px;
    border-bottom: 2px solid #333;
}

.kode-col { width: 35%; text-align: left; }
.nama-col { width: 50%; text-align: left; }
.sat-col { width: 15%; text-align: center; }

td.sat-col {
    text-align: center;
}