:root {
  --admin-zoom: 0.82;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "SF Pro Display", "Pretendard", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(30, 64, 175, 0.12), transparent 22%),
    linear-gradient(180deg, #f7fafc 0%, #eef2f7 100%);
  color: #1f2937;
}
.container {
  max-width: 1480px;
  width: 100%;
  margin: 32px auto 220px;
  padding: 0 24px;
  zoom: var(--admin-zoom);
}
h1 { font-size: 30px; margin-bottom: 24px; letter-spacing: -0.03em; }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(8px);
}
.card h2 { font-size: 15px; color: #475569; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.08em; }
.stat { font-size: 34px; font-weight: 700; color: #0f172a; }
.sub { font-size: 13px; color: #64748b; margin-top: 4px; line-height: 1.5; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8dee9;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}
textarea { min-height: 90px; resize: vertical; font-family: ui-monospace, monospace; }
button {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
button:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #0f766e, #0369a1); color: #fff; }
.btn-secondary { background: #e2e8f0; color: #1e293b; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-ghost { background: #f8fafc; color: #334155; border: 1px solid #d8dee9; }
.btn-toggle { background: #fee2e2; color: #991b1b; }
.btn-toggle.active { background: #dcfce7; color: #166534; }
.btn-sm { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.tab-choice-group { display: flex; gap: 4px; flex-wrap: wrap; }
.tab-choice {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #d8dee9;
}
.tab-choice.active {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.pill.active { background: #dcfce7; color: #166534; }
.pill.candidate { background: #fef3c7; color: #92400e; }
.pill.excluded { background: #e5e7eb; color: #4b5563; }
.pill.cohort { background: #dbeafe; color: #1d4ed8; }
.pill.rss.available { background: #dcfce7; color: #166534; }
.pill.rss.unavailable { background: #fee2e2; color: #991b1b; }
.pill.rss.error { background: #fef3c7; color: #92400e; }
.pill.rss.unknown { background: #e5e7eb; color: #4b5563; }
.pill.crew { background: #f1f5f9; color: #475569; }
.pill.coach { background: #fae8ff; color: #7e22ce; }
.pill.reviewer { background: #fef9c3; color: #854d0e; }
.role-toggle-group { display: flex; gap: 4px; flex-wrap: wrap; }
.role-toggle {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.2;
}
.role-toggle.active.crew { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.role-toggle.active.coach { background: #fae8ff; color: #7e22ce; border-color: #d8b4fe; }
.role-toggle.active.reviewer { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.role-checkboxes { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.role-checkboxes label { font-size: 13px; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.order-input { width: 48px; padding: 4px 6px; font-size: 12px; border: 1px solid #e2e8f0; border-radius: 6px; text-align: center; }
.editable { cursor: pointer; }
.editable:hover { text-decoration: underline; text-decoration-style: dotted; color: #0f766e; }
.inline-sel { width: auto; min-width: 80px; padding: 3px 6px; font-size: 12px; border-radius: 6px; border: 1px solid #0f766e; outline: none; }
.inline-inp { width: 100%; min-width: 80px; padding: 3px 6px; font-size: 12px; border-radius: 6px; border: 1px solid #0f766e; outline: none; }
.table-wrap { width: 100%; overflow: auto; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 1120px; font-size: 12px; }
th, td { padding: 9px 10px; border-bottom: 1px solid #edf2f7; vertical-align: top; text-align: left; }
th { background: #f8fafc; color: #475569; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
.muted { color: #64748b; font-size: 11px; line-height: 1.4; }
.mono { font-family: ui-monospace, monospace; white-space: pre-wrap; word-break: break-word; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.stack.inline { flex-direction: row; align-items: center; gap: 10px; }
.repo-status-stack { align-items: center; text-align: center; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #d8dee9;
  background: #f8fafc;
  flex-shrink: 0;
}
.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.post-list { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.pr-list { display: flex; flex-direction: column; gap: 6px; min-width: 260px; margin-top: 6px; }
.post-item a, .link { color: #0369a1; text-decoration: none; word-break: break-all; }
.track-list { display: flex; gap: 4px; flex-wrap: wrap; }
.track-badge { display: inline-flex; padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; background: #ecfeff; color: #155e75; }
.track-badge.backend { background: #dcfce7; color: #166534; }
.track-badge.android { background: #fef3c7; color: #92400e; }
.filters-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tab {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  border: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.tab:hover { background: #e2e8f0; color: #1e293b; transform: none; }
.tab.active { background: #0f172a; color: #fff; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.form-inline input, .form-inline select { width: auto; min-width: 140px; flex: 1; }
#login {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#login .box {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  zoom: var(--admin-zoom);
}
#login h2 { margin-bottom: 14px; }
#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  display: none;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.28);
  zoom: var(--admin-zoom);
}
.modal-overlay { position:fixed; inset:0; background:rgba(15,23,42,0.4); display:flex; align-items:center; justify-content:center; z-index:100; padding:20px; }
.modal { background:#fff; border-radius:18px; padding:24px; width:min(640px,100%); max-height:80vh; overflow-y:auto; box-shadow:0 20px 48px rgba(15,23,42,0.22); zoom: var(--admin-zoom); }
.modal-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.modal-head h3 { font-size:16px; font-weight:700; }
.modal-foot { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
.regex-sample { margin-bottom:16px; padding:14px; background:#f8fafc; border-radius:12px; border:1px solid #e2e8f0; }
.regex-sample-cohort { font-size:12px; font-weight:700; color:#475569; text-transform:uppercase; letter-spacing:0.06em; margin-bottom:8px; }
.regex-sample-titles { display:flex; flex-direction:column; gap:4px; margin-bottom:10px; }
.regex-sample-titles span { font-size:13px; color:#334155; }
.regex-detected { display:flex; flex-direction:column; gap:6px; }
.regex-detected label { font-size:12px; color:#64748b; }
.regex-input-wrap { display:flex; gap:8px; align-items:center; }
.regex-input-wrap input { font-family:ui-monospace,monospace; font-size:13px; flex:1; }
.repo-section-label { font-size:13px; font-weight:700; color:#475569; margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid #e2e8f0; }
.small { font-size:12px; }
.pagination { display:flex; align-items:center; gap:8px; padding:10px 4px; }
.table-wrap details > summary {
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}
.table-wrap td strong {
  font-size: 12px;
}
.table-wrap td .actions {
  gap: 4px;
}
.table-wrap td .btn-sm {
  padding: 5px 7px;
  font-size: 11px;
}
.table-wrap .pill {
  min-width: 0;
  padding: 3px 7px;
  font-size: 10px;
}
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root {
    --admin-zoom: 1;
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(15, 118, 110, 0.1), transparent 34%),
      linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  }

  .container {
    margin: 18px auto 140px;
    padding: 0 12px;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .grid {
    gap: 12px;
  }

  .grid.stats {
    grid-template-columns: 1fr;
  }

  .card {
    border-radius: 16px;
    padding: 14px;
  }

  .card h2 {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .stat {
    font-size: 28px;
  }

  .sub {
    font-size: 12px;
  }

  .section-head {
    align-items: flex-start;
    gap: 10px;
  }

  .actions,
  .toolbar,
  .form-inline,
  .role-checkboxes {
    width: 100%;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar,
  .form-inline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .form-inline input,
  .form-inline select {
    width: 100%;
    min-width: 0;
  }

  input,
  textarea,
  select,
  button {
    font-size: 14px;
  }

  button,
  .btn-sm {
    width: 100%;
    justify-content: center;
  }

  .role-checkboxes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .role-checkboxes label {
    justify-content: center;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 1080px;
    font-size: 11px;
  }

  th,
  td {
    padding: 8px 9px;
    white-space: nowrap;
  }

  .stack,
  .post-list,
  .pr-list {
    gap: 5px;
  }

  .post-list,
  .pr-list {
    min-width: 220px;
  }

  .track-list,
  .role-toggle-group {
    gap: 4px;
  }

  .table-wrap .actions {
    display: flex;
    width: auto;
    flex-wrap: nowrap;
    align-items: center;
  }

  .table-wrap button,
  .table-wrap .btn-sm {
    width: auto;
    min-width: max-content;
  }

  .table-wrap .role-toggle-group {
    flex-wrap: nowrap;
  }

  .table-wrap .link,
  .table-wrap .post-item a,
  .table-wrap .mono,
  .table-wrap td strong,
  .table-wrap td span {
    writing-mode: horizontal-tb;
    word-break: keep-all;
  }

  .table-wrap .link,
  .table-wrap .post-item a {
    white-space: nowrap;
  }

  .track-badge,
  .table-wrap .pill {
    font-size: 10px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 86vh;
    padding: 16px;
  }

  .modal-head {
    gap: 10px;
  }

  .modal-head h3 {
    font-size: 15px;
  }

  .modal-foot {
    flex-direction: column;
  }

  .modal-foot button {
    width: 100%;
  }

  #toast {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }

  .log-panel {
    zoom: 1;
  }

  .log-panel-head,
  .log-entry {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ── Activity Log Panel ─────────────────────────────────────────── */
.log-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 12px;
  z-index: 200;
  border-top: 1px solid #1e293b;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
  zoom: var(--admin-zoom);
}
.log-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 16px;
  background: #1e293b;
  cursor: pointer;
  user-select: none;
}
.log-panel-title { font-size: 11px; font-weight: 600; color: #64748b; letter-spacing: 0.08em; text-transform: uppercase; }
.log-panel-actions { display: flex; gap: 6px; }
.log-btn {
  background: none;
  border: 1px solid #334155;
  color: #64748b;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: none;
}
.log-btn:hover { background: #334155; color: #e2e8f0; transform: none; }
#log-body { max-height: 160px; overflow-y: auto; padding: 2px 0; }
#log-body.collapsed { display: none; }
.log-entry {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 16px;
  line-height: 1.5;
}
.log-entry:hover { background: #1e293b; }
.log-ts { color: #334155; flex-shrink: 0; }
.log-tag { flex-shrink: 0; font-weight: 700; }
.log-tag.ok  { color: #22c55e; }
.log-tag.err { color: #ef4444; }
.log-tag.run { color: #60a5fa; }
.log-tag.info { color: #475569; }
.log-msg { }
.log-msg.ok  { color: #bbf7d0; }
.log-msg.err { color: #fca5a5; }
.log-msg.run { color: #bfdbfe; }
.log-msg.info { color: #64748b; }
