* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #121212;
  color: #e0e0e0;
}

#app { min-height: 100vh; }

.center-message { text-align: center; padding: 60px 20px; color: #999; }

/* --- Login --- */

.login-box {
  max-width: 340px;
  margin: 100px auto 0;
  text-align: center;
}

.login-box h1 { font-size: 18px; margin-bottom: 20px; color: #fff; }

.login-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  background: #1c1c1c;
  border: 1px solid #444;
  border-radius: 4px;
  color: #e0e0e0;
}

.login-box button {
  width: 100%;
  padding: 10px;
  background: var(--brand-color, #3a6ea5);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.login-box button:hover { background: var(--brand-color-hover, #4a7eb5); }

.forgot-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: #7aa2d8;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
}

.login-subtitle { font-size: 13px; color: #999; margin: -12px 0 20px 0; }

.error { color: #e08f8f; font-size: 13px; }
.success-msg { color: #8fd19e; font-size: 13px; }

/* --- Topbar --- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
  color: #fff;
  padding: 10px 20px;
}

.topbar-left { display: flex; align-items: center; gap: 8px; }

.brand { color: #fff; font-weight: 700; text-decoration: none; }
.brand-logo, .login-box .brand-logo { height: 24px; vertical-align: middle; }

.crumb { color: #aaa; font-size: 13px; }

.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }

.link-btn {
  background: none;
  border: none;
  color: #7aa2d8;
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
}

.crumb-link {
  color: #aaa;
  text-decoration: none;
}
.crumb-link:hover { color: #fff; text-decoration: underline; }

.back-btn {
  background: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 12px;
}
.back-btn:hover { background: #383838; }

.status-line {
  background: #3a2f00;
  border-bottom: 1px solid #6b5900;
  color: #d8b25a;
  padding: 8px 20px;
  font-size: 13px;
}

.content { padding: 20px; max-width: 1100px; margin: 0 auto; }

h1 { font-size: 20px; margin: 0 0 6px 0; color: #fff; }
h2 { font-size: 15px; margin: 24px 0 10px 0; border-top: 1px solid #333; padding-top: 16px; color: #fff; }

.muted { color: #999; font-size: 13px; }

/* --- Tables --- */

.data-table { width: 100%; border-collapse: collapse; background: #1c1c1c; border: 1px solid #333; border-radius: 6px; overflow: hidden; }
.data-table th { text-align: left; padding: 10px 12px; background: #242424; font-size: 12px; text-transform: uppercase; color: #aaa; }
.data-table td { padding: 10px 12px; border-top: 1px solid #2e2e2e; font-size: 14px; }
.data-table tbody tr[data-project] { cursor: pointer; }
.data-table tbody tr[data-project]:hover { background: #242424; }

.pill { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #2a2a2a; color: #bbb; }
.pill-active, .pill-ready { background: #1f3a2a; color: #8fd19e; }
.pill-closed, .pill-failed { background: #3a1f1f; color: #e08f8f; }
.pill-uploading, .pill-normalizing { background: #3a2f00; color: #d8b25a; }

.empty-state { color: #888; padding: 12px 0; }

/* --- Project detail --- */

.project-header { display: flex; align-items: center; justify-content: space-between; }

#toggle-archive-btn {
  background: #3a3a3a; color: #fff; border: none; border-radius: 4px;
  padding: 8px 14px; cursor: pointer; font-size: 13px;
}
#toggle-archive-btn:hover { background: #4a4a4a; }

.timeline-card {
  background: #1c1c1c; border: 1px solid #333; border-radius: 6px;
  padding: 12px 14px; margin-bottom: 8px;
}

.timeline-header { display: flex; align-items: center; gap: 10px; }
.timeline-title { cursor: pointer; }
.timeline-title:hover { text-decoration: underline; }

.version-badge { font-size: 12px; color: #aaa; background: #2a2a2a; padding: 2px 8px; border-radius: 10px; }

.version-history { margin-top: 8px; font-size: 12px; color: #999; }
.version-chip {
  background: #2a2a2a; border: 1px solid #444; color: #e0e0e0; border-radius: 3px;
  padding: 2px 8px; margin-right: 4px; cursor: pointer; font-size: 12px;
}
.version-chip:hover { background: #383838; }

.access-link-row {
  display: flex; align-items: center; gap: 10px; background: #1c1c1c;
  border: 1px solid #333; border-radius: 4px; padding: 8px 12px; margin-bottom: 6px; font-size: 13px;
}
.access-link-row code { flex: 1; overflow-x: auto; white-space: nowrap; color: #e0e0e0; }
.copy-btn {
  background: #2a2a2a; color: #e0e0e0; border: 1px solid #444; border-radius: 3px;
  padding: 3px 10px; cursor: pointer; font-size: 12px;
}
.delete-btn {
  background: #3a1f1f; border: 1px solid #5a2f2f; color: #e08f8f; border-radius: 3px;
  padding: 3px 10px; cursor: pointer; font-size: 12px;
}
.delete-btn:hover { background: #4a2626; }

.inline-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.inline-form input { padding: 6px 8px; background: #1c1c1c; border: 1px solid #444; border-radius: 4px; font-size: 13px; color: #e0e0e0; }
.inline-form button {
  background: var(--brand-color, #3a6ea5); color: #fff; border: none; border-radius: 4px;
  padding: 6px 14px; cursor: pointer; font-size: 13px;
}
.inline-form button:hover { background: var(--brand-color-hover, #4a7eb5); }

.data-table td button { font-size: 12px; background: #2a2a2a; color: #e0e0e0; border: 1px solid #444; border-radius: 4px; padding: 3px 8px; margin-right: 6px; cursor: pointer; }
.data-table td button:hover { background: #383838; }
.data-table td button.delete-btn { background: #3a1f1f; border: 1px solid #5a2f2f; color: #e08f8f; }
.data-table td button.delete-btn:hover { background: #4a2626; }

/* --- Video / comments --- */

.review-layout { display: flex; flex-wrap: wrap; gap: 16px; }
.video-pane { flex: 2 1 600px; min-width: 320px; }
.comment-pane {
  flex: 1 1 320px; min-width: 280px; background: #1c1c1c; border: 1px solid #333;
  border-radius: 6px; padding: 12px; max-height: 80vh; overflow-y: auto;
}

video#player { width: 100%; border-radius: 6px; background: #000; }

.timeline-hint {
  margin-top: 8px; padding: 10px; background: #3a2f00; border: 1px solid #6b5900;
  border-radius: 4px; font-size: 13px; color: #d8b25a; cursor: pointer; text-align: center;
}
.timeline-hint:hover { background: #473a05; }

.comment { border-bottom: 1px solid #2e2e2e; padding: 10px 0; }
.comment-resolved { opacity: 0.55; }
.comment-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.comment-time { color: #7aa2d8; cursor: pointer; font-weight: 600; }
.comment-time:hover { text-decoration: underline; }
.status-pill { font-size: 11px; background: #1f3a2a; color: #8fd19e; padding: 1px 6px; border-radius: 8px; }
.approval-block { margin-bottom: 14px; }
.approval-banner {
  padding: 10px; font-size: 13px; font-weight: 600; text-align: center;
  background: #1f3a2a; color: #8fd19e; border: 1px solid #2f5a3f; border-radius: 6px;
}
.comment-body { font-size: 14px; margin-bottom: 6px; white-space: pre-wrap; color: #ddd; }
.comment-actions button {
  font-size: 12px; background: #2a2a2a; color: #e0e0e0; border: 1px solid #444; border-radius: 4px;
  padding: 3px 8px; margin-right: 6px; cursor: pointer;
}
.comment-actions button:hover { background: #383838; }
.thread-toggle { background: none !important; border: none !important; color: #7aa2d8 !important; }
.thread-toggle:hover { text-decoration: underline; }
.comment-replies { margin-left: 16px; margin-top: 6px; border-left: 2px solid #2e2e2e; padding-left: 10px; }

@media (max-width: 768px) {
  .review-layout { flex-direction: column; }
  .comment-pane { max-height: none; }
}

/* --- Comment modal --- */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: modal-fade-in 0.15s ease-out;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 20px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-box h3 { margin: 0 0 12px 0; font-size: 15px; color: #fff; }

.modal-box input[type="text"],
.modal-box input[type="email"],
.modal-box input[type="password"] {
  width: 100%;
  padding: 10px;
  background: #121212;
  border: 1px solid #444;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.modal-box textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  background: #121212;
  border: 1px solid #444;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  color: #e0e0e0;
  resize: vertical;
}

.modal-hint { font-size: 11px; color: #888; margin-top: 4px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.modal-btn-secondary {
  background: #2a2a2a; color: #e0e0e0; border: 1px solid #444; border-radius: 4px;
  padding: 8px 16px; cursor: pointer; font-size: 13px;
}
.modal-btn-secondary:hover { background: #383838; }

.modal-btn-primary {
  background: var(--brand-color, #3a6ea5); color: #fff; border: none; border-radius: 4px;
  padding: 8px 16px; cursor: pointer; font-size: 13px;
}
.modal-btn-primary:hover { background: var(--brand-color-hover, #4a7eb5); }
