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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
    -webkit-user-select: none;
    user-select: none;
}

/* Prevent screenshots/copying of sensitive content */
img, canvas, .label-center, .summary-panel, .preview-strip {
    -webkit-user-drag: none;
    pointer-events: auto;
}

@media print { body { display: none !important; } }

.view { display: none; }
.view:not([hidden]) { display: block; }

/* Login */
.login-card {
    max-width: 360px;
    margin: 15vh auto;
    background: #16213e;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.login-card h1 { color: #4cc9f0; margin-bottom: 8px; }
.login-card p { color: #888; margin-bottom: 24px; }
.login-card input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0f3460;
    color: #e0e0e0;
    font-size: 14px;
    -webkit-user-select: text;
    user-select: text;
}
.login-card button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #4cc9f0;
    color: #000;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}
.login-card button:hover { background: #3db8df; }
.error { color: #ff6b6b; margin-top: 12px; font-size: 13px; }

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #16213e;
    border-bottom: 1px solid #333;
}
.dashboard-header h1 { color: #4cc9f0; font-size: 20px; }
.header-right { display: flex; align-items: center; gap: 12px; }
#user-display { color: #aaa; }
.dashboard-actions { padding: 16px 24px; display: flex; align-items: center; }
/* Dashboard Controls */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
    padding: 6px 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: transparent;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.filter-tab:hover { background: #16213e; color: #e0e0e0; }
.filter-tab.active { background: #0f3460; color: #4cc9f0; border-color: #4cc9f0; }
.filter-tab span { font-weight: 700; margin-left: 4px; }
.filter-tab[data-filter="unclaimed"] span { color: #ffd166; }
.filter-tab[data-filter="in_progress"] span { color: #4cc9f0; }
.filter-tab[data-filter="needs_verification"] span { color: #e9a820; }
.filter-tab[data-filter="verifying"] span { color: #b06cf0; }
.filter-tab[data-filter="done"] span { color: #06d6a0; }
.search-box input {
    padding: 6px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0f3460;
    color: #e0e0e0;
    font-size: 13px;
    width: 200px;
    -webkit-user-select: text;
    user-select: text;
}
.search-box input::placeholder { color: #555; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px;
}
#page-info { color: #888; font-size: 13px; }
.hint-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}
.hint-yes { background: #06d6a0; color: #000; }
.hint-no { background: #333; color: #888; }
.hint-clear { background: #118ab2; color: #fff; }
.date-col { color: #888; font-size: 12px; white-space: nowrap; }

#folder-table, #activity-table {
    width: calc(100% - 48px);
    margin: 0 24px;
    border-collapse: collapse;
}
#folder-table th, #folder-table td,
#activity-table th, #activity-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #333;
}
#folder-table th, #activity-table th { color: #888; font-size: 12px; text-transform: uppercase; }
.status-unclaimed { color: #ffd166; }
.status-in_progress { color: #4cc9f0; }
.status-needs_verification { color: #e9a820; }
.status-verifying { color: #b06cf0; }
.status-done { color: #06d6a0; }

/* Buttons */
.btn-primary {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    background: #4cc9f0;
    color: #000;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.btn-primary:hover { background: #3db8df; }
.btn-small {
    padding: 5px 12px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #16213e;
    color: #e0e0e0;
    font-size: 12px;
    cursor: pointer;
}
.btn-small:hover { background: #1a2a4e; }
.btn-danger { border-color: #ff6b6b; color: #ff6b6b; }
.btn-danger:hover { background: #3a1a1a; }

/* Mode badge */
.mode-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mode-label { background: #4cc9f0; color: #000; }
.mode-verify { background: #06d6a0; color: #000; }
.mode-readonly { background: #555; color: #fff; }

/* Labeling View */
.label-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background: #16213e;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
}
.label-toolbar .toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
#folder-name { font-weight: 700; color: #4cc9f0; }
#image-progress { color: #aaa; }
#current-image-name { color: #888; font-size: 13px; }
.category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    background: #e74c3c;
    color: #fff;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.label-layout {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    height: calc(100vh - 52px);
    overflow: hidden;
}

.label-left {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}
.brightness-controls, .nav-controls {
    background: #16213e;
    padding: 12px;
    border-radius: 8px;
}
.brightness-controls label, .nav-controls label { display: block; margin-bottom: 4px; font-size: 13px; }
.brightness-controls input[type="range"] { width: 100%; }
.brightness-controls input[type="number"] { width: 60px; background: #0f3460; border: 1px solid #333; color: #e0e0e0; border-radius: 4px; padding: 3px 6px; }
.default-brightness { margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.brightness-shortcuts { font-size: 11px; color: #666; margin-top: 6px; }
.nav-controls button { margin-bottom: 6px; width: 100%; }
.goto-control { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.goto-control input { width: 50px; background: #0f3460; border: 1px solid #333; color: #e0e0e0; border-radius: 4px; padding: 3px 6px; }

.label-center {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#label-canvas {
    border: 1px solid #333;
    cursor: crosshair;
    background: #000;
}
#mouse-pos { font-size: 12px; color: #888; margin-top: 4px; }

.label-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 300px;
    overflow-y: auto;
}
.bbox-panel, .summary-panel, .folder-actions-panel {
    background: #16213e;
    padding: 12px;
    border-radius: 8px;
}
.bbox-panel h3, .summary-panel h3 { font-size: 13px; color: #888; margin-bottom: 8px; text-transform: uppercase; }

#bbox-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 8px;
}
.bbox-item {
    padding: 4px 8px;
    margin-bottom: 2px;
    border-radius: 4px;
    font-size: 13px;
    font-family: monospace;
    cursor: pointer;
    border: 1px solid transparent;
}
.bbox-item:hover { background: rgba(255,255,255,0.05); }
.bbox-item.selected { border-color: #4cc9f0; background: rgba(76,201,240,0.1); }
.bbox-actions { display: flex; gap: 6px; margin-bottom: 6px; }
.bbox-actions button { flex: 1; }

#summary-canvas {
    width: 100%;
    height: auto;
    border: 1px solid #333;
    border-radius: 4px;
    background: #000;
    cursor: pointer;
}
.summary-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.summary-panel h3 { flex-shrink: 0; }
.click-hint { font-weight: 400; font-size: 11px; color: #555; text-transform: none; }

.folder-actions-panel { display: flex; gap: 8px; flex-wrap: wrap; }
.folder-actions-panel button { flex: 1; min-width: 0; }
.folder-actions-panel[hidden] { display: none; }
.folder-nav-panel { display: flex; gap: 8px; margin-top: 8px; }
.folder-nav-panel button { flex: 1; }

/* Hint Panel */
.hint-panel {
    background: #16213e;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #4cc9f0;
}
.hint-panel h3 { font-size: 13px; color: #888; margin-bottom: 8px; text-transform: uppercase; }
.hint-type { font-size: 12px; color: #888; margin-bottom: 6px; }
.hint-type .hint-type-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 11px;
}
.hint-type-clear { background: #555; color: #fff; }
.hint-type-1cd { background: #4cc9f0; color: #000; }
.hint-type-3cd { background: #e74c3c; color: #fff; }
.hint-location {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}
.hint-location:last-child { border-bottom: none; }
.hint-lage-num {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    padding: 1px 4px;
    border-radius: 3px;
    background: #0f3460;
    color: #4cc9f0;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.hint-side {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.hint-side-vorne { background: #06d6a0; color: #000; }
.hint-side-hinten { background: #ffd166; color: #000; }
.hint-desc { color: #ccc; }
.hint-object { font-size: 12px; color: #888; margin-top: 4px; }
.hint-clear-msg {
    padding: 12px;
    text-align: center;
    color: #118ab2;
    font-weight: 600;
    font-size: 14px;
    background: rgba(17,138,178,0.1);
    border: 1px solid #118ab2;
    border-radius: 4px;
}
.hint-missing-msg {
    padding: 8px;
    text-align: center;
    color: #888;
    font-style: italic;
}

/* Help Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal[hidden] { display: none; }
.modal-content {
    background: #16213e;
    border-radius: 12px;
    max-width: 700px;
    max-height: 85vh;
    width: 90vw;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    background: #16213e;
    z-index: 1;
}
.modal-header h2 { color: #4cc9f0; font-size: 18px; }
.modal-header button { font-size: 20px; border: none; background: none; color: #888; cursor: pointer; padding: 4px 8px; }
.modal-header button:hover { color: #fff; }
.modal-body {
    padding: 20px;
}
.modal-body h3 {
    color: #4cc9f0;
    font-size: 15px;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid #333;
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { font-size: 14px; color: #ccc; margin-bottom: 8px; line-height: 1.5; }
.modal-body ol { padding-left: 20px; margin-bottom: 12px; }
.modal-body li { font-size: 14px; color: #ccc; margin-bottom: 6px; line-height: 1.5; }
.help-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.help-table td { padding: 5px 10px; border-bottom: 1px solid #333; font-size: 13px; color: #ccc; }
.help-table kbd {
    display: inline-block;
    padding: 2px 8px;
    background: #0f3460;
    border: 1px solid #555;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: #4cc9f0;
    min-width: 28px;
    text-align: center;
}
.cat-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    min-width: 30px;
    text-align: center;
}

/* Upload Modal */
.file-tree {
    background: #0a0a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px 16px;
    font-family: monospace;
    font-size: 12px;
    color: #aaa;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    -webkit-user-select: text;
    user-select: text;
}
.upload-form { margin-top: 12px; }
.upload-file-label {
    display: inline-block;
    padding: 10px 20px;
    background: #0f3460;
    border: 2px dashed #4cc9f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4cc9f0;
}
.upload-file-label:hover { background: #1a2a4e; }
.upload-file-label input[type="file"] { display: none; }
.upload-file-info { margin-top: 8px; font-size: 13px; color: #888; }
.upload-hint-form { margin-top: 12px; }
.upload-hint-form label { display: block; margin-bottom: 8px; font-size: 13px; color: #ccc; }
.upload-hint-form select, .upload-hint-form input[type="text"], .upload-hint-form input[type="number"] {
    padding: 6px 10px;
    background: #0f3460;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 13px;
    margin-left: 6px;
}
.upload-location-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.upload-location-row label { flex: 1; margin-bottom: 0; }
.upload-location-row input, .upload-location-row select { width: 100%; margin-left: 0; margin-top: 4px; display: block; }
#upload-add-location { margin-bottom: 12px; }
.upload-actions { margin-top: 16px; }
.upload-progress-bar {
    height: 6px;
    background: #0f3460;
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}
.upload-progress-fill {
    height: 100%;
    background: #4cc9f0;
    width: 0;
    transition: width 0.3s;
}
#upload-status { font-size: 13px; color: #888; margin-top: 6px; }
#upload-result { margin-top: 12px; font-size: 13px; }
.upload-success { color: #06d6a0; }
.upload-error { color: #ff6b6b; }

/* Body Diagram */
.body-diagram-container {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 8px;
}
.body-diagram-item { text-align: center; }
.body-diagram-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}
.body-diagram-canvas {
    border-radius: 4px;
    background: #0a0a1a;
}

/* Fullscreen Overlay */
.fullscreen-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.fullscreen-overlay[hidden] { display: none; }
.fullscreen-overlay canvas {
    max-width: 96vw;
    max-height: 92vh;
    object-fit: contain;
}
.fullscreen-close-hint {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: #666;
    font-size: 13px;
    pointer-events: none;
}

/* Preview thumbnails */
.preview-strip {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    justify-content: center;
}
.preview-strip canvas {
    border: 1px solid #333;
    border-radius: 3px;
    cursor: pointer;
    background: #000;
}
.preview-strip canvas:hover { border-color: #4cc9f0; }
.preview-label {
    font-size: 10px;
    color: #666;
    text-align: center;
    margin-top: 2px;
}
.preview-item { display: flex; flex-direction: column; align-items: center; }

/* Admin View */
.admin-content {
    padding: 24px;
}
.admin-content h2 {
    color: #4cc9f0;
    font-size: 18px;
    margin-bottom: 16px;
    margin-top: 24px;
}
.admin-content h2:first-child { margin-top: 0; }
.admin-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: center;
}
.admin-filters label { font-size: 13px; color: #888; }
.admin-filters select {
    padding: 4px 8px;
    background: #0f3460;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 13px;
    margin-left: 4px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.admin-table th, .admin-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #333;
    font-size: 13px;
}
.admin-table th { color: #888; text-transform: uppercase; font-size: 11px; }
