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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #0f1117;
    color: #e1e4e8;
    min-height: 100vh;
}

header {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #58a6ff;
    white-space: nowrap;
}

#stats-bar {
    display: flex;
    gap: 12px;
    font-size: 13px;
}

.stat {
    padding: 4px 10px;
    border-radius: 12px;
    background: #21262d;
    white-space: nowrap;
}
.stat.pending { color: #d29922; }
.stat.done { color: #3fb950; }

#progress-bar-container {
    flex: 1;
    max-width: 300px;
    height: 20px;
    background: #21262d;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #238636, #3fb950);
    border-radius: 10px;
    transition: width 0.3s;
    width: 0%;
}

#progress-text {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 600;
}

#app {
    padding: 16px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Review area */
#review-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.panel {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
}

.panel-header {
    font-size: 13px;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.hint {
    font-weight: 400;
    font-size: 11px;
    color: #484f58;
    text-transform: none;
    letter-spacing: 0;
}

.big-name {
    font-size: 22px;
    font-weight: 600;
    color: #f0f6fc;
    margin-bottom: 12px;
    line-height: 1.3;
}

.meta-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 8px;
    background: #1f2937;
    color: #d29922;
    border: 1px solid #30363d;
}

.meta-tag:empty { display: none; }

.meta-stats {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 8px;
}

.source-url {
    margin-bottom: 12px;
}

.source-url a {
    font-size: 12px;
    color: #58a6ff;
    text-decoration: none;
}

.source-url a:hover {
    text-decoration: underline;
}

.clinics-list {
    font-size: 12px;
    color: #6e7681;
    max-height: 150px;
    overflow-y: auto;
}

.clinic-item {
    padding: 3px 0;
    border-bottom: 1px solid #21262d;
}

.clinic-item .clinic-name { color: #8b949e; }
.clinic-item .clinic-price { color: #d29922; margin-left: 8px; }
.clinic-item .clinic-cat { color: #58a6ff; margin-left: 8px; font-style: italic; }

/* Candidates */
#candidates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.candidate-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #21262d;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.candidate-card:hover {
    border-color: #30363d;
    background: #282e36;
}

.candidate-card.selected {
    border-color: #58a6ff;
    background: #1a2332;
}

.candidate-card.selected .hotkey {
    background: #58a6ff;
    color: #0d1117;
}

.hotkey {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #30363d;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.candidate-info {
    flex: 1;
    min-width: 0;
}

.candidate-name {
    font-size: 15px;
    font-weight: 500;
    color: #f0f6fc;
}

.candidate-meta {
    font-size: 12px;
    color: #6e7681;
    margin-top: 2px;
}

.no-candidates {
    text-align: center;
    padding: 24px;
    color: #484f58;
    font-style: italic;
}

/* Action buttons */
#action-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.action-btn {
    flex: 1;
    padding: 10px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #30363d;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn kbd {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: monospace;
}

.action-btn.confirm {
    background: #238636;
    color: #fff;
    border-color: #238636;
}
.action-btn.confirm:hover { background: #2ea043; }

.action-btn.no-match {
    background: #21262d;
    color: #8b949e;
}
.action-btn.no-match:hover { background: #282e36; color: #e1e4e8; }

.action-btn.bad-data {
    background: #21262d;
    color: #da3633;
}
.action-btn.bad-data:hover { background: #3d1a1a; }

.action-btn.skip {
    background: #21262d;
    color: #6e7681;
}
.action-btn.skip:hover { background: #282e36; color: #8b949e; }

/* Search */
#search-area {
    border-top: 1px solid #30363d;
    padding-top: 12px;
}

.search-header {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 8px;
}

#search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    margin-bottom: 8px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #e1e4e8;
    border-radius: 6px;
}

#search-input:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.3);
}

#search-results {
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover { background: #21262d; }
.search-result-item.selected { background: #1a2332; border: 1px solid #58a6ff; }

.search-result-type {
    font-size: 11px;
    color: #6e7681;
}

/* Shortcut help */
#shortcut-help {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 200;
}

#shortcut-help.hidden { display: none; }

#shortcut-help h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: #58a6ff;
}

#shortcut-help table td {
    padding: 4px 12px 4px 0;
    font-size: 13px;
}

kbd {
    background: #30363d;
    border: 1px solid #484f58;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    font-family: monospace;
}

/* Toast */
#toast-container {
    position: fixed;
    top: 70px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    animation: slideIn 0.2s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.success { background: #0d2818; color: #3fb950; border: 1px solid #238636; }
.toast.info { background: #0d1b30; color: #58a6ff; border: 1px solid #1f6feb; }
.toast.warning { background: #2a1f00; color: #d29922; border: 1px solid #9e6a03; }

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

/* Gamification bar */
#gamification-bar {
    display: flex;
    gap: 12px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    transition: background 0.15s;
}

#gamification-bar:hover { background: #21262d; }

.gam-points { color: #d29922; font-weight: 600; }
.gam-streak { color: #3fb950; }

/* Back button */
.action-btn.back {
    background: #21262d;
    color: #8b949e;
}
.action-btn.back:hover { background: #282e36; color: #e1e4e8; }

/* Leaderboard modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden { display: none; }

.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 24px;
    width: 700px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    color: #58a6ff;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.modal-close:hover { background: #21262d; color: #e1e4e8; }

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid #30363d;
    font-size: 12px;
    color: #8b949e;
    text-transform: uppercase;
}

.lb-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #21262d;
    font-size: 14px;
}

.lb-table tr:hover td { background: rgba(88, 166, 255, 0.05); }

.lb-me td {
    background: rgba(88, 166, 255, 0.1);
    font-weight: 600;
}

/* Login overlay */
#login-overlay {
    position: fixed;
    inset: 0;
    background: #0f1117;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#login-overlay.hidden { display: none; }

#login-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 32px;
    width: 400px;
    max-width: 90vw;
}

#login-box h2 {
    color: #58a6ff;
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}

.login-step p {
    color: #8b949e;
    font-size: 14px;
    margin-bottom: 12px;
}

.login-step input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e1e4e8;
    font-size: 14px;
}

.login-step input:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.3);
}

.login-step button {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: #238636;
    color: #fff;
    margin-bottom: 6px;
    transition: background 0.15s;
}

.login-step button:hover { background: #2ea043; }

.login-step button.secondary {
    background: #21262d;
    border: 1px solid #30363d;
    color: #8b949e;
}

.login-step button.secondary:hover {
    background: #282e36;
    color: #e1e4e8;
}

#user-form-buttons {
    display: flex;
    gap: 8px;
}

#user-form-buttons button { flex: 1; }

.login-error {
    color: #f85149;
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
}

#user-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.user-chip {
    padding: 6px 14px;
    border-radius: 16px;
    background: #21262d;
    border: 1px solid #30363d;
    color: #e1e4e8;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.user-chip:hover { border-color: #58a6ff; background: #1a2332; }
.user-chip.selected { border-color: #58a6ff; background: #1a2332; color: #58a6ff; }

.user-chip-stats {
    font-size: 11px;
    color: #6e7681;
    margin-left: 4px;
}

#user-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #8b949e;
    margin-left: auto;
}

#user-display .username {
    color: #58a6ff;
    font-weight: 600;
}

#btn-logout {
    background: none;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

#btn-logout:hover {
    background: #21262d;
    color: #f85149;
    border-color: #f85149;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f1117; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }
