* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: #7C3AED;
    color: #7C3AED;
}

.tab-btn.active {
    background: #7C3AED;
    border-color: #7C3AED;
    color: white;
}

/* Tab Content */
.tab-content {
    margin-top: 20px;
}

/* Manual Entry Section */
.manual-entry-section {
    max-width: 800px;
    margin: 0 auto;
}

.manual-entry-section h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.section-description {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.manual-entry-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.readonly-field {
    background-color: #f8f9fa !important;
    color: #666 !important;
    cursor: not-allowed !important;
    border-color: #e2e8f0 !important;
}

.required {
    color: #ef4444;
}

.help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

/* Recurring Settings */
.recurring-toggle {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.recurring-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Preview Section */
.preview-section {
    text-align: center;
    margin-top: 20px;
}

.recurring-preview {
    background: white;
    border: 2px solid #7C3AED;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.recurring-preview h3 {
    color: #7C3AED;
    margin-bottom: 15px;
}

.preview-summary {
    background: #EDE9FE;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.preview-summary p {
    margin-bottom: 5px;
}

.preview-items {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
}

.preview-item {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.preview-item:last-child {
    border-bottom: none;
}

.preview-item .date {
    font-size: 0.9rem;
    color: #666;
}

.preview-item .amount {
    text-align: right;
    font-weight: 600;
    color: #7C3AED;
}

.more-items {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-top: 10px;
}

.preview-actions {
    text-align: center;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: white;
    border-left: 4px solid;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast-success {
    border-color: #10b981;
}

.toast-error {
    border-color: #ef4444;
}

.toast-warning {
    border-color: #f59e0b;
}

.toast-info {
    border-color: #3b82f6;
}

.toast-message {
    flex: 1;
    white-space: pre-line;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Pattern Selection Cards */
.pattern-selector {
    margin-bottom: 30px;
}

.pattern-selector h4 {
    margin-bottom: 15px;
    color: #333;
}

.pattern-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.pattern-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.pattern-card:hover {
    border-color: #7C3AED;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
    transform: translateY(-2px);
}

.pattern-card.active {
    border-color: #7C3AED;
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    color: white;
}

.pattern-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.pattern-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.pattern-desc {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Pattern Specific Settings */
.pattern-specific {
    margin-bottom: 25px;
}

.settings-card {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-card h5 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2rem;
}

.pattern-explanation {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.example-text {
    background: #EDE9FE;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #5B21B6;
    border-left: 4px solid #7C3AED;
}

/* Weekday Selector */
.weekday-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.weekday-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.weekday-checkbox input[type="checkbox"] {
    display: none;
}

.weekday-label {
    width: 40px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
    background: white;
}

.weekday-checkbox input[type="checkbox"]:checked + .weekday-label {
    background: #7C3AED;
    border-color: #7C3AED;
    color: white;
}

.weekday-checkbox:hover .weekday-label {
    border-color: #7C3AED;
    transform: scale(1.05);
}

/* Radio Cards */
.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.radio-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    display: block;
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card:hover {
    border-color: #7C3AED;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
}

.radio-card input[type="radio"]:checked + .radio-card-content {
    color: #7C3AED;
}

.radio-card input[type="radio"]:checked + .radio-card-content::before {
    content: "✓";
    position: absolute;
    top: -5px;
    right: -5px;
    background: #7C3AED;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.radio-card-content {
    position: relative;
}

.radio-card input[type="radio"]:checked ~ .radio-card {
    border-color: #7C3AED;
    background: #EDE9FE;
}

.radio-card-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1rem;
}

.radio-card-desc {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

/* Interval Input */
.interval-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.interval-input input {
    flex: 0 0 80px;
}

#interval-unit {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

/* End Condition Section */
.end-condition-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

.end-condition-section h4 {
    margin-bottom: 20px;
    color: #333;
}

/* Button Enhancements */
.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    min-width: 200px;
}

.btn-secondary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

/* Pattern Settings Section */
.pattern-settings {
    margin-bottom: 25px;
}

/* Enhanced Preview Section */
.preview-section {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .tab-navigation {
        flex-direction: column;
        align-items: center;
    }

    .form-actions {
        flex-direction: column;
    }

    .container {
        padding: 20px;
    }

    .pattern-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .radio-cards {
        grid-template-columns: 1fr;
    }

    .weekday-selector {
        justify-content: center;
    }

    .btn-large {
        width: 100%;
        min-width: unset;
    }
}

/* Upload Section */
.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.upload-area:hover {
    border-color: #7C3AED;
    background: #edf2f7;
}

.upload-area.dragover {
    border-color: #7C3AED;
    background: #DDD6FE;
}

.upload-icon {
    color: #7C3AED;
    margin-bottom: 20px;
}

.upload-text {
    color: #718096;
    font-size: 1.1rem;
    line-height: 1.8;
}

.file-info {
    margin-top: 20px;
    text-align: center;
}

.file-info p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #4a5568;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #7C3AED;
    color: white;
}

.btn-primary:hover {
    background: #6D28D9;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.4);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(72, 187, 120, 0.4);
}

.btn-secondary {
    background: #718096;
    color: white;
    margin-right: 10px;
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(113, 128, 150, 0.4);
}

/* Batch Edit Controls */
.batch-edit-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.batch-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-select-all input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.batch-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.batch-field-selector {
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.card-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 15px;
}

/* Progress Section */
.progress-section {
    margin-bottom: 40px;
}

.progress-section h2 {
    margin-bottom: 20px;
    color: #4a5568;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7C3AED 0%, #6D28D9 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #718096;
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.results-header h2 {
    color: #4a5568;
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Edit Card */
.edit-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f7fafc;
    cursor: pointer;
}

.card-title {
    color: #2d3748;
    font-size: 1.2rem;
}

.card-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #718096;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.card-body.expanded {
    max-height: 2000px;
}

.card-content {
    padding: 20px;
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 20px;
}

.image-preview {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    cursor: pointer;
    position: relative;
}

.image-preview:hover::after {
    content: '🔍 クリックして拡大';
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* PDF Preview Styles */
.image-preview object,
.image-preview embed {
    width: 100%;
    height: 100%;
    min-height: 580px;
    border: none;
    background: white;
    border-radius: 4px;
    display: block;
}

.image-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.pdf-label {
    text-align: center;
    padding: 10px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    width: 100%;
}

/* PDF hover effect */
.image-preview:has(embed):hover::after {
    content: '📄 PDFをクリックして拡大';
    background: rgba(0, 0, 0, 0.8);
}

/* Image Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 42%;
    max-height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-close:hover {
    color: #f0f0f0;
}

/* Form Styles */
.form-section {
    display: flex;
    flex-direction: column;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.form-group label {
    margin-bottom: 5px;
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    width: 100%;
    max-width: 350px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.bank-info-section {
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.bank-info-section h4 {
    margin-bottom: 15px;
    color: #4a5568;
}

/* Re-validate Bank Button */
.revalidate-bank-btn {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid #cbd5e0;
    background: white;
    color: #4a5568;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.revalidate-bank-btn:hover {
    background: #f7fafc;
    border-color: #a0aec0;
    transform: translateY(-1px);
}

.revalidate-bank-btn:active {
    transform: translateY(0);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid #48bb78;
}

.toast.error {
    border-left: 4px solid #f56565;
}

.toast.info {
    border-left: 4px solid #4299e1;
}

.toast-message {
    flex: 1;
    margin-right: 10px;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #a0aec0;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #7C3AED;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .card-content {
        grid-template-columns: 1fr;
    }
    
    .image-preview {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-success {
        width: 100%;
    }
}

/* Bank Validation Styles */
.bank-validation-container {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.bank-validation-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.validation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
}

/* Validation States */
.validation-high {
    background: #e6fffa;
    border-color: #48bb78;
}

.validation-high .validation-icon {
    background: #48bb78;
    color: white;
}

.validation-medium {
    background: #fefcbf;
    border-color: #ecc94b;
}

.validation-medium .validation-icon {
    background: #ecc94b;
    color: white;
}

.validation-low {
    background: #fed7d7;
    border-color: #fc8181;
}

.validation-low .validation-icon {
    background: #fc8181;
    color: white;
}

/* Verified badge for bank fields */
.field-verified {
    position: relative;
}

.verified-badge {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #48bb78;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.verified-badge::before {
    content: '✓';
    font-size: 12px;
    font-weight: bold;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* Input field with verified state */
.form-group.has-verified-badge {
    position: relative;
}

.form-group.has-verified-badge input {
    padding-right: 100px;
    /* Removed default styling - let validation classes handle colors */
}

/* Medium confidence badge */
.verified-badge.medium {
    background: #ecc94b;
}

/* Error state badge */
.verified-badge.error {
    background: #fc8181;
    color: white;
}

.verified-badge.error::before {
    content: '✕';
    font-size: 12px;
    font-weight: bold;
}

/* Low confidence - no badge shown */

.validation-loading {
    background: #f7fafc;
    border-color: #cbd5e0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Bank Candidates List */
.bank-candidates {
    margin-top: 10px;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}

.candidate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 5px 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.candidate-item:hover {
    background: #edf2f7;
    border-color: #7C3AED;
    transform: translateX(2px);
}

.candidate-item.selected {
    background: #EDE9FE;
    border-color: #7C3AED;
    font-weight: 600;
}

.candidate-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.candidate-name {
    font-weight: 500;
    color: #2d3748;
}

.candidate-code {
    font-size: 0.85rem;
    color: #718096;
}

.select-btn {
    padding: 4px 12px;
    background: #7C3AED;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.select-btn:hover {
    background: #6D28D9;
}

/* Enhanced Bank Info Fields */
.bank-info-validated {
    position: relative;
}

.bank-info-validated input {
    padding-right: 35px;
}

.validation-badge {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.validation-badge.high {
    background: #48bb78;
    color: white;
}

.validation-badge.medium {
    background: #ecc94b;
    color: white;
}

.validation-badge.low {
    background: #fc8181;
    color: white;
}

/* Animated Loading Spinner for Validation */
.validation-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #7C3AED;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Bank Code and Branch Code Display */
.code-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #edf2f7;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.code-label {
    color: #718096;
    font-weight: 500;
}

.code-value {
    color: #2d3748;
    font-weight: 600;
}

/* Bank Code Badge Styles */
.bank-code-validated {
    position: relative;
}

.bank-code-validated input {
    padding-right: 100px;
}

.code-badge {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.code-badge.success {
    background: #48bb78;
    color: white;
}

.code-badge.success::before {
    content: '✓';
    font-size: 12px;
    font-weight: bold;
}

.code-badge.error {
    background: #fc8181;
    color: white;
}

.code-badge.error::before {
    content: '✕';
    font-size: 12px;
    font-weight: bold;
}

/* Input field with code badge state */
/* Removed default green styling - let validation classes handle this */
/* .form-group.has-code-badge input {
    background-color: #f0fff4;
    border-color: #48bb78 !important;
    box-shadow: 0 0 0 1px #48bb78;
} */

.form-group.has-code-badge.error input {
    background-color: #fef2f2;
    border-color: #fc8181 !important;
    box-shadow: 0 0 0 1px #fc8181;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Validation states for form controls */
.form-control.validation-success,
input.validation-success {
    border-color: #48bb78 !important;
    background-color: #f0fff4 !important;
    box-shadow: 0 0 0 1px #48bb78;
}

.form-control.validation-error,
input.validation-error {
    border-color: #fc8181 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 1px #fc8181;
}

/* Status dropdown color coding */
select[name="支払ステータス"] {
    font-weight: 500;
}

select[name="支払ステータス"] option[value="支払済"],
select[name="支払ステータス"][value="支払済"] {
    color: #48bb78;
    font-weight: 600;
}

select[name="支払ステータス"] option[value="未払"],
select[name="支払ステータス"][value="未払"] {
    color: #fc8181;
    font-weight: 600;
}

/* 立替ステータス color coding */
select[name="立替ステータス"] option[value="精算済"],
select[name="立替ステータス"][value="精算済"] {
    color: #48bb78;
    font-weight: 600;
}

select[name="立替ステータス"] option[value="未精算"],
select[name="立替ステータス"][value="未精算"] {
    color: #ed8936;
    font-weight: 600;
}

select[name="立替ステータス"] option[value="立替なし"],
select[name="立替ステータス"][value="立替なし"] {
    color: #718096;
    font-weight: 500;
}

/* Temporary Data Section */
.temporary-data-section {
    padding: 20px;
}

.temporary-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.temporary-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    min-height: 200px;
}

.loading-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
}

.temporary-file-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.temporary-file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #7C3AED;
}

.temporary-file-card.selected {
    border-color: #7C3AED;
    background: #EDE9FE;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.temporary-file-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    z-index: 10;
    cursor: pointer;
}

.temporary-file-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f8f9fa;
}

.temporary-file-info {
    padding: 15px;
}

.temporary-file-meta {
    margin-bottom: 8px;
}

.meta-label {
    font-size: 0.75rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.meta-value {
    font-size: 1rem;
    color: #2d3748;
    font-weight: 600;
}

.meta-value.amount {
    color: #7C3AED;
    font-size: 1.2rem;
}

.temporary-file-date {
    font-size: 0.85rem;
    color: #a0aec0;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2d3748;
}

.empty-state-desc {
    font-size: 1rem;
    color: #a0aec0;
}

/* Processing State Styles */
.temporary-file-card.processing {
    position: relative;
    opacity: 0.9;
    cursor: not-allowed !important;
    pointer-events: auto;
}

.temporary-file-card.processing .processing-overlay {
    pointer-events: none;
}

.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    backdrop-filter: blur(2px);
}

.processing-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #7C3AED;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #7C3AED;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.processing-message {
    font-size: 0.85rem;
    color: #718096;
    font-style: italic;
    padding: 10px 0;
}

.temporary-file-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}