/* Jarvis Web — minimal Phase 2 styles */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", Roboto, sans-serif;
  background: #f5f6f8;
  color: #222;
  line-height: 1.5;
}
.topbar {
  background: #1f3a5f;
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar .brand { font-weight: bold; font-size: 1.1em; }
.topbar a { color: #cce0ff; text-decoration: none; margin-left: 12px; }
.topbar .user-email { font-size: 0.9em; opacity: 0.85; }
.main-content { max-width: 1200px; margin: 24px auto; padding: 0 16px; }

.login-box {
  background: white;
  border-radius: 8px;
  padding: 40px;
  max-width: 400px;
  margin: 80px auto;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.login-box h1 { margin-bottom: 8px; }
.login-box .note { color: #888; font-size: 0.85em; margin-top: 16px; }

.task-page header {
  background: white;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.task-page h1 { margin: 0 0 6px; font-size: 1.4em; }
.subtitle { color: #555; margin: 0 0 8px; font-size: 1.05em; }
.meta { color: #888; font-size: 0.9em; margin: 0; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #1f3a5f; color: white; }
.btn-success { background: #2e7d32; color: white; }
.btn-danger { background: #c62828; color: white; }

textarea, select, input[type="file"] {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 100px; }
label { display: block; font-weight: 500; margin: 16px 0 4px; color: #444; }

.alert { padding: 12px 16px; border-radius: 4px; margin: 12px 0; }
.alert-warn { background: #fff4e1; border: 1px solid #f5b95a; }
.alert-success { background: #e8f5e9; border: 1px solid #66bb6a; }

.hint { color: #888; font-size: 0.85em; margin: 4px 0; }
.actions { margin-top: 16px; }

.status-msg {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 4px;
}
.status-msg.success { background: #e8f5e9; color: #2e7d32; }
.status-msg.error { background: #ffebee; color: #c62828; }

/* Review layout */
.review-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
}
.left-panel, .right-panel {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.right-panel section { margin-bottom: 24px; }
.right-panel h3 { margin-top: 0; }

.copy-text {
  background: #f9f9f9;
  padding: 12px;
  border-radius: 4px;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.95em;
}
.copy-display { margin: 12px 0; }

.canvas-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
#review-image {
  display: block;
  max-width: 100%;
  height: auto;
}
#annotation-canvas {
  position: absolute;
  top: 0; left: 0;
  pointer-events: auto;
}

.image-preview, .image-display { max-width: 100%; border: 1px solid #ddd; border-radius: 4px; margin-top: 8px; }

.annotation-list { list-style: none; padding: 0; margin: 0; }
.annotation-item {
  background: #fafafa;
  border-left: 3px solid #1f3a5f;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
}
.annotation-item.resolved { opacity: 0.5; }
.annotation-item.post { border-left-color: #2e7d32; }
.ann-header {
  display: flex;
  gap: 8px;
  font-size: 0.85em;
  color: #666;
  margin-bottom: 4px;
}
.ann-comment { margin: 4px 0; }
.ann-region { color: #999; font-size: 0.75em; }

.decision-form, .assign-form, .post-comment-form {
  background: #fafafa;
  padding: 12px;
  border-radius: 4px;
}
.decision-buttons { margin-top: 8px; display: flex; gap: 8px; }

/* Status colors */
.status-NEW { color: #888; }
.status-COPY_REVIEW, .status-FINAL_REVIEW { color: #f57c00; font-weight: bold; }
.status-COPY_REVISION, .status-NEEDS_REVISION { color: #c62828; font-weight: bold; }
.status-DESIGN_PENDING, .status-DESIGN_IN_PROGRESS, .status-DESIGN_HANDOFF { color: #1976d2; font-weight: bold; }
.status-COMPLETED { color: #2e7d32; font-weight: bold; }
.status-CANCELLED, .status-BLOCKED { color: #c62828; }

/* Mobile */
@media (max-width: 768px) {
  .review-layout { grid-template-columns: 1fr; }
  #annotation-canvas { display: none; }  /* Mobile read-only canvas */
  .topbar .user-email { display: none; }
}

/* ─── Admin UI ───────────────────────────────────────── */
.admin-page { max-width: 1100px; margin: 20px auto; padding: 0 20px; }
.admin-page h1 { margin-bottom: 8px; }
.admin-page .meta { color: #888; margin-bottom: 24px; font-size: 0.9em; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 24px 0; }
.admin-card { display: block; padding: 20px; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; text-decoration: none; color: inherit; transition: box-shadow 0.15s; }
.admin-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.admin-card h3 { margin: 0 0 8px; font-size: 1.05em; }
.admin-card .big { font-size: 2.4em; font-weight: bold; margin: 8px 0; color: #1976d2; }
.admin-card p { margin: 0; color: #666; font-size: 0.85em; }

.action-panel { background: #fafafa; padding: 16px; border-radius: 8px; margin-top: 24px; }
.action-panel h3 { margin-top: 0; }
.action-panel form { margin-top: 12px; display: flex; gap: 12px; align-items: center; }

.data-table { width: 100%; border-collapse: collapse; margin-top: 16px; background: #fff; }
.data-table th, .data-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: 0.9em; }
.data-table th { background: #f5f5f5; font-weight: 600; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: 0.85em; }

.vform { display: flex; flex-direction: column; gap: 8px; max-width: 600px; margin-top: 16px; }
.vform label { font-weight: 600; margin-top: 8px; font-size: 0.9em; }
.vform input[type=text], .vform input[type=email], .vform input[type=date],
.vform select, .vform textarea { padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 1em; font-family: inherit; }
.vform input[readonly] { background: #f5f5f5; color: #888; }
.vform button { margin-top: 16px; align-self: flex-start; }

.msg { padding: 10px 14px; border-radius: 4px; margin: 12px 0; }
.msg.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.msg.error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
