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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 32px 20px;
    color: #2d3748;
}

.topbar {
    max-width: 1000px;
    margin: 0 auto 16px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

.topbar a {
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,0.18);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.topbar a:hover { background: rgba(255,255,255,0.3); }

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

h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 28px;
    text-align: center;
    font-weight: 600;
}

.upload-area {
    display: block;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f7fafc;
    margin-bottom: 20px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #edf2ff;
}

.upload-icon { font-size: 48px; margin-bottom: 12px; color: #667eea; }
.upload-text { color: #4a5568; font-size: 16px; margin-bottom: 8px; }
.upload-hint { color: #a0aec0; font-size: 13px; }

#fileInput { display: none; }

.file-list { max-height: 200px; overflow-y: auto; }
.file-list:not(:empty) { margin-bottom: 20px; }

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #edf2ff;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.file-item .remove { color: #e53e3e; cursor: pointer; font-weight: bold; padding: 0 8px; }

.check-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: 0.3px;
}

.check-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102,126,234,0.4);
}

.check-button:disabled { opacity: 0.5; cursor: not-allowed; }

.results { margin-top: 32px; }

.source-tag {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    background: #e2e8f0;
    color: #4a5568;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin: 24px 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7fafc;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header .lief { font-size: 14px; color: #4a5568; }
.results-header .lief b { color: #2c3e50; }

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ok { background: #c6f6d5; color: #22543d; }
.badge-nok { background: #fed7d7; color: #742a2a; }
.badge-unknown { background: #e2e8f0; color: #4a5568; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

tr:last-child td { border-bottom: none; }

.cell-ok { color: #22543d; font-weight: 600; }
.cell-nok { color: #742a2a; font-weight: 600; }
.muted { color: #a0aec0; }

.spinner {
    border: 3px solid #edf2ff;
    border-top-color: #667eea;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 0.7s linear infinite;
    margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-card {
    max-width: 360px;
    margin: 80px auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 36px 32px;
}

.login-card h2 {
    color: #2c3e50;
    font-size: 22px;
    text-align: center;
    margin-bottom: 12px;
    font-weight: 600;
}

.login-card input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    font-size: 16px;
    color: #2d3748;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card input[type="password"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.login-error {
    color: #c53030;
    text-align: center;
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
}

.logout-link { cursor: pointer; }

.drafts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 720px) {
    .drafts { grid-template-columns: 1fr; }
}

.draft-col {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.draft-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #edf2ff;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    text-transform: none;
    letter-spacing: 0;
}

.copy-btn:hover { background: #edf2ff; border-color: #667eea; color: #667eea; }
.copy-btn.copied { background: #c6f6d5; border-color: #22543d; color: #22543d; }

.copy-icon { font-size: 14px; line-height: 1; }

.draft-text {
    margin: 0;
    padding: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: #2d3748;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.results-list-item {
    display: grid;
    grid-template-columns: 180px 1fr 1fr 100px 100px;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: #f7fafc;
    border-radius: 10px;
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.results-list-item:hover { background: #edf2ff; }
.results-list-item .date { font-size: 13px; color: #4a5568; }
.results-list-item .id { color: #a0aec0; font-size: 13px; }
