
.column-toggle {
    display: flex ;
    align-items: center ;
    background: white ;
    padding: 8px 12px ;
    border-radius: 6px ;
    border: 1px solid #e5e7eb ;
    margin-bottom: 8px ;
    transition: all 0.2s ease ;
}

.red {
    background-color: #ef4444 ;
    color: white ;
}

.column-toggle__label {
    font-size: 14px ;
    color: #13294B ;
    cursor: pointer ;
    user-select: none ;
    margin-left: 8px ;
}

/* Table enhancements */
.table-controls {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-controls__section {
    margin-bottom: 16px;
}

.table-controls__section:last-child {
    margin-bottom: 0;
}

.table-controls__title {
    font-size: 14px;
    font-weight: 600;
    color: #13294B;
    margin-bottom: 8px;
}

.table-controls__search {
    width: 100%;
    max-width: 300px;
}

.column-visibility {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.column-toggle {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
    margin: 0;
}

.column-toggle:hover {
    border-color: #13294B;
    background-color: #f8fafc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.column-toggle input[type="checkbox"] {
    position: relative;
    width: 40px;
    height: 22px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    margin: 0;
    margin-right: 12px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.column-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.column-toggle input[type="checkbox"]:checked {
    background: #13294B;
}

.column-toggle input[type="checkbox"]:checked::before {
    left: 20px;
}

.column-toggle label {
    font-size: 14px;
    color: #13294B;
    cursor: pointer;
    user-select: none;
}

.column-toggle__label {
    font-size: 14px;
    color: #13294B;
    cursor: pointer;
    user-select: none;
    margin-left: 8px;
}

/* Table styling */
.table-container {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 24px;
}

.table th {
    background: #13294B;
    color: white;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background-color 0.2s;
}

.table th:hover {
    background: #1e3a5f;
}

.table th.sortable:hover {
    background: #1e3a5f;
}

.table th.sorted-asc::after {
    content: "↑";
    margin-left: 4px;
}

.table th.sorted-desc::after {
    content: "↓";
    margin-left: 4px;
}

.sort-indicator {
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
}

.sorted-asc .sort-indicator::after {
    content: "↑";
    color: white;
}

.sorted-desc .sort-indicator::after {
    content: "↓";
    color: white;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table .btn {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

.table .btn-success {
    background: #10b981;
    color: white;
}

.table .btn-danger {
    background: #ef4444;
    color: white;
}

.table .btn-info {
    background: #3b82f6;
    color: white;
}

.table .btn-warning {
    background: #f59e0b;
    color: white;
}

.hidden-column {
    display: none;
}

/* Responsive table */
@media screen and (max-width: 768px) {
    .table-controls__search {
        max-width: 100%;
    }
    
    .column-visibility {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .table td {
        padding: 8px 12px;
    }
}

/* Container for centering content */
.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Error alert styling */
.alert {
    width: 100%;
    max-width: 800px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0 auto 24px auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
    box-sizing: border-box;
}

.alert strong {
    color: #dc2626;
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.alert .close {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.alert .close:hover {
    background-color: rgba(220, 38, 38, 0.1);
}

/* Page titles - consistent styling */
h2 {
    color: #13294B;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 32px 0;
    text-align: center;
    line-height: 1.2;
}

/* Form section titles - consistent styling */
h4 {
    color: #13294B;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    display: block;
    text-align: left;
}

/* Success/confirmation styling */
.success-content {
    width: 100%;
    max-width: 800px;
    text-align: center;
    padding: 40px 20px;
    margin: 0 auto;
}

.success-content h2 {
    color: #10b981;
    margin-bottom: 16px;
}

.success-content small {
    color: #6b7280;
    font-size: 16px;
    display: block;
    margin-bottom: 20px;
    font-weight: 500;
}

.generated-codes {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    font-family: 'Courier New', Courier, monospace;
    color: #13294B;
    word-wrap: break-word;
    text-align: left;
    white-space: pre-wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Form styling */
form {
    margin: 0 auto;
    width: 100%;
    max-width: 800px;
    padding: 0;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

/* Input styling */
.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 500;
    color: #13294B;
    background: #ffffff;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #13294B;
    box-shadow: 0 0 0 3px rgba(19, 41, 75, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Select dropdown styling */
.form-select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #13294B;
    background: #ffffff;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2313294B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

.form-select:focus {
    border-color: #13294B;
    box-shadow: 0 0 0 3px rgba(19, 41, 75, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.bands-textarea {
    min-height: 100px;
    white-space: pre-wrap;
    font-family: monospace;
}

/* Input validation states */
.form-control:invalid {
    border-color: #ef4444;
}

.form-control:valid {
    border-color: #10b981;
}

.form-select:invalid {
    border-color: #ef4444;
}

.form-select:valid {
    border-color: #10b981;
}

/* Submit button */
.btn-custom {
    background: linear-gradient(135deg, #13294B 0%, #1e3a5f 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 40px auto 0;
    box-shadow: 0 4px 6px -1px rgba(19, 41, 75, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(19, 41, 75, 0.4);
    background: linear-gradient(135deg, #0f1f3d 0%, #13294B 100%);
}

.btn-custom:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px -1px rgba(19, 41, 75, 0.3);
}

.btn-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-custom:hover::before {
    left: 100%;
}

/* Animation for alerts */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button styling for close actions */
#button, .toolbar-btn {
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

#button:hover, .toolbar-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

#button.disabled, .toolbar-btn.disabled {
    opacity: 0.4;
    cursor: pointer;
}

#button.disabled:hover, .toolbar-btn.disabled:hover {
    background-color: transparent;
}

.buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

/* Lucide icons in toolbar: dark on white header (base layout) */
.site-header .toolbar-btn {
    color: #13294B;
}
.site-header .toolbar-btn .icon svg {
    stroke: currentColor;
    fill: none;
    vertical-align: middle;
}
.site-header .toolbar-btn:hover {
    color: #0d1f3c;
}
.site-header .toolbar-btn.disabled {
    color: rgba(19, 41, 75, 0.5);
}

/* Content wrapper for proper centering */
.content-wrapper {
    width: 100%;
    max-width: 1200px;
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .content-wrapper {
        padding: 20px 10px;
    }
    
    .alert {
        margin: 0 10px 20px 10px;
        max-width: calc(100% - 20px);
    }
    
    form {
        padding: 0 10px;
        max-width: calc(100% - 20px);
    }
    
    .success-content {
        padding: 20px 10px;
        max-width: calc(100% - 20px);
    }
    
    h2 {
        font-size: 28px;
        margin-bottom: 24px;
    }
    
    h4 {
        font-size: 16px;
    }
    
    .form-control, .form-select {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .form-select {
        padding-right: 40px;
        background-size: 14px;
        background-position: right 12px center;
    }
    
    .btn-custom {
        padding: 14px 28px;
        font-size: 16px;
        margin-top: 32px;
        min-width: unset;
    }
    
    .generated-codes {
        padding: 16px;
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: 24px;
    }
    
    /* Mobile modal fixes */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 5vh auto !important;
        max-height: 85vh !important;
        padding: 15px !important;
    }
    
    /* Hide button text on mobile for prev/next group buttons */
    #prevGroupBtn::before {
        content: '←';
    }
    
    #nextGroupBtn::before {
        content: '→';
    }
    
    #prevGroupBtn,
    #nextGroupBtn {
        font-size: 0;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    #prevGroupBtn::before,
    #nextGroupBtn::before {
        font-size: 20px;
    }
    
    /* Hide button text for prev/next sample buttons */
    #prevSampleBtn::before {
        content: '←';
    }
    
    #nextSampleBtn::before {
        content: '→';
    }
    
    #prevSampleBtn,
    #nextSampleBtn {
        font-size: 0;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    #prevSampleBtn::before,
    #nextSampleBtn::before {
        font-size: 20px;
    }
    
    /* Keep side-by-side layout on mobile with reduced sizes */
    #samplesModal .modal-content > div:nth-child(3) {
        gap: 10px !important;
    }
    
    /* Thumbnail section - reduced width for mobile */
    #samplesModal .modal-content > div:nth-child(3) > div:first-child {
        width: 150px !important;
    }
    
    /* Inner padding wrapper on mobile */
    #samplesModal .modal-content > div:nth-child(3) > div:first-child > div {
        padding: 5px !important;
    }
    
    /* Reduce thumbnail size on mobile */
    #samplesModalThumbnailIR,
    #samplesModalThumbnailIRVIS {
        max-height: 80px !important;
    }
    
    /* Reduce min-height containers on mobile */
    #samplesModal .modal-content > div:nth-child(3) > div:first-child > div > div[style*="min-height: 150px"] {
        min-height: 80px !important;
    }
    
    /* Reduce scroll space on mobile */
    #samplesModal .modal-content > div:nth-child(3) > div:first-child > div > div[style*="height: 120px"] {
        height: 80px !important;
    }
    
    /* Ensure table is scrollable */
    .table-data {
        font-size: 14px;
    }
    
    .table-data th,
    .table-data td {
        padding: 8px 4px;
    }
}

.sample-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sample-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.special-toggle {
    background: #f0f7ff ;
    border-color: #13294B ;
    margin-bottom: 16px ;
    width: 100% ;
    grid-column: 1 / -1 ;
    cursor: pointer ;
}

.special-toggle input[type="checkbox"] {
    pointer-events: none ;
}

.special-toggle .column-toggle__label {
    font-weight: 600 ;
    pointer-events: none ;
}

.qr-success-page {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(19,41,75,0.07);
    border: 1px solid #e2e8f0;
}

.success-content {
    text-align: center;
    padding: 0;
    margin: 0;
    background: none;
    box-shadow: none;
    border: none;
}

.success-content h2 {
    color: #10b981;
    margin-bottom: 12px;
    font-size: 2rem;
}

.success-content small {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 12px;
    display: block;
}

#barcode-list {
    list-style: decimal inside;
    margin: 0 0 20px 0;
    padding: 0;
    color: #13294B;
    font-family: 'Courier New', Courier, monospace;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    max-height: 200px;
    overflow-y: auto;
}

.print-steps {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 20px;
    margin: 0;
    box-shadow: 0 1px 3px rgba(19,41,75,0.05);
}

.print-steps h3 {
    color: #13294B;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: left;
}

.print-steps ol {
    margin: 0;
    padding-left: 20px;
    color: #13294B;
    font-size: 1rem;
}

.print-steps li {
    margin-bottom: 14px;
    line-height: 1.6;
}

.print-steps a {
    color: #3b82f6;
    text-decoration: underline;
    font-weight: 500;
}

.print-steps a:hover {
    color: #1d4ed8;
}

.site-host {
    background: #fff7ed;
    color: #FF5F05;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95em;
    border: 1px solid #ffe5b4;
}

.undo-btn {
    padding: 2px 8px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.undo-btn:enabled {
    background-color: #dc3545;
    color: white;
}

.undo-btn:enabled:hover {
    background-color: #c82333;
    transform: scale(1.05);
}

.undo-btn:disabled {
    background-color: #6c757d;
    color: #adb5bd;
    cursor: not-allowed;
}

.undone-row {
    background-color: #f8f9fa;
    opacity: 0.7;
}

.details-btn {
    padding: 2px 8px;
    font-size: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    margin-left: 5px;
}

.details-btn:hover {
    background-color: #0056b3;
}

.details-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
    max-height: 70vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.json-display {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    white-space: pre-wrap;
    margin: 10px 0;
}

.alert {
    padding: 15px;
    margin: 10px 0;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.processing-summary {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}
.error-details {
    margin: 20px 0;
}
.error-list {
    max-height: 400px;
    overflow-y: auto;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 10px;
}
.error-item {
    padding: 5px 0;
    border-bottom: 1px solid #ffeaa7;
}
.error-item:last-child {
    border-bottom: none;
}
.actions {
    margin: 30px 0;
}
.actions .btn-custom {
    margin-right: 10px;
}
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 5px;
    margin: 20px 0;
}
.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 5px;
    margin: 20px 0;
}