:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

header {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.brand {
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

nav { display: flex; gap: 8px; }
nav .nav-btn {
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}
nav .nav-btn:hover { background: #f1f5f9; color: var(--text); }
nav .nav-btn.active { background: #eff6ff; color: var(--primary); }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }

h1 { font-size: 26px; margin: 4px 0 8px; letter-spacing: -0.5px; }
h2 { font-size: 18px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 8px 0; font-weight: 600; cursor: pointer; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--primary); margin: 0; }
.muted { color: var(--muted); font-size: 13px; margin: 4px 0; }

.intro { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }

button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: all 0.15s ease;
}
button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.primary:hover { background: var(--primary-hover); }
button.reject { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
button.reject:hover { background: #fee2e2; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.video-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.video-card .preview {
  height: 180px;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  position: relative;
}
.play {
  font-size: 28px;
  color: #fff;
  background: rgba(255,255,255,0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.video-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.pill { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill-youtube { background: #fee2e2; color: #dc2626; }
.pill-tiktok { background: #f1f5f9; color: #0f172a; border: 1px solid #cbd5e1; }
.pill-instagram { background: #fce7f3; color: #db2777; }

.origin-title {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 12px;
}

.card-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Detail Modal */
#detail { margin-bottom: 24px; border: 2px solid var(--primary); }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; }
#detail video { width: 100%; max-height: 550px; background: #000; border-radius: 8px; margin: 16px 0; }
.caption-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 12px 0; }
.caption-box pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; margin: 6px 0 0 0; }
.clean-caption-text { color: #15803d; font-weight: 500; }
.raw-caption-text { color: var(--muted); }
.detail-footer { display: flex; justify-content: space-between; font-size: 13px; margin: 12px 0; }
#detail .actions { display: flex; gap: 12px; justify-content: flex-end; }

/* Source Monitoring Grid */
.source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.source-card { background: #ffffff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.source-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 15px; }
.source-metrics { display: flex; justify-content: space-between; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 10px 0; margin-bottom: 10px; }
.source-metrics div { text-align: center; flex: 1; }
.source-metrics span { display: block; font-size: 11px; color: var(--muted); }
.source-metrics b { font-size: 16px; color: var(--text); }
.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.status-ok { background: #dcfce7; color: #15803d; }
.status-warn { background: #fef9c3; color: #854d0e; }
.status-danger { background: #fee2e2; color: #b91c1c; }

/* Cookie Management */
.cookie-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.cookie-tab-btn { background: transparent; border: none; font-size: 14px; font-weight: 600; color: var(--muted); padding: 6px 14px; border-radius: 6px; }
.cookie-tab-btn.active { background: #eff6ff; color: var(--primary); }
.cookie-status-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 13px; }
textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-family: monospace; font-size: 12px; background: #fafafa; }
.cookie-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 14px; }

/* Login */
.login { max-width: 420px; margin: 10vh auto; }
.login label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0; }
.login input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-top: 6px; font-size: 14px; }
.login button { width: 100%; margin-top: 10px; padding: 10px; font-size: 14px; }

.empty { text-align: center; padding: 60px 20px; }
.empty span { font-size: 40px; display: block; margin-bottom: 10px; }

#notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
}
#notice[hidden] { display: none; }
[hidden] { display: none !important; }

footer { text-align: center; font-size: 12px; color: var(--muted); margin: 40px 0 20px; }
