/* Stephen Dash - minimal v0 styling. Polished in later items. */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #1a1f2c;
  --muted: #5b6478;
  --line: #e3e6ed;
  --brand: #1f6feb;
  --brand-ink: #ffffff;
  --teal: #4ecca3;
  --danger: #d33;
  --shadow: 0 4px 16px rgba(20, 25, 60, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
}
.logout-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.user-pill {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 999px;
}

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}
.main h2 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 700;
}
.empty {
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  padding: 18px;
  border-radius: 10px;
}

/* Buttons */
.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
}

/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef1f8 0%, #f7f8fb 100%);
}
.login-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 32px 28px;
  width: min(380px, 92vw);
  box-shadow: var(--shadow);
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
}
.login-card .sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}
.login-card label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}
.login-card input[type=text],
.login-card input[type=password] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  background: var(--bg);
}
.login-card input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
}
.login-card button { width: 100%; margin-top: 6px; }

.error-banner {
  background: #fdecec;
  color: #b00020;
  border: 1px solid #f3c7c7;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* Run list */
.run-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.run-item { margin: 0; }
.run-link {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.run-link:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  text-decoration: none;
}
.run-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
}
.run-id {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.run-property {
  margin: 10px 0 4px;
  font-size: 15px;
}
.run-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Run detail */
.run-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.run-header h2 { margin: 0 0 6px; font-size: 20px; }
.run-header .prop-meta { margin: 0; color: var(--muted); font-size: 14px; }
.approve-all-form { margin: 0; flex: 0 0 auto; }
.run-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}
.run-header-actions a.btn-ghost { text-decoration: none; }
.btn-lg { padding: 12px 22px; font-size: 15px; }

.tabnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}
.tab:hover { border-color: var(--brand); text-decoration: none; }

.platform {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 22px;
}
.platform h3 {
  margin: 0 0 16px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}
.status-pending  { background: #fff4d4; color: #8a6d00; border-color: #f0dca0; }
.status-edited   { background: #e3edff; color: #1a4eb3; border-color: #b9cdf7; }
.status-approved { background: #e6f8ef; color: #0a7d44; border-color: #b3e6cb; }
.status-posted   { background: #d3f3df; color: #086534; border-color: #88d6ab; }
.status-missing  { background: #fae6e6; color: #a02020; border-color: #f4bcbc; }

.platform-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 24px;
}
.platform-video video {
  width: 100%;
  max-width: 380px;
  border-radius: 10px;
  background: #000;
  display: block;
}
.caption-meta { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.platform-fields { display: flex; flex-direction: column; gap: 16px; }
.field-form {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0;
}
.field-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field-len { margin-left: auto; font-size: 11px; color: var(--muted); }
.edited-pill {
  background: #e3edff;
  color: #1a4eb3;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: lowercase;
  letter-spacing: 0.2px;
}
.field-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  background: var(--surface);
  resize: vertical;
}
.field-form textarea:focus { outline: none; border-color: var(--brand); }
.field-form button { margin-top: 8px; }

.original-toggle { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.original-pre {
  background: #f0f1f5;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  margin: 6px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.reason-form textarea { background: var(--surface); }
.reason-label .hint { text-transform: none; color: var(--muted); font-weight: normal; font-size: 11px; }

.approve-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.btn-danger { color: #a02020; border-color: #f4bcbc; }
.posted-banner {
  background: #d3f3df;
  color: #086534;
  border: 1px solid #88d6ab;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  flex: 1;
}
.approved-banner {
  background: #e6f8ef;
  color: #0a7d44;
  border: 1px solid #b3e6cb;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  flex: 1;
}

@media (max-width: 800px) {
  .platform-grid { grid-template-columns: 1fr; }
  .run-header { flex-direction: column; align-items: stretch; }
}
