/* CCHDO's reviewer stylesheet, extracted VERBATIM from
 *   their-crme/human_review/reviewer/crnlp_reviewer_local.html
 * by scripts/sync_cchdo_css.mjs. Do not edit this file: edit nothing here and add nothing here.
 * Our own styles live in public/crme-additions.css, so "what did we change" is one file away.
 *
 * sha256 of the extracted block: 829e08bc095f64f74874780dbb7e3cb452dad0090d45c99939ab28f9c043df80
 * 557 lines
 */
:root {
    --bg: #f8f9fb;
    --bg-card: #ffffff;
    --bg-hover: #f1f4f8;
    --border: #e2e7ef;
    --border-strong: #c8d0dd;
    --text-primary: #1a2233;
    --text-secondary: #4a5568;
    --text-muted: #8a96a8;
    --accent: #2563eb;
    --accent-light: #eff4ff;
    --accent-border: #bfcfff;
    --green: #16a34a;
    --green-bg: #f0fdf4;
    --green-border: #bbf7d0;
    --red: #dc2626;
    --red-bg: #fef2f2;
    --red-border: #fecaca;
    --yellow: #b45309;
    --yellow-bg: #fffbeb;
    --yellow-border: #fde68a;
    --gray-bg: #f3f4f6;
    --font: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    --mono: 'SF Mono', 'Fira Code', monospace;
    --radius: 8px;
    --radius-sm: 5px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
  }

  /* HEADER */
  header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
  }

  .header-left { display: flex; align-items: center; gap: 12px; }

  .logo {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .header-divider {
    width: 1px;
    height: 18px;
    background: var(--border-strong);
  }

  .page-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .stats-bar { display: flex; gap: 24px; align-items: center; }

  .stat { display: flex; align-items: center; gap: 6px; }

  .stat-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
  }
  .dot-pending { background: var(--yellow); }
  .dot-approved { background: var(--green); }
  .dot-corrected { background: var(--accent); }
  .dot-rejected { background: var(--red); }

  .stat-text { font-size: 13px; color: var(--text-secondary); }
  .stat-text strong { color: var(--text-primary); font-weight: 600; }

  /* TOOLBAR */
  .toolbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 10px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .reviewer-field {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .reviewer-field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
  }

  input[type="text"], select {
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    padding: 5px 10px;
    outline: none;
    transition: border-color 0.15s;
  }

  input[type="text"]:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  }

  .toolbar-spacer { flex: 1; }

  .btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: var(--font);
    transition: all 0.12s;
    white-space: nowrap;
  }

  .btn:hover { opacity: 0.88; }
  .btn:active { transform: scale(0.97); }

  .btn-default {
    background: var(--bg);
    border-color: var(--border-strong);
    color: var(--text-secondary);
  }

  .btn-approve {
    background: var(--green-bg);
    border-color: var(--green-border);
    color: var(--green);
  }

  .btn-reject {
    background: var(--red-bg);
    border-color: var(--red-border);
    color: var(--red);
  }

  .btn-correct {
    background: var(--yellow-bg);
    border-color: var(--yellow-border);
    color: var(--yellow);
  }

  .btn-save {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }

  .btn-cancel {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text-muted);
  }

  .btn-sm { padding: 4px 10px; font-size: 12px; }

  /* TABS */
  .tabs {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    gap: 0;
  }

  .tab {
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .tab:hover { color: var(--text-primary); }

  .tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  .tab-badge {
    background: var(--gray-bg);
    color: var(--text-muted);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    font-family: var(--mono);
  }

  .tab.active .tab-badge {
    background: var(--accent-light);
    color: var(--accent);
  }

  /* MAIN */
  main { padding: 24px 32px; max-width: 1400px; }

  /* SECTION HEADERS */
  .section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 10px;
  }

  .section-header:first-child { margin-top: 0; }

  .section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .section-line {
    flex: 1;
    height: 1px;
    background: var(--border);
  }

  .section-count {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--mono);
  }

  /* CRUISE GROUP */
  .cruise-group { margin-bottom: 20px; }

  .cruise-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 0 2px;
  }

  .cruise-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--mono);
  }

  .cruise-file {
    font-size: 12px;
    color: var(--text-muted);
  }

  .cruise-pill {
    font-size: 11px;
    font-family: var(--mono);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
  }

  .cruise-pill-pending {
    background: var(--yellow-bg);
    color: var(--yellow);
    border: 1px solid var(--yellow-border);
  }

  .cruise-pill-done {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
  }

  /* TABLE */
  .table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow);
  }

  table { width: 100%; min-width: 860px; border-collapse: collapse; }

  thead { background: var(--bg); }

  th {
    padding: 9px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }

  tbody tr {
    border-top: 1px solid var(--border);
    transition: background 0.1s;
  }

  tbody tr:first-child { border-top: none; }
  tbody tr:hover { background: var(--bg-hover); }

  tbody tr.row-approved { background: var(--green-bg); }
  tbody tr.row-approved:hover { background: #dcfce7; }
  tbody tr.row-rejected { background: var(--red-bg); opacity: 0.6; }
  tbody tr.row-corrected { background: var(--accent-light); }
  tbody tr.row-corrected:hover { background: #e0eaff; }

  td {
    padding: 10px 14px;
    vertical-align: middle;
    font-size: 13px;
    color: var(--text-secondary);
  }

  td.td-primary { color: var(--text-primary); font-weight: 500; }
  td.td-mono { font-family: var(--mono); font-size: 12px; color: var(--accent); }

  .badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--mono);
    border: 1px solid transparent;
  }

  .badge-pending { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-border); }
  .badge-approved { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
  .badge-rejected { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
  .badge-corrected { background: var(--accent-light); color: var(--accent); border-color: var(--accent-border); }

  .action-cell { display: flex; gap: 6px; align-items: center; }

  .reviewed-by {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
  }

  /* EDIT ROW */
  tr.edit-row td {
    background: var(--accent-light);
    border-top: 1px solid var(--accent-border);
    border-bottom: 1px solid var(--accent-border);
    padding: 14px;
  }

  .edit-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
  }

  .field-group { display: flex; flex-direction: column; gap: 4px; }

  .field-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .field-group input { width: 100%; background: white; }

  .edit-actions {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .crosswalk-hint {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
  }

  .crosswalk-hint span { color: var(--accent); font-weight: 500; }

  /* EMPTY */
  .empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
  }

  .empty-icon { font-size: 32px; margin-bottom: 12px; }

  .empty-state h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
  }

  /* LOADING */
  .loading {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 13px;
  }

  /* TOAST */
  .toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999;
  }

  .toast {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .toast-success { background: var(--green); color: white; }
  .toast-error { background: var(--red); color: white; }

  @keyframes slideUp {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  /* HIDE/SHOW */
  .hidden { display: none !important; }

  .evidence {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
  }

  .evidence summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
  }

  .evidence-text {
    margin-top: 6px;
    max-width: 760px;
    white-space: pre-wrap;
  }

  @media (max-width: 760px) {
    header {
      height: auto;
      min-height: 56px;
      padding: 10px 16px;
      align-items: flex-start;
      gap: 12px;
      flex-wrap: wrap;
    }

    .stats-bar { gap: 12px; flex-wrap: wrap; }
    .toolbar { padding: 10px 16px; flex-wrap: wrap; }
    .toolbar-spacer { display: none; }
    .tabs { padding: 0 16px; overflow-x: auto; }
    main { padding: 18px 16px; }
    .cruise-header { align-items: flex-start; flex-wrap: wrap; }
    .cruise-file { overflow-wrap: anywhere; }
  }

  .selection-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-wrap: wrap;
  }
  .selection-count { color: var(--text-muted); font-size: 13px; min-width: 76px; }
  .row-select { width: 18px; height: 18px; accent-color: var(--accent); }
  .stat-added .stat-dot { background: #7c3aed; }
  .badge-added { color: #6d28d9; background: #ede9fe; }
  dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 24px 70px rgba(16, 24, 40, 0.24);
  }
  dialog::backdrop { background: rgba(16, 24, 40, 0.45); }
  .dialog-header, .dialog-actions { padding: 16px 20px; border-bottom: 1px solid var(--border); }
  .dialog-header { display: flex; justify-content: space-between; align-items: center; }
  .dialog-header h2 { margin: 0; font-size: 18px; }
  .dialog-body { padding: 20px; display: grid; gap: 14px; overflow-y: auto; }
  .dialog-actions { border-top: 1px solid var(--border); border-bottom: 0; display: flex; justify-content: flex-end; gap: 8px; }
  .dialog-field { display: grid; gap: 6px; }
  .dialog-field label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
  .dialog-field input, .dialog-field textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 5px; padding: 9px 10px;
    font: inherit; color: var(--text-primary); background: #fff;
  }
  .dialog-field textarea { min-height: 76px; resize: vertical; }
