* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

.control-panel {
    background: white;
    border-bottom: 1px solid #ddd;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.form-group input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

button,
.file-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-print {
    background: #2563eb;
    color: white;
}

.btn-print:hover {
    background: #1d4ed8;
}

.btn-add {
    background: #16a34a;
    color: white;
}

.btn-add:hover {
    background: #15803d;
}

.file-button {
    background: #9333ea;
    color: white;
    position: relative;
}

.file-button:hover {
    background: #7e22ce;
}

.btn-download {
    background: #f59e0b;
    color: white;
}

.btn-download:hover {
    background: #d97706;
}

.file-button input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.product-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f9fafb;
    position: sticky;
    top: 0;
}

th {
    padding: 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #ddd;
}

td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
}

td input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.btn-delete {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    color: #991b1b;
}

.print-area {
    padding: 30px;
}

.a4-page {
    width: 210mm;
    min-height: 297mm;
    padding: 10mm;
    margin: 0 auto;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.barcode-grid {
    display: grid;
    gap: 4px;
}

.barcode-item {
    border: 1px solid #ccc;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    break-inside: avoid;
    text-align: center;
    min-height: 80px;
    max-width: 100px;
}

.barcode-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2px;
}

.barcode-container svg {
    max-width: 100%;
    height: auto;
    max-height: 40px;
}

.barcode-code {
    font-family: "Courier New", monospace;
    margin-top: 1px;
    text-align: center;
    font-size: 7px;
}

.barcode-name {
    margin-top: 1px;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    padding-top: 2px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.1;
}

.barcode-price {
    margin-top: 1px;
    text-align: center;
    font-size: 8px;
    color: black;
    font-weight: bold;
}

@media print {
    body {
        background: white;
    }

    .control-panel {
        display: none !important;
    }

    .print-area {
        padding: 0;
    }

    .a4-page {
        box-shadow: none;
        margin: 0;
        padding: 10mm;
    }

    @page {
        size: A4;
        margin: 0;
    }
}