/* Labeler-specific gold theme overrides */
body.theme-gold .config-section {
    background: rgba(206, 186, 76, 0.12);
    border-color: rgba(206, 186, 76, 0.35);
}
body.theme-gold .config-section h3 {
    color: rgb(206, 186, 76);
}
body.theme-gold .config-group label {
    color: rgb(206, 186, 76);
}
body.theme-gold .config-group select,
body.theme-gold .config-group input[type="text"],
body.theme-gold .config-group input[type="number"],
body.theme-gold .config-group textarea {
    background: rgba(206, 186, 76, 0.15);
    border-color: rgba(206, 186, 76, 0.4);
    color: #e8e8e8;
}
/* When locked on gold theme, switch to gold/yellow text for visibility */
body.theme-gold .payment-locked .config-section h3 {
    color: rgb(206, 186, 76);
}
body.theme-gold .payment-locked .config-group label {
    color: rgb(206, 186, 76);
}
body.theme-gold .payment-locked .config-group select,
body.theme-gold .payment-locked .config-group input[type="text"],
body.theme-gold .payment-locked .config-group input[type="number"],
body.theme-gold .payment-locked .config-group textarea {
    color: rgb(206, 186, 76);
    border-color: rgba(206, 186, 76, 0.4);
}
body.theme-gold .payment-locked .vendor-rules-header label {
    color: rgb(206, 186, 76);
}
body.theme-gold .payment-locked .vendor-rule-add-btn {
    color: rgb(206, 186, 76);
    border-color: rgba(206, 186, 76, 0.4);
}
body.theme-gold .vendor-rules-header label {
    color: rgb(206, 186, 76);
}
body.theme-gold .vendor-rule-row,
body.theme-gold .post-label-rule-row {
    background: rgba(206, 186, 76, 0.08);
    border-color: rgba(206, 186, 76, 0.25);
}
body.theme-gold .vendor-rule-add-btn {
    background: rgba(206, 186, 76, 0.1);
    border-color: rgba(206, 186, 76, 0.4);
    color: rgb(206, 186, 76);
}
body.theme-gold .vendor-rule-add-btn:hover {
    background: rgba(206, 186, 76, 0.2);
    border-color: rgb(206, 186, 76);
}
body.theme-gold .vendor-hint {
    color: rgba(206, 186, 76, 0.7);
}
/* Gold theme: placeholder text white, vendor/post-label rule fields golden bg */
body.theme-gold .config-group select option,
body.theme-gold .config-group input::placeholder {
    color: #ffffff;
}
body.theme-gold .vendor-rule-field input,
body.theme-gold .vendor-rule-field select {
    background-color: rgba(206, 186, 76, 0.15);
    border-color: rgba(206, 186, 76, 0.4);
    color: #e8e8e8;
}
body.theme-gold .vendor-rule-field select option {
    background-color: rgb(180, 155, 40);
    color: #e8e8e8;
}
body.theme-gold .vendor-rule-field input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}
body.theme-gold .vendor-rule-split-config input,
body.theme-gold .vendor-rule-split-config select,
body.theme-gold .vendor-rule-threshold-config input,
body.theme-gold .vendor-rule-threshold-config select {
    background-color: rgba(206, 186, 76, 0.15);
    border-color: rgba(206, 186, 76, 0.4);
    color: #e8e8e8;
}
body.theme-gold .vendor-rule-remove-btn {
    color: #e8e8e8;
}
body.theme-gold .vendor-rule-template-select {
    background-color: rgba(206, 186, 76, 0.15);
    border-color: rgba(206, 186, 76, 0.4);
    color: #e8e8e8;
}
/* Gold theme: upload boxes */
body.theme-gold .upload-box {
    background: rgba(206, 186, 76, 0.08);
    border-color: rgba(206, 186, 76, 0.5);
}
body.theme-gold .upload-box:hover {
    background: rgba(206, 186, 76, 0.15);
    border-color: rgb(206, 186, 76);
}
body.theme-gold .upload-box h4 {
    color: rgb(206, 186, 76);
}
body.theme-gold .upload-box p {
    color: #e8e8e8;
}
body.theme-gold .upload-icon {
    color: rgb(206, 186, 76);
}
body.theme-gold .plr-summary {
    color: rgba(13, 40, 73, 0.6);
}
body.theme-gold .info-accordion summary {
    color: rgb(206, 186, 76);
}
body.theme-gold .info-accordion-body {
    color: #f2f2f2;
}
body.theme-gold .info-accordion-body em {
    color: rgb(206, 186, 76);
}
body.theme-gold .info-accordion-body li strong {
    color: #ffffff;
}
body.theme-gold .info-accordion {
    background: rgba(13, 40, 73, 0.35);
    border-color: rgba(13, 40, 73, 0.4);
}
body.theme-gold .info-accordion summary::after {
    color: #0D2849;
}

/* Smart Labeler-specific styles */
.nav-link {
    color: rgb(206, 186, 76);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(206, 186, 76, 0.5);
    border-radius: 4px;
    transition: all 0.2s;
}
.nav-link:hover {
    background-color: rgba(206, 186, 76, 0.1);
    border-color: rgb(206, 186, 76);
}
.nav-link.active {
    background-color: rgba(206, 186, 76, 0.2);
}

/* Configuration Section */
.config-section {
    background-color: rgba(13, 40, 73, 0.6);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.config-section h3 {
    color: rgb(206, 186, 76);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.config-section h3 svg {
    width: 18px;
    height: 18px;
}
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.config-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.config-group label {
    color: #f2f2f2;
    font-size: 0.85rem;
    font-weight: 500;
}
.config-group select,
.config-group input[type="number"],
.config-group input[type="text"],
.config-group input[type="date"] {
    padding: 0.625rem 0.875rem;
    border: 1px solid rgba(206, 186, 76, 0.4);
    border-radius: 6px;
    background-color: rgba(13, 40, 73, 0.9);
    color: #f2f2f2;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}
.config-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23CEBA4C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}
.config-group select:hover,
.config-group input[type="number"]:hover,
.config-group input[type="text"]:hover,
.config-group input[type="date"]:hover {
    border-color: rgba(206, 186, 76, 0.6);
    background-color: rgba(13, 40, 73, 1);
}
.config-group select:focus,
.config-group input:focus {
    outline: none;
    border-color: rgb(206, 186, 76);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(206, 186, 76, 0.15);
}
.config-group input[type="number"] {
    -moz-appearance: textfield;
}
.config-group input[type="number"]::-webkit-outer-spin-button,
.config-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.config-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
}
.config-group select option {
    background-color: rgb(13, 40, 73);
    color: #f2f2f2;
    padding: 0.5rem;
}
.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}
.rule-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    border: 1px solid rgba(206, 186, 76, 0.15);
    transition: all 0.2s ease;
}
.rule-group:hover {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(206, 186, 76, 0.25);
}
.rule-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: rgb(206, 186, 76);
    cursor: pointer;
}
.rule-group label {
    color: #ccc;
    font-size: 0.85rem;
    flex: 1;
    cursor: pointer;
    user-select: none;
}
.rule-group input[type="number"] {
    width: 80px;
    padding: 0.5rem 0.625rem;
    border: 1px solid rgba(206, 186, 76, 0.4);
    border-radius: 6px;
    background-color: rgba(13, 40, 73, 0.9);
    color: rgb(206, 186, 76);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    -moz-appearance: textfield;
}
.rule-group input[type="number"]::-webkit-outer-spin-button,
.rule-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.rule-group input[type="number"]:hover {
    border-color: rgba(206, 186, 76, 0.6);
}
.rule-group input[type="number"]:focus {
    outline: none;
    border-color: rgb(206, 186, 76);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(206, 186, 76, 0.15);
}
/* Vendor Rules Builder */
.vendor-rules-section {
    margin-top: 1rem;
}
.vendor-rules-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}
.vendor-rules-header label {
    color: #f2f2f2;
    font-size: 0.85rem;
    font-weight: 500;
}
.vendor-rule-add-btn {
    background: rgba(206, 186, 76, 0.15);
    border: 1px solid rgba(206, 186, 76, 0.5);
    color: rgb(206, 186, 76);
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.vendor-rule-add-btn:hover {
    background: rgba(206, 186, 76, 0.25);
    border-color: rgb(206, 186, 76);
}
.vendor-rule-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.vendor-rule-template-select {
    background: rgba(13, 40, 73, 0.8);
    border: 1px solid rgba(206, 186, 76, 0.4);
    color: #aaa;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}
.vendor-rule-template-select:focus {
    outline: none;
    border-color: rgb(206, 186, 76);
    color: #f2f2f2;
}
.vendor-rule-row {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    margin-top: 0.5rem;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vendor-rule-main {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.vendor-rule-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 120px;
}
.vendor-rule-field label {
    color: #aaa;
    font-size: 0.75rem;
}
.vendor-rule-field input,
.vendor-rule-field select {
    padding: 0.5rem 0.625rem;
    border: 1px solid rgba(206, 186, 76, 0.4);
    border-radius: 6px;
    background-color: rgba(13, 40, 73, 0.9);
    color: #f2f2f2;
    font-family: inherit;
    font-size: 0.85rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}
.vendor-rule-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23CEBA4C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.75rem;
    cursor: pointer;
}
.vendor-rule-field select option {
    background-color: rgb(13, 40, 73);
    color: #f2f2f2;
}
.vendor-rule-field input:focus,
.vendor-rule-field select:focus {
    outline: none;
    border-color: rgb(206, 186, 76);
}
.vendor-rule-field input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.vendor-rule-toggles {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding-bottom: 0.35rem;
}
.vendor-rule-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #ccc;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}
.vendor-rule-toggle input {
    accent-color: rgb(206, 186, 76);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.vendor-rule-remove-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 0.25rem 0.25rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.vendor-rule-remove-btn:hover {
    opacity: 1;
}
.vendor-rule-split-config {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(206, 186, 76, 0.1);
    flex-wrap: wrap;
}
.vendor-rule-split-config input[type="number"] {
    width: 55px;
    padding: 0.35rem 0.4rem;
    border: 1px solid rgba(206, 186, 76, 0.4);
    border-radius: 4px;
    background-color: rgba(13, 40, 73, 0.9);
    color: rgb(206, 186, 76);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
}
.vendor-rule-split-config input[type="number"]::-webkit-outer-spin-button,
.vendor-rule-split-config input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.vendor-rule-split-config input[type="number"]:focus {
    outline: none;
    border-color: rgb(206, 186, 76);
}
.vr-split-label {
    color: #ccc;
    font-size: 0.8rem;
}
.vr-split-slash {
    color: #666;
    font-size: 0.85rem;
    margin: 0 0.15rem;
}
.vr-split-pct2 {
    color: rgb(206, 186, 76);
    font-weight: 600;
    font-size: 0.85rem;
}
.vendor-rule-split-config select {
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(206, 186, 76, 0.4);
    border-radius: 4px;
    background-color: rgba(13, 40, 73, 0.9);
    color: #f2f2f2;
    font-size: 0.8rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23CEBA4C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    padding-right: 1.5rem;
    cursor: pointer;
}
.vendor-rule-split-config select option {
    background-color: rgb(13, 40, 73);
    color: #f2f2f2;
}
.vendor-rule-threshold-config {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(206, 186, 76, 0.1);
    flex-wrap: wrap;
    color: #ccc;
    font-size: 0.8rem;
}
.vendor-rule-threshold-config input[type="number"] {
    width: 65px;
    padding: 0.35rem 0.4rem;
    border: 1px solid rgba(206, 186, 76, 0.4);
    border-radius: 4px;
    background-color: rgba(13, 40, 73, 0.9);
    color: rgb(206, 186, 76);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
}
.vendor-rule-threshold-config input[type="number"]::-webkit-outer-spin-button,
.vendor-rule-threshold-config input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.vendor-rule-threshold-config input[type="number"]:focus {
    outline: none;
    border-color: rgb(206, 186, 76);
}
.vendor-rule-threshold-config select {
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(206, 186, 76, 0.4);
    border-radius: 4px;
    background-color: rgba(13, 40, 73, 0.9);
    color: #f2f2f2;
    font-size: 0.8rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23CEBA4C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    padding-right: 1.5rem;
    cursor: pointer;
}
.vendor-rule-threshold-config select option {
    background-color: rgb(13, 40, 73);
    color: #f2f2f2;
}
.vr-thresh-above-label {
    color: rgb(206, 186, 76);
    font-weight: 500;
}
/* Tax Period Toggle (labeler) */
.tax-period-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}
.tax-period-toggle:hover {
    background: rgba(206, 186, 76, 0.08);
    border-color: rgba(206, 186, 76, 0.4);
}
.tax-period-toggle.active {
    background: rgba(206, 186, 76, 0.1);
    border-color: rgba(206, 186, 76, 0.5);
}
.tax-period-toggle-text {
    color: #ccc;
    font-size: 0.85rem;
    font-weight: 500;
}
.tax-period-toggle.active .tax-period-toggle-text {
    color: rgb(206, 186, 76);
}
.tax-period-toggle-hint {
    color: #777;
    font-size: 0.75rem;
}
.tax-period-fields {
    padding-left: 0.5rem;
}

/* Drag-to-reorder vendor rules */
.vendor-rule-row.dragging {
    opacity: 0.5;
    box-shadow: 0 4px 16px rgba(206, 186, 76, 0.3);
    z-index: 10;
}
.vendor-rule-row.drag-over {
    border-top: 2px solid rgb(206, 186, 76);
}
.vendor-rule-number {
    color: rgba(206, 186, 76, 0.7);
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 1.5rem;
    text-align: center;
    user-select: none;
}
.vendor-rule-drag-handle {
    cursor: grab;
    color: #666;
    font-size: 1.1rem;
    padding: 0 0.35rem;
    user-select: none;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.vendor-rule-drag-handle:hover {
    color: rgb(206, 186, 76);
}
.vendor-rule-drag-handle:active {
    cursor: grabbing;
}

.vendor-hint {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.35rem;
}

/* Post-Label Rules */
.post-label-rules-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(206, 186, 76, 0.15);
}
.post-label-rule-row {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    margin-top: 0.5rem;
}
.post-label-rule-main {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.post-label-rule-main .vendor-rule-field {
    flex: 1;
    min-width: 100px;
}
.plr-mode-field { max-width: 120px; }
.plr-threshold-field { max-width: 110px; }
.plr-reclassify-config, .plr-split-config {
    margin-top: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: rgba(13, 40, 73, 0.4);
    border-radius: 4px;
}
.plr-reclass-row, .plr-split-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.plr-label {
    color: #aaa;
    font-size: 0.8rem;
    white-space: nowrap;
}
.plr-label-sep { margin-left: 0.5rem; }
.plr-reclass-row select, .plr-split-row select {
    max-width: 200px;
}
.plr-split-row input[type="number"] {
    width: 60px;
}
.plr-summary {
    font-size: 0.72rem;
    color: rgba(206, 186, 76, 0.7);
    margin-top: 0.4rem;
    font-style: italic;
}

/* File Upload Section */
.upload-section-smart {
    background-color: rgba(13, 40, 73, 0.5);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.upload-section-smart h3 {
    color: rgb(206, 186, 76);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.upload-box {
    border: 2px dashed rgba(206, 186, 76, 0.4);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}
.upload-box:hover {
    border-color: rgb(206, 186, 76);
    background-color: rgba(206, 186, 76, 0.05);
}
.upload-box.dragover {
    border-color: rgb(206, 186, 76);
    background-color: rgba(206, 186, 76, 0.1);
}
.upload-box.has-file {
    border-style: solid;
    border-color: rgba(144, 238, 144, 0.5);
    background-color: rgba(144, 238, 144, 0.05);
}
.upload-box h4 {
    color: #f2f2f2;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.upload-box .required {
    color: #ff6b6b;
}
.upload-box .optional-badge {
    background-color: rgba(206, 186, 76, 0.2);
    color: rgb(206, 186, 76);
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
}
.upload-box p {
    color: #aaa;
    font-size: 0.8rem;
    margin: 0.25rem 0;
}
.upload-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
    color: rgba(206, 186, 76, 0.6);
}
.file-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background-color: rgba(144, 238, 144, 0.1);
    border-radius: 4px;
}
.file-display .file-name {
    color: #90EE90;
    font-size: 0.85rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-display .remove-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}
.stat-box {
    background-color: rgba(13, 40, 73, 0.6);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}
.stat-box .stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: rgb(206, 186, 76);
}
.stat-box .stat-label {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 0.25rem;
}
.stat-box.green .stat-value { color: #90EE90; }
.stat-box.yellow .stat-value { color: #FFFF99; }
.stat-box.red .stat-value { color: #FF9999; }

/* Match Sources Grid */
.sources-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(206, 186, 76, 0.2);
}
.source-item {
    text-align: center;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
.source-item .source-count {
    font-size: 1.1rem;
    font-weight: bold;
    color: #90EE90;
}
.source-item .source-label {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.15rem;
}

/* Results Table */
.results-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 8px;
    margin: 1rem 0;
}
.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.results-table th {
    background-color: rgba(13, 40, 73, 0.9);
    color: rgb(206, 186, 76);
    padding: 0.75rem 0.5rem;
    text-align: left;
    position: sticky;
    top: 0;
    font-weight: 600;
}
.results-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(206, 186, 76, 0.1);
    color: #ddd;
}
.results-table tr:hover {
    background-color: rgba(206, 186, 76, 0.05);
}
.results-table .confidence-cell {
    font-weight: bold;
    text-align: center;
}
.results-table .py-cell {
    text-align: center;
    font-family: monospace;
}
.results-table .source-cell {
    font-size: 0.75rem;
    text-transform: uppercase;
}
/* Confidence colors */
.conf-green { color: #90EE90; }
.conf-yellow { color: #FFFF99; }
.conf-orange { color: #FFCC80; }
.conf-red { color: #FF9999; }
/* Row indicator */
.row-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}
.row-indicator.green { background-color: #90EE90; }
.row-indicator.yellow { background-color: #FFFF99; }
.row-indicator.orange { background-color: #FFCC80; }
.row-indicator.red { background-color: #FF9999; }

/* Results Section */
.results-section {
    background-color: rgba(13, 40, 73, 0.5);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}
.results-section h3 {
    color: rgb(206, 186, 76);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.results-message {
    color: #90EE90;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* Submit Button */
.submit-btn-smart {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, rgb(206, 186, 76) 0%, rgb(180, 160, 60) 100%);
    border: none;
    border-radius: 8px;
    color: #0D2849;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.submit-btn-smart:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(206, 186, 76, 0.3);
}
.submit-btn-smart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.submit-btn-smart svg {
    width: 20px;
    height: 20px;
}

/* Download Button */
.download-btn-smart {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: rgba(144, 238, 144, 0.2);
    border: 1px solid #90EE90;
    border-radius: 6px;
    color: #90EE90;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.download-btn-smart:hover {
    background-color: rgba(144, 238, 144, 0.3);
}
.download-btn-smart svg {
    width: 18px;
    height: 18px;
}

/* Reset/Start Over Button */
.reset-btn-smart {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: rgba(206, 186, 76, 0.1);
    border: 1px solid rgba(206, 186, 76, 0.5);
    border-radius: 6px;
    color: rgb(206, 186, 76);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.reset-btn-smart:hover {
    background-color: rgba(206, 186, 76, 0.2);
    border-color: rgb(206, 186, 76);
}
.reset-btn-smart svg {
    width: 18px;
    height: 18px;
}

/* How It Works Section */
.info-section {
    background-color: rgba(13, 40, 73, 0.4);
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}
.info-section h4 {
    color: rgb(206, 186, 76);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.info-item {
    font-size: 0.8rem;
    color: #aaa;
}
.info-item strong {
    color: #f2f2f2;
    display: block;
    margin-bottom: 0.25rem;
}
.info-item ul {
    margin: 0.25rem 0 0 1rem;
    padding: 0;
}
.info-item li {
    margin-bottom: 0.15rem;
}

/* Accordion dropdowns */
.info-accordion {
    border: 1px solid rgba(206, 186, 76, 0.15);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: rgba(13, 40, 73, 0.3);
    overflow: hidden;
}
.info-accordion summary {
    cursor: pointer;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #f2f2f2;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}
.info-accordion summary:hover {
    background: rgba(206, 186, 76, 0.08);
}
.info-accordion summary::-webkit-details-marker {
    display: none;
}
.info-accordion summary::after {
    content: '+';
    color: #CEBA4C;
    font-size: 1.1rem;
    font-weight: 400;
    transition: transform 0.2s;
}
.info-accordion[open] summary::after {
    content: '\2212';
}
.info-accordion[open] summary {
    border-bottom: 1px solid rgba(206, 186, 76, 0.1);
}
.info-accordion-body {
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.6;
}
.info-accordion-body p {
    margin: 0 0 0.5rem 0;
}
.info-accordion-body p:last-child {
    margin-bottom: 0;
}
.info-accordion-body em {
    color: #CEBA4C;
    font-style: normal;
}
.info-accordion-body ul {
    margin: 0.3rem 0 0 1rem;
    padding: 0;
}
.info-accordion-body li {
    margin-bottom: 0.3rem;
}
.info-accordion-body li strong {
    color: #ddd;
}
.info-tip-callout {
    background: rgba(206, 186, 76, 0.06);
    border-left: 2px solid #CEBA4C;
    padding: 0.4rem 0.6rem;
    border-radius: 0 4px 4px 0;
    margin-top: 0.4rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 40, 73, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(206, 186, 76, 0.3);
    border-top-color: rgb(206, 186, 76);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    color: rgb(206, 186, 76);
    margin-top: 1rem;
    font-size: 1rem;
}

/* Error display */
.error-section {
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.5);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}
.error-section h3 {
    color: #ff6b6b;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.error-message {
    color: #ff9999;
    font-size: 0.9rem;
}
.retry-btn {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 107, 107, 0.2);
    border: 1px solid #ff6b6b;
    border-radius: 4px;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 0.85rem;
}
.retry-btn:hover {
    background-color: rgba(255, 107, 107, 0.3);
}

.template-download-link:hover {
    text-decoration: underline;
    color: #fff;
}

/* Check Images Section */
.check-images-section {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.check-images-upload {
    margin-top: 0.75rem;
}
.upload-box-compact {
    padding: 1rem;
}
.upload-box-compact .upload-icon-sm {
    width: 24px;
    height: 24px;
    margin-bottom: 0.25rem;
}
.check-file-list {
    margin-top: 0.75rem;
    text-align: left;
}
.check-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.25rem;
    background-color: rgba(144, 238, 144, 0.1);
    border-radius: 4px;
}
.check-file-item .file-name {
    color: #90EE90;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}
.check-remove-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}
.check-remove-btn:hover {
    color: #ff4444;
}

/* Check OCR Summary in Results */
.check-ocr-summary {
    margin: 0.75rem 0;
    padding: 0.6rem 1rem;
    background: rgba(13, 40, 73, 0.5);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 6px;
    text-align: center;
}
.check-ocr-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(206, 186, 76);
    margin-bottom: 0.3rem;
}
.check-ocr-stats {
    font-size: 0.85rem;
    color: #ccc;
}
.check-ocr-sep {
    margin: 0 0.5rem;
    color: #555;
}
.check-ocr-matched strong {
    color: #90EE90;
}
.check-ocr-unmatched strong {
    color: #ff6b6b;
}

.hidden { display: none !important; }

/* ==========================================================================
   Responsive — Tablet (768px)
   ========================================================================== */
@media (max-width: 768px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
    .config-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Responsive — Mobile (600px)
   ========================================================================== */
@media (max-width: 600px) {
    .config-grid {
        gap: 0.75rem;
    }
    .config-section {
        padding: 1rem;
    }
    .config-section h3 {
        font-size: 1rem;
    }
    .labeler-upload-section {
        padding: 1.5rem;
    }
}
