* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.auth-view {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: radial-gradient(circle at top, #e8f1ff 0%, #f7f8fb 50%, #eef2f6 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 20px 50px rgba(31, 41, 55, 0.12);
    border: 1px solid #e3e6ee;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-title {
    font-size: 2em;
    font-weight: 700;
    color: #1f2a37;
}

.auth-subtitle {
    margin-top: 8px;
    color: #5f6c7b;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-label {
    font-weight: 600;
    color: #374151;
}

.auth-input {
    padding: 12px 14px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    font-size: 1em;
}

.auth-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.auth-submit {
    margin-top: 8px;
}

.auth-error {
    color: #b91c1c;
    font-size: 0.95em;
    min-height: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

header {
    background: #2c3e50;
    color: white;
    padding: 30px;
    text-align: center;
    border-bottom: 3px solid #34495e;
}

header .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    text-align: left;
}

header .header-top h1 {
    margin-bottom: 6px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-weight: 600;
    color: #dbeafe;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1em;
}

.tabs {
    display: flex;
    background: #ffffff;
    border-bottom: 2px solid #d0d0d0;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #555;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.tab-btn.active {
    color: #2c3e50;
    border-bottom-color: #3498db;
    background: #f8f9fa;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

.upload-box {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.upload-box:hover {
    border-color: #3498db;
    background: #f0f8ff;
    border-style: solid;
}

.upload-box svg {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.upload-box h3 {
    margin: 20px 0 10px;
    color: #333;
}

.upload-box p {
    color: #666;
    margin: 5px 0;
}

.file-info {
    margin-top: 20px;
    font-size: 0.9em;
    color: #999;
}

.upload-progress {
    margin-top: 30px;
}

.upload-file-item {
    margin: 5px 0;
}

.file-status {
    font-size: 0.9em;
}

.overall-progress {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #3498db;
    width: 0%;
    transition: width 0.3s;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.upload-result {
    margin-top: 30px;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #333;
}

.tabs-small {
    display: flex;
    gap: 10px;
}

.tab-small-btn {
    padding: 8px 16px;
    border: 2px solid #bdc3c7;
    background: white;
    color: #555;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-small-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.btn-secondary {
    background: #3498db;
    color: white;
}

.btn-secondary:hover {
    background: #2980b9;
}

.btn-primary {
    background: #2c3e50;
    color: white;
}

.btn-primary:hover {
    background: #34495e;
}

.btn-primary:disabled {
    background: #95a5a6;
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-light {
    background: #f1f5f9;
    color: #1f2a37;
}

.btn-light:hover {
    background: #e2e8f0;
}

.delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
    line-height: 1;
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: #fee2e2;
    transform: scale(1.1);
}

.delete-btn:active {
    transform: scale(0.95);
}

.pagination {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.pagination button {
    min-width: 40px;
    padding: 8px 12px;
}

.pagination span {
    padding: 0 5px;
    color: #666;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    background: white;
}

.data-table th {
    padding: 8px;
    text-align: left;
    border-bottom: 2px solid #bdc3c7;
    background: #ecf0f1;
    font-weight: 600;
    white-space: nowrap;
    color: #2c3e50;
}

.data-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.data-table tbody tr {
    background: white;
}

.data-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.card-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.card-meta {
    font-size: 0.9em;
    color: #666;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-processed {
    background: #e8f5e9;
    color: #388e3c;
}

.status-failed {
    background: #ffebee;
    color: #c62828;
}

.type-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #34495e;
    color: white;
    border-radius: 4px;
    font-size: 0.85em;
    margin-top: 10px;
}

.card-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9em;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    color: #333;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.validation-info {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
}

.validation-pass {
    background: #d1fae5;
    border-left: 4px solid #10b981;
}

.validation-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.validation-error {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
}

.validation-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.check-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.check-icon.valid {
    background: #10b981;
    color: white;
}

.check-icon.invalid {
    background: #ef4444;
    color: white;
}

/* Match status styles */
.match-status-matched {
    color: #388e3c;
    font-weight: 500;
}

.match-status-suggested-high {
    color: #4caf50;
    font-weight: 500;
}

.match-status-suggested-medium {
    color: #f59e0b;
    font-weight: 500;
}

.match-status-suggested-low {
    color: #999;
    font-weight: 500;
}

.match-status-unmatched {
    color: #999;
}

.match-action-btn {
    padding: 6px 12px;
    font-size: 0.9em;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.match-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.match-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.match-item {
    margin: 10px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #ddd;
}

.match-item.confirmed {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.match-item.high-score {
    border-left-color: #4caf50;
}

.match-item.medium-score {
    border-left-color: #f59e0b;
}

.match-item.low-score {
    border-left-color: #999;
}

@media (max-width: 768px) {
    .auth-card {
        padding: 28px 22px;
    }

    header .header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-actions {
        width: 100%;
        justify-content: space-between;
    }

    .container {
        margin: 10px;
        border-radius: 12px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .tabs {
        flex-wrap: nowrap;
    }
    
    .tab-btn {
        font-size: 0.9em;
        padding: 12px 15px;
    }
    
    .tab-content {
        padding: 20px;
    }
}
