*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f5f5f5;
  min-height: 100vh;
}

/* ── Auth ──────────────────────────────────────── */
.auth-container {
  max-width: 380px;
  margin: 80px auto;
  padding: 32px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.auth-container .logo { text-align: center; margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 8px; border: 1px solid #ddd; background: #f9f9f9; border-radius: 6px; cursor: pointer; font-size: 14px; transition: background 0.1s; }
.tab-btn.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

/* ── Forms ─────────────────────────────────────── */
form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: #555; }
input, select, textarea {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #1a1a1a; }
input:disabled { background: #f5f5f5; color: #888; }
input[type="color"] { padding: 2px; height: 36px; cursor: pointer; }
.btn-sm.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
textarea { min-height: 72px; resize: vertical; }
fieldset { border: 1px solid #e5e5e5; border-radius: 6px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 600; padding: 0 6px; font-size: 12px; color: #555; text-transform: uppercase; letter-spacing: 0.4px; }
.checkbox-label { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; font-weight: normal; }
.checkbox-label input { width: auto; }

/* ── Buttons ───────────────────────────────────── */
button { padding: 8px 16px; border-radius: 6px; border: 1px solid #ddd; cursor: pointer; font-size: 13px; font-family: inherit; background: #fff; transition: background 0.1s; }
button:hover { background: #f5f5f5; }
.btn-primary { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.btn-primary:hover { background: #333; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { color: #dc2626; border-color: #fca5a5; }
.btn-danger:hover { background: #fef2f2; }
.form-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ── App shell ─────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 52px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header .logo { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
.app-nav { display: flex; gap: 4px; flex: 1; }
.nav-btn { background: none; border: none; padding: 6px 12px; border-radius: 6px; font-size: 14px; cursor: pointer; color: #555; }
.nav-btn:hover { background: #f5f5f5; color: #1a1a1a; }
.nav-btn.active { background: #f0f0f0; color: #1a1a1a; font-weight: 600; }
.main-content { max-width: 900px; margin: 0 auto; padding: 24px; }

/* ── Section layout ────────────────────────────── */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-header h2 { font-size: 18px; font-weight: 600; }

/* ── Table ─────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  margin-top: 4px;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafafa;
  border-bottom: 1px solid #e5e5e5;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.actions { display: flex; gap: 6px; white-space: nowrap; }

/* ── Badges ────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-active   { background: #dcfce7; color: #15803d; }
.badge-paused   { background: #fef9c3; color: #92400e; }
.badge-archived { background: #f3f4f6; color: #6b7280; }
.badge-green    { background: #dcfce7; color: #15803d; }
.badge-yellow   { background: #fef9c3; color: #92400e; }
.badge-grey     { background: #f3f4f6; color: #6b7280; }
.badge-danger   { background: #fee2e2; color: #dc2626; }

/* ── Form card ─────────────────────────────────── */
.form-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.form-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

/* ── Profile grid ──────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .profile-grid { grid-template-columns: 1fr; } }

/* ── Logo ──────────────────────────────────────── */
.logo { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }

/* ── Misc ──────────────────────────────────────── */
.loading { color: #888; padding: 32px 0; }
.empty   { color: #888; padding: 16px 0; }
.error-msg { color: #dc2626; font-size: 13px; margin-top: 8px; min-height: 18px; }
.success-msg { color: #15803d; font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ── Campaign detail ────────────────────────────── */
.back-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: #888; padding: 0; margin-bottom: 14px; font-size: 13px; cursor: pointer; }
.back-btn:hover { color: #1a1a1a; background: none; }
.link-btn { background: none; border: none; padding: 0; color: #1a73e8; cursor: pointer; font-size: inherit; font-weight: inherit; }
.link-btn:hover { text-decoration: underline; }
.detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.detail-header h2 { font-size: 18px; font-weight: 600; flex: 1; margin: 0; }

/* ── Stat cards ─────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 16px; }
.stat-card .label { font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.stat-card .value { font-size: 26px; font-weight: 700; line-height: 1; }

/* ── Inner tabs ─────────────────────────────────── */
.inner-tabs { display: flex; gap: 2px; border-bottom: 1px solid #e5e5e5; margin-bottom: 16px; }
.inner-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 14px; margin-bottom: -1px; font-size: 13px; font-weight: 500; color: #888; cursor: pointer; border-radius: 0; }
.inner-tab:hover { color: #1a1a1a; background: none; }
.inner-tab.active { color: #1a1a1a; border-bottom-color: #1a1a1a; }

/* ── Content status badges ──────────────────────── */
.badge-pending_review { background: #fef3c7; color: #92400e; }
.badge-approved       { background: #dcfce7; color: #15803d; }
.badge-rejected       { background: #fee2e2; color: #dc2626; }
.badge-scheduled      { background: #dbeafe; color: #1d4ed8; }
.badge-published      { background: #f3e8ff; color: #7c3aed; }

/* ── Review two-panel layout ────────────────────── */
.review-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 700px) { .review-panel { grid-template-columns: 1fr; } }
.preview-box { background: #fafafa; border: 1px solid #e5e5e5; border-radius: 6px; padding: 14px; min-height: 120px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.preview-box--html { white-space: normal; font-family: Georgia, serif; line-height: 1.7; }
.preview-box--html h2 { font-size: 15px; font-weight: 600; margin: 14px 0 6px; }
.preview-box--html p { margin: 0 0 10px; }
.tag-pill { display: inline-block; background: #f0f9ff; color: #0369a1; font-size: 12px; padding: 2px 10px; border-radius: 12px; font-weight: 500; }

/* ── Detail list (ambassador detail view) ────────── */
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: baseline; }
.detail-list dt { font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; }
.detail-list dd { font-size: 14px; color: #1a1a1a; word-break: break-word; }

/* ── Channel cards ──────────────────────────────── */
.channel-cards { display: flex; flex-direction: column; gap: 10px; }
.channel-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.channel-card-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.channel-card-platform { font-weight: 600; font-size: 14px; }
.channel-card-identity { color: #555; font-size: 13px; }
.platform-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-pick-btn { padding: 8px 16px; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; font-family: inherit; transition: border-color 0.1s; }
.platform-pick-btn:hover { background: #f5f5f5; border-color: #1a1a1a; }

/* ── Terms and Conditions page ───────────────────── */
.terms-container { max-width: 720px; margin: 40px auto; padding: 0 24px 60px; }
.terms-header { text-align: center; margin-bottom: 40px; }
.terms-header .logo { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; color: #1a1a1a; text-decoration: none; display: inline-block; margin-bottom: 16px; }
.terms-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.terms-date { font-size: 13px; color: #888; }
.terms-body section { margin-bottom: 28px; }
.terms-body h2 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.terms-body p { font-size: 14px; line-height: 1.7; color: #333; }
.terms-body ul { margin: 8px 0 0 20px; display: flex; flex-direction: column; gap: 6px; }
.terms-body ul li { font-size: 14px; line-height: 1.6; color: #333; }
.terms-body a { color: #1a1a1a; }
.terms-footer { text-align: center; margin-top: 40px; }
